diff options
author | Guangxiong Lin <[email protected]> | 2023-09-01 22:49:17 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-09-01 22:49:17 +0800 |
commit | cd3a485f1bc8b343a517327840e78f881cbac6de (patch) | |
tree | 86be028b5307ac9eb57ba7eecf0fee8f6fdd3038 | |
parent | a38386a9111b13a74f5f8e670a256fccc14ec635 (diff) | |
download | dotfiles-cd3a485f1bc8b343a517327840e78f881cbac6de.tar.gz dotfiles-cd3a485f1bc8b343a517327840e78f881cbac6de.tar.bz2 dotfiles-cd3a485f1bc8b343a517327840e78f881cbac6de.zip |
Use ctrlp when fzf is not available
-rw-r--r-- | .vim/after/plugin/ctrlp.vim | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/.vim/after/plugin/ctrlp.vim b/.vim/after/plugin/ctrlp.vim index 767b00f..ca19bc6 100644 --- a/.vim/after/plugin/ctrlp.vim +++ b/.vim/after/plugin/ctrlp.vim @@ -1,25 +1,27 @@ -if get(g:, 'loaded_fzf_vim', 0) == 0 - let g:ctrlp_map = '<leader>ff' - let g:ctrlp_cmd = 'CtrlP' - let g:ctrlp_working_path_mode = 'ra' - let g:ctrlp_use_caching = 0 - let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'line'] - let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } - - let g:ctrlp_user_command = 'find %s -type f' - if executable('fd') - let g:ctrlp_user_command = ' - \ fd --hidden --type f . %s - \ --exclude .git' - endif +if executable('fzf') + finish +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 %<CR> +let g:ctrlp_map = '<leader>ff' +let g:ctrlp_cmd = 'CtrlP' +let g:ctrlp_working_path_mode = 'ra' +let g:ctrlp_use_caching = 0 +let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'line'] +let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } - packadd ctrlp.vim - packadd ctrlp-py-matcher +let g:ctrlp_user_command = 'find %s -type f' +if executable('fd') + let g:ctrlp_user_command = ' + \ fd --hidden --type f . %s + \ --exclude .git' 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 %<CR> + +packadd ctrlp.vim +packadd ctrlp-py-matcher |