53 votes
Accepted

How to add indentation guides/lines

Unified answer: If you are using tabs I'd try using listchars: :set listchars=tab:\|\ :set list note: there is a space after the last \ above. This method is good because it uses Vim's built-in ...
user avatar
  • 8,032
50 votes
Accepted

What does :set background=dark do?

What happens when you :set background The basic mechanism by which :set background works is actually pretty simple, and it is documented (although not particularly clearly) in :help 'background'. ...
user avatar
  • 27.5k
49 votes

How to add indentation guides/lines

Another option I use, which isn't exactly what you asked for, but accomplishes the same purpose of making it easier to see what is in the same column, is to set the following in your vimrc: set ...
user avatar
35 votes
Accepted

How do I customize vimdiff colors?

The colors are controlled by these four highlight groups (:help hl-DiffAdd): DiffAdd diff mode: Added line DiffChange diff mode: Changed line DiffDelete diff mode: Deleted line DiffText diff ...
user avatar
  • 16.7k
33 votes

How do I customize vimdiff colors?

One quick fix is to disable syntax highlighting. Sometimes the code syntax highlighting will cause the foreground text to be the same color as the vimdiff background color, making the text "invisible"....
user avatar
  • 730
23 votes
Accepted

List valid color schemes?

The easiest way is to use :help c_Ctrl-d after :colorscheme. So, :colorschemeCtrl-d will output the colorschemes you have available to you. Make sure there is a space after :colorscheme
user avatar
  • 5,806
23 votes
Accepted

How do I change the colour of the statusline of the currently focused window?

You can change it in your vimrc. The currently focused window is highlight group Statusline, other windows are StatuslineNC. Example for terminal Vim: hi StatusLine ctermfg=8 ...
user avatar
  • 298
21 votes

How to add indentation guides/lines

For the sake of completeness, there is also the Indent Guides plugin, which shows the indentation levels by alternating the colors of white spaces. It requires version 7.2 or later. Since it uses the ...
user avatar
  • 2,251
19 votes
Accepted

How can I create my own colorscheme?

Colorscheme locations First, Vim looks in its runtime folders for a colors directory. Here is where all the colorschemes should be stored (:help 'runtimepath') This means you will need one file that ...
17 votes
Accepted

Set cursor colour different when on a highlighted word

I use this snippet from Damian Conway's fantastic talk, More Instantly Better Vim (at 4m 59s). It causes the entire highlight to blink briefly when you leap between search results. " Damian Conway's ...
user avatar
  • 27.5k
16 votes
Accepted

How do I conditionally set :colorscheme?

Lets fail with Style! silent! colorscheme evening silent! colorscheme solarized The :silent! will ignore the errors at start up. Just put color schemes in reverse order of what you really want. For ...
user avatar
15 votes
Accepted

When making a colorscheme, what is the label for the ~ area of the screen below EOF?

Since Vim 8 there is the EndOfBuffer highlight group for this; from :help hl-EndOfBuffer: EndOfBuffer filler lines (~) after the last line in the buffer. By default, this is highlighted like ...
user avatar
14 votes

Is it possible to use two different color backgrounds in a single vim buffer?

It's certainly possible to use a different background colour for syntax-highlighted elements. Just define the guibg and ctermbg colours in your hilight command. The former sets the background colour ...
user avatar
  • 27.5k
13 votes

How do I customize vimdiff colors?

Extending Ingo Karkat's solution to terminal, hi DiffAdd ctermfg=NONE ctermbg=Green hi DiffChange ctermfg=NONE ctermbg=NONE hi DiffDelete ctermfg=LightBlue ctermbg=Red ...
user avatar
  • 233
12 votes
Accepted

Trouble Using Color Scheme in NeoVim

Main Issue The main problem you are experiencing is caused by the ordering of the commands in your .vimrc. You set the g:impact_transbg variable after you load the colorscheme, and so the variable ...
user avatar
  • 27.5k
12 votes

How do I restore visual mode selection highlighting?

I had this issue as well because I had switched to the "evening" color scheme in my ~/.vimrc file so that my comments were easier to read on a dark background: :colorscheme evening To restore visual ...
user avatar
12 votes
Accepted

Highlight whole todo comment line

I'm not sure why the answer you linked to is accepted and so highly voted, because neither of the included solutions will actually work, and while a working solution is alluded to in the explanation, ...
user avatar
  • 27.5k
11 votes

List valid color schemes?

Another way to show the list is by set wildmenu. With this, after :colorscheme + space + tab, a list of completion is displayed and also selectable with arrow key or Ctrl-N and Ctrl-P. This is not ...
user avatar
  • 1,881
10 votes

How to add indentation guides/lines

I've found the indentLine plugin to be the best for this. You do need a font with the appropriate symbols though, I find Consolas on Windows and Menlo on Mac OS X work well. As is pointed out in the ...
user avatar
10 votes
Accepted

Is it possible to use two different color backgrounds in a single vim buffer?

Because I was curious how well this would work, I've hacked something together that sort of works. As mentioned in the comments on the earlier answer, the only way to do this is to fill up regions ...
user avatar
10 votes

Colorscheme's background not correct in terminal

There's two reasons why I think this may be happening: The solarized color scheme you are using does not declare ctermfg and ctermbg for any of the features you want to highlight. Try out this color ...
user avatar
10 votes
Accepted

Why does the order of :set bg=dark and :set bg=light matter?

The elflord colorscheme does set background=dark. Since it is sourced after your set bg=light it will override it. set t_Co=256 is pointless. It doesn't do anything in GVim and you should set your ...
user avatar
  • 32.8k
10 votes
Accepted

Visual Differences between vim on virtualbox Ubuntu guest (through putty) OR gVim on Windows host

PuTTY, like other high-color terminals, only supports a fixed color palette of 256 colors. GVIM can use the full 24-bit RGB color space; that's why you see "finer" nuances there. As for attributes, ...
user avatar
  • 16.7k
9 votes

Why does my colorscheme look different when I run vim with sudo?

When you run vim with sudo, you are running as user root, so you are using root's vimrc and .vim. Your colorscheme and other customizations set in your ~/.vimrc are not being used. You can see this by ...
user avatar
  • 5,874
9 votes
Accepted

Is it possible to assign a sign to "Todo" group?

Try this function : function! SignKeyword() silent! sign undefine todo sign define todo text=>> texthl=Search g/\v\C(<TODO>|<FIXME>)/execute "sign place 9999 line=" . ...
user avatar
  • 6,426
9 votes
Accepted

How to save color scheme in gVim between sessions?

In Vim, settings are saved across sessions by writing them in an init script called vimrc. On Windows, that vimrc is supposed to be at this location: $HOME/vimfiles/vimrc The installer may or may ...
user avatar
  • 32.8k
9 votes

Make vim show all the colors

The colorscheme must be missing cterm definitions, the full highlight command should look like: hi Normal cterm=NONE ctermfg=15 ctermbg=7 gui=NONE guifg=White guibg=grey20 If your terminal supports ...
user avatar
  • 1,516
9 votes
Accepted

Strange Highlighting during Git Commit

Your Vim setup is actually behaving correctly, here. Git commit messages are recommended always to have a blank line after the first line. The strange colouring you're seeing is highlighting this as ...
user avatar
  • 27.5k
9 votes
Accepted

Neovim Gray Background

A quick rundown on colorschemes See :help :colorscheme. Essentially it sources a file containing :highlight commands. What are highlight commands? Statements of the form :hi[ghlight] [default] {group-...
user avatar
  • 20.9k
9 votes

How to set a colorscheme that still shows spelling errors?

Here is a bit more complete answer to address this annoyance: " Force to use underline for spell check results augroup SpellUnderline autocmd! autocmd ColorScheme * \ highlight SpellBad \ ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible