我習慣使用gvim,但我想使用vim + tmux的好處。爲此我想換成vim。但是在vim中,光標樣式並不會改變,這取決於我是哪種模式,這是gvim的一個有用特性。我使用zsh(oh-my-zsh)並在gnome-terminal下面。如何在vim中更改光標樣式,具體取決於插入模式還是普通模式?
我想這個答案:http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes
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
但globaly改變光標。絕對是我不想要的東西
接下來我試過這個插件:http://www.vim.org/scripts/script.php?script_id=4403,但它都沒有奏效。
它看起來可以滿足我的需求,但它也不起作用。你能想象爲什麼? – Jonas
看來我完全誤讀了你的文章。我刪除了我的答案。 –
[如何在插入/正常模式下更改vim光標?](http:// stackoverflow。com/questions/6488683/how-do-i-change-the-vim-cursor-in-insert-normal-mode) –