This commit is contained in:
TankorSmash 2021-12-13 15:56:27 -05:00 committed by GitHub
commit 7373f203df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 11 deletions

View file

@ -24,6 +24,10 @@ if !exists('g:rg_window_location')
let g:rg_window_location = 'botright'
endif
if !exists('g:rg_highlight_type')
let g:rg_highlight_type = 'keyword'
endif
fun! g:RgVisual() range
call s:RgGrepContext(function('s:RgSearch'), '"' . s:RgGetVisualSelection() . '"')
endfun
@ -110,8 +114,7 @@ fun! s:RgPathContext(search, txt)
endfun
fun! s:RgHighlight(txt)
let @/=escape(substitute(a:txt, '"', '', 'g'), '|')
call feedkeys(":let &hlsearch=1\<CR>", 'n')
call matchadd(g:rg_highlight_type, a:txt)
endfun
fun! s:RgRootDir()