0

I have accidently pressed something and the string "#def" now always shows a white (as opposed to my regular dark) background:

This occured while trying to comment out a function in python. What I (think I) pressed:

  • navigate to first character of first line to comment
  • SHIFT + V
  • SHIFT + I
  • #
  • ESC

What I meant to press:

  • navigate to first character of first line to comment
  • CTRL + V
  • SHIFT + I
  • #
  • ESC

where the difference is in the second line (SHIFT vs. CTRL). Ever since the string "#def" is highlighted throughout the document, even when I type it new. :nohl does not clear it either.

What did I do and how can I get rid of the highlight?

1
  • 1
    Well, # searches for a word under the cursor, but if it was inserted I’m not convinced that command was triggered (and :noh would turn it off). The only other thing I can think of is match, which is harder to enter accidentally
    – D. Ben Knoble
    Jul 7 at 12:42

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.