Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Annoying, red highlighting of random words in vim

Tags:

vim

I have this problem identifying the reason word get this annoying red background in my vim:

enter image description here

Do you happen to know why vim highlights random words throughout documents that I open and how I can turn this off?

like image 976
luqo33 Avatar asked Feb 21 '15 16:02

luqo33


People also ask

How do you get rid of red highlights in Vim?

If you want to avoid this in an apache . conf file like I did, you can add it to the end, like "# vim: nospell". Or, you could add words to spelling dictionary. I have to do set nospell , every time that red happens!

Why is text highlighted red in Vim?

Similarly, errors are generally highlighted in red color and it looks like vim does not know how the syntax should be handled for /etc/sysconfig/named . However, highlighting of error messages is done with the help of Error and ErrorMsg highlight groups. So try to highlight groups as shown below.

Why are some words highlighted in Vim?

Most filetypes (like python) in Vim come with a syntax that defines highlight groups (see them via :highlight ). A colorscheme then provides combinations of foreground / background color and/or formatting like bold and italic, for terminals, color terminals, and/or GVIM.


2 Answers

You have the spell check switched on. Switch it off using

:set nospell 

(source: http://www.linux.com/learn/tutorials/357267-using-spell-checking-in-vim)

like image 70
Jongware Avatar answered Sep 22 '22 22:09

Jongware


Disabling highlighting is not always something you really want to do. Instead, you can change the style of your error, so they become more friendly. Put this after setting any style:

" Any other stuff like setting colorscheme " colorscheme distinguished  " Change style of highlighting  hi clear SpellBad  hi SpellBad cterm=underline 

As a result, your errors will be underlined in not-annoying way.

like image 21
Vladyslav Zavalykhatko Avatar answered Sep 22 '22 22:09

Vladyslav Zavalykhatko