Skip to content

Instantly share code, notes, and snippets.

@cmkoller
Last active August 29, 2015 14:21
Show Gist options
  • Save cmkoller/23e9fc98484d12824736 to your computer and use it in GitHub Desktop.
Save cmkoller/23e9fc98484d12824736 to your computer and use it in GitHub Desktop.
Clinic: Atom Shortcuts

#Atom Shortcuts

##Opening Atom the Right Way

  1. Open iTerm
  2. cd into the right directory
  3. Type atom . to open the directory in Atom.

(DON'T just go opening a directory with every project you've ever done! It will seriously make your life so much more difficult!)

##Settings

Access settings with cmd + ,.

###Themes

You can change your theme, under the "Theme" tab! I like "Atom Dark" for both UI and Syntax.

###Cool Packages

  • file-icons -- Differentiate your different files with beautiful icons!
  • advanced-new-file -- Create new files by typing a relative pathname by typing cmd + alt + n
  • emmet -- Make everything easier, and also write HTML faster by hitting tab after abbreviations

##Keyboard Shortcuts

This is where your life will change.

###Messing with the View

  • Toggle tree-view sidebar: cmd + \
  • Font size: cmd + +, cmd + - (this is pretty universal!)

###Navigating your code

  • Move the cursor quickly: cmd + arrow key
  • Move the cursor word-by-word: opt + → and opt + ←
  • Highlighting code: Any of the above commands plus shift will highlight from your current cursor location to the new cursor location
  • Highlighing multiple lines: cmd + l will highligh one line. If you keep hitting l, more lines will be highlighted underneath!

###Navigating your documents

  • Moving between open tabs: cmd + opt + → and cmd + opt + ←
  • Searching the current file: cmd + f
  • Searching the project directory: cmd + shift + f

####The Fuzzy Finder - cmd + p

This is so important it got its own section. This will seriously become your life.

cmd + p will open a "fuzzy finder" window where you can type letters. As you type letters, filenames from your project directory that match those letters will come up. At any time, you can hit enter to open the selected (top) file, or use the up/down arrows to scroll through the list of possibilities until you find what you want.

Here's the magic: given a certain filename, as long as you type the letters of that filename in the right order, you can skip as many (and as much punctuation) as you want. So if I want to open application_controller.rb, I can type apcon or apconrb and it'll probably come up first on the list. If I want to open index.html.erb, I can type inhtr and it'll show up.

I generally like to just type the first couple sounds of each word in the filename until I see what I want!

###Messing with your code

  • Comment/uncomment blocks of code: cmd + /
  • Tab/un-tab blocks of code: Highlight a block of code, then hit cmd + [ to tab and cmd + ] to un-tab.
  • Tab/un-tab lines of code: Put your cursor on the line of code (no highlighting necessary), and hit cmd + [ to tab and cmd + ] to un-tab.
  • Delete a single word: cmd + opt + backspace will delete from your cursor location, to the beginning of the current word.
  • Delete to beginning of line: cmd + backspace will delete from your cursor location, to the beginning of the line.
  • Delete to end of line: ctrl + k will delete from your cursor location, to the end of the line.
  • Cut (and paste) a single line: With nothing highlighted, press cmd + x. It'll cut the entire line your cursor is on.
  • Move the current line up and down: cmd + ctrl + ↑ and cmd + ctrl + ↓

###Multiple Cursors

  • Add a new cursor: cmd + click
  • Select the next word that's the same as the current word: cmd + d (repeated however many times you want) will select the next word(s) that match the word your cursor is currently on - and create a cursor on each one!
  • Get rid of multiple cursors: esc

###Resources

###(Random Tip)

Sometimes, you will accidentally press cmd + ., and at least for me this opens this gross window at the bottom of my editor called "Key Binding Resolver" that I couldn't figure out how to close. The answer: press cmd + . again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment