macosvimvi

Cursor lost in highlighted text - Vim


When text is highlighted in vim, for example using the 'em' tag when writing a HTML document, I find that in some color schemes the cursor becomes invisible, making it difficult to correctly place the closing tag. Is there a way to have the cursor change color over highlighted text?


Solution

  • This problem led me down quite a rabbit hole and caused me to learn a lot more about how syntax highlighting works than intended.

    I learned that the reason my, supposedly italic, text was highlighted in the first place, is because the Mac terminal doesn't support italics ("Enabling italics in vim syntax highlighting for mac terminal")

    I realised, thanks to "Colour colour everywhere! 256 colour-mode for Linux consoles", that due to the color profile I had chosen in Terminal's preferences, my "bright" and "normal" colors showed no difference, and for that reason my color profiles never looked like the screenshots.

    And, finally, I solved my cursor getting lost problem by changing the cursor color in the Terminal preferences.