How can I disable that vim lets me scroll past the end of a file?
feedback
|
|
Vim doesn't actually let you scroll past the end of the file (as in, move the cursor past the last existing line), but it shows you a few lines behind the last one, because it has to show something. It cannot be disabled, sorry. Not unless you wish to download Vim's sources (it is open source, after all) and fiddle with it. It natively inserts ~'s on rows that don't exist, because, well, it has to show something. All editors do that. As someone suggested, there are workarounds around this ... but that is all they are - workarounds. And none of them work really pretty. I wouldn't recommend any of them. | |||
|
feedback
|
|
Without a fairly ugly hack that would probably look visually disturbing and slow Vim down, you can't do what you want. Basically you would have to set up something like an autocmd for the CursorMoved/CursorMovedI events that tried to detect whether the bottom of the file was displayed, and if so, execute some normal mode commands to force the scroll position. It is worth noting (and as the people at link that johnny provided in his comment say), Vim is not the only application that behaves like this, and you can't really scroll past the end of a file in Vim—the last line must always be visible. | |||
|
feedback
|