Wednesday, June 13, 2018

How can I set cursorline only during a search?

I don't use the cursorline, but I would find it helpful to set it during a whenever I press 'n' or 'N' to make the line of the current search match pop out. However once I press anything other than n or N, I'd like to turn the cursorline off. I can do something like 'nnoremap n :setlocal cursorline<CR>n', but I'm not sure how I can conditionally turn it off provided the next key I press isn't an 'n' or 'N'. Any ideas how I could do this?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: