update fzf use rg

This commit is contained in:
ManjaroOne666 2019-06-15 15:44:12 +01:00
parent 3e39dff74f
commit df3ed9f9d4
1 changed files with 21 additions and 9 deletions

View File

@ -43,19 +43,31 @@ if executable('fzf') && v:version >= 704
nnoremap <space>fg :GFiles<CR>
nnoremap <space>ff :Files<CR>
nnoremap <space>fr :History<CR>
nnoremap <space>fH :History<CR>
nnoremap <space>ft :Tags<CR>
nnoremap <space>fb :Buffers<CR>
nnoremap <space>fh :Helptags<CR>
nnoremap <space>fa :Ag<CR>
nnoremap <space>fA :Ag!<CR>
" nnoremap <space>fa :Ag<CR>
" nnoremap <space>fA :Ag!<CR>
" Ag! gives fullscreen with preview
command! -bang -nargs=* Ag
\ call fzf#vim#ag(<q-args>,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
" command! -bang -nargs=* Ag
" \ call fzf#vim#ag(<q-args>,
" \ <bang>0 ? fzf#vim#with_preview('up:60%')
" \ : fzf#vim#with_preview('right:50%:hidden', '?'),
" \ <bang>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(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
" Files command with preview window
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],