2012-09-14 11 views
8

He notado que cuando comienzo el día y abro vim, uso: Exp, aparece el mensaje "Presione ENTER o escriba command to continue". Por lo general, esto se muestra cuando se ejecuta un comando externo. No recuerdo: Exp haciendo esto en el pasado (?). Además, el aviso solo se muestra con el primer uso de netrw ?!Vim netrw pidiendo "Presione ENTER o escriba command para continuar"

Aunque es trivial, me parece molesto. ¿Alguien tiene una idea de por qué netrw está haciendo esto? He estado quitando varias cosas en mi .vimrc para ver si cambian nada, pero podría estar aquí mucho tiempo ...

Pasos para reproducir:

  • vim Abrir o gVim
  • : Exp (seguido de enter)
  • Aparecerá la solicitud.
+0

recreado en la terminal de Windows Vim, con ': e.'. En particular, a través de 'vim -N -u NORC'. –

Respuesta

3

El contenido de v:scrollstart se puede utilizar para tener una idea de por qué sucede esto.

Existen algunas opciones que pueden estar relacionadas con el problema. De 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' 

Editar:

De :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. 

También debe comprobar si está utilizando la última versión del plugin, ya que hay una corrección de errores en versión 71 que está relacionada con su problema:

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

Conozco estas opciones, pero como no hay resultados que mostrar, no esperaría tener que presionar enter. –

+0

@ vext01 las opciones fueron solo una suposición, ya que no recibo ningún aviso de hit-enter cuando ejecuto los pasos que proporcionó. ¿Obtuviste algo en 'v: scrollstart'? – mMontu

+0

set cmdheight = 2 parece ser lo mejor que puedo hacer por ahora. ¡Aclamaciones! –

3

Normalmente solo hago :e . para buscar en el directorio actual. Además, para deshacerse de las indicaciones, puede hacer :silent Exp.

+0

Esto también funciona. –

2

modificado esta línea en ~/.vimrc parece resolver el problema para mí:

let g:netrw_silent = 1 
Cuestiones relacionadas