DEV Community

jgngo
jgngo

Posted on

VSCode Tips

If you have 11 minutes to spare, watch this first. The general principle is:

[🐭 Mouse (Slow) and 🎹 Keyboard (Fast)]

Speed Selection

If you work with tags (HTML, Vue, React), the most common task involves moving an entire tag to another location or file. Amateur coders will use a mouse to highlight the block of code and then cut and paste.

To save time, move your cursor to the start tag, for example somewhere in <div>. Then press Alt-Shift-Right Arrow. The first stroke selects the word, then repeat the action until the selection is all the way to the closing </div>.

From here, you can then cut (Ctrl-X) or move (Alt-Up/Down Arrow) the selected code.

Ctrl-D: Quickly select the entire word where the cursor is. Press again to select the same word in a another location. Since there are multiple cursors, deleting or typing will make edits simultaneously.

Deleting Lines

Ctrl-Shift-K: Deletes the entire line where the cursor is

Navigation

Ctrl-P: Allows you to open a file directly without using the mouse to locate it in a file directory.

Ctrl-Shift-Period: Opens a navigator to quickly jump to particular sections of code.

Enjoy your free time!

Top comments (2)

Collapse
 
andrewbaisden profile image
Andrew Baisden

Lots of great tips thanks for sharing them! I know all VS Code users will find this worthwhile.

Collapse
 
rifat17 profile image
rifat17

Ctrl-Shift-Period!, wow! thanks.