DEV Community

Cover image for Part 2: Advanced Code Editing, Refactoring & Multi-Cursor Power (VS Code Shortcuts for Windows & Mac)!!
Nishkarsh Pandey
Nishkarsh Pandey

Posted on

Part 2: Advanced Code Editing, Refactoring & Multi-Cursor Power (VS Code Shortcuts for Windows & Mac)!!

Welcome back to Part 2 of the series:
“Mastering VS Code Shortcuts: From Beginner to Pro”

In this post, we’re diving into what makes coding in VS Code lightning fast — powerful editing, multi-cursor workflows, and built-in refactoring tools. 🧠⚡

Whether you’re building in React, Python, Rust, or Go — these shortcuts will save you hours over time.

✂️ Code Editing Shortcuts::

Action Windows Mac
Copy Line Up/Down Shift + Alt + ↑ / ↓ Shift + Option + ↑ / ↓
Move Line Up/Down Alt + ↑ / ↓ Option + ↑ / ↓
Delete Line Ctrl + Shift + K Cmd + Shift + K
Insert Line Below/Above Ctrl + Enter / Ctrl + Shift + Enter Cmd + Enter / Cmd + Shift + Enter
Undo / Redo Ctrl + Z / Ctrl + Y Cmd + Z / Cmd + Shift + Z
Indent / Outdent Line Ctrl + ] / [ Cmd + ] / [
Toggle Line Comment Ctrl + / Cmd + /
Block Comment Shift + Alt + A Shift + Option + A

🧙‍♂️ Multi-Cursor Magic::

Action Windows Mac
Add Cursor (Clicking) Alt + Click Option + Click
Add Next Match to Selection Ctrl + D Cmd + D
Select All Matches Ctrl + Shift + L Cmd + Shift + L
Insert Cursor Above/Below Ctrl + Alt + ↑ / ↓ Option + Cmd + ↑ / ↓
Box Selection (Column Mode) Shift + Alt + Drag Option + Shift + Drag
Undo Cursor Stop Ctrl + U Cmd + U

💡 Pro Tip: Multi-cursor editing is perfect for:

Renaming variable instances.
Changing list items.
Bulk editing function params.
Once you master it, you’ll barely need your mouse.

🧠 Refactoring Shortcuts::

Action Windows Mac
Rename Symbol F2 F2
Quick Fix / Lightbulb Ctrl + . Cmd + .
Organize Imports Alt + Shift + O Option + Shift + O
Extract Method / Variable (via Lightbulb / F1) (via Lightbulb / F1)
Show Problems Panel Ctrl + Shift + M Cmd + Shift + M
Navigate Errors F8 / Shift + F8 F8 / Shift + F8

🧩 Quick Fix Tip: When you see that lightbulb icon 💡, hit Ctrl + . / Cmd + . to get refactor suggestions, fix missing imports, or convert inline code to a method.

🏁 Smart Selection Shortcuts::

Action Windows Mac
Expand Selection Shift + Alt + → Shift + Option + →
Shrink Selection Shift + Alt + ← Shift + Option + ←
Select All Occurrences Ctrl + F2 Cmd + F2
Find Next/Previous Occurrence F3 / Shift + F3 Cmd + G / Shift + Cmd + G

✅ Final Thoughts (Part 2)
Editing code is where you spend most of your time — so every second saved here multiplies.

Here’s what to try this week:

Use Alt + Click and Ctrl + D for multi-cursors.

Try F2 to rename variables without searching.

Use Ctrl + . instead of manually fixing imports or errors.

In Part 3, we’ll explore terminal shortcuts, Zen mode, extensions, debugging tools, and customization hacks for your ultimate workflow.

💬 Do you already use multi-cursors? Have a secret shortcut I missed? Let’s talk in the comments! 👇

Top comments (2)

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

been cool seeing steady progress - it adds up. what do you think actually keeps things growing over time? habits? luck? just showing up?

Collapse
 
nish2005karsh profile image
Nishkarsh Pandey

Thanks so much, Nathan — appreciate you following along! 🙌
Great question — honestly, I think it’s a mix. Habits keep the engine running, showing up fuels consistency, and a little luck (like being seen at the right time) can spark that momentum. But without the first two, luck doesn’t have much to land on.
Curious to hear your take too — what’s helped you stay consistent over time?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.