Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom editor: How to jump back and forward

Tags:

atom-editor

I'm used to PHP Storm where you can easily jump back and forwards to where the cursor previously was. Is there such a feature in the atom editor?

like image 731
eddy147 Avatar asked Feb 24 '16 10:02

eddy147


People also ask

How do you jump to the next line in an Atom?

In Atom, Cmd Enter (Mac) or Ctrl Enter (Windows/Linux) will make a new line and go there, skipping past whatever is presently on the line.

Can you undo in Atom?

When in a file that needs reverting, press ctrl-cmd-r to revert the file.


2 Answers

I think you are looking for the package "last-cursor-position":

https://atom.io/packages/last-cursor-position

If you want to modify the key binding, click on "view code" for the package and edit the file keymaps\last-cursor-position.cson

Edit: Or better, override keybindings in your keymap.cson

like image 152
Fab313 Avatar answered Dec 22 '22 22:12

Fab313


An extra step for those who got used to toolbars in IDEs: to add "back" and "forward" actions to toolbar, I've installed these two packages in addition to last-cursor-position mentioned above:

  • https://atom.io/packages/tool-bar
  • https://atom.io/packages/flex-tool-bar

Then edited the tool bar (there is a gear button on default flex toolbar for this) by adding two buttons that refer to last-cursor-position shortcuts:

{
  type: "button"
  icon: "arrow-left"
  callback: "last-cursor-position:previous"
  tooltip: "Back"
}
{
  type: "button"
  icon: "arrow-right"
  callback: "last-cursor-position:next"
  tooltip: "Forward"
}

Got this toolbar

like image 27
skirill Avatar answered Dec 22 '22 20:12

skirill