diff options
author | Guangxiong Lin <[email protected]> | 2022-04-13 09:51:35 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-04-13 09:51:35 +0800 |
commit | a50815d4ea872b8f02987f13a03a83805b570af9 (patch) | |
tree | fa0f19caecb69e066808f729db1d973f707e9bea | |
parent | 22bbfcd6c80adc3c566e7fedc1eb883773438e64 (diff) | |
download | dotfiles-a50815d4ea872b8f02987f13a03a83805b570af9.tar.gz dotfiles-a50815d4ea872b8f02987f13a03a83805b570af9.tar.bz2 dotfiles-a50815d4ea872b8f02987f13a03a83805b570af9.zip |
Load fzf plugin only when fzf exists (vim)
-rw-r--r-- | .vim/after/plugin/fzf.vim | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/.vim/after/plugin/fzf.vim b/.vim/after/plugin/fzf.vim index cda5a27..e041d6b 100644 --- a/.vim/after/plugin/fzf.vim +++ b/.vim/after/plugin/fzf.vim @@ -1,22 +1,24 @@ -let g:fzf_command_prefix = 'Fzf' +if executable('fzf') + let g:fzf_command_prefix = 'Fzf' -command! -bang -nargs=* FzfRg - \ call fzf#vim#grep( - \ 'rg --hidden --column --line-number --no-heading --color=always --smart-case --glob !.git -- '.shellescape(<q-args>), 1, - \ fzf#vim#with_preview(), <bang>0) + command! -bang -nargs=* FzfRg + \ call fzf#vim#grep( + \ 'rg --hidden --column --line-number --no-heading --color=always --smart-case --glob !.git -- '.shellescape(<q-args>), 1, + \ fzf#vim#with_preview(), <bang>0) -noremap <leader>ff :FzfFiles<CR> -noremap <leader>fgf :FzfGFiles<CR> -noremap <leader>fb :FzfBuffers<CR> -noremap <leader>fm :FzfHistory<CR> -noremap <leader>ft :FzfBTags<CR> -noremap <leader>fT :FzfTags<CR> -noremap <leader>fa :FzfAg<space> -noremap <leader>fr :FzfRg<space> -noremap <leader>fc :FzfCommands<CR> -noremap <leader>fgc :FzfBCommits<CR> -noremap <leader>fgC :FzfCommits<CR> -noremap <leader>fl :FzfBLines<CR> -noremap <leader>fL :FzfLines<CR> + noremap <leader>ff :FzfFiles<CR> + noremap <leader>fgf :FzfGFiles<CR> + noremap <leader>fb :FzfBuffers<CR> + noremap <leader>fm :FzfHistory<CR> + noremap <leader>ft :FzfBTags<CR> + noremap <leader>fT :FzfTags<CR> + noremap <leader>fa :FzfAg<space> + noremap <leader>fr :FzfRg<space> + noremap <leader>fc :FzfCommands<CR> + noremap <leader>fgc :FzfBCommits<CR> + noremap <leader>fgC :FzfCommits<CR> + noremap <leader>fl :FzfBLines<CR> + noremap <leader>fL :FzfLines<CR> -packadd fzf.vim + packadd fzf.vim +endif |