Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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

 
discard

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.