How to change VIM underlines colors - vim

I'm an author of a VIM colorscheme (danger.vim) and I'd like to change some colors that I can barely see.
This is how it looks in Solarized:
This is how it looks in my theme:
As you can see, it's hard to see the underlines at import sys. I'd make them probably lighter blue, and bold.
I use the Syntastic plugin to integrate with Pyflakes and JSLint mainly.
I also use Flux, probably a reason why it's even harder to see.

In your colorscheme file at:
hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color
Change the part after guisp to the color you want.
i.e.
hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FFFFFF " undercurl color
will make the underlines white
edit:
You can make errors bold by change gui=undercurl to gui=bold,undercurl

Seems like Syntastic shows warnings as spell errors, so all I had to do was to define:
SpellBad word not recognized |hl-SpellBad|
SpellCap word not capitalised |hl-SpellCap|
SpellRare rare word |hl-SpellRare|
SpellLocal wrong spelling for selected region |hl-SpellLocal|
In my colorscheme file.

Related

Get rid of the underline in Vim's fold name

This is my setting for Vim's folding:
hi Folded term=bold ctermfg=White
How do I get rid of the underline?
For attributes that you don't specify, the :hi command will keep the previous one. So if your colorscheme includes cterm=underline, you need to configure this:
hi Folded term=bold cterm=NONE ctermfg=White

Linux VIM : Omnicppcomplete + supertab use bash color theme

I use vim with omnicppcomplete and supertab for programming. The dropdown window, which shows possible completions is like pink. How can i change the color for example to my personal bash color theme?
Open your colorscheme.
Find the lines that start with hi Pmenu*.
Edit them to your liking.
If there's no such line in your colorscheme, add the lines below and change the colors to what you want:
hi Pmenu cterm=none ctermfg=White ctermbg=Black
hi PmenuSel cterm=none ctermfg=Black ctermbg=DarkGreen
hi PmenuSbar cterm=none ctermfg=none ctermbg=Green
hi PmenuThumb cterm=none ctermfg=DarkGreen ctermbg=DarkGreen
See :help :highlight for more.

MatchParen and cursorcolumn conflict

Vim is not showing the matching brackets on the same column when I do in _vimrc
:set cursorline
:set cursorcolumn
Actually I have in my _vimrc
:set cursorline
:set cursorcolumn
:highlight CursorLine term=underline guibg=#fffcd0 cterm=underline
:highlight CursorColumn term=underline guibg=#e1ffd5 cterm=underline
Then the matching bracket on the same column does not highlight.
I tried below playing with guibg and guifg with Black and Cyan and gui=inverse as:
:highlight MatchParen guibg=somecolors guifg=othercolor gui=inverse
But nothing works.
I need the highlighted current column as #e1ffd5 and current line as #fffcd0, and
the matching brackets highlighted.
I need the both. How can I?
Normally if you do not turn on cursorline and cursorcolumn then there will be no problem, vim will show every matching paren normally, like:
image01.
All the problems will take place if you turn on cursorline and cursorcolumn. The matching paren highlight on the same column at the other end will be vanished, like:
image02.
Finally I tried
:highlight MatchParen guibg=Black guifg=Cyan gui=inverse
But this also is not very perfect. Paren on the other side will fade into white, which I never want.
I want everything perfectly, better saying a mixture of picture 1 and 2 both.
I tried but I could not.
Setting ctermfg and/or guifg to NONE gets you what you want.
hi CursorColumn cterm=NONE ctermbg=236 ctermfg=NONE gui=NONE guibg=#2d2d2d guifg=NONE
hi CursorLine cterm=NONE ctermbg=236 ctermfg=NONE gui=NONE guibg=#2d2d2d guifg=NONE
With the cterm settings I found the following.
First I found that the following command made the matching paren disappear.
:hi MatchParen cterm=NONE ctermfg=black ctermbg=white
While my cursor was on these pren, I switched over to next vertical split, and saw that the colors of the matching peren were reversed.
That led me to the solution with the following command.
:hi MatchParen cterm=reverse
or
:hi MatchParen cterm=reverse ctermfg=<your color> ctermbg=<your color>
I think the color you are looking for is
(steelblue and black) or (black and steelblue)
My setting and I didn't change :hi cursorcolumn.
:hi MatchParen cterm=reverse ctermfg=NONE ctermbg=NONE

jshint vimrc SpellBad customization does not stick

Using
" Customize jshint highlights
hi clear SpellBad
hi SpellBad cterm=underline,bold ctermfg=white ctermbg=black
I was able to customize my jshint SpellBad highlights to the colors I desire when I first open a buffer containing jshint errors. As can be seen here, my background is black and the line with the error is in bold white and underlined. Exactly as I specified using those definitions in .vimrc above.
The problem is, when I switch around between buffers or open a that buffer later again, my custom jshint SpellBad colors no longer apply and I get the "default" colors which I do not want.
Why is this so? And how do I make my custom jshint SpellBad colors stick?
Because your custom highlight settings will be cleared after every :colorscheme commands.
try:
autocmd ColorScheme * hi clear SpellBad
\| hi SpellBad cterm=underline,bold ctermfg=white ctermbg=black

Change syntax color in vim?

I have syntax highlighting on, but comments are set to dark blue. This hard for me to read against a black terminal. How do I change it so that the comments are colored green instead?
Probably you just need to tell vim that you have a dark background:
:set background=dark
This should change the highlighting to something better readable.
Take a look at syncolor.vim. You'll find it in /usr/share/vim/vim{version}/syntax/.
Excerpt:
" There are two sets of defaults: for a dark and a light background.
if &background == "dark"
SynColor Comment term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE
SynColor Constant term=underline cterm=NONE ctermfg=Magenta ctermbg=NONE gui=NONE guifg=#ffa0a0 guibg=NONE
SynColor Special term=bold cterm=NONE ctermfg=LightRed ctermbg=NONE gui=NONE guifg=Orange guibg=NONE
So the first SynColor line looks of interest. I confess I don't know if you can override this, as opposed to changing this file.
If you want to change the color of a comment without changing the background, you can use the highlight command. Vim documentation on :highlight
For example, :hi Comment term=bold ctermfg=Cyan guifg=#80a0ff gui=bold
$VIMRUNTIME/colors/README.txt (on my system, /usr/share/vim/vim72/colors)
You can set colorsheme to desert. Default in e.g. Ubuntu 16.04
best way is to change colorscheme to another (lighter) one:
in navigation mode type:
:colorscheme space Ctl+D
and then type the scheme name Enter
For the googler's out there.
https://vimdoc.sourceforge.net/htmldoc/syntax.html
You can change the highlighting per syntax file, like in javascript.vim or python.vim syntax files.
For example changing a 'Comment' to be the color green. You would add this line somewhere inside of the respective syntax file.
hi Comment term=NONE cterm=NONE ctermfg=GREEN ctermbg=NONE gui=NONE guifg=NONE guibg=NONE
and you can do this for others like 'String'
hi String term=NONE cterm=NONE ctermfg=MAGENTA ctermbg=NONE gui=NONE guifg=NONE guibg=NONE

Resources