-
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:line
Code.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
CtrlShiftP
Show All Commands | Show command palette |
CtrlShiftM
View: Toggle Problems | Show/hide errors and warnings |
CtrlB
View: Toggle Side Bar Visibility | Show/hide left panel |
CtrlAltB
View: Toggle Secondary Side Bar Visibility | Show/hide left panel |
CtrlJ
View: Toggle Panel | Show/hide bottom panel |
Ctrlù
View: Toggle Terminal | Show/hide terminal |
CtrlM
Toggle 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 |
CtrlShiftE
View: Show Explorer | Show the file explorer |
Collapse Folders in Explorer | Collapse the folders in the file explorer |
CtrlO
File: Open File… | Open a file |
CtrlR
File: Open Recent… | Open a recent file |
AltShiftR
File: Reveal in File Explorer | Open an OS file explorer with the file being selected |
CtrlTab
View: Quick Open Least Recently Used Editor in Group | Navigate backward history of file |
CtrlShiftTab
View: Quick Open Previous Recently Used Editor in Group | Navigate forward history of file |
CtrlE
CtrlP Go to file… | Go to file |
CtrlK, CtrlO
File: Open Folder… | Open folder |
CtrlS | Save |
CtrlK, S | Save all |
CtrlK, Enter
View: Keep Editor | Keep the editor open |
CtrlK, ShiftEnter
View: Pin Editor
View: Unpin Editor | Pin/unpin the editor |
CtrlK, M
Change Language Mode | Set the editor language |
CtrlF4
CtrlW View: Close Editor | Close an editor |
CtrlShiftT
View: Reopen Closed Editor | Reopen the last closed editor |
CtrlK, W
View: Close All Editors in Group | Close all editors in editor group |
CtrlK, U
View: Close Saved Editors in Group | Close saved editors in editor group |
CtrlK, CtrlW
View: Close All Editors | Close all editors |
CtrlK, F
Workspaces: Close Workspace | Close workspace
Close folder |
Change File Encoding | Reload the file with another encoding |
AltShiftC
File: Copy Path of Active File | Copy the full path of the file in the clipboard |
CtrlK, P
workbench.action.files.copyPathOfActiveFile | Copy path of file in active editor |
CtrlShiftC
Open new terminal | Open a command window of the operating system |
Display
AltZ
Toggle Word Wrap | Toggle word wrap |
View: Toggle Render Whitespace | Display/undisplay space characters |
View: Toggle Editor Sticky Scroll
Preference: 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 0
View: 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, CtrlJ
Unfold 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
CtrlL
Expand 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 |
CtrlF2
Change All Occurrences | Select all the instances of the current selection |
CtrlShiftL
Select All Occurrences of Find Match | Select all the instances of the current selection |
CtrlD
Add Selection to Next Find Match | Add the next found match to the current selection |
CtrlK, CtrlD
Move Selection to Next Find Match | Unselect the last selection and add the next found match the current selection |
CtrlU
Cursor Undo | Undo the last cursor state change
Useful to undo cancel the last CtrlD or the last CtrlAlt↓. |
Cursor Redo | Redo the previously undone cursor state change |
Edition
Sort Lines Ascending | Sort lines in increasing order |
Sort Lines Descending | Sort lines in decreasing order |
Delete Duplicate Lines | Delete duplicate lines |
Alt↑ | Move line up |
Alt↓ | Move line down |
AltShift↑ | Copy line up |
AltShift↓ | Copy line down |
CtrlK, CtrlC
Add Line Comment | Comment the selected lines |
CtrlK, CtrlU
Remove Line Comment | Uncomment the selected lines |
Ctrl:
Toggle Line Comment | Toggle the line comment on the selected lines |
CtrlShiftA
Toggle Block Comment | Toggle the block comment on the selected lines |
AltShiftF
Format Document | Reformat the whole document |
CtrlI
Trigger Suggest | Display the suggestion popup |
Navigation in editor
Alt← | Go to previous edit location |
Alt→ | Go to next edit location |
CtrlShiftO
Go to symbol in Editor… | Go to a symbol |
AltF8
Go to Next Problem (Error, Warning, Info) | Go to next problem |
F8
Go to Next Problem in File (Error, Warning, Info) | Go to next problem |
AltShiftF8
Go to Previous Problem (Error, Warning, Info) | Go to previous problem |
ShiftF8
Go 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 |
CtrlShiftN
New 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 |
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 definition of the symbol where is the cursor |
CtrlF
Find | 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. |
CtrlShiftF
Search: Find in Files | Search in files |
F4
Search: Focus Next Search Result | Select next search match |
ShiftF4
Search: Focus Previous Search Result | Select previous search match |
CtrlShiftH
Search: Replace in Files | Replace in files |
CtrlShiftO
Go to symbol in Editor… | Go to a symbol definition in the current editor |
CtrlT
Go 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
Compare: Toggle Inline View | Toggle inline view |
AltF5
Go to Next Change | Go to next change |
AltShiftF5
Go to Previous Change | Go to previous change |
AltF3
Show Next Change | Show next change |
AltShiftF3
Go to Previous Change | Show previous change |
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 |
AltF12 | Peek definition |
AltShiftF12 | Find all references |
ShiftF12 | Peek all references |
CtrlShiftG | Show/hide source code management
GitLens changes it to CtrlShiftG, G |
CtrlShiftD | Show launch and debug |
CtrlShiftB
Tasks: Run Build Task | Display the selector to run a build task |
CtrlF5
Run: Start Without Debugging | Launch the program |
F5
Debug: Start Debugging | Launch the program in debug mode |
F5
Debug: Continue | Continue the program in debug mode |
ShiftF5
Debug: Stop | Stop the program in debug mode |
CtrlShiftF5
Debug: Restart | Relaunch the program in debug mode |
Customisation
CtrlShiftX | Show manage extensions |
Ctrl,
Preferences: Open Settings (UI) | Display settings |
Preferences: Open Worspace Settings (JSON) | Open <workspace>/.vscode/settings.json |
Preferences: Open User Setting (JSON) | If there is a profile: open <user-data-dir>/User/profiles/<profile-id>/settings.json
otherwise: open <user-data-dir>/User/settings.json |
Preferences: Open Application Settings (JSON) | If there is a profile: open <user-data-dir>/User/settings.json
otherwise: 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
CtrlShiftV
Markdown: Open Preview | Show Markdown preview |
CtrlK, V
Markdown: 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
- XML
- Code Spell Checker
- Markdown Table Formatter
- 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.typeCheckingMode
tobasic
orstrict
.
-
to set the virtual environment to use, run
-
Codeium
Codeium: Provide Authentication Token
Declare the authentication token CtrlI
CtrlShiftI
Codeium: Command
Open command AltC Cancel command AltA Accept diff AltR Reject diff AltF Follow-up diff Codeium: Toggle Autocomplete for Current Language
Toggle autocomplete for current language Alt\ Trigger line suggestion Alt[ Show next completion Alt] Show previous completion CtrlAltA
CtrlShiftA
Codeium: Open Chat
Display the chat Codeium: Focus on Chat View
Display and focus on the chat codeium.enableCodeLens
Toggle the display of inline action buttons -
GitLens (doc)
CtrlShiftG, B
GitLens: Toggle File Blame
Toggle the display (on the left) of the blaming for each code line GitLens: Toggle Line Blame
Toggle the display (at the right of the file line) of the blaming for the current line CtrlShiftG, ShiftB
GitLens: Toggle Code Lens
Toggle the display of inlined code blaming GitLens: Toggle File Heatmap
Toggle the display of the heatmap -
Docker
Docker Containers: Attach Shell
Open a shell in a running container - Shades of Purple
-
GitLab Workflow
gitlab.aiAssistedCodeSuggestions.enabled
Toggle code completion -
Extension Pack for Java
Java: Create Java Project…
Launch a wizard to create a Java project - Other extensions