mirror of
https://github.com/itme-brain/vim.git
synced 2026-05-08 07:30:13 -04:00
cap
This commit is contained in:
parent
4722ec2da4
commit
bdee5567a7
1 changed files with 6 additions and 4 deletions
10
vimrc
10
vimrc
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue