我习惯使用 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)
但它会全局更改光标。
我也试过这个插件,但也没有用。(如何检查插件是否正常工作?)
我使用 gvim 进行编码,并想使用 clang-format 作为插件。据我所知,它已经集成在 vim 中。我只需要将这一行添加到我的 .vimrc 中:
map <C-K> :pyf <path-to-this-file>/clang-format.py<cr>
Run Code Online (Sandbox Code Playgroud)
不幸的是我找不到<path-to-this-file>. 我已经通过 apt-get 安装了 clang-format-3.6。
感谢帮助!
我今天用 Ubuntu 16.04 设置了我的新电脑。我已经安装了 vim-gnome。在使用它时,一切都很好。但是当我关闭 gvim 时,我在终端中收到此消息:
(gvim:5834): GLib-GObject-WARNING **: cannot retrieve class for invalid (unclassed) type '<invalid>'
Run Code Online (Sandbox Code Playgroud)
它没有产生任何问题,但我仍然想解决这个问题,然后才能影响某些事情。