- Print command line help
Code.exe --help - Print version
Code.exe --version - Wait for the files to be closed before returning
Code.exe --wait file1 file2 - Open file at given position
Code.exe --wait file1:lineCode.exe --wait file1:line:column - Specify the directory that user data is kept in
--user-data-dir H:\Documents\tools\VSCode\myDataDir - Specify the directory where the extensions are installed
--extensions-dir H:\Documents\tools\VSCode\extensions
Common Quick Open / Command Palette prefixes:
CtrlP
workbench.action.quickOpen | Quick Open: search and open files in the workspace. | |
> | CtrlShiftP F1 workbench.action.showCommands | Show and run commands from VS Code and extensions. |
@ | CtrlShiftOworkbench.action.gotoSymbol | Go to symbol in the current file (functions, classes, etc.). |
@: | CtrlShiftO,:workbench.action.gotoSymbol | Go to symbol in current file, grouped by category. |
# | CtrlTworkbench.action.showAllSymbols | Go to symbol in the entire workspace. |
: | CtrlGworkbench.action.gotoLine | Go to line (and column) in the current file, e.g. :42:5.::17 goes to the 17-th character.::-17 goes to the 17-th character from the end. |
? | Show help for the available prefix commands in the Quick Open box. |
Display and toggle panels
CtrlShiftPShow All Commands | Show command palette |
CtrlShiftMView: Toggle Problems | Show/hide errors and warnings |
CtrlBView: Toggle Side Bar Visibility | Show/hide left panel |
CtrlAltBView: Toggle Secondary Side Bar Visibility | Show/hide left panel |
CtrlJView: Toggle Panel | Show/hide bottom panel |
CtrlShiftUView: Toggle Output | Show/hide output panel |
CtrlùView: Toggle Terminal | Show/hide terminal |
CtrlShiftùTerminal: Create New Terminal | Create a new terminal |
CtrlMToggle Tab Key Moves Focus | Set/unset mode for changing focus with tab key |
| CtrlK, CtrlS | Display keyboard shortcuts Type the string definition of a shortcut (e.g. ctrl + n), to find where it is used. |
Code: Show Release Notes | Display the last release notes |
Help: About | Display versions of VS Code and its components |
File
| CtrlN double left click on tab menubar New Untitled File | Open new empty editor |
CtrlShiftEView: Show Explorer | Show the file explorer |
Collapse Folders in Explorer | Collapse the folders in the file explorer |
CtrlOFile: Open File… | Open a file |
CtrlRFile: Open Recent… | Open a recent file |
AltShiftRFile: Reveal in File Explorer | Open an OS file explorer with the file being selected |
CtrlTabView: Quick Open Least Recently Used Editor in Group | Navigate backward history of opened tabs |
CtrlShiftTabView: Quick Open Previous Recently Used Editor in Group | Navigate forward history of opened tabs |
| CtrlE CtrlP Go to file… | Go to file |
CtrlK, CtrlOFile: Open Folder… | Open folder |
| CtrlS | Save |
Setting "editor.formatOnSave": false | Do not format on save |
| CtrlK, S | Save all |
CtrlK, EnterView: Keep Editor | Keep the editor open |
CtrlK, ShiftEnterView: Pin EditorView: Unpin Editor | Pin/unpin the editor |
CtrlK, MChange Language Mode | Set the editor language |
| CtrlF4 CtrlW View: Close Editor | Close an editor |
CtrlShiftTView: Reopen Closed Editor | Reopen the last closed editor |
CtrlK, WView: Close All Editors in Group | Close all editors in editor group |
CtrlK, UView: Close Saved Editors in Group | Close saved editors in editor group |
CtrlK, CtrlWView: Close All Editors | Close all editors |
CtrlK, FWorkspaces: Close Workspace | Close workspace Close folder |
Change File Encoding | Reload the file with another encoding |
AltShiftCFile: Copy Path of Active File | Copy the full path of the file in the clipboard |
CtrlK, Pworkbench.action.files.copyPathOfActiveFile | Copy path of file in active editor |
CtrlShiftCOpen new terminal | Open a command window of the operating system |
Display
AltZToggle Word Wrap | Toggle word wrap |
View: Toggle Render Whitespace | Display/undisplay space characters |
View: Toggle Editor Sticky ScrollPreference: editor.stickyScroll.enabled | Toggle sticky scroll (the command View: Toggle Editor Sticky Scroll does not seem to work anymore) |
| F11 | Toggle full screen |
| CtrlK, Z | Toggle the zen mode |
CtrlNum +View: Zoom In | Zoom in |
CtrlNum -View: Zoom Out | Zoom out |
CtrlNum 0View: Reset Zoom | Reset zoom |
editor.inlayHints.enabled | Display/undisplay the inline parameter hints |
editor.guides.indentation | Display/undisplay the indentation guides (vertical lines) |
Folding
CtrlShift)Fold | Fold |
CtrlShift^Unfold | Unfold |
CtrlK, CtrlàFold All | Fold all |
CtrlK, CtrlJUnfold All | Unfold all |
CtrlK, Ctrl&Fold Level 1 | Fold level 1 |
CtrlK, CtrléFold Level 2 | Fold level 2 |
CtrlK, Ctrl"Fold Level 3 | Fold level 3 |
CtrlK, Ctrl'Fold Level 4 | Fold level 4 |
CtrlK, Ctrl(Fold Level 5 | Fold level 5 |
CtrlK, Ctrl-Fold Level 6 | Fold level 6 |
CtrlK, CtrlèFold Level 7 | Fold level 7 |
CtrlK, Ctrl_Fold All Regions | Fold all regions A region is between a comment containing #region Region Name and a comment containing #endregion |
Selection
CtrlLExpand Line Selection | Add the next line to the selection |
AltShift→Expand Selection | Expand Selection (e.g. select the containing node in XML) |
AltShift←Shrink Selection | Shrink Selection |
Multi-selection
CtrlAlt↑Add Cursor Above | Add cursor on previous line |
CtrlAlt↓Add Cursor Below | Add cursor on next line |
| Altleft click | Add cursor |
CtrlF2Change All Occurrences | Select all the instances of the current selection |
CtrlShiftLSelect All Occurrences of Find Match | Select all the instances of the current selection |
CtrlDAdd Selection to Next Find Match | Add the next found match to the current selection |
CtrlK, CtrlDMove Selection to Next Find Match | Unselect the last selection and add the next found match the current selection |
CtrlUCursor Undo | Undo the last cursor state change Useful to undo the last CtrlD or the last CtrlAlt↓. |
Cursor Redo | Redo the previously undone cursor state change |
Edition
CtrlZUndo | Undo |
CtrlShiftZ
CtrlYRedo | Redo |
CtrlShiftKDelete line | Delete line |
Sort Lines Ascending | Sort lines in increasing order |
Sort Lines Descending | Sort lines in decreasing order |
Delete Duplicate Lines | Delete duplicate lines |
| CtrlShiftEnter | Insert Line Above |
| CtrlEnter | Insert Line Below |
| Alt↑ | Move line up |
| Alt↓ | Move line down |
| AltShift↑ | Copy line up |
| AltShift↓ | Copy line down |
| AltSpace | Display autocompletion |
F2Rename Symbol | Rename |
| Ctrl; | Quick fix… |
Ctrl^Indent line | Indent line |
Ctrl)Outdent line | Outdent line |
CtrlK, CtrlCAdd Line Comment | Comment the selected lines |
CtrlK, CtrlURemove Line Comment | Uncomment the selected lines |
Ctrl:Toggle Line Comment | Toggle the line comment on the selected lines |
CtrlShiftAToggle Block Comment | Toggle the block comment on the selected lines |
AltShiftFFormat Document | Reformat the whole document |
CtrlITrigger Suggest | Display the suggestion popup |
Navigation in editor
| Alt← | Go to previous edit location |
| Alt→ | Go to next edit location |
CtrlShiftOGo to symbol in Editor… | Go to a symbol |
AltF8Go to Next Problem (Error, Warning, Info) | Go to next problem |
F8Go to Next Problem in File (Error, Warning, Info) | Go to next problem |
AltShiftF8Go to Previous Problem (Error, Warning, Info) | Go to previous problem |
ShiftF8Go to Previous Problem in File (Error, Warning, Info) | Go to previous problem |
Navigation between editors
| Ctrl⇞ | Next editor |
| Ctrl⇟ | Previous editor |
| CtrlK, O | Open active file in new window |
CtrlShiftNNew Window | New window |
| AltF4 CtrlShiftW Close Window | Close the window |
Ctrl*View: Split Editor | Split editor vertically |
| CtrlK, Ctrl* | Split editor horizontally |
CtrlAlt→View: Move Editor into Next Group | Move editor into next group |
CtrlAlt←View: Move Editor into Previous Group | Move editor into previous group |
| Ctrl& | Set focus on the first tab group |
| Ctrlé | Set focus on the second tab group |
| Ctrl" | Set focus on the third tab group |
| Ctrl' | Set focus on the fourth tab group |
Search/replace
Ctrl↓ScrollLineDown | Scroll down by one line |
Ctrl↑ScrollLineUp | Scroll up by one line |
View: Toggle Locked Scrolling Across Editors | Lock the scrolling of editors |
| CtrlG | Display go to line dialog |
| F12 | Go to the definition of the symbol under the cursor |
CtrlFFind | Search Use the regexp \xa0 to find non breaking spaces |
| F3 | Find next |
| CtrlH | Replace Groups are defined by ( and ).Use $0 to insert the full string, $1 the first group… $$ to insert $.To uppercase a group, use \U$1.\u and \l upper/lowercase a single character, \U and \L upper/lowercase the rest of the matching group.The modifiers can also be stacked: \u\u\u$1 uppercase the first three characters of the group, \l\U$1 lowercase the first character and uppercase the rest. |
CtrlShiftFSearch: Find in Files | Search in files |
F4Search: Focus Next Search Result | Select next search match |
ShiftF4Search: Focus Previous Search Result | Select previous search match |
CtrlShiftHSearch: Replace in Files | Replace in files |
CtrlShiftOGo to symbol in Editor… | Go to a symbol definition in the current editor |
CtrlTGo to symbol in Workspace… | Go to a symbol definition in the workspace |
Comparison of two files
- Using the UI
- Right click on the first file and select
- Right click on the second file and select
- Using the CLI
Code.exe --diff file1 file2 - Using commands
File: Compare Active File With…File: Compare New Untitled Text Files: create a comparison between two empty editable editors
Comparison
Compare: Toggle Inline View | Toggle inline view |
AltF5Go to Next Change | Go to next change |
AltShiftF5Go to Previous Change | Go to previous change |
AltF3Show Next Change | Show next change |
AltShiftF3Go to Previous Change | Show previous change |
Casing
Transform to Lowercase | Convert selection to lowercase |
Transform to Uppercase | Convert selection to uppercase |
Transform to Title Case | Convert selection to titlecase |
Convert Indentation to Spaces | Reindent with spaces |
Convert Indentation to Tabs | Reindent with tabs |
Code navigation
| AltF12 | Peek definition |
| AltShiftF12 | Find all references |
| ShiftF12 | Peek all references |
Source code management
CtrlShiftGView: Show Changes | Show/hide source code management GitLens changes it to CtrlShiftG, G |
Git: Toggle Git Blame Editor Decoration | Show/hide Git blame decorations |
Terminal
Terminal: Toggle Sticky Scroll | Toggle sticky scroll in terminal |
Debug
| CtrlShiftD | Show launch and debug |
CtrlShiftBTasks: Run Build Task | Display the selector to run a build task |
CtrlF5Run: Start Without Debugging | Launch the program |
F5Debug: Start Debugging | Launch the program in debug mode |
F5Debug: Continue | Continue the program in debug mode |
ShiftF5Debug: Stop | Stop the program in debug mode |
CtrlShiftF5Debug: Restart | Relaunch the program in debug mode |
F9Debug: Toggle Breakpoint | Toggle line breakpoint |
ShiftF9Debug: Inline Breakpoint | Toggle inline breakpoint |
F10Debug: Step Over | Step over |
F11Debug: Step Into | Step into |
ShiftF11Debug: Step Out | Step out |
CtrlF11Debug: Step Into Target | Step into callee |
F6Debug: Pause | Step on the first next line to be executed |
Customisation
| CtrlShiftX | Show manage extensions |
Ctrl,Preferences: Open Settings (UI) | Display settings |
Preferences: Open Workspace Settings (JSON) | Open <workspace>/.vscode/settings.json |
Preferences: Open User Settings (JSON) | If there is a profile: open <user-data-dir>/User/profiles/<profile-id>/settings.jsonotherwise: open <user-data-dir>/User/settings.json |
Preferences: Open Application Settings (JSON) | If there is a profile: open <user-data-dir>/User/settings.jsonotherwise: the command is unavailable |
Preferences: Open Default Settings (JSON) | Open defaultSettings.json (where is this file?) |
| CtrlK, CtrlT | Display the theme picker (navigate with ↑/↓, the theme is interactively applied) |
Emmet
Emmet: Balance (outward) | Select the outer node scope |
Emmet: Balance (inward) | Select the inner node scope |
Markdown
CtrlShiftVMarkdown: Open Preview | Show Markdown preview |
CtrlK, VMarkdown: Open Preview to the Side | Show Markdown preview in an editor on the side |
Markdown: Show Source | Open an editor with the source of the Markdown preview currently displayed |
Markdown: Find File References | Find the references to the Markdown file currently displayed |
To set Git bash as the default shell, define in
settings.json:
"terminal.integrated.profiles.windows": { |
Used extensions
- WSL
- Markdown Table Formatter
- Markdown Preview Mermaid Support
- XML
- Code Spell Checker
- to define the used languages, set the property
"cSpell.language": "en,fr"insettings.json.
- to define the used languages, set the property
- Pylance
- Python
- to set the virtual environment to use, run
Python: Select Interpreter. - to define the default virtual environment to use, add
"python.envFile": "${workspaceFolder}/.venv"insettings.json. - to enable type checking, set
python.analysis.typeCheckingModetobasicorstrict.
- to set the virtual environment to use, run
- Docker
Docker Containers: Attach ShellOpen a shell in a running container - Shades of Purple
- GitLab Workflow
gitlab.aiAssistedCodeSuggestions.enabledToggle code completion - Extension Pack for Java
Java: Create Java Project…Launch a wizard to create a Java project - Codeium
Codeium: Provide Authentication TokenDeclare the authentication token CtrlI
CtrlShiftI
Codeium: CommandOpen command AltC Cancel command AltA Accept diff AltR Reject diff AltF Follow-up diff Codeium: Toggle Autocomplete for Current LanguageToggle autocomplete for current language Alt\ Trigger line suggestion Alt[ Show next completion Alt] Show previous completion CtrlAltA
CtrlShiftA
Codeium: Open ChatDisplay the chat Codeium: Focus on Chat ViewDisplay and focus on the chat codeium.enableCodeLensToggle the display of inline action buttons - GitLens (doc)
CtrlShiftG, B
GitLens: Toggle File BlameToggle the display (on the left) of the blaming for each code line GitLens: Toggle Line BlameToggle the display (at the right of the file line) of the blaming for the current line CtrlShiftG, ShiftB
GitLens: Toggle Code LensToggle the display of inlined code blaming GitLens: Toggle File HeatmapToggle the display of the heatmap - Other extensions
"XML Date": { |