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
Related
I have tried to look at other answers here on SO and Google but none of them seem to be changing my cursor settings. I am wanting to have a background of yellow with foreground of white bold but can't get it with the settings that I have seen around the web. I am using MacVim mvim in iTerm2.
Most likely you are interested in these three highlighting groups: Cursor, CursorColumn and CursorLine. The names are self explanatory.
For example to change just the cursor color:
:highlight Cursor ctermfg=White ctermbg=Yellow cterm=bold guifg=white guibg=yellow gui=bold
To do the same for column cursor:
:highlight CursorColumn ctermfg=White ctermbg=Yellow cterm=bold guifg=white guibg=yellow gui=bold
If you also need to highlight the current line, use CursorLine.
If you wants to keep it enable always put the below things in your .vimrc or .gvimrc file
for cursorline
set cursorline
autocmd InsertEnter * highlight CursorLine guibg=#000050 guifg=fg
autocmd InsertLeave * highlight CursorLine guibg=#004000 guifg=fg
for cursor column
set cursorcolumn
autocmd InsertEnter * highlight CursorColumn ctermfg=White ctermbg=Yellow cterm=bold guifg=white guibg=yellow gui=bold
autocmd InsertLeave * highlight CursorColumn ctermfg=Black ctermbg=Yellow cterm=bold guifg=Black guibg=yellow gui=NONE
You can change the colors in your wish
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.
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
In some colorschemes the current line highlighting changes background, in others, like Desert, the current line is underlined.
I want to change the current line highlighting in Desert to use a different background color instead of underlining. How can I do that?
My .vimrc:
set cursorline
highlight Cursorline cterm=bold
Update: .vimrc that solves the issue
colorscheme desert
set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
color desert
set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
desert is your colorscheme.(should come first)
put it in your ~/.vimrc
This works better (in every terminal) for me.
:hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white
It is setting of color for terminal: background color - ctermbg, and text color - ctermfg. For using in graphical window, add parameters guibg=darkred guifg=white
You can highlight the corresponding column as well, using the command:
:set cursorcolumn
It is useful to toggle highlighting on and off by pressing one key in the editor. Add these line to your vimrc:
:nnoremap H :set cursorline! cursorcolumn!<CR>
typing 'H' will toggle highlighting on and off (Map it to another key if you want)
You can find more info in the article:
http://vim.wikia.com/wiki/Highlight_current_line
for a style similar to the one you get in gvim in the terminal, preserving the syntax highlight:
" first thing is entering vim mode, not plain vi
set nocompatible
" force 256 colors on the terminal
set t_Co=256
" load the color scheme before anything
colorscheme darkblue " or desert... or anything
" the syntax cmd is when the colorscheme gets parsed, i think..
syntax on
" might not be on by default, this enable the cursor line feature
set cursorline
" set the prefered colours, pick one line here only.
" dark grey, better you can get if you don't support 256 colours
hi CursorLine cterm=NONE ctermbg=8 ctermfg=NONE
" light grey, no 256 colors
hi CursorLine cterm=NONE ctermbg=7 ctermfg=NONE
" dark redish
hi CursorLine cterm=NONE ctermbg=52 ctermfg=NONE
" dark bluish
hi CursorLine cterm=NONE ctermbg=17 ctermfg=NONE
" very light grey
hi CursorLine cterm=NONE ctermbg=254 ctermfg=NONE
" yelowish
hi CursorLine cterm=NONE ctermbg=229 ctermfg=NONE
" almost black
hi CursorLine cterm=NONE ctermbg=234 ctermfg=NONE
If you want to turn the underline on use either one of:
:hi CursorLine cterm=underline
:hi CursorLine gui=underline
Otherwise use one of those:
:hi CursorLine cterm=none
:hi CursorLine gui=none
I had a similar problem setting cursorline highlight, but mine was due to the mksession command that I was using to save the session information during vim exit. This session is then automatically restored during program startup, if it's run without any file arguments.
If anyone has .vimrc setup like this, you can add the following to .vimrc to set cursorline highlight correctly:-
function s:SetCursorLine()
set cursorline
hi cursorline cterm=none ctermbg=darkblue ctermfg=white
endfunction
autocmd VimEnter * call s:SetCursorLine()
A bit of explanation as to why this works. Along with various buffer and window information, mksession saves the current colorscheme name. This is restored during program startup through session restoration. However, since the session restoration is typically done after .vimrc has been run (typically using a function invoked through 'autocmd VimEnter *'), the cursorline highlight setting in .vimrc is reset by the default for the restored colorscheme.
The above function, invoked through the autocmd, will be run after all the initialization is complete and therefore successfully sets the cursorline highlight.
HTH.
You must add .vimrc end line:
highlight lineNr term=bold cterm=NONE ctermbg=none ctermfg=none gui=bold
set cursorline
highlight CursorLine term=bold cterm=NONE ctermbg=none ctermfg=none gui=bold
highlight CursorLineNr term=bold cterm=none ctermbg=none ctermfg=yellow gui=bold
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