|
call feedkeys(":let &hlsearch=1\<CR>", 'n') |
I'm enjoying vim-ripgrep quite a bit but I noticed that since installing, hlsearch was being set and unset quite a bit and I wasn't sure why. I tracked it down to the line above.
If you replace it with
call matchadd('keyword', a:txt)
it'll highlight it without messing with the search at all, at the cost of not being able to cycle through all the matches manually. This was my first mess with syntax highlighting so I'm not sure if this is a one-stop solution for every use case but it worked for me.
vim-ripgrep/plugin/vim-ripgrep.vim
Line 114 in ec87af6
I'm enjoying vim-ripgrep quite a bit but I noticed that since installing, hlsearch was being set and unset quite a bit and I wasn't sure why. I tracked it down to the line above.
If you replace it with
it'll highlight it without messing with the search at all, at the cost of not being able to cycle through all the matches manually. This was my first mess with syntax highlighting so I'm not sure if this is a one-stop solution for every use case but it worked for me.