VSCode Cheat Sheet and Knowledgebase

Aus MattWiki
Version vom 27. Oktober 2024, 19:27 Uhr von Matt (Diskussion | Beiträge) (→‎VSCode Configuration)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Application Wide Shortcuts

Shortcut Action
Ctrl + Shift + P Command palette
Ctrl + , Open settings
Ctrl + Zoom in
Ctrl - Zoom out
Ctrl + K Ctrl + T Theme selector

Editor Shortcuts

Window Control

Shortcut Action
Ctrl + 1 Go to first editor panel
Ctrl + 2 / 3 Go to second / third editor panel, create one if not present
Ctrl + ^ Split editor panel
Ctrl + W Close file
Ctrl + Shift + T Reopen last closed file
Ctrl + Tab Next tab
Ctrl + B Toggle sidebar visibility

Navigation

Shortcut Action
Alt + ↑/↓ Move line up/down
Shift + Alt + ↑/↓ Duplicate line up/down
Ctrl + Shift + K Delete line
Ctrl + Z Undo

Multi Cursor Editing

Shortcut Action
Alt + Click Add cursor
Ctrl + D Multi-select word
Ctrl + Shift + Alt + ↑/↓ Add second cursor in the line above or below

Coding

Shortcut Action
Ctrl + # Comment / Uncomment line
Shift + Alt + F Format document
Ctrl + Space Show suggestions

File Management

Shortcut Action
Ctrl + # Comment / Uncomment line
Shift + Alt + F Format document
Ctrl + Space Show suggestions

Terminal Shortcuts

Shortcut Action
Ctrl + ö / Ctrl + ` Toggle terminal panel / Switch to terminal panel, if in editor
Ctrl + Shift + ö Create second terminal tab
Ctrl + L Clear Terminal
Ctrl + Shift + 5 Split Terminal

VSCode Configuration

If not specified otherwise in the following sections always go to Settings first or press Ctrl + ,.

Visibility in Explorer

Hiding or making files or folders visible is implemented with excludes in VSCode.

Go to section: Files: Exclude for all excluding options or specifically for Files Exclude.

Don't Show Suggestions

Section Editor: Quick Suggestions

Disable all for Intellisense. By CTRL + SPACE it can be show again

Don't Show Parameter Hover

Section: Editor > Parameter Hints: Enabled

Suggest Function Parameters with Parenthesis

Section: JavaScript > Suggest: Complete Function Calls

Activate: Complete functions with their parameter signature.

Disable File Switcher List on Ctrl + Tab

Open keybindings.json and add:

[  
    { 
        "other configurations" : "..." 
    },
    {
      "key": "ctrl+tab",
      "command": "workbench.action.nextEditorInGroup"
    },
    {
      "key": "ctrl+shift+tab",
      "command": "workbench.action.previousEditorInGroup"
    }
]

Indentations / Tab Size

For changing default tab size from 4 to 2 in Settings go to section: Editor > Tab Size

Make sure to change it in all profiles or set it in user profile, click on the gear wheel and set to all profiles.

Formatting / Indentation for autoformatting Python with autopep8

Go to section: Extensions > autopep8

Add to args:

--indent-size=2