46

In emacs, when i am editing a program, and miss-input some command and make the cursor jump to somewhere in other files. Is there a short-cut key or command to jump back to the last location of the cursor?

3 Answers3

46

I believe what you are searching for is pop-global-mark, usually bound to C-x C-@ and C-x C-SPC.

The global mark ring is updated automatically on many occasions such as buffer switching, accidental or otherwise.

Joseph Gay
  • 661
  • 5
  • 3
14

You can use the command previous-buffer which in my version (GNU Emacs 23.2.1) is bound to C-x left-arrow by default.

Just type Meta-x describe-key C-x left for further information

There is also winner-mode that binds C-c left arrow to winner-undo which in short allows you to undo any change done to your windows.

Mcradle
  • 870
  • 1
  • 7
  • 16
7

In Spacemacs and Doom Emacs, C-o is bound to evil-jump-backward

GitHub Repositories

Blind Spots
  • 2,607
  • 1
  • 16
  • 21