-
Notifications
You must be signed in to change notification settings - Fork 24
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
Turn off highlight on CursorMoved and InsertEnter without remapping (doesn't break search operator pending mode) #9
Comments
This works amazingly well and is a lot cleaner than what I did. Can I use it as starting point for a new branch? |
Please take a look at branch "purplep": https://github.com/romainl/vim-cool/tree/purplep. |
@romainl Yes, of course you can. I've leared about |
I merged the "purplep" branch into "master". Thanks a lot! |
nice.. thanks a lot @purpleP |
🙏 |
This is a left over from the base of this plugin that I borrowed from @purpleP, see [romainl/vim-cool#9].
Thanks to guys from neovim I've found a way to automatically turn off search highlight when it's no longer needed (for me).
Notice how I check if the cursor is on something that have been searched previously. In your plugin you're using
if expand("<cword>") =~ @/
which wouldn't work if someone searched for more than one word.So in case someone is wondering this would turn off highlight if you've moved cursor with anything except next/previous match motion or if you've entered insert mode (in operator pending mode also, yey!)
The text was updated successfully, but these errors were encountered: