Skip to main content
57 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'. ...
Rich's user avatar
  • 32.4k
55 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 ...
Karl Bielefeldt's user avatar
52 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"....
wisbucky's user avatar
  • 980
45 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 ...
Ingo Karkat's user avatar
  • 17.9k
25 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 ...
kmario23's user avatar
  • 353
15 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, ...
Rich's user avatar
  • 32.4k
13 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 ...
Integrator's user avatar
13 votes

How do I customize vimdiff colors?

Another quick (perhaps even lazy) fix is to just do something like: :colo desert This will change your color scheme, and in some cases will make hidden text become visible.
Nathan Chappell's user avatar
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 ...
Rich's user avatar
  • 32.4k
11 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 ...
LEI's user avatar
  • 1,636
11 votes

How to set if else for vim's "set background = " for light and dark colorschemes?

if &background ==# 'dark' " balabala endif &background get value of 'background' option, check :help let-& ==# compare strings case sensitively, check :help ==#
dedowsdi's user avatar
  • 6,318
10 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 ...
Rich's user avatar
  • 32.4k
10 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-...
D. Ben Knoble's user avatar
  • 27.2k
10 votes
Accepted

24-bit / 256 colorscheme in Windows console

tl;dr: My path was using the an old Vim version, with v8.1.428 we have full 24-bit glorious colours in Vim in the Windows Console! See below for screenshots. Err, so there was a basic mistake on my ...
icc97's user avatar
  • 603
10 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 \ ...
Osamu Aoki's user avatar
9 votes
Accepted

How to completely turn off colorscheme?

Disabling Colours Entirely If you want Vim not to use colours at all, you just need to run the command: :set t_Co=0 This tells Vim that it is running in a terminal that does not support colours, so ...
Rich's user avatar
  • 32.4k
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: $HOME\_vimrc or (if HOME is not defined): C:\Users\yourlogin\...
romainl's user avatar
  • 41.8k
8 votes

List valid color schemes?

If you want to do this in Vimscript, you can get a List of color schemes by using the getcompletion() function: let c = getcompletion('', 'color') echo c This is a bit simpler than the existing ...
Rich's user avatar
  • 32.4k
8 votes

how to change vim background color in hex code or rgb color code?

To set the background (and foreground) to some explicit color, you probably want to use a highlight command in your vimrc, such as " plain text hi Normal ctermfg=227 ctermbg=17 (assuming you are ...
Dalker's user avatar
  • 455
8 votes
Accepted

How to set a colorscheme that still shows spelling errors?

I'm going to take a stab in the dark and suggest that your configuration is probably resulting in no highlighting. You can check this with the command :verbose highlight SpellBad: if the xxx at the ...
Rich's user avatar
  • 32.4k
8 votes
Accepted

How to customize colorschemes without editing their source files?

The AfterColors plug-in (GitHub mirror) provides an after-directory auto-loading mechanism for color schemes. This can however be easily achieved in modern Vim by using the ColorScheme autocommand ...
PiCTo's user avatar
  • 369
7 votes
Accepted

How can Vim be configured to restore normal terminal color on exit?

How to Clear the Screen When Exiting Vim When Vim quits, it sends the escape sequence defined by the t_te setting to the terminal in order to tell it what to do. This should be set automatically by ...
Rich's user avatar
  • 32.4k
7 votes

What does :set background=dark do?

The doc at :h 'background' should provide all the information you need: When set to "dark", Vim will try to use colors that look good on a dark background. When set to "light", Vim will try to ...
statox's user avatar
  • 50.4k
7 votes
Accepted

Vim9: How will '#' characters be handled in colors/* files now?

In vim9 comment starts with either space+# or beginning of the line and # (as far as I remember). So your color setting would still work. :h vim9 /Comments starting<CR> To improve readability ...
Maxim Kim's user avatar
  • 13.8k
6 votes
Accepted

Automatically disable cursorline when in diff mode?

One would expect, that the OptionSet autocommand is triggered when entering diff mode. Unfortunately that is currently not the case. So I created a patch that will enable this behavior. Once it is ...
Christian Brabandt's user avatar
6 votes
Accepted

ctermbg and ctermfg are backwards or incorrect for certain highlighting groups

You're probably overlooking the additional attributes set in the cterm= field for those highlights. For instance, after I set ctermfg=black ctermbg=white for StatusLine, I get this when I query it: :...
filbranden's user avatar
  • 29.6k
6 votes

How can I change the colorscheme of the vim terminal buffer?

I had the same question (I am using vim 8.2) and a google search brought me here. I searched vim help for g:terminal_ansi_colors and made a list as they suggested of rgb values for gruvbox using the ...
John's user avatar
  • 61
5 votes

How to install base16 for iTerm2?

You have to run the script when your shell starts and it has to be ran from the base16-vim color scheme, which is tersely documented in base16-shell. But, you don't want to use that script. It'll ...
Tommy A's user avatar
  • 6,800
5 votes
Accepted

Vim zebra line coloring?

It is possible using my plugin DynamicSigns. Quoting from the README: 2.7 Alternating colors You can also set up the plugin to color the lines in your buffer in alternating colors. To do so, ...
Christian Brabandt's user avatar
5 votes

Hightlight Gutter of Function Being Edited

One could (ab)use :help sign: " define an highlight group highlight CurrentBlock ctermbg=red ctermfg=red cterm=NONE " define a sign sign define currentblock text=>> texthl=CurrentBlock " ...
romainl's user avatar
  • 41.8k

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