Skip to content

Clingonboy/VIM-CursorLine-hightlighting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

VIM CursorLine hightlighting

How it works

reference: https://stackoverflow.com/questions/6488683/how-to-change-the-cursor-between-normal-and-insert-modes-in-vim

A popular approach to indicate switching to and from Insert mode is toggling the cursorline option, which is responsible for whether the current screen line is highlighted (see :help cursorline):

:autocmd InsertEnter * set cursorline
:autocmd InsertLeave * set nocursorline

or, alternatively:

:autocmd InsertEnter,InsertLeave * set cul!

Modify the CursorLine highlighting group to change the styling of the cursor line to your liking (see :help :highlight and :help highlight-groups).

This approach assumes, of course, that you do not use the cursor line highlighting in Normal mode.

My setup

Check my vimrc to see how setup the cursor hightlighting

The specific part is this:

"----------------CURSORLINE------------------------------------------------"
set cursorline
hi cursorline cterm=none term=none
hi cursorlinenr cterm=none term=none
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
highlight CursorLine guibg=#303000 ctermbg=234
highlight CursorLineNr guibg=#303000 ctermbg=234 ctermfg=green

you have to execute this code after your load a colorscheme otherwais it con be overwrite.

Ciao

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors