开发者

VIM question about the colorize plugin

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