Skip to content

Instantly share code, notes, and snippets.

@smkopp92
Last active July 26, 2017 20:28
Show Gist options
  • Save smkopp92/e743e76eeb6853007ba9 to your computer and use it in GitHub Desktop.
Save smkopp92/e743e76eeb6853007ba9 to your computer and use it in GitHub Desktop.
A guide for coding efficiency

#Atom Shortcuts Shamelessly stolen borrowed from DRod who shamelessly stole borrowed from Christina

##Settings

Access settings with cmd + ,

###Themes

You can change your theme, under the "Theme" tab! I just use "One Dark" by default. It looks nice.

###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
  • minimap -- Shows an entire view of the current file for navigation

##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

####Multiple panes

  • Create a new pane: cmd + k followed by pressing an arrow key denoting where you want the new pane.
  • Move to a pane: cmd + k followed by cmd + arrow key where the arrow key is the pane direction to which you want to move relative to your current pane.

####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 tab to tab and tab + shift to un-tab.
  • Delete a single word: 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
  • Remove a cursor: cmd + click wherever a cursor already exists.
  • 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. esc works too.

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