When we edit the last few lines of a document in vim, those lines are displayed at the bottom part of the screen, which is a little uncomfortable for me. Is there a way to scroll below the end of the document, so that the bottom lines in the document can be displayed at the top of the screen? (Currently Sublime Text has such capability.)
I've done some searches, the closest answer I could find is to use "set scrolloff=10". But that is not what I am looking for. Since it doesn't display the bottom lines of the document at the top of the screen.
Thanks in advance!
To move right, press l . To move down, press j . To move up, press k .
You can jump to line number 700 (press ESC type 700G) 700G Move cursor to end of file in vim In short press the Esc key and then press Shift + G to move cursor to end of file in vi or vim text editor under Linux and Unix-like systems.
Hit Esc + A + $ : Go to bottom of the file and end of line. In this quick tutorial, you learned how to move to the last character of the file. Now you know how to jump to the end of the file using the vim command. We also explained how to jump to the start of the file using the vim text editor, including various keyboard shortcuts combinations.
By default Vim scrolls three lines when moving vertically, and six columns when moving horizontally. On MS-Windows system-wide settings. Note that horizontal scrolling only works if 'nowrap' is set. Also, unless how the horizontal scrollbar works). You can modify the default behavior by mapping the keys.
When your mouse has a scroll wheel, it should work with Vim in the GUI. For the Win32 GUI the scroll action is hard coded. <ScrollWheelRight> . This should work in all modes, except when editing the command line. Note that horizontal scrolling only works if 'nowrap' is set.
In addition to @Kent's answer, zz
would allow you to bring the current line to the middle of the screen, which in my opinion is more convenient to see the context of the current line of text/code.
Also, zb
would bring the current line to the bottom of the screen, which may also help sometimes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With