Cursor lost in selected text - Vim

When the text is selected in vim, for example, using the "em" tag when writing an HTML document, I found that in some color schemes the cursor becomes invisible, which makes it difficult to correctly position the closing tag. Is there a way to change the cursor color to the selected text?

+5
source share
3 answers

This problem led me to a pretty rabbit hole and made me learn a lot more about how syntax highlighting works than intended.

I found out that the reason why my supposedly italic text was highlighted in the first place was because the Mac terminal does not support italics (" Enabling italics in vim syntax highlighting for mac terminal ")

I realized, thanks to “ Color is everywhere! 256 color modes for Linux consoles ”, that because of the color profile that I had selected in the terminal settings, my “bright” and “normal” colors showed no difference, and for this reason my color profiles never looked like screenshots.

And finally, I decided that my cursor was lost by changing the cursor color in the terminal settings.

0
source

Change cursor color in gvim

Look at both answers, sir, I think you will have your answer there ....

0

You need to connect to events CursorMoved,CursorMovedI, and then define the selection group under the cursor with synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name"). If this is one of those groups that can be distinguished, you can issue a command :highlight Cursor ...to change it (or change it).

But it is rather difficult. Why don't you just change the color scheme and choose a color that is easily recognized under any circumstances ?! (The team :hilists all the colors and helps you choose one.)

0
source