1

The situation is:

  • Open a file
  • Drag minimap to the middle of this long file
  • Click somewhere on the line I want to edit
  • Intend to press Home to go to the head of the line.
  • Accidentally press Ctrl + Home
  • Am taken to the head of the file.

QUESTION

Is there a shortcut to return to the line I want to edit?

jwpfox
  • 5,124
  • 11
  • 45
  • 42
FlyC
  • 1,844
  • 1
  • 15
  • 18
  • 1
    Sounds like you want soft undo; if you're on Windows/Linux, press `Ctrl+u`; if you're on MacOS it's `Cmd+u`. Add `Shift` to either key binding (depending on platform) for soft redo. – OdatNurd Mar 15 '18 at 03:50
  • @OdatNurd That's exactly what I'm looking for! thanks! – FlyC Mar 15 '18 at 05:33
  • Possible duplicate of [How to jump to previous and last cursor in Sublime Text 3?](https://stackoverflow.com/questions/19996878/how-to-jump-to-previous-and-last-cursor-in-sublime-text-3) – Darrick Herwehe Mar 16 '18 at 13:34

1 Answers1

4

From the creator of Sublime Text at https://forum.sublimetext.com/t/soft-undo/307

Undo/redo in Sublime Text normally only steps through actions that modify the buffer, skipping over those that simply modify the selection. Changes to the selection are still part of the undo history, and can be stepped through using Ctrl+U/Ctrl+Shift+U (softUndo/softRedo commands). These key bindings aren't displayed in the menu, and I'm wondering if anyone has discovered them on their own.

I rarely use them myself, but did today, so it got me wondering if anyone else does

Change Ctrl in the above to Cmd if using a Mac.

Community
  • 1
  • 1
jwpfox
  • 5,124
  • 11
  • 45
  • 42