I just added a few things to my colorscheme.vim
which is sourced from my .vimrc
. In fact, it is the last line in the .vimrc
.1
source ~/.vim/colorscheme.vim
Oddly, now most of it doesn't apply, yet some of it obviously does. If I manually :source ~/.vim/colorscheme.vim
it works, and so the only solution I've found is to add a keybinding for that. I.e., now everytime I start the editor I have to manually load the colorscheme.
Here's colorscheme.vim
. The stuff I added was mostly for Diff
but a few other things got tweaked. Loaded manually, it all seems to work.
hi ColorColumn guibg=Black guifg=#dbdbdb ctermbg=black ctermfg=yellow
hi Comment ctermbg=gray ctermfg=darkblue guibg=#dbbdbd guifg=#000088
hi Conditional cterm=bold ctermfg=yellow gui=bold guifg=#ffff00
hi Constant ctermfg=brown guifg=#ff8800
hi Cursor guibg=#ff0000 guifg=#ffff00
hi Directory ctermfg=gray
hi DiffAdd guibg=#000044 guifg=#ffff00
hi DiffChange guibg=#000044 guifg=#aaaaaa
hi DiffDelete guibg=#000044 guifg=#008888
hi DiffText guibg=#884400 guifg=#ff8800
hi ErrorMsg ctermbg=red ctermfg=cyan cterm=bold guibg=#880000 guifg=#ffffff gui=bold
hi Folded guibg=#00ff00 guifg=#3300aa ctermbg=blue ctermfg=green
hi Identifier ctermfg=darkgreen gui=none guifg=#449944
hi LineNr ctermbg=black ctermfg=darkblue guibg=#111111 guifg=#444444
hi NonText ctermfg=red guifg=#ff8800
hi Normal guibg=#222228 guifg=#dbdbdb
hi Number cterm=underline ctermfg=green gui=underline guifg=#00ff00
hi PreProc cterm=bold guifg=#cccc88
hi Repeat cterm=bold ctermfg=cyan gui=bold guifg=#00ffff
hi StatusLine cterm=bold ctermfg=green ctermbg=darkmagenta guibg=#aa00aa guifg=#00ff00
hi StatusLineNC ctermfg=7 ctermbg=black
hi Special ctermfg=magenta gui=bold guifg=#ff0088 guibg=#303030
hi SpecialKey ctermfg=darkblue guifg=#111111
hi SpellBad ctermbg=gray ctermfg=darkred
hi Statement ctermfg=gray guifg=#448888
hi Type ctermfg=darkcyan guifg=#dd88dd gui=italic
if has("gui_running")
set guioptions -=r
set guioptions +=l
set guioptions -=T
endif
A weird thing about "some of it" working is that it includes, e.g., SpellBad
, which is near the end. So it is not flaking out at some point, it is just ignoring or overriding most of the other stuff.
This applies to both console vim and gvim.
1. Note that there were no changes made to .vimrc
, although since then I've tried moving that line to the top, etc., but this did not make any difference.
.vimrc
? What is the output of:scriptnames
before you manually load it?scriptnames
includes it in order with other sourced scripts and does not change before or after sourcing it manually.:help hi-normal-cterm
recommends setting the colors for Normal first, before setting any other colors. My first suggestion is to move thehi Normal ...
line to the top of thehi
list. Next, I would set your colorscheme from your~/.vimrc
by executingcolorscheme colorscheme
rather than by sourcing the file so as to pick up any other steps Vim thinks is necessary when setting a colorscheme. Not that other approaches won't work, but if you're having trouble, the closer your attempt is to the "standard" solution, the better chance you will have finding someone who can spot the problem.colorscheme
(regardless of whereNormal
is). I fear my use of the term "color scheme" in the title and the fact that I called the sourced filecolorscheme.vim
may have caused some confusion -- the actual command is something I had never heard of. My .vimrc goes back more than a decade and I've just occasionally moved parts of it out to other files for sourcing.