diff options
author | Guangxiong Lin <[email protected]> | 2023-11-03 20:06:29 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-11-03 20:06:29 +0800 |
commit | 7ed1a02d83402b0090086d8a88444b552ebf0afb (patch) | |
tree | 7f4c0c1fe1ec98cbeea45e1d91fde1ee1ae8146d | |
parent | 6bc03dc4a7d0475e6d25c1c10bbd78bb930baf4e (diff) | |
download | dotfiles-7ed1a02d83402b0090086d8a88444b552ebf0afb.tar.gz dotfiles-7ed1a02d83402b0090086d8a88444b552ebf0afb.tar.bz2 dotfiles-7ed1a02d83402b0090086d8a88444b552ebf0afb.zip |
Update fzf vim config
-rw-r--r-- | .vim/after/plugin/fzf.vim | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/.vim/after/plugin/fzf.vim b/.vim/after/plugin/fzf.vim index 0694caa..648cb54 100644 --- a/.vim/after/plugin/fzf.vim +++ b/.vim/after/plugin/fzf.vim @@ -1,3 +1,7 @@ +if !executable('fzf') + finish +endif + let s:fzf_default_opts = $FZF_DEFAULT_OPTS function! s:build_quickfix_list(lines) abort @@ -38,39 +42,36 @@ command! FzfQuickFix call fzf#run({ \ 'options': s:fzf_default_opts. ' --multi --prompt "QuickFix> "' \ }) -if executable('fzf') && get(g:, 'loaded_fzf', 0) == 1 - let g:fzf_command_prefix = '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 ' . <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 ' . <q-args>, 1, + \ fzf#vim#with_preview(), <bang>0) - command! FzfGitChangedFiles call fzf#run({ - \ 'source': s:command_git_patch_files_changed, - \ 'sink': 'e' - \ }) +command! FzfGitChangedFiles call fzf#run(fzf#wrap({ + \ 'source': s:command_git_patch_files_changed, + \ 'sink': 'e' + \ })) - 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>fr :FzfRg<space> - noremap <leader>fc :FzfCommands<CR> - nnoremap <leader>fC :FzfGitChangedFiles<CR> - noremap <leader>fgc :FzfBCommits<CR> - noremap <leader>fgC :FzfCommits<CR> - noremap <leader>fl :FzfBLines<CR> - noremap <leader>fL :FzfLines<CR> - noremap <leader>fq :FzfQuickFix<CR> +noremap <leader>ff :FzfFiles<CR> +noremap <leader>fgf :FzfGitChangedFiles<CR> +noremap <leader>fb :FzfBuffers<CR> +noremap <leader>fm :FzfHistory<CR> +noremap <leader>ft :FzfBTags<CR> +noremap <leader>fT :FzfTags<CR> +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>fq :FzfQuickFix<CR> - let g:fzf_action = { - \ 'ctrl-q': function('s:build_quickfix_list') - \ } - let g:fzf_layout = { 'down': '40%' } - let g:fzf_preview_window = [ 'right:80%:hidden', 'ctrl-/' ] +let g:fzf_action = { + \ 'ctrl-q': function('s:build_quickfix_list') + \ } +let g:fzf_layout = { 'down': '40%' } +let g:fzf_preview_window = [ 'right:80%:hidden', 'ctrl-/' ] - packadd fzf.vim -endif +packadd fzf.vim |