Vim Netrw询问 "Press ENTER or type command to continue"

标签 vim netrw

我已经注意到,当我开始一天并打开vim,然后使用:Exp时,出现“按Enter或键入命令以继续”提示。通常,这在执行外部命令时显示。我不记得:Exp过去这样做过(?)。此外,仅在首次使用netrw ?!时显示提示。

虽然微不足道,但我觉得这很烦人。有人知道netrw为什么要这样做吗?我一直在删除.vimrc中的各种内容以查看它们是否有任何改变,但是我可能会在这里待很长时间...

重现步骤:

  • 打开vim或gvim
  • :Exp(接着输入)
  • 出现提示。
  • 最佳答案

    v:scrollstart的内容可用于了解发生这种情况的线索。

    有一些可能与该问题有关的选项。
    vim-faq:

      Vim will prompt you with the "hit enter to continue" prompt, if there are
      some messages on the screen for you to read and the screen is about to be
      redrawn.  You can add the 'T' flag to the 'shortmess' option to truncate
      all messages. This will help in avoiding the hit-enter prompt: 
    
          :set shortmess+=T
    
      You can also increase the command height by setting the 'cmdheight' option: 
    
          :set cmdheight=2
    
      For more information, read 
    
          hit-enter
          avoid-hit-enter
          'shortmess'
          'cmdheight'
    

    编辑:

    :h netrw-problems:
    P10. I'm being pestered with "[something] is a directory" and
         "Press ENTER or type command to continue" prompts...
    
        The "[something] is a directory" prompt is issued by Vim,
        not by netrw, and there appears to be no way to work around
        it.  Coupled with the default cmdheight of 1, this message
        causes the "Press ENTER..." prompt.  So:  read |hit-enter|;
        I also suggest that you set your |'cmdheight'| to 2 (or more) in
        your <.vimrc> file.
    

    您还应该检查是否正在使用最新的插件版本,因为与您的问题相关的版本71上有错误修复:
    v71:           * bugfix -- made some "set nomodifiable"s into
               :
               :
               * When ch=1, on the second and subsequent uses of
                 browsing Netrw would issue a blank line to clear
                 the echo'd messages.  This caused an annoying
                 "Hit-Enter" prompt; now a blank line message
                 is echo'd only if &ch>1.
    

    关于Vim Netrw询问 "Press ENTER or type command to continue",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12422468/

    相关文章:

    vim - 视觉模式下的 's'有什么作用?

    python - Vim - 在当前 python 站点包上运行 ctags

    vim - 打开新文件后关闭 netrw 资源管理器

    Vim - 退出/关闭 Netrw 而不选择任何文件

    vim - 在指定的拆分中从.netrw打开文件

    emacs - 为自动缩进代码编写自定义函数有什么好的*抽象*?

    在 Windows XP 中编译 C

    highlighting - 将 vim 中的匹配限制为某些文件类型?

    vim - 如何在 vim 脚本中模拟按键

    vim - 在 Vim/netrw 中垂直拆分打开文件