如何让 Vim 在不同模式下更改光标以满足这些条件:
gconftool
或此类工具。我只需要这影响 Vim 的一个实例,而不是整个终端。Gnome Terminal
和 中工作GVim
。我曾尝试在 中使用 sample 进行更改help gcr
,但它仅适用于 GVim,不适用于 Gnome 终端中的 Vim。
我已经测试过http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes,但它改变了整个终端的光标。
玩gcr
是首选。
编辑:我知道这gcr
仅适用于 GUI 模式,但我的意思是 vim 内部的某种功能。可能是某种插件......
小智 5
您将无法在 gnome-terminal 中更改它,因为它使用 gconf 派生它的光标设置,而 vim 无法覆盖它。
但是,这就是我在 .vimrc 文件中的内容,使用 gconf 并且它按预期工作,即将它重置为之前的内容(cursor_shape 块)。您应该能够使用 gcr 在 gvim 中独立设置光标。
" for gnome-terminal
au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape underline"
au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
au VimEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1713 次 |
最近记录: |