When I do a global search and replace with confirm (e.g., :s/t/s/gc) I have a lot of trouble seeing which of many occurrences is currently under the cursor.

I've tried the usual tricks, e.g., hi IncSearch ctermfg=Black ctermbg=lightyellow cterm=bold,underline,reverse but still have trouble.

I think it would help some if I could make the cursor blink aggressively in addition to the other settings.

I've read this posting and tried to understand this video but they are way too complicated for me. Is there any way to get a blink simply by adding another attribute to cterm?

Thanks very much for any suggestions!

  • 1
    Well if an experimented Vimmer like Damian Conway created a function to make the highlighting blink it is not because it is fun it is because there's no way to do it simply with cterm. The highlighting commands defines how text should look like but they don't have an option to create blink. Now what is your exact problem with the links you gave? Why are they to complicated? You have trouble using them? If so what is your trouble?
    – statox
    Jan 6, 2017 at 8:55
  • 1
    What you're asking for is exactly what is provided by Damian Conway's Vimscript. You don't have to understand it. You just have to copy it into your .vimrc.
    – Rich
    Jan 6, 2017 at 9:14
  • 1
    Possible duplicate of Set cursor colour different when on a highlighted word
    – Rich
    Jan 6, 2017 at 9:17
  • 3
    This is about :s///c not n, though you could use gn and replace interactively that way, but then you're not getting the benefit of the :g.
    – Antony
    Jan 6, 2017 at 10:55
  • Sorry statox, I should have elaborated. As Antony noted, Conway's script doesn't work with global substitutions. In fact I can't get it to work with n either, because I can't find an example of usage. I also can't figure out how to experiment with @DevSolar's adaption of Conway's script, which addresses exactly the problem I have, but again, not for global substitutions with confirmation. So, specifically, my trouble is that I don't know how to adapt @DevSolar's script for commands of the form g/t/s//c/gc
    – Leo Simon
    Jan 6, 2017 at 18:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.