Multi-cursor editing in VS Code

preview_player
Показать описание
An introduction and comprehensive look at multi-cursor editing in VS Code.

As the name suggests, multi-cursor lets you create multiple cursors in a file. This is an advanced feature but once you get used to working with multiple cursors, you'll find that you can use them to transform text in really interesting ways and that multi-cursors becomes an invaluable part of your workflow.

This video covers the basics of multi-cursors, the different ways in which you can create multiple cursors, some of the unique behaviors of multi-cursor editing, and the settings related to VS Code's multi-cursor support.

The video targets people who have some experience with VS Code and are now interested in exploring more advanced features and improving their editing skills. Unfortunately, while I can tell you all about VS Code's multi-cursor support, to become an effective user of multi-cursors you really need to start using yourself. I highly encourage you to experiment with multi-cursor editing and seeing what you can do with it. If you discover anything neat, be sure to post it in the comments so that others can learn too!

= Sections =

00:00 Introduction

01:12 Add Selection to Next Find Match and multi-cursor basics
04:27 Clearing Multi-Cursors
04:55 Cursor Undo/Redo
06:07 Add Selection To Previous Find Match
06:54 Match Case and Match Whole Word
09:40 Select All Occurrences of Find Match

11:42 Creating Cursors With the Mouse

15:10 Multi-Cursor Behavior — Cursor merging
18:35 Multi-Cursor Behavior — Copy / paste

21:27 Add Cursor Above / Below
25:22 Column / Box Selection

27:30 Add Cursors to Top / Bottom
28:34 Add Cursors to Line Ends

29:14 Conclusion
Рекомендации по теме
Комментарии
Автор

Thanks, you are a life saver; saving me so much time. One of my bigger struggles learning to code and build stuff, is knowing how to ask the right questions to solve your problems. I had never heard of multi-cursor but had seen a few people on YouTube 'do that trick' and wondered how they were doing it. Thanks for the explanation. This will be going on my web-dev resources playlist, as I'm sure I'll need to come back to it as I progress and in learning and skill.

TinyMaths
Автор

Thanks for taking time, to give thorough usecase of multi cursor editing. This surely gonna save time me a lot !

PremKumar-uyjd
Автор

two more: the first time you ctrl-d, if there is no selection, VSC selects the current word for you.
to skip one or more incidences using ctrl-d, you can alternate between ctrl+d and option+click. So Ctrl + D, Ctrl + D, option+click, Ctrl + D

AniishAu
Автор

Thankyou so much you are truly a life savior💗

Deepak-ipse
Автор

This was great. I'd seen people do them on YouTube, but didn't understand it, so thankyou for your efforts :)

gfmoore
Автор

One thing that you should be using is Ctrl-D to make the first selection too.

Astlaus
Автор

Fantastic and thorough video on the topic. Thank you!

budkin
Автор

Ive started using multi cursors when writing html. I first create elements using Emmet, like .col*2 and then using multi cursor to add to both divs at once. Seems quicker and easier than copy pasting

SmetadAnarkist
Автор

Nice to see how Emacs features come into other editors, like vscode. =)

freehck
Автор

Thank you very much. This was very usefull!

patriciadaudt
Автор

how did this man create a 30 minute video on this alone? literally 4-5 sentences would've been enough to show alt click and control d.

DiamondhandsForever
Автор

You are so modeste but you can certainly tell us more about your usage in the code base of our favourite IDE (someone must explain me why VSCODE is a text editor until then I will just say it is an IDE)... I am impressed by the fact that you are doing these examples within the VsCode code itself haha 😂 Inception kind of thing!!!

Luxcium
Автор

Thanks for the tutorial! How can I jump an instance found by Ctrl+D? Let's suppose, I want to add a cursor to the first, second and fourth occurrence of "readonly" (skipping the third one)

rauldurand
Автор

Is it possible to drop multiple cursors by just using the keyboard (no mouse)?

magyarpinoy
Автор

My problem with multi-cursors is continuing to edit as if I'm in single cursor mode when my multi-cursor edit is done. I keep forgetting to hit escape to get out of multi-cursor mode. I wish it would do it automatically or make it more visibly apparent that you are still in multi-cursor mode.

rightclick
Автор

There should be a speed run version of this, less explanations and directly show what the keybinding does

madacol