Nat*_*tjo 5 vim command-line tmux cursor
我习惯使用 GVim,但我也想使用 vim+tmux。因此我决定切换到vim。但是在 vim 中,光标样式不会根据模式而改变。
我使用 zsh 和 gnome 终端。
我已经尝试过这个答案:如何在 Gnome 终端上的控制台 Vim 中基于正常或插入模式使光标从细线变为块
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
Run Code Online (Sandbox Code Playgroud)
但它会全局更改光标。
我也试过这个插件,但也没有用。(如何检查插件是否正常工作?)
小智 0
这里列出了两个不同的选项:
带有良好注释的 .vimrc 文件也会对您有所帮助,例如https://github.com/thoughtbot/dotfiles/blob/master/vimrc