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)

๋Œ“๊ธ€

Zoho IMAP Settings: The Complete Fix When Your Email Stops Syncing

Quick Summary Zoho IMAP breaks more often than it should, and the error messages are genuinely useless. The fix is usually a combination of using the right server address, enabling IMAP inside Zoho Mail's settings, and generating an app-specific password. This guide covers the exact steps for Outlook, iPhone, Thunderbird, and Android so you stop going in circles. Photo by Fotis Fotopoulos on Unsplash So your Zoho Mail stopped syncing. Emails aren't coming in, your phone shows a spinning indicator forever, or Outlook throws some vague authentication error and you have no idea what changed. Sound familiar? I've seen this exact situation probably thirty times across different clients, and every single time the person swears they didn't change anything. And honestly? They usually didn't. Zoho changed something on their end, or an app update reset a setting, or someone enabled two-factor authentication without realizing what that does to third-party mail clients. The...

Zoho Mail IMAP Configuration: Exact Settings That Work First Time

Quick Summary Getting Zoho Mail IMAP to work in Outlook or Thunderbird is not as straightforward as Zoho's docs make it sound. The port numbers, SSL settings, and app password requirements catch almost everyone off guard the first time. Here are the exact settings and steps that actually work, without the back-and-forth with support. Photo by Fotis Fotopoulos on Unsplash Last month I spent almost two hours on a Friday afternoon helping a new employee get Zoho Mail working in Outlook. Two hours. The settings look simple on paper — and honestly, they are — but there are two or three specific things that Zoho just does not make obvious, and if you miss any one of them, you get a generic authentication error that tells you absolutely nothing useful. Sound familiar? The thing is, I've set up Zoho IMAP maybe forty times across different clients and different mail apps. Outlook, Thunderbird, Apple Mail, even some third-party Android clients. And every single time, someone new come...

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

Magnesium Glycinate vs Magnesium Citrate: Which One Actually Fixed My Sleep

Quick Summary I spent months trying different magnesium forms after my sleep fell apart, and the difference between glycinate and citrate is way bigger than I expected Glycinate is the gentler, slower option great for sleep and anxiety, while citrate works faster but comes with some digestive surprises nobody warns you about If you're confused about which one to take, this breaks down exactly what each form does and who should actually be using it Photo by Anshu A on Unsplash About two years ago I hit a wall. I was waking up at 3am every single night, my legs felt restless, and I was grinding my teeth so bad my jaw hurt in the morning. My doctor ran some basic labs, everything came back "normal," and I left that appointment feeling completely dismissed. A friend of mine — she's really into functional nutrition — casually mentioned that I might just be magnesium deficient. I kind of rolled my eyes at first. It sounded like one of those wellness buzzwords people throw...
↑