|
| 1 | +" ctrlpvim/ctrlp.vim |
| 2 | + |
| 3 | +let NERDTreeQuitOnOpen = 1 |
| 4 | +let NERDTreeWinSize = 75 |
| 5 | +if !argc() |
| 6 | + autocmd vimenter * NERDTreeClose |
| 7 | + autocmd vimenter * CtrlPMRUFiles |
| 8 | +endif |
| 9 | + |
| 10 | +" ref: https://postd.cc/how-to-boost-your-vim-productivity/ |
| 11 | +let g:ctrlp_use_caching = 0 |
| 12 | +if executable('pt') |
| 13 | + set grepprg=pt\ --nogroup\ --nocolor |
| 14 | + let g:ctrlp_user_command = 'pt %s -l --nocolor -g ""' |
| 15 | +elseif executable('ag') |
| 16 | + set grepprg=ag\ --nogroup\ --nocolor |
| 17 | + let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' |
| 18 | +else |
| 19 | + let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f'] |
| 20 | +endif |
| 21 | + |
| 22 | +" ref: https://qiita.com/oahiroaki/items/d71337fb9d28303a54a8 |
| 23 | +nnoremap <Leader>e :<C-u>CtrlPMRUFiles<CR> |
| 24 | +nnoremap <Leader>ea :<C-u>CtrlPMixed<CR> |
| 25 | +nnoremap <Leader>eb :<C-u>CtrlPBuffer<CR> |
| 26 | +nnoremap <Leader>ed :<C-u>CtrlPDir<CR> |
| 27 | +nnoremap <Leader>ef :<C-u>CtrlP<CR> |
| 28 | +nnoremap <Leader>el :<C-u>CtrlPLine<CR> |
| 29 | +nnoremap <Leader>em :<C-u>CtrlPMRUFiles<CR> |
| 30 | +nnoremap <Leader>eq :<C-u>CtrlPQuickfix<CR> |
| 31 | +nnoremap <Leader>es :<C-u>CtrlPMixed<CR> |
| 32 | +nnoremap <Leader>et :<C-u>CtrlPTag<CR> |
| 33 | +
|
| 34 | +" ref: https://qiita.com/tekkoc/items/8c78e01167953ab513f9 |
| 35 | +let g:ctrlp_prompt_mappings = { |
| 36 | + \ 'PrtBS()': ['<c-h>'], |
| 37 | + \ 'PrtDeleteWord()': ['<c-w>'], |
| 38 | + \ 'PrtCurEnd()': ['<c-e>'], |
| 39 | + \ 'PrtCurLeft()': ['<c-b>'], |
| 40 | + \ 'PrtCurRight()': ['<c-f>'], |
| 41 | + \ 'PrtSelectMove("j")': ['<c-j>'], |
| 42 | + \ 'PrtSelectMove("k")': ['<c-k>'], |
| 43 | + \ 'PrtHistory(-1)': ['<c-n>'], |
| 44 | + \ 'PrtHistory(1)': ['<c-p>'], |
| 45 | + \ 'AcceptSelection("e")': ['<cr>'], |
| 46 | + \ 'ToggleRegex()': ['<c-r>'], |
| 47 | + \ 'ToggleByFname()': ['<c-d>'], |
| 48 | + \ 'PrtExit()': ['<c-l>', '<esc>', '<c-c>'], |
| 49 | + \ 'ToggleFocus()': ['<nop>'], |
| 50 | + \ 'PrtExpandDir()': ['<nop>'], |
| 51 | + \ 'AcceptSelection("h")': ['<nop>'], |
| 52 | + \ 'AcceptSelection("t")': ['<nop>'], |
| 53 | + \ 'AcceptSelection("v")': ['<nop>'], |
| 54 | + \ 'ToggleType(1)': ['<nop>'], |
| 55 | + \ 'ToggleType(-1)': ['<nop>'], |
| 56 | + \ 'PrtInsert()': ['<nop>'], |
| 57 | + \ 'PrtCurStart()': ['<nop>'], |
| 58 | + \ 'PrtClearCache()': ['<nop>'], |
| 59 | + \ 'PrtDeleteEnt()': ['<nop>'], |
| 60 | + \ 'CreateNewFile()': ['<nop>'], |
| 61 | + \ 'MarkToOpen()': ['<nop>'], |
| 62 | + \ 'OpenMulti()': ['<nop>'], |
| 63 | + \ 'PrtDelete()': ['<nop>'], |
| 64 | + \ 'PrtSelectMove("t")': ['<nop>'], |
| 65 | + \ 'PrtSelectMove("b")': ['<nop>'], |
| 66 | + \ 'PrtSelectMove("u")': ['<nop>'], |
| 67 | + \ 'PrtSelectMove("d")': ['<nop>'], |
| 68 | + \ } |
0 commit comments