Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload Vim highlight setting and colorscheme

Tags:

vim

If I change Vim's highlight setting, how do I "reload" it for colorschemes to take effect?

So, in my case, I remove highlight's cursor line number

se hl-=N:CursorLineNr

Changing highlight from

highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor eMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:Vert Split,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:D iffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:Spel lCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine, #:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn

to

highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor eMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v :Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffCh ange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRar e,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_: TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn

(I've emphasized the change.)

But the cursor line number is still "highlighted"!

Changing highlight doesn't update the colorscheme—so how do I "force" an update? I've tried setting syntax coloring off then on again and changing colorschemes to no avail.

like image 567
user1569050 Avatar asked Dec 08 '25 21:12

user1569050


1 Answers

If you want to reset/clear a highlight-group, you could use :hi cmd.

in your case, try with:

:hi CursorLineNr NONE   #this will disable the hl setting for the given group

:hi clear CursorLineNr  #this will set the given group's highlight setting to default.

:h hi to see detail

if you want to reload your colorscheme, you could :color xxx

hope it helps

like image 60
Kent Avatar answered Dec 11 '25 19:12

Kent