Version: 1.0.0
Last Updated: 2021-11-29 12:43:49PM
- https://github.com/hl2guide/Awesome-Visual-Studio-Code-Extensions
- https://github.com/hl2guide/Awesome-Visual-Studio-Code-Keyboard-Shortcuts
The vast majority of efficient input comes from typing on the keyboard.
Learn the keyboard shortcuts, focusing on the ones that you will use the most using the below Keyboard Reference Sheets.
This guide uses the Windows keyboard shortcuts.
These are the official Microsoft PDF files:
- Windows: https://go.microsoft.com/fwlink/?linkid=832145
- Linux: https://go.microsoft.com/fwlink/?linkid=832144
- MacOS: https://go.microsoft.com/fwlink/?linkid=832143
To open a file quickly press Ctrl+P
.
To open any recently opened file press Ctrl+R
.
To access the Settings page press Ctrl+,
.
To set your own keyboard shortcuts press Ctrl+K
then Ctrl+S
.
You can set your own custom font (for any installed font) and whether to use font ligatures or not in the Settings page.
Ligatures make it so things like !=
==
and ===
render properly. Fonts must support ligatures for it to take effect.
For all coding I personally recommend using the wonderful font Iosevka: https://github.com/be5invis/Iosevka
Make sure that font installed and appears on an OS level first.
On the settings page use the search bar to search for Font Family
.
For the results:
Code Lens: Font Family
Editor: Font Family
Editor > Inlay Hints: Font Family
SCM: Input Font Family
Markdown > Preview: Font Family
type in Iosevka, sans-serif
.
Then for the results:
Debug > Console: Font Family
Terminal > Integrated: Font Family
type in Iosevka Term, monospace
.
On the settings page use the search bar to search for Editor: Tab Size
.
For the Editor: Tab Size
result set it to your liking. I recommend 4
.
On the settings page use the search bar to search for Editor: Render Whitespace
.
For the Editor: Render Whitespace
result set it to your liking. I recommend all
.
- Your mouse can select text easily in most scenarios.
- Press
Shift+Up
orShift+Down
to select lines.
To add cursors at arbitrary positions, select a position with your mouse and use Alt+Click
.
To set cursors above or below the current position press Ctrl+Alt+Up
or Ctrl+Alt+Down
You can add additional cursors to all occurrences of the current selection by pressing Ctrl+Shift+L
.
To fast scroll press and hold alt
and then press up
or down
or use your mouse wheel.
To resume normal scrolling simply release the alt
key.
To copy and entire line up or down press Shift+Alt+Up
or Shift+Alt+Down
.
To move and entire line up or down press Alt+Up
or Alt+Down
.
Press Ctrl+G
, type in a line number and press Enter
to go a specific line.
Press Ctrl+L
to select the current line that the cursor is at.
Press Ctrl+Shift+K
to delete and entire line.
Select a section of code and then press Ctrl+K
then Ctrl+F
to format selected text.
Press Shift+Alt+F
to format an entire document.
When working with a large document folding (collapsing) sections of code is really useful to focus on a particular section.
- Press
Ctrl+Shift+[
to fold selected lines. - Press
Ctrl+Shift+]
to unfolder selected lines. - Press
Ctrl+K
thenCtrl+0
to fold all sections in a document. - Press
Ctrl+K
thenCtrl+J
to unfold all sections in a document.
Press Ctrl+Shift+M
to view errors and warnings for the current document, depending on the type of document.
For documents that support IntelliSense you can use Ctrl+Space
while coding to get suggestions for method names, parameters etc.
To find a string within the current document:
- Press
Ctrl+F
- Type in the search string
- Press
Enter
to jump to the first result found
To replace one or all occurences of a string within the current document:
- Press
Ctrl+H
- In the first field type in the string to find
- In the second field type in the string to replace with
- Press
Enter
to perform one replacement ORCtrl+Alt+Enter
to replace all occurences
Regular expressions are powerful and allow for:
- Prefixing
- Suffixing
- Pattern Matching
While the replace dialog is active press Alt+R
to toggle regular expressions on or off.
To add a string to the beginning of each line.
Note: (.*)
means "zero or more characters" and $1
means "the entire line".
E.g. to prefix TEXT-
:
- Press
Ctrl+H
- In the first field type in
(.*)
- In the second field type in the string
TEXT-$1
- Press
Enter
to perform one replacement ORCtrl+Alt+Enter
to replace all occurences
To add a string to the end of each line.
Note: (.*)
means "zero or more characters" and $1
means "the entire line".
E.g. to suffix .zip
:
- Press
Ctrl+H
- In the first field type in
(.*)
- In the second field type in the string
$1.zip
- Press
Enter
to perform one replacement ORCtrl+Alt+Enter
to replace all occurences
Note: (.*)
means "zero or more characters".
To replace all lines that contain A1
with paper
:
- Press
Ctrl+H
- In the first field type in
(.*)A1(.*)
- In the second field type in the string
paper
- Press
Enter
to perform one replacement ORCtrl+Alt+Enter
to replace all occurences
For more info on the power of regular expressions please refer to: Use regular expressions in Visual Studio
Have fun!