Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim-ripgrep pollutes :history with let hlsearch=1 #50

Open
tankorsmash opened this issue Mar 16, 2020 · 1 comment
Open

vim-ripgrep pollutes :history with let hlsearch=1 #50

tankorsmash opened this issue Mar 16, 2020 · 1 comment

Comments

@tankorsmash
Copy link

tankorsmash commented Mar 16, 2020

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.

@tankorsmash
Copy link
Author

#51

Made a pull request with the changes, plus a README entry for the new change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant