- C-u and C-d to jump up/down
- [ and ] to go prev/next empty line (I have a macro to clear empty spaces at the end of lines so this works well for jumping functions in code)
- from the article: 50% to go the halfway point of a document
- 100gg to go to line 100
- 100k to go 100 lines down
Are there any more good ones?
Edit: occurs to me that you might have remapped kkk to escape normal mode. At one time I had done this for jj. Now I just use C-[ as it’s portable to vanilla vim setups and less of a stretch than the escape key.
:set relativenumber
The line the cursor is on is now shown in the left sidebar as 0, counting up for each line away from the cursor. So now it tells you what number to use for "10j" and "10k" to move up and down a specific number of lines. m[a-z]
`[a-z]
Mark a point in a file into a register, and jump back to that point. Or even more interesting: m[A-Z]
`[A-Z]
Same as above, except capital marks are global and work across files.Also,
``
Jump back to the last place you jumped from (but only within the same file).zt, zz, and zb are similar but move the text not the cursor. So, zt will take the current line the cursor is on and make it the first visible line on the screen (and keep the cursor on that line). zz to the middle, zb to the bottom.
Personally, I use [ and ] to jump around most often in code, but the above are handy when you are working with documents.
I find these handy, especially after doing a search (quoted from :h z):
- z. redraw, cursor line to center of window
- z<CR> redraw, cursor line to top of window
- z- redraw, cursor line at bottom of window
Between that and 20j and (blasphemy probably) just using the scroll wheel, that handles most of my scrolling needs.
Or just use the directional keys and PgUp/PgDown like any person in the last 30 yrs
I may still try it out. But decade long habits...
I thought it meant that you were laughing like haha (a leas in Brazil)
I didn't know it had bad connotations