While it's pretty easy to move around Atom by clicking with the mouse or using the arrow keys, there are some keybindings that may help you keep your hands on the keyboard and navigate around a little faster.
Atom ships with many of the basic Emacs keybindings for navigating a document. To go up and down a single character, you can use Ctrl+P and Ctrl+N. To go left and right a single character, you can use Ctrl+B and Ctrl+F. These are the equivalent of using the arrow keys, though some people prefer not having to move their hands to where the arrow keys are located on their keyboard.
In addition to single character movement, there are a number of other movement keybindings:
Atom has support for all the standard Windows cursor movement key combinations. To go up, down, left or right a single character you can use the arrow keys.
In addition to single character movement, there are a number of other movement keybindings:
Atom has support for all the standard Linux cursor movement key combinations. To go up, down, left or right a single character you can use the arrow keys.
In addition to single character movement, there are a number of other movement keybindings:
You can also move directly to a specific line (and column) number with Ctrl+G. This will bring up a dialog that asks which line you would like to jump to. You can also use the row:column
syntax to jump to a character in that line as well.
Atom also has a few movement and selection commands that don't have keybindings by default. You can access these commands from the Command Palette, but if you find yourself using commands that don't have a keybinding often, have no fear! You can easily add an entry to your keymap.cson
to create a key combination. You can open keymap.cson
file in an editor from the Atom > KeymapFile > KeymapEdit > Keymap menu.
For example, the command editor:move-to-beginning-of-screen-line
is available in the command palette, but it's not bound to any key combination. To create a key combination you need to add an entry in your keymap.cson
file. For editor:select-to-previous-word-boundary
, you can add the following to your keymap.cson
:
'atom-text-editor':
'cmd-shift-e': 'editor:select-to-previous-word-boundary'
'atom-text-editor':
'ctrl-shift-e': 'editor:select-to-previous-word-boundary'
'atom-text-editor':
'ctrl-shift-e': 'editor:select-to-previous-word-boundary'
This will bind the command editor:select-to-previous-word-boundary
to Cmd+Shift+ECtrl+Shift+E. For more information on customizing your keybindings, see Customizing Keybindings.
Here's a list of Movement and Selection Commands that do not have a keyboard shortcut by default:
editor:move-to-beginning-of-next-paragraph
editor:move-to-beginning-of-previous-paragraph
editor:move-to-beginning-of-screen-line
editor:move-to-beginning-of-line
editor:move-to-beginning-of-next-word
editor:move-to-previous-word-boundary
editor:move-to-next-word-boundary
editor:select-to-beginning-of-next-paragraph
editor:select-to-beginning-of-previous-paragraph
editor:select-to-beginning-of-line
editor:select-to-beginning-of-next-word
editor:select-to-next-word-boundary
editor:select-to-previous-word-boundary
editor:move-to-beginning-of-next-paragraph
editor:move-to-beginning-of-previous-paragraph
editor:move-to-beginning-of-screen-line
editor:move-to-beginning-of-line
editor:move-to-end-of-line
editor:move-to-first-character-of-line
editor:move-to-beginning-of-next-word
editor:move-to-previous-word-boundary
editor:move-to-next-word-boundary
editor:select-to-beginning-of-next-paragraph
editor:select-to-beginning-of-previous-paragraph
editor:select-to-end-of-line
editor:select-to-beginning-of-line
editor:select-to-beginning-of-next-word
editor:select-to-next-word-boundary
editor:select-to-previous-word-boundary
editor:move-to-beginning-of-next-paragraph
editor:move-to-beginning-of-previous-paragraph
editor:move-to-beginning-of-screen-line
editor:move-to-beginning-of-line
editor:move-to-end-of-line
editor:move-to-first-character-of-line
editor:move-to-beginning-of-next-word
editor:move-to-previous-word-boundary
editor:move-to-next-word-boundary
editor:select-to-beginning-of-next-paragraph
editor:select-to-beginning-of-previous-paragraph
editor:select-to-end-of-line
editor:select-to-beginning-of-line
editor:select-to-beginning-of-next-word
editor:select-to-next-word-boundary
editor:select-to-previous-word-boundary
You can also jump around a little more informatively with the Symbols View. To jump to a symbol such as a method definition, press Cmd+RCtrl+R. This opens a list of all symbols in the current file, which you can fuzzy filter similarly to Cmd+TCtrl+T. You can also search for symbols across your project but it requires a tags
file.
You can generate a tags
file by using the ctags utility. Once it is installed, you can use it to generate a tags
file by running a command to generate it. See the ctags documentation for details.
Once you have your tags
file generated, you can use it to search for symbols across your project by pressing Cmd+Shift+R. This also enables you to use Alt+Cmd+Down to go to and Alt+Cmd+Up to return from the declaration of the symbol under the cursor.
Once you have your tags
file generated, you can use it to search for symbols across your project by pressing Ctrl+Shift+R. This also enables you to use Alt+Ctrl+Down to go to and Alt+Ctrl+Up to return from the declaration of the symbol under the cursor.
Once you have your tags
file generated, you can use it to search for symbols across your project by pressing Cmd+Shift+RCtrl+Shift+R.
You can customize how tags are generated by creating your own .ctags
file in your home directory, ~/.ctags
%USERPROFILE%\.ctags
. An example can be found here.
The symbols navigation functionality is implemented in the symbols-view package.
Atom also has a great way to bookmark specific lines in your project so you can jump back to them quickly.
If you press Cmd+F2Alt+Ctrl+F2Ctrl+Shift+F2, Atom will toggle a "bookmark" on the current line. You can set these throughout your project and use them to quickly find and jump to important lines of your project. A small bookmark symbol is added to the line gutter, like on line 22 of the image below.
If you hit F2, Atom will jump to the next bookmark in the file you currently have focused. If you use Shift+F2 it will cycle backwards through them instead.
You can also see a list of all your project's current bookmarks and quickly filter them and jump to any of them by hitting Ctrl+F2.
The bookmarks functionality is implemented in the bookmarks package.