diff options
Diffstat (limited to '.vim/after/plugin')
-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 |