In-file navigation


First thing first, lets split in-file navigation into 3 main categories:

  1. moving - moves the cursor anywhere within visible screen stands still

  2. scrolling - screen moves but cursor's position remains the same

  3. jumping - move anywhere within the current file/buffer, both cursor position and screen change

And here are my main navigation goodies that I use in day-by-day development.


Cursor moves, screen does not

horizontally by char/column

  • absolute column index: |, 5|

  • single char left/right: h, l

  • multiple chars: 4h, 3l

  • any char on the line: fc, Fc


horizontally by token/word

  • beginning/end of next token: w, b

  • beginning/end of next word: W, B

  • multiple token: 3w, 3b

  • multiple words: 3W, 3B

  • end of current/next token/word: e, E


horizontally at beginning/end of line

  • beginning of line: 0

  • end of line: $

  • first non-blank char: ^

  • last non-blank char: g_


vertically by line

  • single line: "j", "k"

  • multiple lines: "6j", "6k"


vertically by paragraph

  • up: "}"

  • down: "{"


on visible screen

  • open/close brace: "%"

  • top/middle/bottom: "H", "M", "L"

  • char/word/line: "C-c m c", "C-c m w", "C-c m l"



Screen moves, cursor does not


  • top of the screen: "zt"

  • middle of the screen: "zz"

  • bottom of the screen: "zb"


vertically by one line

  • down: "C-y"

  • up: "C-e"


horizontally by one column

  • right: "zl"

  • left: "zh"


horizontally by screen

  • right: "zL"

  • left: "zH"



Both cursor and screen move

at beginning/end of file

  • top: "gg"

  • bottom: "G"


by full screen

  • down: "C-f"

  • up: "C-b"


by half page

  • down: "C-d"

  • up: "C-u"


to line

  • absolute: "34G", "70%"



  • mark: "mm"

  • beginning of marked line: "'m"

  • marked cursor position: "`m"

  • undo the jump: "''"



  • semantic: "C-c j f"


Happy navigation!!!

comments powered by Disqus