Vim multiple cursors are invisible after color change

I've been using vim with multiple cursors for a few years now, but it wasn't until today when I fiddled with my color scheme that I found cursors not always showing up.
When they visually select something, they use the color for the selection group Visual

; however, if I do not visually select, multiple cursors are completely invisible, with vim

both gvim

.
I tried to change the background color Normal

but not use. They also don't seem to use the group settings Normal

as they are not visible in the text with different background / foreground colors. What puzzles me the most is that this has not happened before.

Edit:

After some testing, it seems that when I open vim to edit the file, the cursors are visible, but if I try to set the color scheme even though it's already set, they become (seemingly) permanently invisible.

+3


source to share


1 answer


Apparently the plugin defines its own highlight groups . When you switch colors, the usual command :hi clear

at the top of the diagram removes all existing selections.

Ideally, the plugin will not define its own highlight, but just a link to an existing selection group. At least the backlight is customizable.

To support color changes that happen on the fly, the plugin must hook into the autocommand event ColorScheme

and reinitialize. (There aren't many plugins though).

As a workaround, you can do it yourself (like in ~/.vimrc

):



:autocmd ColorScheme * runtime autoload/multiple_cursors.vim

      

(Select yours first (default) :colorscheme

, then add :autocmd

. Any customization of the plugin will be best done before it. If that still doesn't work, try putting this in yours .vimrc

:

autocmd ColorScheme * hi multiple_cursors_cursor term=reverse cterm=reverse gui=reverse

      

This would be more efficient than re-searching the entire plugin script, but duplicates some information from the plugin.

+3


source







All Articles