update fzf use rg
This commit is contained in:
parent
3e39dff74f
commit
df3ed9f9d4
|
@ -43,20 +43,32 @@ if executable('fzf') && v:version >= 704
|
||||||
|
|
||||||
nnoremap <space>fg :GFiles<CR>
|
nnoremap <space>fg :GFiles<CR>
|
||||||
nnoremap <space>ff :Files<CR>
|
nnoremap <space>ff :Files<CR>
|
||||||
nnoremap <space>fr :History<CR>
|
nnoremap <space>fH :History<CR>
|
||||||
nnoremap <space>ft :Tags<CR>
|
nnoremap <space>ft :Tags<CR>
|
||||||
nnoremap <space>fb :Buffers<CR>
|
nnoremap <space>fb :Buffers<CR>
|
||||||
nnoremap <space>fh :Helptags<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
|
" Ag! gives fullscreen with preview
|
||||||
command! -bang -nargs=* Ag
|
" command! -bang -nargs=* Ag
|
||||||
\ call fzf#vim#ag(<q-args>,
|
" \ 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%')
|
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||||
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||||
\ <bang>0)
|
\ <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 =
|
let g:fzf_colors =
|
||||||
\ { 'fg': ['fg', 'Normal'],
|
\ { 'fg': ['fg', 'Normal'],
|
||||||
\ 'bg': ['bg', 'Normal'],
|
\ 'bg': ['bg', 'Normal'],
|
||||||
|
|
Loading…
Reference in New Issue