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

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

Photo by Rahul Mishra on Unsplash

So I was refactoring a config file at like 11pm — one of those JSON monsters with 40 nearly identical keys — and I'm sitting there manually editing each line like an absolute caveman. My colleague walks by, watches me for about 10 seconds, and just goes "dude, multi-cursor." I felt mildly humiliated. But also enlightened. That was three years ago and I genuinely use VS Code multi-cursor editing almost every single day now.

If you've never really gone deep on this feature, you're leaving serious time on the table. Let me walk you through how it actually works — not just the obvious stuff, but the bits that take a while to discover on your own.

The Basics: Placing Cursors Manually

The most straightforward way to place multiple cursors is holding Alt (Windows/Linux) or Option (Mac) and clicking wherever you want a cursor. Each click drops a new cursor and you can type, delete, or paste across all of them simultaneously. Sounds simple, but people underestimate how powerful this is for scattered edits that don't follow a pattern.

For adding cursors above or below your current line, use:

Ctrl + Alt + Up/Down Arrow   (Windows/Linux)
Cmd + Option + Up/Down Arrow (Mac)

This is great when you've got a block of lines and you want to append or prepend something to all of them at once. Add a comma, wrap something in quotes, slap a semicolon at the end — whatever you need. Honestly this alone saves me probably 20 minutes a week.

Select All Occurrences — The One You Actually Need

Here's the thing though — the real power move is selecting all occurrences of a word. Highlight a variable name or string, then hit:

Ctrl + Shift + L   (Windows/Linux)
Cmd + Shift + L    (Mac)

Boom. Every single instance of that text in the file gets its own cursor. Now you can rename that variable, wrap it, delete it — all at once, no find-and-replace dialog needed. I use this constantly when renaming things during a quick refactor and I don't want to break out a full rename symbol operation.

Related to this — if you want to select occurrences one at a time (so you can skip certain ones), use:

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

Each press grabs the next match. Hit it once to get the next occurrence, again to get the one after that. If you accidentally grab one you don't want, Ctrl + K then Ctrl + D skips that match and moves to the next. That skip combo took me an embarrassingly long time to find.

Column / Box Selection

Now here's where it gets tricky and honestly where a lot of people don't realize multi-cursor editing applies. Column selection lets you drag a rectangular block across multiple lines — super useful for columnar data, log files, or those moments where you need to edit the 5th character on 20 consecutive lines.

Shift + Alt + drag mouse        (Windows/Linux)
Shift + Option + drag mouse     (Mac)

Or keyboard only — hold Shift + Alt (or Shift + Option) and use arrow keys to extend the column selection. This creates a cursor at the same position on every line in the selection. I've used this to strip out prefixes from a column of values pasted from a spreadsheet more times than I can count.

Insider Trick #1: Multi-Cursor with Regex Find

Okay this one's a bit of a hidden gem. Open Find (Ctrl + F / Cmd + F), enable regex mode with Alt + R, type your pattern, and then hit Alt + Enter. This selects every match in the file as a cursor simultaneously. No extra steps.

So say you've got a bunch of lines like const foo = "bar" and you want to grab just the values inside the quotes — write a regex for that, hit Alt + Enter, and now you've got cursors inside every quoted string. From there you can type, wrap with something, whatever you need. Combine this with capture groups and your Find/Replace and you've basically got a tiny sed command right inside the editor.

Insider Trick #2: Cursor Undo

This one saves me when I go a bit trigger-happy with Ctrl + D and grab too many occurrences. Instead of pressing Escape and losing all your cursors, hit:

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

This undoes the last cursor action — so you can step back one cursor at a time without blowing up your whole multi-selection. It's the undo button specifically for cursor placement, not for text changes. Took me forever to stumble on this and I've never seen it mentioned in any quick tips article.

A Few Settings Worth Tweaking

If you're doing heavy multi-cursor work, there's one setting worth knowing about. By default, VS Code uses Alt+Click to place cursors, but if you're on certain laptop trackpads or Linux setups, that can conflict with system shortcuts. You can change the multi-cursor modifier in settings:

Go to File → Preferences → Settings and search for editor.multiCursorModifier. Switch it from alt to ctrlCmd if you're having conflicts. Small thing but it's annoying as hell when your cursor shortcuts keep getting intercepted by your OS.

Also — if you want to see your cursors more clearly (especially on dark themes where the thin blinking line disappears), bump up editor.cursorWidth to something like 3 or 4 in your settings JSON. Way easier to track multiple cursors when they're actually visible.

When Multi-Cursor Isn't the Right Tool

Worth saying — multi-cursor editing is amazing for structural edits and quick renames within a file, but if you're doing a rename across an entire codebase, use the actual rename symbol feature (F2) or a proper find-and-replace across files (Ctrl + Shift + H). I've seen people try to multi-cursor their way through a 50-file refactor and it's... not pretty. Right tool for the right job.

But for single-file work, repetitive edits, column transformations, and quick renames? Multi-cursor is faster than anything else. Get these shortcuts into muscle memory and you'll wonder how you coded without them. Hope this saves you from your own 11pm caveman moment.

Related: VS Code Tips and Tricks That Actually Save You Time (No Fluff)

๋Œ“๊ธ€

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...
↑