加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vim:在插入模式下更改状态行颜色

发布时间:2020-12-15 22:07:19 所属栏目:安全 来源:网络整理
导读:当我进入插入模式时,我发现这个片段可以更改状态行颜色: " first,enable status line alwaysset laststatus=2" now set it up to change the status line based on modeif version = 700 au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=underc
当我进入插入模式时,我发现这个片段可以更改状态行颜色:

" 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

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

解决方法

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

guisp用于突出显示的“特殊”颜色.在这种情况下,它是undercurl效果的颜色.听起来你想要改变实际的高光颜色,所以试试这个:

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

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

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

对于InsertLeave,我只使用我的普通StatusLine颜色作为示例.您应该能够在colorscheme文件中找到它.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读