protips

Logo

This site lists the protips that we shared with students during our courses

View the Project on GitHub appliedtechnology/protips

Save your fingers - lesson 2 - Visual Studio Code

We are programmers. We type a lot. Let’s save our fingers and make the precious keystrokes we do count!

We’ve given you a brand new (for most of you, I presume) code editor - Visual Studio Code. It’s a very powerful tool and right now in lead of the preferred editors for JavaScript developers.

The trait of a really good editor is that you never need to use the mouse. Everything (!) has a keyboard shortcut, that you could and should use.

The full map (https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf) is horrendously large and I know noone that knows all of these. But you should know a few commands to simplify your everyday life.

Here are my top 10:

  1. ⌘S Save current file and ⌥⌘S to Save All open documents
  2. ⌘W Close current file(window)
  3. ⌘P Goto file dialog
  4. ⇧⌥F format document (fixes indentation etc)
  5. ⌘F Find stuff and ⌥⌘F to replace the stuff you found
  6. ⌘C copies selected text OR entire line, ⌘X cuts it
  7. ⌥↓ / ⌥↑ - move line up or down
  8. ⇧⌥↓ / ⇧⌥↑ copies line up or down
  9. ⌃` - shows the integrated terminal
  10. ⌘B - toggles the sidebar (with all the files etc) visibility

In the list above: