Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer

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

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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