vim: use rg if it exists

This commit is contained in:
Marco Thomas
2023-03-07 23:07:33 +01:00
parent b3c3a4a5d8
commit 87363190c0

View File

@@ -115,8 +115,13 @@ command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
"map <C-s> :GGrep<CR>
map <C-s> :Rg<CR>
let rgcheck = system("which rg 2> /dev/null")
if v:shell_error == 0
map <C-s> :Rg<CR>
else
map <C-s> :GGrep<CR>
endif
" git
map <leader>gs :Git status<CR>