Quay lại TIL
2023-05-15Tipsbeginner2 min

VS Code Productivity Shortcuts


# VS Code Productivity Shortcuts

Today I discovered several VS Code shortcuts that have dramatically improved my coding efficiency.

## Ctrl+Shift+L: Multi-Selection Magic

The most impactful shortcut I learned was Ctrl+Shift+L (or Cmd+Shift+L on Mac), which selects all occurrences of the current selection. This is incredibly useful for renaming variables, methods, or making the same edit in multiple places simultaneously.

## Other Useful Shortcuts

- **Alt+Click**: Place multiple cursors exactly where you need them
- **Ctrl+D**: Select the next occurrence of the current selection (great for selective multi-editing)
- **Ctrl+/**: Toggle line comment - works on multiple selected lines
- **Alt+Up/Down**: Move the current line or selection up or down
- **Ctrl+L**: Select the current line

## Impact on Productivity

After just one day of consciously using these shortcuts, I estimate I saved at least 30 minutes of editing time. The multi-selection shortcuts in particular have changed how I approach text editing tasks completely.

I've now created a personal cheat sheet of these shortcuts that I keep visible near my workspace to build the muscle memory.

Code Example

// Some useful VS Code shortcuts:
// Ctrl+Shift+L - Select all occurrences of current selection
// Alt+Click - Insert cursor
// Ctrl+D - Select next occurrence of current selection
// Ctrl+/ - Toggle line comment