Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim editor error color

Tags:

vim

colors

I am using Vim 7.3 on Ubuntu. Problem is - whenever I got some error in my code, that error is marked with white color. I can't see anything underneath that color. So if I have typo error (missing one brace) it will mark that brace with white, but I wont be able to see that mistake ( it is covered with color ). Sometimes it marks all line. I am using Molokai color scheme.

I tried to change color scheme, but nothing happens. I suppose that error color is coming from the vim native settings.

Any ideas how to fix this?

like image 655
Miroslav Trninic Avatar asked Feb 14 '13 09:02

Miroslav Trninic


People also ask

How do I change the color in vim editor?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.

What does RED text mean in vim?

For example, vim can understand comments and highlight those texts in blue color and variables in green, etc… 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 .

Does vim have color?

Vim color schemes are a useful feature of this popular text editor. Not only do they allow for practical syntax highlighting, but they also give users a chance to personalize the interface. As a Vim user, you can change color schemes that come with the software package or install user-made color schemes.


2 Answers

The

:hi

command lists all defined highlightings. Find the one with the white color (for errors, this should be Error), and change it (see :help :highlight) in your ~/.vimrc, e.g.:

:hi Error ctermfg=Red guifg=Red
like image 131
Ingo Karkat Avatar answered Oct 30 '22 03:10

Ingo Karkat


If highlighting is the issue, then you can easily and quickly turn off all highlighting by typing ":noh" (without the quotes) from command mode. This will temporarily turn off highlighting. This also works for getting rid of highlighting after a search (which really annoys me because like your problem here, I can't read the text when it's highlighted).

If you haven't already, you should create a file in your home directory named ".vimrc", so pathing it out would be "~/.vimrc". This is the what @mtk is referring to (just in case you don't know that already. Some people at work use Vim but don't know about the .vimrc file).

like image 33
Freedom_Ben Avatar answered Oct 30 '22 02:10

Freedom_Ben