Tips for VSCode
1. Commands
Command control palette: Ctrl+Shift+P
Use short-cuts for changing view:
New window: Ctrl+N
Open window: Ctrl+O
Close window: Ctrl+F4
Toggle window: Ctrl+tab
Next/previous windows Ctrl+PgUp/PgDn
Open/close sidebar: Ctrl+B
Open/close panel: Ctrl+J
Open explorer: Ctrl+Shift+E
Open source control: Ctrl+Shift+G
Open extensions: Ctrl+Shift+X
See problems: Ctrl+Shift+M
Go to next problem: F8
Locate symbol: Ctrl+Shift+O
Go to symbol: F12 (just peak Alt+F12)
Go to line: Ctrl+G
Zoom: Ctrl++ / Ctrl+-
Zen mode: Ctrl+K,Z
Save file: Ctrl+S
Change settings? Ctrl+,
Change short cuts? Ctrl+K, Ctrl+S
2. Code editing
Use smart short cuts for editing:
Move current line: Alt+↑ / ↓
Copy current line: Alt+Shift+↑ / ↓
Cut current line: Ctrl+X
Indent line: Tab
Deindent line: Shift+Tab
Fold/unfold:
single block: Ctrl+Shift+´ / Ctrl+Shift+å
all: Ctrl+K, Ctrl+1 / Ctrl+K, Ctrl+J
Toggle commment: Ctrl+'
Select multiple occurances: Ctrl+D (undo: Ctrl+U)
Select columns: Ctrl+Shift+Alt
3. Notebook editing
When inside a cell you are in edit mode, when not you are in command mode.
The most important notebook commands are:
Run cell: Ctrl+Enter
Run cell and advance: Shift+Enter
Enter edit mode: Enter
Exit edit mode: Esc
Only in command mode:
Change to markdown cell: M
Change to code cell: Y
Create cell above: A
Create cell belove: B
Delete cell: D+D
Move cell up: Alt+PgUp
Move cell up: Alt+PgUp
Split cell: Ctrl+Shift+-
Copy cell: Ctrl+C
Paste cell: Ctrl+V
Markdown: Guide on writing markdown
Optional: Create Restart-and-Run-All shortcut
Open extensions Ctrl+Shift+X
Search for and install multi-command
Press Ctrl+Shift+P
Use Preferences: Open Keyboard Shortcuts (JSON)
Paste in and save
{
"key": "ctrl+space",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"notebook.clearAllCellsOutputs",
"jupyter.restartkernel",
"notebook.execute"
]
},
"when": "notebookEditable && activeEditor == 'workbench.editor.notebook'"
}