VS Code Setup and WSL2 IntegrationLesson 5.2
How to configure VS Code settings and keybindings
settings.json, user vs workspace settings, common developer settings, editor.formatOnSave, tabSize, defaultFormatter, keybindings.json, useful built-in shortcuts
VS Code Settings and Keybindings
VS Code stores configuration in JSON files. User settings apply globally; workspace settings (.vscode/settings.json) apply to one project and can override user settings.
Open settings.json
# Command Palette (Ctrl+Shift+P):
# Preferences: Open User Settings (JSON)Recommended developer settings
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.fontSize": 14,
"terminal.integrated.defaultProfile.linux": "zsh",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}Essential built-in keyboard shortcuts
Ctrl+P # quick file open
Ctrl+Shift+P # command palette
Ctrl+B # toggle sidebar
Ctrl+/ # toggle line comment
Alt+Up/Down # move line up or down
Shift+Alt+F # format document
Ctrl+D # select next occurrenceCustom keybinding example
[
{
"key": "ctrl+shift+t",
"command": "workbench.action.terminal.new"
}
]