Home > vim > Custom Colors

Custom Colors

Problem:
I had set up my vim to run flake8 when I save python files. The issue now was that the quickfix window would display the errors in white/white-grey text on a yellow background. That proved to be really hard to read.

white on yellow

Solution:
1. One option was to change my colorscheme to something that would display the text. (Many hours later I still had not found a colorscheme that I liked.)
2. Change the color for just that “aspect”.

So I went with option 2 and changed the color. Which resulted in black on yellow and is now much easier to read.
screen-shot-2016-12-21-at-22-13-58

Steps:
While in vim look at the current colors that are already set. (:highlight or :hi)

:highlight

highlight

The colors I wanted to change were for ‘Search’. So while still in vim

:highlight Search term=reverse ctermbg=11 ctermfg=0  guibg=Yellow

To make this permanent I added the following to .vimrc

highlight clear
highlight Search term=reverse ctermbg=11 ctermfg=0  guibg=Yellow

Source:
http://andrewradev.com/2011/08/06/making-vim-pretty-with-custom-colors/
http://superuser.com/questions/654919/how-to-turn-off-gvim-error-highlighting

Advertisements
Categories: vim Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: