Skip to the content.

VSCode Productivity Tips & Hacks

Visual Studio Code is the most popular Integrated Development Environment globally. According to Stack Overflow’s 2023 Developer Survey, ~74% of developers prefer VS Code over others.

Stack Overflow’s 2023 Developer Survey

Reference: Stack Overflow’s 2023 Developer Survey

1. Open in VS Code

To open a project in VS Code:

A simpler method is to enable the ‘open with code’ option during VS Code installation, allowing the right-click context menu to open folders in VS Code.

Open in VS Code

If this config was missed initially, re-run the VS Code setup and ensure all checkboxes are checked. Previous configurations remain unchanged.

2. Renaming

Refactoring is essential for improving project quality and maintainability. VS Code facilitates this with the Rename Symbol command (F2).

Renaming in VS Code

3. Multi Cursor

Multi-select cursor allows editing multiple locations simultaneously.

Use these shortcuts to append text at the end of multiple lines.

Multi Cursor

Additional shortcuts:

Multi Cursors for matching words

For renaming values with preserved case, use the ‘Multiple Cursor Case Preserve’ extension.

With Multiple Cursor Case Preserve extension

4. Move Lines Up/Down

Move lines with:

Move lines up/down

5. Copy lines Up/Down

Copy lines with:

To copy a line to a non-adjacent location, use Ctrl + L to select the line, then copy and paste.

Copy lines up/down

6. Delete the Line

Delete a line quickly with:

Alternatively, use Ctrl + X to cut the line.

Delete the line

7. Comment Code Block

Commenting code blocks:

Comment code blocks

8. Code Navigation Backward and Forward

Navigate code with:

Code Navigation

Customize key bindings via File -> Preferences -> Keyboard Shortcuts.

Key-map Personalization

9. Quick Open

Open a file quickly with:

Navigate recently opened files or search by name.

Quick Open

10. Command Palette

Access all VS Code commands with:

Command Palette

11. Global Find

Search within the codebase with:

Filter search areas via the advanced menu.

Global Find

12. Fast Scrolling

Scroll quickly by holding the Alt key while scrolling.

Fast Scrolling

Adjust scroll speed with the editor.fastScrollSensitivity setting.

Bonus: Open terminal outside VS Code with Ctrl + Shift + C

These shortcuts enhance daily productivity in VS Code.

Ref: Yasas Sandeepa - Medium