开发者

VIM question about the colorize plugin

开发者 https://www.devze.com 2023-03-13 21:37 出处:网络
It is working well but it relies on my using Esc to get out of input mo开发者_开发知识库de. I tend to use jj (which i set up in -vimrc)

It is working well but it relies on my using Esc to get out of input mo开发者_开发知识库de.

I tend to use jj (which i set up in -vimrc)

How do I adjust the last line of the code to suit jj?

"You need the next line to change the color back when you hit escape.

inoremap <Esc> <Esc>:highlight Normal guibg=Sys_Window<cr>


You can use the following mapping in your ~/.vimrc:

inoremap jj <Esc>:highlight Normal guibg=Sys_Window<CR>

Note: If you have a inoremap jj <Esc> line already, you could subsitute the inoremap for just imap -- that way, the jj just 'falls through' and also uses your <Esc> bind that you set up.

Hope this helps!


There is an event that is launched when you exit insert mode. Maybe you should better use it:

augroup alterNormal
    autocmd InsertLeave * :highlight Normal guibg=Sys_Window
augroup END
0

精彩评论

暂无评论...
验证码 换一张
取 消