I am used to using vi, not vim. What I find annoying in vim is that when you are scrolling with CTRL-F and reach EOF, vim scrolls down to the very last line and put this line on the top of your screen, and you can't see the lines above. You must scroll up a little bit so you can see the context. All this happens with CTRL-F only, not with j or the down cursor key.

In vi, you scroll down (with CTRL-F), but when you reach EOF it still show you, say, 15 lines and then the typical ~.

How can I config vim to behave like vi in this case? I am using Putty for remote access.


You want to set option scrolloff:

'scrolloff' 'so' number (default 0)

number of screen lines to keep above and below the cursor. This will make some context visible around where you are working.

Use e.g.

:set scrolloff=10

to always keep at least 10 lines visible.


It's easier to get to the bottom of a file with shift-g. It does not go past the end of the file.

  • 3
    His goal is not to try and go to the end of the file. He's scrolling through the file with CTRL-F and doesn't like Vim's behavior when the end is reached. That's a different thing. – Starfish Jan 7 '12 at 2:56
  • @Starfish Ah ok. My misunderstanding. – James T Jan 7 '12 at 7:20

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.