This commit is contained in:
Bryan Ramos 2026-05-07 11:08:36 -04:00
parent 4722ec2da4
commit bdee5567a7

10
vimrc
View file

@ -164,10 +164,12 @@ function! FzfRg()
if executable('rg') && exists(':Rg') == 2 if executable('rg') && exists(':Rg') == 2
execute 'Rg ' . escape(l:query, '|') execute 'Rg ' . escape(l:query, '|')
else else
let l:grepprg = &grepprg let l:results = system('grep -RIn -e ' . shellescape(l:query) . ' . 2>/dev/null')
set grepprg=grep\ -RIn if empty(l:results)
execute 'silent grep! ' . shellescape(l:query) . ' .' echohl WarningMsg | echom 'No matches found' | echohl None
let &grepprg = l:grepprg return
endif
cgetexpr split(l:results, "\n")
copen copen
endif endif
endfunction endfunction