mirror of
https://github.com/jremmen/vim-ripgrep.git
synced 2025-12-27 12:15:36 +08:00
add rg_highlight_type to use for result highlighting
This commit is contained in:
parent
ec87af6b69
commit
704c1aabc8
2 changed files with 12 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue