分页: 1 / 1

在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2010-05-09 22:16
fuadam1982
新装了ubuntu10.04在gnome-terminal中使用vim效果还是很不错的就是它的光标在insert和normal下都是一样的实在挺不爽。网上看了一个方法:

au InsertEnter * silent execute "!gconftool-2 -s /apps/gnome-terminal/profiles/Default/cursor_blink_mode -t string off"
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"

不过是针对gnome-terminal2.26的而10.04中已经是2.29.6了,其实在终端里运行gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam是没有问题的,只是在vim中执行就没有反应了。难道在gnome-terminal下只能很不爽的用vim吗?

Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2010-05-12 4:29
迷幻摇滚男
楼主能不能说说你的联系方式

Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2010-05-12 9:29
eexpress
居然说的是系统的光标哦。
这没意义吧。

Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2011-04-12 21:42
蝶梦我
在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 block"
endif
但是其他的终端光标形状自然也会变。

Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2011-04-13 14:34
lilydjwg
为神马非要在 gnome-terminal 里用 vim?要用图形界面的话就用 GVIM,要终端的话用 tty 吧。

Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状

发表于 : 2011-04-17 8:36
Fermat618
多用用就习惯了。左下角不是有个 -- 插入 -- 么。
我一般都处于normal状态,编辑完成立即回来。