/* This is coming directly from Molokai's issue #36. */
The problem
Molokai is a very nice theme for Vim but it has a terrible vimdiff highlighting (see left split, last 5 lines). +
are not green and -
are not red.
I've been suggested by justinmk@GitHub to use the following ~/.vimrc
(here's the gist).
syntax enable
let s:color_override_dark = '
\ if &background == "dark"
\ | hi StatusLine guifg=#000000 guibg=#ffffff gui=NONE ctermfg=16 ctermbg=15 cterm=NONE
\ | hi CursorLine guibg=#293739 ctermbg=236
\ | hi PmenuSel guibg=#0a9dff guifg=white gui=NONE ctermbg=39 ctermfg=white cterm=NONE
\ | hi PmenuSbar guibg=#857f78
\ | hi PmenuThumb guifg=#242321
\ | hi WildMenu gui=NONE cterm=NONE guifg=#f8f6f2 guibg=#0a9dff ctermfg=255 ctermbg=39
\ | hi DiffAdd guifg=#ffffff guibg=#006600 gui=NONE ctermfg=231 ctermbg=22 cterm=NONE
\ | hi DiffChange guifg=#ffffff guibg=#007878 gui=NONE ctermfg=231 ctermbg=30 cterm=NONE
\ | hi DiffDelete guifg=#ff0101 guibg=#9a0000 gui=NONE ctermfg=196 ctermbg=88 cterm=NONE
\ | hi DiffText guifg=#000000 guibg=#ffb733 gui=NONE ctermfg=000 ctermbg=214 cterm=NONE
\ | hi MatchParen guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline
\ | endif
\'
if has('vim_starting') "only on startup
exe 'autocmd ColorScheme * '.s:color_override_dark
" expects &runtimepath/colors/{name}.vim.
silent! colorscheme molokai
endif
which unfortunately does not work for some reasons. Can someone point out what has been done wrongly?
The solution
Inserting the following code into ~/.vimrc
fixes the problem stated above.
colorscheme molokai
" Better gitcommit messages
hi diffAdded ctermbg=NONE ctermfg=46 cterm=NONE guibg=NONE guifg=#00FF00 gui=NONE
hi diffRemoved ctermbg=NONE ctermfg=196 cterm=NONE guibg=NONE guifg=#FF0000 gui=NONE
hi link diffLine String
hi link diffSubname Normal
And here we have a before / after :)
Further information
It is possible to remap F10
to *show me what syntax is this*. Then, one can modify what s/he feels needs some adjustments, as I've done for the 'strong' diffLine
and to the 'green' diffSubname
.
Diff*
... (On the first line I've linked the issue.):help new-line-continuation
.