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
|
||||
execute 'Rg ' . escape(l:query, '|')
|
||||
else
|
||||
let l:grepprg = &grepprg
|
||||
set grepprg=grep\ -RIn
|
||||
execute 'silent grep! ' . shellescape(l:query) . ' .'
|
||||
let &grepprg = l:grepprg
|
||||
let l:results = system('grep -RIn -e ' . shellescape(l:query) . ' . 2>/dev/null')
|
||||
if empty(l:results)
|
||||
echohl WarningMsg | echom 'No matches found' | echohl None
|
||||
return
|
||||
endif
|
||||
cgetexpr split(l:results, "\n")
|
||||
copen
|
||||
endif
|
||||
endfunction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue