I know that gg and G can move the cursor to the top and bottom of the file. But is there a way to jump to the top or bottom of the visible window?

  • Capital H does not work for me. I'm using Linux ubuntuxfr 5.4.0-77-generic #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux i can only get the cursor within 5 or sometimes 6 lines from the top of the window ( unless i'm editing one of the very first lines in the file ). Other distros i've used in the past did not have this issue. thoughts ?
    – ochoa
    Jul 18, 2021 at 23:11
  • @ochoa your "Answer" was not an answer to the question. We use those only to provide an answer to the original question. If you have a question, you may follow up with a comment to clarify something or ask a new question. See also How to Ask,How to Answer.
    – D. Ben Knoble
    Jul 19, 2021 at 15:28

1 Answer 1


Type H (capital H, H for "high") to move to the top of the screen.

Type M (capital M, M for "middle") to move to the middle of the screen.

Type L (capital L, L for "low") to move to the bottom of the screen.

  • 4
    Since j moves down and k moves up, it's a little awkward that J and K don't make these top/bottom movements. Is there a mnemonic to remember these by, similar to M for "middle" like @Caco points out? Mar 4, 2020 at 3:02
  • 4
    @user1717828 H for High, L for Low. Mar 4, 2020 at 4:09
  • 1
    mnemonic H high -- top L low -- bottom
    – Marcio
    May 28, 2021 at 14:10
  • 1
    @Marcio I also edited the answer to include the mnemonics, since you were not the only one to comment on it... Thanks for your contribution and welcome to the site!
    – filbranden
    May 28, 2021 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.