3 ms·
'gg' and 'G' in command mode will send you to the beginning and the ending of the file. I've always used ':1' for the beginning and ':$' for the end. To me, th
by scott_s 15y ago
'gg' and 'G' in command mode will send you to the beginning and the ending of the file.
I've always used ':1' for the beginning and ':$' for the end. To me, the benefit of this is that I always use the same mechanism to go to a particular line of a file. (I often do, say, ':45' if an error is reported at line 45.)
For moving up and down large distances, I also prefer ctrl+u for up and ctrl+d for down. There is a minor difference: ctrl+f will put the last line at the top of the screen, filling the rest with the tilde-abyss. That always bothers me.
- jdludlow 15y ago45G does the same thing as :45, so the people using gg and G can also remain consistent with their muscle memory.
- graywh 15y agoThe reason for that difference between ctrl-d and ctrl-f is that one moves the cursor half a page (or 'scroll') and the other scrolls the screen one page.
- edanm 15y agoI like the idea of :1 and :$, but how do you get it to work in conjuction with selections (visual mode)? If I want to select the entire contents of the file, hitting "v" then ":1" seems not to work.