Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of highlighted misspelled word?

In the theme I'm using for vim, the strings are shown in red color but the problem is I have spellcheck on and the misspelled words are also shown in red color.

This makes it hard to see what is the mistake until you go to that word and delete any character.

I want to make the highlightation of the misspelled word in somewhat lighter then it currently. Say #ff2929.

                                                       You can't see what is the misspelled word

like image 362
Santosh Kumar Avatar asked Jul 01 '12 03:07

Santosh Kumar


2 Answers

You can use the hi (short for :help highlight) command in your ~/.vimrc. The general structure is:

hi SpellBad    ctermfg=015      ctermbg=000     cterm=none      guifg=#FFFFFF   guibg=#000000   gui=none

The cterm is for terminal vim and the gui is for gVim. The fg stands for foreground and is the color of the letters and the bg stands for background and is the color behind the letters.

Terminal colors can be 0-15 for standard terminal colors (8 normal and 8 bright) or 0-255 for terms supporting 256 colors, like xterm-256colors. The gui colors are in hexadecimal format. xterm-color-table is a useful reference for both 256 and hexadecimal colors. The final option can be used to specify bold, italic, or none (neither).

In your case, it might be simplest to set the foreground to black to make the letters stand out. First, find a word that's mispelled with :set spell and then typing asdflkjasldf or something. Then type :hi SpellBad ctermfg=000 guifg=#000 and see if that's a solution you like. If not, use the xterm-color-table or another color reference to find a color you do like.

like image 189
Conner Avatar answered Oct 13 '22 02:10

Conner


Try this:

 :hi SpellBad guibg=#ff2929 ctermbg=224
  • guibg is for GUI
  • ctermbg is for TERM
like image 28
kev Avatar answered Oct 13 '22 02:10

kev