简体   繁体   English

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

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

I usually get this new window open up suddenly while I am editing a Ruby file in VIM. 当我在VIM中编辑Ruby文件时,我通常会突然打开这个新窗口。 This is getting irritating because, i cant type in anything while its processing. 这令人恼火,因为在处理时我无法输入任何东西。 And it usually happens arbitarily. 它通常是任意发生的。 Does any one here know which plugin could be doing this? 这里有人知道哪个插件可以这样做吗? Or is this somekind of VIM's process? 或者这是VIM的一些过程吗?

I have this same issue on my work desktop, but not my home machine. 我的工作桌面上有同样的问题,但不是我的家用机器。 The setups are near identical. 设置几乎相同。

While stalking down a possible cause, I noticed that when I leave my cursor over a Ruby symbol such as File , Vim would popup a short description of the File class. 虽然缠扰下一个可能的原因,我注意到,当我离开我的光标移到一个Ruby符号,例如File时,Vim会弹出文件类的简短说明。 After comparing all the various vim scripts and ri -related files that I could find, I finally settled on the only solution that worked... 在比较了我能找到的所有各种vim脚本和ri相关文件后,我终于确定了唯一有效的解决方案......

Open $HOME/_vimrc and add the following line: 打开$HOME/_vimrc并添加以下行:

autocmd FileType ruby,eruby set noballooneval

Previously, I commented out a block in $VIMRUNTIME/ftplugin/ruby.vim , but Brian Carper suggested a better solution of :set noballooneval . 之前,我在$VIMRUNTIME/ftplugin/ruby.vim注释掉了一个块,但Brian Carper提出了一个更好的解决方案:set noballooneval I added the autocmd line so it is only executed with Ruby files. 我添加了autocmd行,所以它只用Ruby文件执行。

If anyone figures out a true solution, please contact me. 如果有人找到真正的解决方案,请与我联系。 :( :(

This is happening when you hit K in normal mode. 在正常模式下按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}

If you notice, it's running ri in the open window, which is the ruby documentation app. 如果你注意到,它在打开的窗口中运行ri ,这是ruby文档应用程序。 In Unixy environments, the help program normally runs inline, just displacing the vim output for a minute. 在Unixy环境中,帮助程序通常以内联方式运行,只需将vim输出移位一分钟即可。

Is this using gvim, or command-line vim? 这是使用gvim还是命令行vim?

In either case, you can try monkeying with 'keywordprg' to fix the popup 在任何一种情况下,您都可以尝试用'keywordprg'来修复弹出窗口

Or, if you can't train yourself not to type it, you can just use :nnoremap K k to change what K does (in this case, just treat it as normal k command and go up one line). 或者,如果您不能训练自己不要输入它,您可以使用:nnoremap K k来改变K作用(在这种情况下,只需将其视为普通的k命令并向上移动一行)。

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

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