簡體   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