在 gvim 中更改光标的颜色 [英] Change color of cursor in gvim

查看:30
本文介绍了在 gvim 中更改光标的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变当前模式下的光标颜色.

I want to change the color of the cursor pending on the current mode.

这是我目前的代码 (.gvimrc).

Here is my code so far (.gvimrc).

set gcr=n:blinkon0
set gcr=i:blinkon0
highlight Cursor guifg=white guibg=red
highlight iCursor guifg=white guibg=green

现在光标是灰色的,没有任何变化.手动运行 highlight Cursor guifg=white guibg=red 有效,但下面的行无效.

Right now the cursor is gray, nothing changes. Running highlight Cursor guifg=white guibg=red manually works, but not the line below.

我想要插入模式为绿色,其他模式为红色.

I want the color green in insert mode and red in every other mode.

推荐答案

我从 vim irc @ freenode 那里得到了一些帮助.

I got some help from the vim irc @ freenode.

这是解决方案.

au InsertLeave * hi Cursor guibg=red
au InsertEnter * hi Cursor guibg=green

这篇关于在 gvim 中更改光标的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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