VS Code Multi-Cursor Editing Tricks That Will Actually Change How You Code

VS Code Multi-Cursor Editing Tricks That Will Actually Change How You Code

Photo by Rahul Mishra on Unsplash

So I was refactoring a config file at some ungodly hour — something like 60 lines of nearly identical JSON keys — and my coworker walked by and watched me manually editing each one. He just stared at me for a second, said nothing, and reached over to hit three keystrokes. Suddenly there were cursors on every single line simultaneously. I felt like an idiot. That was the day I actually sat down and learned VS Code multi-cursor editing properly, and I haven't looked back since.

If you're still editing repetitive code line by line, this post is going to feel like cheating. Good.

The Basic Multi-Cursor Shortcut Everyone Knows (But Uses Wrong)

Most people know you can hold Alt (or Option on Mac) and click to drop multiple cursors wherever you want. That's fine. But I see people using this to click on 30 individual lines, which defeats the entire purpose. That's like using a nail gun to tap in one nail at a time.

The move you actually want for stacked, consecutive lines is Ctrl+Alt+Down (or Cmd+Option+Down on Mac) to add a cursor one line below, repeatedly. Hold it down and watch the cursors stack. Then just type and every line gets the same edit simultaneously. Want to go upward? Ctrl+Alt+Up. Simple, fast, and honestly satisfying in a weird way.

The One That Actually Saves the Most Time: Select All Occurrences

Here's the thing though — the real power move is selecting every instance of a variable, class name, or string across your entire file at once.

Highlight any word, then hit Ctrl+Shift+L (Windows/Linux) or Cmd+Shift+L (Mac). VS Code will drop a cursor on every single occurrence of that selection in the file. Now you can rename, wrap, delete, or transform all of them at the same time. No regex. No find-and-replace dialog. Just... done.

There's also Ctrl+D (Cmd+D on Mac) which selects the next occurrence one at a time — useful when you want to be selective. Hit it a few times to grab just the ones you want, skip one with Ctrl+K, Ctrl+D, then edit. I use this probably a dozen times a day.

Column (Box) Selection — The Underrated One

This one genuinely surprises people. If your code has a block of text aligned vertically — like a list of variable assignments — you can select a column across multiple lines and edit all of them at once.

Hold Shift+Alt and then drag your mouse down (or use Shift+Alt+Down arrow key). You'll get a rectangular selection, not a line-by-line one. This is perfect for things like adding a prefix to a bunch of property names, or ripping out a column of data you don't need.

Honestly, this is the feature I show new devs first because it looks like magic and it gets them interested in learning the rest.

Insider Trick #1: Multi-Cursor With Find and Replace

Most people treat Find & Replace (Ctrl+H / Cmd+H) as a separate tool from multi-cursor editing. But here's something a lot of folks miss — when you're in the Find widget (Ctrl+F), you can click the little "Select All Occurrences" button (or press Alt+Enter) and it dumps you back into the editor with every match already selected as a multi-cursor.

This means you can use regex to find a complex pattern, hit Alt+Enter, and then surgically edit every match live in context. Way more intuitive than trying to write a regex replacement string — especially when you just want to see what you're changing before you commit to it.

Insider Trick #2: Middle Mouse Button for Cursors

If you're on a machine with a middle mouse button, you can hold Alt and middle-click drag to do a column selection without using the keyboard at all. It's a small thing, but on a large monitor with a lot of vertical code, it's surprisingly fast.

