Improve vim ripgrep

This commit is contained in:
Marko Korhonen 2020-12-04 10:41:08 +02:00
parent 9e41240cdd
commit f203732a94

View file

@ -32,14 +32,12 @@ endfunction
" Looks
"let $FZF_DEFAULT_OPTS=' --color=dark --color=fg:15,bg:-1,hl:1,fg+:#ffffff,bg+:0,hl+:1 --color=info:0,prompt:0,pointer:12,marker:4,spinner:11,header:-1 --layout=reverse --margin=1,4'
" ripgrep custom settings
command! -bang -nargs=* Rg
\ call fzf#vim#grep('rg --column --line-number --no-heading --color=always --smart-case '
\ . (len(<q-args>) > 0 ? <q-args> : '""'), 0,
\ fzf#vim#with_preview({'options': ['--delimiter=:', '--nth=2..', '--layout=reverse', '--info=inline']}), <bang>0)
" Keybinds
nmap <C-f> :Files<CR>
nmap <C-g> :Rg<CR>
" Ripgrep command customization
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --hidden --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)