In this article, I will introduce popular visual studio code shortcuts in the process of website development.
Visual Studio Code Shortcuts
1) Toggle Sidebar
macOS: command
+ b
.
Windows: ctrl
+ b
.
2) Command Palette
macOS: command
+ shift
+ p
.
Windows: ctrl
+ shift
+ p
.
3) Toggle Line Comment
macOS: command
+ /
.
Windows: ctrl
+ /
.
4) Quick Open File
macOS: command
+ p
.
Windows: ctrl
+ p
.
5) Comment Code Block
macOS: shift
+ option
+ a
.
Windows: shift
+ alt
+ a
.
6) Copy Lines Or Block
macOS: shift
+ option
+ ↑
or ↓
.
Windows: shift
+ alt
+ ↑
or ↓
.
7) Shows Errors and Warnings
macOS: command
+ shift
+ m
.
Windows: ctrl
+ shift
+ m
.
8) Switch tabs
macOS: command
+ 1
or command
+ 2
or command
+ 3
.
Windows: ctrl
+ 1
or ctrl
+ 2
or ctrl
+ 3
.
9) Multi Select Cursor
macOS: command
+ d
.
Windows: ctrl
+ d
.
10) Open Terminal
macOS: command
+ j
.
Windows: ctrl
+ j
.
11) Formats The Entire File
macOS: shift
+ option
+ f
.
Windows: shift
+ alt
+ f
.
12) Move line
macOS: option
+ ↑
or ↓
.
Windows: alt
+ ↑
or ↓
.
13) Go To Definition
macOS/Windows: f12
.
14) Global Find
macOS: command
+ shift
+ f
.
Windows: ctrl
+ shift
+ f
.
15) Toggle suggestions
macOS: command
+ i
.
Windows: ctrl
+ i
.
16) Zen mode
macOS: command
+ k
then z
.
Windows: ctrl
+ k
then z
.
Note that you do not press these three keys at the same time. We just hold the ctrl or command button with the k key. Then release and then press the z key.
17) Split VS Code Screen
macOS: command
+ \
.
Windows: ctrl
+ \
.
18) Go To Line
macOS: ctrl
+ G
.
Windows: ctrl
+ G
.
19) Navigation History
Windows/macOS: ctrl
+ tab
.
20) Fold Code Block
macOS: command
+ option
+ [
.
Windows: ctrl
+ shift
+ [
.
21) Choose Programming Languages
Many times there will be many file extensions that cannot be detected by vs code. Therefore, the shortcut below will help you choose the appropriate programming language for that file.
macOS: command
+ k
then m
.
Windows: ctrl
+ k
then m
.
22) Go To The Begin Or End Of File
macOS: command
+ ↑
or ↓
.
Windows: ctrl
+ home
or end
.
23) Rename
Windows/macOS: f2
.
24) Trim Spaces
macOS: command
+ k
+ x
.
Windows: ctrl
+ k
+ x
.
25) Show Keyboard Shortcuts
macOS: command
+ k
then command
+ s
.
Windows: ctrl
+ k
then ctrl
+ s
.
Related Articles
- Best Themes Visual Studio Code For Developers
- Best Code Editor For Developer
- Best Visual Studio Code Extensions For Web Developer
Summary:
I hope the article will find common shortcuts in visual studio code and if you have any questions, just send an email and I will respond as soon as possible. I hope you continue to support the site so that I can write more good articles. Have a nice day!