10

1日を始めてvimを開き、:Expを使用すると、「Enterキーを押すか、コマンドを入力して続行する」というプロンプトが表示されることに気付きました。通常、これは外部コマンドが実行されたときに表示されます。私は覚えていません:過去にこれを行った経験(?)。さらに、プロンプトはnetrw?!を最初に使用したときにのみ表示されます。

些細なことですが、これは面倒です。netrwがこれを行っている理由を誰かが知っていますか?.vimrcのさまざまなものを削除して、何かが変わるかどうかを確認していますが、長い間ここにいる可能性があります...

再現する手順:

  • vimまたはgvimを開く
  • :Exp(続いてEnter)
  • プロンプトが表示されます。
4

3 に答える 3

5

の内容を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.
于 2012-09-14T11:44:43.137 に答える
5

この行をに追加~/.vimrcすると、問題が解決するようです。

let g:netrw_silent = 1
于 2013-05-01T20:25:32.077 に答える
3

私は通常:e .、現在のディレクトリを参照するために行います。また、プロンプトを取り除くためにあなたはすることができます:silent Exp

于 2012-09-14T16:02:45.817 に答える