Is there a shortcut to go to the last edited line?

Asked

Viewed 86 times

6

In Sublime Text, I’ve already happened to be editing a line of code and have to check a code right above to see what I’m going to implement. Turns out, when I do this, I miss a shortcut so I get back to the line I was editing earlier.

Example:

  • I’m editing line 175 of the file
  • I focused on line 22 so I could see a function declared there.
  • I want to go back to line 175 again, which I was editing.

Has two details:

  • You could use CTRL+G, but I would always have to record the line I was before.

  • I currently use CTRL+Z. When he focuses on the line, I give CTRL+Y. This is too ugly.

Is there a shortcut that focuses on the last line I edited in Sublime Text 3?

  • 1

    sublime has Bookmark plugin, serves exactly for this

  • 1

    Have you tried alt+-?

  • 1

    @hkotsubo seems to work ;)

1 answer

6


On Windows and Linux, you can use ALT+- ("alt" + "hyphen"). In Mac OS the shortcut is CTRL+-.

Typing several times in a row, it goes back in all positions that the cursor was, including on different tabs (it just doesn’t jump between different windows, but inside the same window, it jumps from one tab to another without problems).

If you want to go forward instead of back, use ALT+SHIFT+- (or CTRL+SHIFT+- on Mac OS).

It is also possible to change shortcut keys by editing your file .sublime-keymap (menu Preferences->Key Bindings). For example, if I want CTRL+- be the shortcut to return and CTRL+SHIFT+- to advance, just add:

{ "keys": ["ctrl+-"], "command": "jump_back" },
{ "keys": ["ctrl+shift+-"], "command": "jump_forward" },

Browser other questions tagged

You are not signed in. Login or sign up in order to post.