Posted 23 Apr 2022 | by anythingultimate
Visual Studio Code Editor's Tricks

 




Check the current version

code -v

Print process usage and additional diagnostics

code --status

Open the current directory with VSCode

Go to that directory, open the terminal, and run

code .

Or write the relative path

code relativePath

Open the current workspace

open vscode terminal

code ~/.bash_profile

Change theme

Preferences → Color Theme → Choose among the default themes

You can use https://vscodethemes.com/ for more custom themes

Change icons

Similarly, you can change icons

Preferences → File Icon Theme → Choose and apply

Change fonts

Take an example fira code .We want to change our font to Fira Code. Download it and Extract the Zip file you just downloaded. In the extracted file, find and open the ttf folder. For every .ttf file in that folder, double-click to install the font.

Go to Settings, under Commonly Used, find the Editor: Font Family .
In the text box, add ‘Fira Code’, at the start of the existing setting. You’ll end up with 'Fira Code', 'Droid Sans Mono', 'monospace', monospace.

in the setting, search for liga and click on edit in settings.json and add "editor.fontLigatures": true

Command pallet

  • Open by Ctrl+p type to search any files in the current workspace

  • Ctrl+p and write @ to get the breakdown of all the code symbols inside the current file

  • Ctrl+p and write : then write line number to go to that line number

  • Ctrl+p and write > or directly Ctrl+Shift+p to run any command on the entire editor. You can also search for commands.

Some keyboard shortcuts

Toggle side bar visibility Ctrl+B

Ctrl+space => Suggestions
Ctrl+Shift+space => Param hints
Ctrl+Shift+z => redo
Ctrl+z => undo
Ctrl+L => highlight line

Auto directory creation

Click on new file icon and write file path with directory for example test/folder/test.js

Move line

Alt+Up arrow | Alt+Down arrow => Move line up or down
Alt+Shift+Up arrow | Alt+Shift+Down arrow | Alt+Ctrl+Shift+Up arrow | Alt+Ctrl+Shift+Down arrow => Copy and paste line

Enable colorizer

Settings and search for coloriz and enable it.

More keyboard shortcuts

