Aug 24, 2024

My Favorite VS Code Shortcuts

My Favorite VS Code Shortcuts

Here are some simple VS Code shortcuts I use all the time to speed up my work:

1. Open Files Fast

Find and open files quickly:

Cmd + P (Mac) / Ctrl + P (Windows)

2. Toggle Terminal

Show or hide the terminal easily:

Ctrl + `

3. Edit Multiple Lines

Add multiple cursors to edit several places at once:

Alt + Click

4. Comment Code

Add or remove comments from code:

Cmd + / (Mac) / Ctrl + / (Windows)

5. Go to Line

Jump to a specific line in the file:

Cmd + G (Mac) / Ctrl + G (Windows)

6. Go to Definition

Jump to where a function or variable is defined:

F12

7. Rename Symbol

Change the name of a variable or function everywhere it appears:

F2

8. Open Command Palette

Use commands quickly by opening the command palette:

Cmd + Shift + P (Mac) / Ctrl + Shift + P (Windows)

9. Duplicate Line

Copy the current line and paste it below:

Shift + Option + Down (Mac) / Shift + Alt + Down (Windows)

10. Move Line Up/Down

Move the line up or down:

Option + Up/Down (Mac) / Alt + Up/Down (Windows)

11. Format Code

Automatically format your code:

Shift + Option + F (Mac) / Shift + Alt + F (Windows)

12. Open/Close Sidebar

Show or hide the sidebar panel:

Cmd + B (Mac) / Ctrl + B (Windows)

13. Find and Replace

Search and replace text in the file:

Cmd + F / Cmd + Shift + F (Mac)  
Ctrl + F / Ctrl + Shift + F (Windows)

14. Split Editor

Open two editor views side by side:

Cmd + \ (Mac) / Ctrl + \ (Windows)

OTHER POSTS

Use npm scripts to Simplify Daily Tasks

Running long terminal commands over and over? Automate them with simple npm scripts in your package.json.

Read more →

Learn Faster with Browser DevTools Tricks

Your browser is more powerful than you think. Chrome/Edge/Firefox DevTools can save you tons of time debugging and experimenting directly in the browser.

Read more →

Fix "Email in this signature doesn't match the committer email" on GitHub

Pushed a signed GPG commit only to get a warning that the signature is unverified because of an email mismatch? Here is how to sync your GPG identity with Git.

Read more →

How to Set Up Verified GPG Commit Signing on GitHub

Tired of seeing the "Unverified" badge on your GitHub commits? Setting up a GPG key signs your commits cryptographically, proving to your team (and future employers) that the code actually came from you.

Read more →