diff options
author | Guangxiong Lin <[email protected]> | 2022-04-13 09:51:58 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-04-13 09:51:58 +0800 |
commit | 42759d62300ffdf8419511acad1f11061a4f6571 (patch) | |
tree | b02451db0e4a1b7f5c6c8d8d9ed3a50d4ad031fc | |
parent | a50815d4ea872b8f02987f13a03a83805b570af9 (diff) | |
download | dotfiles-42759d62300ffdf8419511acad1f11061a4f6571.tar.gz dotfiles-42759d62300ffdf8419511acad1f11061a4f6571.tar.bz2 dotfiles-42759d62300ffdf8419511acad1f11061a4f6571.zip |
Use ctrlp when there is no fzf
-rw-r--r-- | .vim/after/plugin/ctrlp.vim | 22 | ||||
-rw-r--r-- | .vim/after/plugin/minpac.vim | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/.vim/after/plugin/ctrlp.vim b/.vim/after/plugin/ctrlp.vim new file mode 100644 index 0000000..32a0a74 --- /dev/null +++ b/.vim/after/plugin/ctrlp.vim @@ -0,0 +1,22 @@ +if get(g:, 'loaded_fzf', 0) == 0 + let g:ctrlp_map = '<leader>ff' + let g:ctrlp_cmd = 'CtrlP' + let g:ctrlp_working_path_mode = 'ra' + let g:ctrlp_regexp = 1 + let g:ctrlp_use_caching = 0 + let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'line'] + + let g:ctrlp_user_command = 'find %s -type f' + if executable('fd') + let g:ctrlp_user_command = 'fd --hidden . %s' + endif + + nnoremap <leader>fb :CtrlPBuffer<CR> + nnoremap <leader>fm :CtrlPMRU<CR> + nnoremap <leader>fT :CtrlPTag<CR> + nnoremap <leader>ft :CtrlPBufTag \.<CR> + nnoremap <leader>fq :CtrlPQuickfix<CR> + nnoremap <leader>fl :CtrlPLine 1<CR> + + packadd ctrlp.vim +endif diff --git a/.vim/after/plugin/minpac.vim b/.vim/after/plugin/minpac.vim index d64fb55..54487e5 100644 --- a/.vim/after/plugin/minpac.vim +++ b/.vim/after/plugin/minpac.vim @@ -22,6 +22,7 @@ function! InitMinpac() abort call minpac#add('https://github.com/SirVer/ultisnips.git', {'type': 'opt'}) call minpac#add('https://github.com/honza/vim-snippets') call minpac#add('https://github.com/prabirshrestha/vim-lsp') + call minpac#add('https://github.com/ctrlpvim/ctrlp.vim.git', {'type': 'opt'}) call minpac#add('https://github.com/ludovicchabant/vim-gutentags.git') call minpac#add('https://github.com/easymotion/vim-easymotion.git') |