vim:在插入模式下更改状态行颜色 [英] vim: change the status line color in insert mode

查看:41
本文介绍了vim:在插入模式下更改状态行颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个片段可以在我进入插入模式时更改状态行颜色:

I found this snippet to change the status line color when i go to insert mode:

" first, enable status line always
set laststatus=2

" now set it up to change the status line based on mode
if version >= 700
  au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=undercurl guisp=Magenta
  au InsertLeave * hi StatusLine term=reverse ctermfg=0 ctermbg=2 gui=bold,reverse
endif

现在,当我进入插入模式时,状态行变为紫色,但我想将其更改为红色.我用红色更改了品红色,但它不起作用..

Now, when i go to insert mode the status line go to violet color, but I want to change it to go to red color. I changed Magenta by Red, but it doesn't work..

推荐答案

如果您使用 :help,您可以找出每个属性的含义.

If you use :help, you can find out what each of those attributes mean.

guisp 用于突出显示的特殊"颜色.在这种情况下,它是底卷效果的颜色.听起来您想更改实际的高亮颜色,所以试试这个:

guisp is used for the "special" color of the highlight. In this case, it's the color of the undercurl effect. It sounds like you want to change the actual highlight color, so try this:

au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=undercurl guisp=Magenta guibg=Red

事实上,如果您只使用 GUI Vim,则不需要任何终端选项:

And in fact, if you just use a GUI Vim, you don't need any of the terminal options:

au InsertEnter * hi StatusLine guibg=Red
au InsertLeave * hi StatusLine guibg=#ccdc90

对于InsertLeave,我只是使用了正常的StatusLine 颜色作为示例.您应该可以在您的颜色方案文件中找到它.

For InsertLeave, I just used the my normal StatusLine color as an example. You should be able to find it in your colorscheme file.

顺便说一句,guibg实际上影响文本颜色,而guifg影响线条颜色...

Incidentally, guibg actually affects the text color, while guifg affect the line color...

这篇关于vim:在插入模式下更改状态行颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