Vim CursorLine color change in insert mode

前端 未结 5 407
天命终不由人
天命终不由人 2021-01-30 11:29

There is good snippet for changing cursor color:

if &term =~ \"xterm\\\\|rxvt\"
  \" use an orange cursor in insert mode
  let &t_SI = \"\\]12         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 12:07

    NO COLOR in current line even if you enter or leave INSERT MODE

    
    "set cursorline
    set noshowmode
    
    "Enable CursorLine
    set nocursorline
    
    "Default Colors for CursorLine
    hi CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE
    
    "Change Color when entering Insert Mode
    autocmd InsertEnter * set nocursorline
    
    "Revert Color to default when leaving Insert Mode
    autocmd InsertLeave * set nocursorline
    
    

提交回复
热议问题