From df3ed9f9d485f883863e6d54a293e1d45bdaa32f Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Sat, 15 Jun 2019 15:44:12 +0100 Subject: [PATCH] update fzf use rg --- config/plugins.shared.vim | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/config/plugins.shared.vim b/config/plugins.shared.vim index 27063af..bc08394 100644 --- a/config/plugins.shared.vim +++ b/config/plugins.shared.vim @@ -43,20 +43,32 @@ if executable('fzf') && v:version >= 704 nnoremap fg :GFiles nnoremap ff :Files - nnoremap fr :History + nnoremap fH :History nnoremap ft :Tags nnoremap fb :Buffers nnoremap fh :Helptags - nnoremap fa :Ag - nnoremap fA :Ag! + " nnoremap fa :Ag + " nnoremap fA :Ag! " Ag! gives fullscreen with preview - command! -bang -nargs=* Ag - \ call fzf#vim#ag(, - \ 0 ? fzf#vim#with_preview('up:60%') - \ : fzf#vim#with_preview('right:50%:hidden', '?'), - \ 0) - + " command! -bang -nargs=* Ag + " \ call fzf#vim#ag(, + " \ 0 ? fzf#vim#with_preview('up:60%') + " \ : fzf#vim#with_preview('right:50%:hidden', '?'), + " \ 0) + " + " Similarly, we can apply it to fzf#vim#grep. To use ripgrep instead of ag: + command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, + \ 0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ 0) + + " Files command with preview window + command! -bang -nargs=? -complete=dir Files + \ call fzf#vim#files(, fzf#vim#with_preview(), 0) + let g:fzf_colors = \ { 'fg': ['fg', 'Normal'], \ 'bg': ['bg', 'Normal'],