title | description | date | tags | |||||||
---|---|---|---|---|---|---|---|---|---|---|
My VS Code Cheatsheet |
Useful VS Code tips and tricks for my reference and yours |
2020-02-24T09:58:08.051Z |
|
Command-Shift-P
Then type your search term, for example “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.
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
code .
Ctrl-`
Command-B
Select one instance of the text that appears in multiple locations. Use Command-D to select all, then edit.
Option–click on a file in the Explorer.