繁体   English   中英

我在Vim中编辑Ruby Files时得到了这个窗口。 它是什么?

[英]I get this window while editing Ruby Files in Vim. What is it?

当我在VIM中编辑Ruby文件时,我通常会突然打开这个新窗口。 这令人恼火,因为在处理时我无法输入任何东西。 它通常是任意发生的。 这里有人知道哪个插件可以这样做吗? 或者这是VIM的一些过程吗?

我的工作桌面上有同样的问题,但不是我的家用机器。 设置几乎相同。

虽然缠扰下一个可能的原因,我注意到,当我离开我的光标移到一个Ruby符号,例如File时,Vim会弹出文件类的简短说明。 在比较了我能找到的所有各种vim脚本和ri相关文件后,我终于确定了唯一有效的解决方案......

打开$HOME/_vimrc并添加以下行:

autocmd FileType ruby,eruby set noballooneval

之前,我在$VIMRUNTIME/ftplugin/ruby.vim注释掉了一个块,但Brian Carper提出了一个更好的解决方案:set noballooneval 我添加了autocmd行,所以它只用Ruby文件执行。

如果有人找到真正的解决方案,请与我联系。 :(

在正常模式下按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?

在任何一种情况下,您都可以尝试用'keywordprg'来修复弹出窗口

或者,如果您不能训练自己不要输入它,您可以使用:nnoremap K k来改变K作用(在这种情况下,只需将其视为普通的k命令并向上移动一行)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM