Cheat Sheets

VS Code

Created: 2019 May 27th

Updated: 2019 August 18th

Edit this page on GitHub

Want to list out what extensions you have installed?

Say that you are moving from VS Code to VS Code Insiders and you want to install the same extensions:

1code --list-extensions | xargs -L 1 echo code-insiders --install-extension

Moving from VS Code Insiders to VS Code? Then swap round the commands:

1code-insiders --list-extensions | xargs -L 1 echo code --install-extension

Want to have your own keyboard shortcut?

In some cases moving from one platform to another (Windows to Linux say) they keyboard shortcuts are different or just plain not there.

You can create your own keyboard shortcuts but it’s buried in the GUI settings for some reason.

In VSCode goto File -> Preferences -> Keyboard shortcuts., then over on the top right you can select the icon for Open Keyboard Shortcuts (JSON).

Alternatively use the keyboard shortcuts Crtl+Shift+p and search for “Open Keyboard Shortcuts (JSON)”

Paste in your shortcut, in this case duplicating lines, which is missing in Ubuntu VS Code:

1// Place your key bindings in this file to override the defaults
3 {
4 "key": "shift+alt+down",
5 "command": "editor.action.copyLinesDownAction",
6 "when": "editorTextFocus && !editorReadonly"
7 },
8 {
9 "key": "shift+alt+up",
10 "command": "editor.action.copyLinesUpAction",
11 "when": "editorTextFocus && !editorReadonly"
12 }

Shout out to Caleb Porzio for the suggestion of adding in shortcuts for the sidebar defaults, “explorer”, “git” (scm), “debug” and “extensions”. The default shortcuts are a bit inconsistent.

2 {
3 "key": "ctrl+k ctrl+e",
4 "command": "workbench.view.explorer"
5 },
6 {
7 "key": "ctrl+k ctrl+g",
8 "command": "workbench.view.scm"
9 },
10 {
11 "key": "ctrl+k ctrl+d",
12 "command": "workbench.view.debug"
13 },
14 {
15 "key": "ctrl+k ctrl+x",
16 "command": "workbench.extensions.action.showInstalledExtensions"
17 }

Remove the clutter

Another tip from Caleb Porzio is removing all the clutter in the editor and moving the sidebar.

Add these “optional” setting to the settings.json file, you can access it with Crtl+Shift+p.

2 "workbench.activityBar.visible": false,
3 "workbench.editor.showTabs": false,
4 "workbench.sideBar.location": "right",
5 "workbench.statusBar.visible": false,
6 "editor.minimap.enabled": false