Last Updated: February 25, 2016
·
689
· maxcan

The underappreciated H, M, and L motions (top, middle, bottom of window)

Long story short, [count]H, M, and [count]L will move the cursor to the top, middle, or bottom of your window with scrolling the content. If you put in a count, it will move you count many lines from the top or bottom.

Its less well known than motions like %, *, gg, G, etc but I've always found myself awkwardly trying to move to the window edge since that's how my brain most quickly perceives location in code. Since I saw these, I've been using them a lot.

2 Responses
Add your response

I had previously rebound H/L to move to front of line and end of line respectively, then realized when I was on a coworkers machine, that the native behavior was obviously still in place (which is more useful in place of the dread [n]j / [n]k, or worse, repeated j/k).

Thanks for the explanation of these motions.

over 1 year ago ·

I don't really use these all that much. I'm curious, what are your reasons for using these rather than zt z. and zb or <c-u>, <c-d>?

over 1 year ago ·