6

From time to time I see something like in the status bar when I open a file:

"Gemfile" 112L, 2941C
"Gemfile" 112 lines --62%--
Press ENTER or type command to continue

Where is it coming from? How to disable it forever?

This is seriously getting out of hand, I am editing wrong lines in files because when I switch to the file it is off by one line.

Update

When multiple files are opened in buffers and you bring vim to foreground especially after some changes like git merge vim seem to reload files.

Settings cmdheight to 2 doesn't help because there might be more messages. This is what I just had after merge:

NORMAL  +3 ~9 departments  ... STATUS BAR
"app/assets/stylesheets/_menu.sass.erb" 144L, 3372C
"app/assets/stylesheets/_users.sass" 120L, 2110C
"spec/factories/users.rb" 19L, 469C
Press ENTER or type command to continue

There should be a way to get rid of this.

  • 5
    That looks like the information vim normally prints when loading a file, though it's interesting it's being printed twice. Does it still happen when you run with -u NONE? – Josh Apr 6 '15 at 18:10
  • I don't think it is supposed to wait for me to press Enter as well. No, it's some plugin I think. Guess have to find out what's causing it. The problem is - I don't see that every time. – firedev Apr 7 '15 at 7:34
  • 2
    The "press enter" prompt makes sense; it will do that when there is more text to display than would fit, as there is in this case since its displaying a bunch of extra info. See :help press-enter. – Josh Apr 7 '15 at 15:04
4

This is controlled with the shortmess option. In particular, you probably want to set the O (upper-case o) flag with set shortmess+=O.

O     message for reading a file overwrites any previous message.
      Also for quickfix message (e.g., ":cn").

Note that this is included in the Vim default, which is filnxtToO. So I think you either added this to your vimrc some time in the past and forgot about it, or some plugin is resetting it. In How do I debug my vimrc file? you can find some tips on how to figure out where this is being reset.

Also see :help 'shortmess'. And this question is almost exactly the same.

0

So I kind of alleviated it by using

:set cmdheight=2

But that is weak sause and I don't think should be the answer.

Update Yep, the next day I had 3 files changed and it asked me to press enter again.

  • I think that use 3 is better, because sometimes more than 2 lines are shown. For me many times xD – adelarsq Dec 28 '15 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.