当我在VIM中编辑Ruby文件时,我通常会突然打开这个新窗口.这令人恼火,因为在处理时我无法输入任何东西.它通常是任意发生的.这里有人知道哪个插件可以这样做吗?或者这是VIM的一些过程吗?
K
在正常模式下击中时会发生这种情况.
K Run a program to lookup the keyword under the cursor. The name of the program is given with the 'keywordprg' (kp) option (default is "man"). The keyword is formed of letters, numbers and the characters in 'iskeyword'. The keyword under or right of the cursor is used. The same can be done with the command > :!{program} {keyword} There is an example of a program to use in the tools directory of Vim. It is called 'ref' and does a simple spelling check. Special cases: - If 'keywordprg' is empty, the ":help" command is used. It's a good idea to include more characters in 'iskeyword' then, to be able to find more help. - When 'keywordprg' is equal to "man", a count before "K" is inserted after the "man" command and before the keyword. For example, using "2K" while the cursor is on "mkdir", results in: > !man 2 mkdir - When 'keywordprg' is equal to "man -s", a count before "K" is inserted after the "-s". If there is no count, the "-s" is removed. {not in Vi}
如果您注意到,它正在ri
打开的窗口中运行,这是ruby文档应用程序.在Unixy环境中,帮助程序通常以内联方式运行,只需将vim输出移位一分钟即可.
这是使用gvim还是命令行vim?
在任何一种情况下,您都可以尝试使用monkeying 'keywordprg'
来修复弹出窗口
或者,如果你不能训练自己不要输入它,你可以:nnoremap K k
用来改变K
它的作用(在这种情况下,只需将它视为正常k
命令并上一行).
我的工作桌面上有同样的问题,但不是我的家用机器.设置几乎相同.
在找到可能的原因时,我注意到当我将光标放在Ruby符号上时File
,Vim会弹出一个File类的简短描述.在比较了ri
我能找到的所有各种vim脚本和相关文件后,我终于确定了唯一有效的解决方案......
打开$HOME/_vimrc
并添加以下行:
autocmd FileType ruby,eruby set noballooneval
在此之前,我评论了一个块$VIMRUNTIME/ftplugin/ruby.vim
,但Brian Carper提出了一个更好的解决方案:set noballooneval
.我添加了这一autocmd
行,所以它只用Ruby文件执行.
如果有人找到真正的解决方案,请与我联系.:(