Peter Reavy

There and back again in Emacs (and Visual Studio)

Posted in emacs by Peter Reavy on June 27, 2012

In Emacs, when you’re editing a line and you know need to make a brief change somewhere else before coming back, then store the mark before you go so you can jump back when you’re done.

Type C-SPC C-SPC the store the mark & cancel region highlighting (I’m assuming you have transient mark mode enabled as it normally is by default).

Navigate to where you wanted and do your other edit. When you’re done, C-U C-SPC to jump back.

The exemplary Mastering Emacs has much more on the topic of the mark commands.

In Visual Studio, if you’ve set up Emacs Emulation, you can do nearly the same thing.
Type C-SPC ESC to store the mark then cancel region selection.

Then go somewhere else in your code and do something. It’s the same C-U C-SPC to come back again.

Advertisements