Search code examples
vimsyntax-highlightingvim-syntax-highlighting

Changing text selection color in visual mode in vim


I use black background and white text. The problem is, when I want to select some text in visual mode, the selected text is NOT visible at all, as both of them are white. I do not want to switch to light backgrounds. How can I change just the text selection color to something else, so that selected text is visible?

enter image description here


Solution

  • If the colorscheme is supposed to be a dark colorscheme. It should automatically have

    set background=dark
    

    inside of it. If it doesn't you can add it after the colorscheme is loaded. If background is set to dark vim will try to use colors that look good on a dark background.

    Take a look at :help 'background'