新装了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吗?
在gnome-terminal中使用vim怎么才能改变cursor的形状
-
- 帖子: 1
- 注册时间: 2010-05-09 21:49
-
- 帖子: 5
- 注册时间: 2010-05-11 16:09
Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状
楼主能不能说说你的联系方式
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- 蝶梦我
- 帖子: 9
- 注册时间: 2010-05-21 23:44
Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状
在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
儒风道骨 虚己游世
- lilydjwg
- 论坛版主
- 帖子: 4258
- 注册时间: 2009-04-11 23:46
- 系统: Arch Linux
- 联系:
Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状
为神马非要在 gnome-terminal 里用 vim?要用图形界面的话就用 GVIM,要终端的话用 tty 吧。
- Fermat618
- 帖子: 728
- 注册时间: 2008-12-28 16:01
Re: 在gnome-terminal中使用vim怎么才能改变cursor的形状
多用用就习惯了。左下角不是有个 -- 插入 -- 么。
我一般都处于normal状态,编辑完成立即回来。
我一般都处于normal状态,编辑完成立即回来。
爱因斯坦会弹钢琴
爱因斯坦会拉小提琴
爱因斯坦会骑自行车
爱因斯坦会拉小提琴
爱因斯坦会骑自行车