

#vim on freenode: 1000+ person reasonably active IRC channel.


The above function, invoked through the autocmd, will be run after all the initialization is complete and therefore successfully sets the cursorline highlight. vimrc is reset by the default for the restored colorscheme. vimrc has been run (typically using a function invoked through 'autocmd VimEnter *'), the cursorline highlight setting in. However, since the session restoration is typically done after. This is restored during program startup through session restoration. Along with various buffer and window information, mksession saves the current colorscheme name. Hi cursorline cterm=none ctermbg=darkblue ctermfg=whiteĪutocmd VimEnter * call s:SetCursorLine()Ī bit of explanation as to why this works. vimrc to set cursorline highlight correctly:- function s:SetCursorLine() vimrc setup like this, you can add the following to. This session is then automatically restored during program startup, if it's run without any file arguments. 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. Hi CursorLine cterm=NONE ctermbg=234 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=229 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=254 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=17 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=52 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=7 ctermfg=NONE Hi CursorLine cterm=NONE ctermbg=8 ctermfg=NONE " dark grey, better you can get if you don't support 256 colours " set the prefered colours, pick one line here only. " might not be on by default, this enable the cursor line feature " the syntax cmd is when the colorscheme gets parsed, i think. 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Ĭolorscheme darkblue " or desert.
