gpt4 book ai didi

ruby - 我在 Vim 中编辑 Ruby 文件时得到这个窗口。它是什么?

转载 作者:数据小太阳 更新时间:2023-10-29 08:16:11 25 4
gpt4 key购买 nike

当我在 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?

无论哪种情况,您都可以尝试使用 'keywordprg' 来修复弹出窗口

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

关于ruby - 我在 Vim 中编辑 Ruby 文件时得到这个窗口。它是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/871465/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com