(Side note: VS Code's settings for multi-cursor behavior live under File > Preferences > Settings — search for editor.multiCursorModifier if you want to swap Alt for Ctrl as your multi-cursor key. Some people prefer it, especially if Alt conflicts with system shortcuts on Linux.)

Practical Example: Renaming Object Keys in Bulk

Say you've got something like this:

const config = {
  user_name: "",
  user_email: "",
  user_phone: "",
  user_address: "",
};

You need to strip the user_ prefix from every key. Just double-click user_name to select it, then use Ctrl+D three more times to grab all four occurrences of user_ (you'd select just that prefix part). Then delete. Four lines, one action. Done in two seconds.

Now here's where it gets tricky — sometimes the occurrences you're selecting with Ctrl+D are context-dependent and you'll accidentally grab one you didn't want. That's what Ctrl+K, Ctrl+D is for — it skips the current selection and jumps to the next one without adding a cursor there. Think of it as "skip this one."

Quick Reference Cheat Sheet

Since I know someone's going to want this in a copy-paste format:

Add cursor below:         Ctrl+Alt+Down     (Cmd+Option+Down on Mac)
Add cursor above:         Ctrl+Alt+Up       (Cmd+Option+Up on Mac)
Select next occurrence:   Ctrl+D            (Cmd+D on Mac)
Skip current occurrence:  Ctrl+K, Ctrl+D    (Cmd+K, Cmd+D on Mac)
Select all occurrences:   Ctrl+Shift+L      (Cmd+Shift+L on Mac)
Column selection drag:    Shift+Alt+drag
Select all find matches:  Alt+Enter (while Find widget is open)

In my experience, the biggest barrier to using multi-cursor editing consistently isn't knowing the shortcuts — it's building the reflex to reach for them instead of defaulting to manual edits. The next time you catch yourself about to edit three or more similar lines by hand, stop. That's your signal.

Hope this saves you a few hours of tedious editing. Your future self will thank you — probably at 2am during a refactor.

Related: VS Code Tips and Tricks That Actually Save You Time (Not Just the Obvious Ones)

๋Œ“๊ธ€

Mojang Session Servers Down? Here's Why You Can't Log Into Minecraft Right Now

Photo by Patrik Kernstock on Unsplash So you sit down to play some Minecraft, probably after a long day, maybe you've got friends waiting in a server lobby, and you get smacked with this: Failed to connect to the server. Error: Authentication servers are down for maintenance. Or sometimes it shows up as: Failed to login: Invalid session (Try restarting your game and the launcher) Yeah. The Mojang session servers are down, or at least they're not talking to your game properly. I've seen this come up constantly in forums and Discord servers whenever there's a Mojang outage, and the frustrating part is — half the time people don't even realize it's not their fault. Here's what's actually going on. Why This Happens Minecraft doesn't just let you waltz into a multiplayer server. Every time you connect, your client reaches out to Mojang's session servers at session.minecraft.net to verify you...

what is art therapy AI painting checker Introducing the AI HTP Test Site: A New Era in Art Therapy

 #what is art therapy #art therapy activities   AI Art Above is the AI ​​picture psychological test. Below is the AI ​​HTP tree human house test.  Psychotherapy test AI Art Psychotherapy HTP test Introducing the AI HTP Test Site: A New Era in Art Therapy What Is HTP? HTP (House-Tree-Person) is a well-known projective drawing test commonly used in art therapy and psychological evaluation. Participants draw a house, a tree, and a person, and mental health professionals interpret these drawings to gain insights into the individual’s emotional state, personality traits, and underlying issues. AI Meets HTP Thanks to advancements in artificial intelligence, the HTP test has evolved. Our AI HTP Test Site allows you to upload your drawings and receive a detailed, automated analysis. The system evaluates various elements—line thickness, spatial arrangement, color usage, and more—to provide immediate, data-drive...

์ด ๋ธ”๋กœ๊ทธ ๊ฒ€์ƒ‰

Zoho Mail IMAP Not Working: Every Fix I've Actually Used

Quick Summary Zoho Mail IMAP stops working for the dumbest reasons - wrong port, 2FA blocking app passwords, or DNS that looks fine but isn't. I've fixed this across Outlook 2016, iPhones, Android, and Mac Mail, and the root cause is almost always one of four things. Here's the exact step-by-step with real menu paths so you're not clicking around for two hours like I was the first time. Photo by Juanjo Jaramillo on Unsplash It was a Monday morning. One of our sales guys walks up and says his Outlook stopped pulling emails from Zoho. Just stopped. Overnight. Nothing changed - or so he said. Checked his machine, checked the account settings, everything looked right on the surface. Port 993, SSL enabled, correct email address. And yet. Nothing. Here's the thing - Zoho Mail IMAP issues have this annoying pattern where the settings look correct but something underneath is broken. Could be an app password that got invalidated when someone toggled 2FA. Could be IMAP ac...
↑