Command
Search EverywhereDouble Shift
Find Action...Ctrl+Shift+A
Open Solution or Project...Ctrl+Shift+O
Open File or Folder...Ctrl+O
NuGet Quick ListAlt+Shift+N
Build SolutionCtrl+Shift+B
Show Intention ActionsAlt+Enter
Navigate To...Alt+`
Recent FilesCtrl+Comma
Find UsagesShift+F12
Select In...Alt+F1
Settings...Ctrl+Alt+S
Generate...Alt+Insert
Debug...Alt+Shift+F9
View Breakpoints...Ctrl+Alt+B
Attach to Process...Ctrl+Alt+P
VCS Operations Popup...Ctrl+Alt+Q
Refactor This...Ctrl+Shift+R
Inspect This...Ctrl+Alt+Shift+A
Reformat CodeCtrl+Alt+Enter
Code Cleanup...Ctrl+E, C

Manage projects and solutions

Command
Open Solution or Project...Ctrl+Shift+O
Open File or Folder...Ctrl+O
NuGet Quick ListAlt+Shift+N
Build SolutionCtrl+Shift+B
Build Current ProjectCtrl+Shift+F7
Cancel BuildCtrl+F9

Basic editing

Command
CutCtrl+X
CopyCtrl+C
PasteCtrl+V
Paste as Plain TextCtrl+Alt+Shift+V
Paste from History...Ctrl+Shift+V
Duplicate Line or SelectionCtrl+D
Copy PathsCtrl+Shift+C
Copy ReferenceCtrl+Alt+Shift+C
Save AllCtrl+Shift+S
UndoCtrl+Z
RedoCtrl+Y
Indent SelectionTab
Unindent Line or SelectionShift+Tab
Start New LineShift+Enter
Start New Line Before CurrentCtrl+Enter
Delete LineCtrl+Shift+L
Toggle CaseCtrl+Shift+U
Scratch FileCtrl+Alt+Shift+Insert
Open source in new windowShift+F4
Show WhitespacesCtrl+R, W
Soft-WrapCtrl+E, W

Caret navigation

Command
Move Caret to Previous WordCtrl+Left
Move Caret to Next WordCtrl+Right
Move Caret to Line StartHome
Move Caret to Line EndEnd
Containing DeclarationCtrl+[
Move Caret to Matching BraceCtrl+]
Move Caret to Code Block StartAlt+Shift+[
Move Caret to Code Block EndAlt+Shift+]
Next MethodAlt+Down
Previous MethodAlt+Up
Move Caret to Page TopCtrl+Page Up
Move Caret to Page BottomCtrl+Page Down
Page UpPage Up
Page DownPage Down
Move Caret to Text StartCtrl+Home
Move Caret to Text EndCtrl+End

Select text

Command
Select AllCtrl+A
Left with SelectionShift+Left
Right with SelectionShift+Right
Move Caret to Previous Word with SelectionCtrl+Shift+Left
Move Caret to Next Word with SelectionCtrl+Shift+Right
Move Caret to Line Start with SelectionShift+Home
Move Caret to Line End with SelectionShift+End
Up with SelectionShift+Up
Down with SelectionShift+Down
Select Containing DeclarationCtrl+Shift+[
Move Caret to Code Block Start with SelectionCtrl+Alt+Shift+[
Move Caret to Code Block End with SelectionCtrl+Alt+Shift+]
Move Caret to Page Top with SelectionCtrl+Shift+Page Up
Move Caret to Page Bottom with SelectionCtrl+Shift+Page Down
Page Up with SelectionShift+Page Up
Page Down with SelectionShift+Page Down
Move Caret to Text Start with SelectionCtrl+Shift+Home
Move Caret to Text End with SelectionCtrl+Shift+End
Extend SelectionCtrl+Alt+Right
Shrink SelectionCtrl+Alt+Left

Multiple carets and selection ranges

Command
Add/Remove CaretAlt+Shift+Click
Toggle Column Selection ModeAlt+Shift+Insert
Clone Caret AboveDouble Ctrl + Up
Clone Caret BelowDouble Ctrl + Down
Clone Caret Above with Virtual SpaceAlt+Shift+Up
Clone Caret Below with Virtual SpaceAlt+Shift+Down
Add Caret to Each Line in SelectionAlt+Shift+G
Add Selection for Next OccurrenceAlt+Shift+.
Select All OccurrencesAlt+Shift+;
Deselect Last OccurrenceAlt+Shift+Comma
Create Rectangular SelectionAlt+Shift+Middle-Click
Drag to Create Rectangular SelectionAlt+Click
Drag to Create Multiple Rectangular SelectionsCtrl+Alt+Shift+Click

Coding assistance

Command
Show Intention ActionsAlt+Enter
Basic CompletionCtrl+Space
Type-Matching CompletionCtrl+Alt+Space
Second Basic CompletionAlt+Shift+Space
Complete Current StatementCtrl+Shift+Enter
Reformat CodeCtrl+Alt+Enter
Parameter InfoCtrl+Shift+Space
Quick DocumentationCtrl+Shift+F1
Move Statement UpCtrl+Alt+Shift+Up
Move Statement DownCtrl+Alt+Shift+Down
Move Element LeftCtrl+Alt+Shift+Left
Move Statement RightCtrl+Alt+Shift+Right
Move Line UpN/A
Move Line DownN/A
Comment with Line CommentCtrl+Alt+/
Comment with Block CommentCtrl+Shift+/
Generate...Alt+Insert
Code Cleanup...Ctrl+E, C
Silent Code CleanupCtrl+E, F

Context navigation

Command
Next MethodAlt+Down
Previous MethodAlt+Up
Go to Line/Column...Ctrl+G
SwitcherCtrl+Tab
Select In...Alt+F1
Locate/Select in Solution ViewAlt+Shift+L
Recent FilesCtrl+Comma
Recently Changed FilesCtrl+Shift+Comma
Last Edit LocationCtrl+Shift+Backspace
BackCtrl+Minus
ForwardCtrl+Shift+Minus
Select Next TabAlt+Right
Select Previous TabAlt+Left
Show BookmarksCtrl+`
Toggle BookmarkCtrl+K, K
Toggle Bookmark with MnemonicCtrl+F11
Add to FavoritesAlt+Shift+F
Show Favorites windowAlt+2
Show Structure windowCtrl+Alt+F
Show Find windowAlt+3

Find everything

Command
Search EverywhereDouble Shift
Find...Ctrl+F
Find Next / Move to Next OccurrenceF3
Find Previous / Move to Previous OccurrenceShift+F3
Replace...Ctrl+H
Find in Files...Ctrl+Shift+F
Replace in Files...Ctrl+Shift+H
Next Occurrence of the Word at CaretCtrl+F3
Go to File...Ctrl+Shift+T
File MemberAlt+\
Go to Symbol...Ctrl+Alt+Shift+T
Find Action...Ctrl+Shift+A

Navigate from symbols

