In-file navigation

Emacs

Here are my Emacs in-file navigation goodies that I use on daily basis, splitted into 3 main categories:

  1. moving - cursor moves, screen does not

  2. scrolling - screen moves, cursor does not

  3. jumping - both cursor and screen move .

1. Moving

Moves the cursor anywhere within visible screen, while the screen stands still.

1.1 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

/img/out-5.gif

1.2 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

/img/out-6.gif

1.3 horizontally at beginning/end of line

  • beginning of line: 0

  • end of line: $

  • first non-blank char: ^

  • last non-blank char: g_

/img/out-7.gif

1.4 vertically by line

  • single line: "j", "k"

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

/img/out-8.gif

1.5 vertically by paragraph

  • up: "}"

  • down: "{"

/img/out-9.gif

1.6 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"

/img/out-10.gif

2. Scrolling

Screen moves but cursor's position remains the same

2.1 top/middle/bottom

  • top of the screen: "zt"

  • middle of the screen: "zz"

  • bottom of the screen: "zb"

/img/out-11.gif

2.2 vertically by one line

  • down: "C-y"

  • up: "C-e"

/img/out-12.gif

2.3 horizontally by one column

  • right: "zl"

  • left: "zh"

/img/out-20.gif

2.4 horizontally by screen

  • right: "zL"

  • left: "zH"

/img/out-13.gif

3. Jumping

Jump anywhere within the current file/buffer, both cursor's position and screen change.

3.1 at beginning/end of file

  • top: "gg"

  • bottom: "G"

/img/out-14.gif

3.2 by full screen

  • down: "C-f"

  • up: "C-b"

/img/out-15.gif

3.3 by half page

  • down: "C-d"

  • up: "C-u"

/img/out-16.gif

3.4 to line

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

/img/out-17.gif

3.5 mark/jump

  • mark: "mm"

  • beginning of marked line: "'m"

  • marked cursor position: "`m"

  • undo the jump: "''"

/img/out-18.gif

3.6 method/function

  • semantic: "C-c j f"

/img/out-19.gif

Happy navigation!!!

comments powered by Disqus