我想根据当前模式更改VIM的光标(不是gVIM的)。我希望:
- 正常和可视模式=块光标
- 插入和命令模式= I形光标
我尝试将以下代码添加到.vimrc
中,但它没有起作用。
if has("autocmd")
au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
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 ibeam"
endif
我从http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes获取了那一小段代码,但它说这是针对Gnome-Terminal(版本2.26),而我使用的是Gnome-Terminal(版本3.60)。不确定这是否导致它无法工作。
有什么想法可以解决这个问题吗?