Command
Navigate To...Alt+`
Find UsagesShift+F12
Go to Declaration or UsagesF12
Go to Type DeclarationCtrl+Shift+F11
Show UsagesAlt+Shift+F12
Go to Super MethodAlt+Home
Go to Implementation(s)Ctrl+F12
Go to Derived SymbolsAlt+End
Highlight Usages in FileAlt+Shift+F11

Code analysis

Command
Show Intention ActionsAlt+Enter
Next Code IssueAlt+Page Down
Previous Code IssueAlt+Page Up
Next ErrorAlt+Shift+Page Down
Previous ErrorAlt+Shift+Page Up
Toggle Code InspectionCtrl+Alt+Shift+8
Run Inspection by Name...Ctrl+Alt+Shift+I
Inspect This...Ctrl+Alt+Shift+A
Show Errors in Solution windowCtrl+Alt+2
Show Inspection Results windowCtrl+Alt+4

Run and debug

Command
Run context configurationCtrl+F5
Run...Ctrl+Alt+Shift+R
Debug context configurationAlt+F5
Debug...Alt+Shift+F9
Attach to Process...Ctrl+Alt+P
StopShift+F5
PauseCtrl+Alt+Break
Resume ProgramF5
Stop Background Processes...Ctrl+Shift+F2
Step OverF10
Force Step OverAlt+Shift+F8
Step IntoF11
Smart Step IntoShift+F7
Force Step IntoAlt+F11
Step OutShift+F11
Run To CursorCtrl+F10
Force Run To CursorCtrl+Alt+F9
Skip to CursorCtrl+Shift+F10
Show Execution PointAlt+NumPad *
Evaluate Expression...Shift+F9
Quick Evaluate ExpressionCtrl+Alt+F8
Toggle Line BreakpointF9
Toggle Temporary Line BreakpointCtrl+Alt+Shift+F8
Toggle Breakpoint EnabledCtrl+F9
View Breakpoints...Ctrl+Alt+B
Edit BreakpointAlt+F9
Show Build windowAlt+0
Show Run windowAlt+4
Show Debug windowAlt+5
Show NuGet windowAlt+7

Refactorings

Command
Refactor This...Ctrl+Shift+R
Rename...Ctrl+R, R
Change Signature...Ctrl+R, S
Inline...Ctrl+R, I
Move...Ctrl+R, O
Extract Method...Ctrl+R, M
Introduce Field...Ctrl+R, F
Introduce Parameter...Ctrl+R, P
Introduce Variable...Ctrl+R, V
Safe Delete...Ctrl+R, D

Global VCS actions

Command
VCS Operations Popup...Ctrl+Alt+Q
Commit...Ctrl+Alt+K
Update ProjectCtrl+Alt+W
RollbackCtrl+Alt+Z
Push...Ctrl+Shift+K
Next ChangeCtrl+Alt+Shift+N
Previous ChangeCtrl+Alt+Shift+P
Show Version Control windowAlt+9
Show Commit windowN/A

Unit testing

Command
Unit Testing Quick List...Alt+Shift+U
Run Unit TestsCtrl+U, R
Debug Unit TestsCtrl+U, D
Stop ExecutionCtrl+U, S
Repeat Previous RunCtrl+U, U
Rerun Failed TestsCtrl+U, F
Run Tests Until FailureCtrl+U, W
Run All Tests from SolutionCtrl+U, L
Create New SessionCtrl+U, N
Append Tests to SessionCtrl+U, A
Run Current SessionCtrl+U, Y
Run Unit Tests under dotMemory UnitCtrl+U, M
Run Selected TestsShift+Enter
Debug Selected TestsCtrl+D
Run Current Session (Tool Window)Ctrl+Y
Create New Session (Tool Window)Alt+Shift+Insert
Append Tests to Session (Tool Window)Ctrl+Alt+Insert
Remove Selected Tests (Tool Window)Delete
Run All Tests from Solution (Tool Window)Ctrl+L
Show Unit Tests windowAlt+8

Tool windows

Command
Hide Active Tool WindowShift+Escape
Hide All Tool WindowsCtrl+Shift+F12
Jump to Last Tool WindowCtrl+Alt+Backspace
Show Solution windowCtrl+Alt+L
Show Favorites windowAlt+2
Show Find windowAlt+3
Show Run windowAlt+4
Show Debug windowAlt+5
Show Structure windowCtrl+Alt+F
Show Services windowN/A
Show Version Control windowAlt+9
Show Commit windowN/A
Show Build windowAlt+0
Show Errors in Solution windowCtrl+Alt+2
Show Inspection Results windowCtrl+Alt+4
Show NuGet windowAlt+7
Show Unit Tests windowAlt+8
Show Terminal windowCtrl+Alt+1
Show Database windowCtrl+Alt+3
Liked This Page. Spare a while to share it.

About The Admin Of This Blog:

Author Of This Article

I am a passionate and experienced Full Stack Web Developer having 4+ years of experience in Web Development using Laravel, React, WordPress, Angular, Vue, Bootstrap, Tailwind CSS, Saas, ES6, etc. I like to explore and learn about new technologies whenever I get any chance.

Stay Connected With Me On GooglePlus, Facebook And Twitter

Calculator

C
±
x ²
%
7
8
9
*
(
4
5
6
/
)
1
2
3
-
+
0
.
=
x ²
x^
sin
cos
tan
x !
π
C
log
ln
e
rad
7
8
9
*
(
4
5
6
/
)
1
2
3
-
+
0
.
%
±
=

Calender

Sa
Su
Mo
Tu
We
Th
Fr

Total Blog Views