Skip to main content

My VS Code Cheatsheet

Here’s a list of useful (Mac-based) VS Code tips for my reference and yours.

Use the Command Palette

Command-Shift-P

Then type your search term, for example “settings”.

Settings

My preferences (in settings.json or via Preferences→Settings):

{
"workbench.editor.showTabs": true,
"editor.formatOnSave": true,
"explorer.confirmDragAndDrop": false,
"editor.minimap.enabled": false,
"extensions.ignoreRecommendations": false,
"explorer.compactFolders": false,
"explorer.autoReveal": false,
"editor.accessibilitySupport": "off",
"ruby.codeCompletion": "rcodetools",
"emmet.includeLanguages": {
"nunjucks": "html",
"erb": "html"
},
"emmet.triggerExpansionOnTab": true
}

Note: the Emmet ones are really useful for code autocompletion.

Additional Emmet Settings

To add a keyboard shortcut for adding an arbitrary wrapper element (say, div.wrap) around some selected code:

Open the Command Palette then search “emmet wrap”. When you see the option “Emmet: wrap with abbreviation”, click the settings icon beside it. Enter your preferred keyboard shortcut. I currently use:

Command-Shift-A

Open current terminal directory in VS Code

code .

Toggle Terminal

Ctrl-`

Toggle sidebar visibility

Command-B

Edit multiple rows simultaneously

Select one instance of the text that appears in multiple locations. Use Command-D to select all, then edit.

Open file to side (for side-by-side editing)

Option–click on a file in the Explorer.

External Link Bookmark Note Entry Search