Skip to main content
56 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
  • 32k
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
49 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
  • 950
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
  • 32k
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
  • 32k
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,626
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,258
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
  • 32k
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
  • 26.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
  • 583
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 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
  • 40.7k
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
  • 32k
8 votes
Accepted

CursorLine colors

The default syntax script for vim doesn't have lightyellow listed for vimHiCtermColor. You could patch it and submit your change to the vim_dev mailing list. Or, better, ask them if that is ...
romainl's user avatar
  • 40.7k
8 votes
Accepted

SpecialKey foreground color w/ cursorline set

I've been struggling with that behavior for a long time. Basically, the foreground color of SpecialKey on the current line is changed to the foreground color of Normal if: the cursorline option is ...
romainl's user avatar
  • 40.7k
8 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
  • 32k
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
  • 32k
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

Change color of Vim error message when .swp file exists

This is using the MoreMsg highlighting group, so in your colorscheme, you want to tweak this highlighting option.
Christian Brabandt's user avatar
7 votes
Accepted

How do I turn Vi colors off in Ubuntu Linux 14.04

You can use: :set t_Co=0 This will tell Vim that you're not using a colour terminal. The difference with using :syntax off is that this will still enable some syntax highlighting features with bold, ...
Martin Tournoij's user avatar
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
  • 32k
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
  • 49.9k
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.4k
6 votes
Accepted

Tmux messing with Vim highlighting

Add this line to your tmux.conf file set -g default-terminal "screen-256color" Add the line below to you shells rc file in my case its my .zshrc if [[ $TERM == xterm ]]; then TERM=xterm-256color; ...
byaruhaf's user avatar
  • 786
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
  • 28.8k

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