2012-07-09

Emacs: Ways to Jump to Points

when coding, there's a common need to jump to a particular place, then return to previous position.

There are several ways. Most common standard way are:

  • exchange-point-and-markCtrl+x Ctrl+x】.
  • Ctrl+u Ctrl+Space

I've tried all ways in past years, including custom elisp that push marks. But i found split windows to be the best.

e.g. split window. Go to where you wanna be. When done, unsplit. Give split/unsplit a easy key. (➲ Emacs: How to Define Keyboard Shortcuts) e.g. In ErgoEmacs, it's:

  • Alt+3delete-other-windows
  • Alt+4split-window-vertically
  • Alt+0delete-window
  • Alt+sother-window

On a different note, here's a nice tip when using mouse (thx to Ken Goldman):

  • Middle mouse button on a status bar expands current pane.
  • Right mouse button on a status bar closes current pane.