2012-09-14 75 views
8

我注意到,當我開始一天並打開vim,然後使用:Exp,我得到「按ENTER鍵或鍵入命令以繼續」提示。通常這在執行外部命令時顯示。我不記得:在過去做這件事(?)。此外,提示只在第一次使用netrw時顯示?!Vim netrw詢問「按ENTER鍵或鍵入命令繼續」

雖然微不足道,但我覺得這很煩人。有沒有人有一個想法,爲什麼netrw這樣做?我在我的.vimrc被消除各種事情,看看他們是否改變什麼,但我可以在這裏很長一段時間......

重現步驟:

  • Vim打開或使用gvim
  • : Exp(緊接着輸入)
  • 提示出現。
+0

在Windows終端Vim的重建,用':e.'。特別是通過'vim -N -u NORC'。 –

回答

3

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. 

您也應該檢查,如果你使用的是最新的插件版本,有一個bug修復上與您的問題相關的版本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. 
+0

我知道這些選項,但由於沒有輸出顯示,我不希望必須按Enter鍵。 –

+0

@ vext01這些選項只是一個猜測,因爲我在執行您提供的步驟時沒有得到任何命中輸入提示。 'v:scrollstart'有什麼用嗎? – mMontu

+0

設置cmdheight = 2似乎是我現在可以做的最好的事情。乾杯! –

3

我通常只是做:e .瀏覽當前目錄。另外,爲了擺脫提示,你可以做:silent Exp

+0

這也適用。 –

2

加入這行來~/.vimrc似乎解決這個問題對我來說:

let g:netrw_silent = 1