Skip to content

Instantly share code, notes, and snippets.

@YayC
Last active December 13, 2015 22:18
Show Gist options
  • Save YayC/4983250 to your computer and use it in GitHub Desktop.
Save YayC/4983250 to your computer and use it in GitHub Desktop.
Some ST2 and OSX time savers that I use (as of the first night of Dev Bootcamp). Boosting the productivity of a total novice, give 'em a spin.

J's Essential Keyboard Shortcuts


ST2, Terminal, and OSX

If you haven't seen one of these, try it out! Well documented but these are the ones I use consistently.

⇧ = shift, ⌃ = ctrl, ⌥ = option, ⌘ = command (aka master)

Sublime Text 2

What an awesome tool.

  • ⌘ + click → gives you another cursor, wherever you click! Especially useful to control all cursors with osx tips below.
  • ⇧ + ⌘ + P → start typing any command here (eg, "package manager," the most essential ST2 package) and it pulls it up super fast. So much better than pointing through menus from the top bar.
  • ⌘ + d → highlight next instance of the selection in the document. Press this a few times and you'll have several instances highlighted, ready for simultaneous editing.
  • ⇧ + ⌘ + d → duplicate the selection immediately below it. Super useful for copying a line down that you just need to slightly alter, or a whole block
  • ⌃ + ⌘ + g → what I think of as the "god" key. Highlights every instance of the selection in the document, allowing you to edit all simultaneously.
  • ⌃ + ⌘ + up/down → slide the current line up/down. Close relative of the god key above.
  • ⌘ + k then ⌘ + b → show or hide the sidebar (think of it like "kill bar")
  • ⌥ + ⌘ + [number] → sets the number of columns
  • ⌘ + n → create new file
  • ⌘ + s → save file

OSX

Just recently started using these and I love them.

  • ⌘ + arrow key → sends the cursor all the way in the indicated direction within the document
  • ⌘ + ⇧ + arrow key → highlight all the way in the direction indicated
  • ⌥ + arrow key → send the cursor to the next word / word border in the document
  • ⌥ + ⇧ + arrow key → highlight a word
  • ⌘ + spacebar → open spotlight (search your computer)
  • ⌘ + number → move to that number desktop (I think this is called "mission control")
  • fn + delete → forward delete

Terminal + iTerm

  • start typing a directory name, then press tab (once or twice) → auto-completes, or lists possible options given what you've typed (shout out to Tyler for teaching me this one today)
  • arrow up to cycle through your last executed commands
  • ⌃ + a → move to beginning of line (think "a is the beginning of the alphabet")
  • ⌃ + e → move to the end of the line (think "e for end")
  • ⌃ + u → delete everything before cursor
  • ⌃ + k → delete everything after cursor (think "ukkk! I should delete that!")

Bonus Tools: Text Expansion (eg aText) and Clipboard Manager (eg ClipMenu)

These aren't on the shared DBC computers, but I love them on my personal mac.

  • Text expansion tools like aText can automate anything you find yourself typing repetitively.
  • A clipboard manager allows you to copy multiple things before pasting, by making a history of your clipboard readily accessible. I just press ⇧ + ⌘ + v (instead of the regular ⌘ + v) to paste something different from the most recent copy/ cut. Very useful.

Hope it helps-- go forth and build!

@omarrayward
Copy link

Thanks for the shortcuts. I didn't know about the shortcuts in the terminal

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