An Opinionated Primer to Visual Studio Code

Working with Files

The top-level view is self explanatory. You have a file explorer on the left, currently open files in the center. The most important thing is to view your files in a way that is visually pleasing to yourself.

You can open your files next to each other by right-clicking the filename (either in the file browser or the tab at the top).
You can open your files next to each other by right-clicking the filename (either in the file browser or the tab at the top).

Shortcuts & Tips

You can go to a file with ⌘—p . It is my most-used shortcut. Just remember that you may have multiple index.htmls!

Go to file
  1. Search within file: ⌘-f
  2. Replace within file: ⌘-alt-f
  3. Search within all files: ⌘-shift-f (this can also be found in the sidebar)
Search within current file, or all files. Notice that the global search has an icon in the sidebar.
Surprisingly useful

The Terminal, and Git

How the terminal & git work are beyond our scope. Let’s look at how Code applies them. The obvious benefit is the lovely UI that it supplies for any version control system. Terminal does not get this, but it does get its own keyboard shortcut: ctrl-`.

Add & commit selected lines using the … menu

Settings

Your user settings are very important, although you will probably interact with them infrequently. As such, learning the json syntax is not important. Knowing what you can change is important.

  • Your settings can be global (vscode) or local (this workspace).
  • You can edit the settings by way of a .json file, or with a nice UI.
  • You can set a value for a specific language
Local, VSCode builtin, and user settings
Removing the minimap for plaintext & markdown

Extensions

Navigating the extensions is much like navigating Chrome or Firefox extensions. There is little official oversight, but the best extensions will float to the top by way of user review.

Many extensions are not useful, but still fabulous in their own way.

The command palette

It does pretty much everything. Remember, the shortcut is ⌘-shift-p . If you have one takeaway, this should be it. If you do not remember the shortcut for search & replace, just open the command palette and type replace! Need to edit your settings? Just open the palette and type settings. I never, ever, remember the shortcut for changing your theme.

Closing Thoughts

Your workflow is important. It allows you to be more productive, and makes you less likely to pull your hair out. Just like everything else, it is good to practice self care. Everything I mentioned allows me to feel more motivated and positive. I hope this helps you in the same way.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store