- Published on
Multicursor in VSCode, a productivity boost
- Authors
- Name
- Lorenzo Pieri
- @404answnotfound
Table of Contents
The why
I think there are at least two very specific kinds of Developers. There's the very productive kind that can automate anything with the blink of an eye and then there's us, the common folks, those that avoided shortcuts for all their lives because learning a key sequence by muscle might take at least 15 seconds and that's a time we'd rather use to browse the Internet randomly, for no apparent reason whatsoever.
If, like me, you're part of the common rabble, that also means that you feel jealous whenever someone of your tribe, The Cool Developers, uses some kind of really fascinating ultra productive key sequence that would take you actual labor if you wanted to apply the same changes your friend did.
But don't worry, as usual this blog post is here to answer your gloomy questions because, pretty much like me, you came to a point in your developer's life where you cannot be unwilling to acknowledge the sublime power of shortcuts and terminal powerapps.
The how
You don't need to be afraid, this post won't be long. Afterall, it is about shortcuts, isn't it?
Infact, I'll use exactly this post to showcase what can be done with them.
All you need to do is press the button (Alt for other keyboards)
As you can see, it's already kind of cool that you can move single lines of code around without even touching your mouse and selecting the lines you want to move, but what if you wanted to move code blocks?
Same story.
(SHIFT) to select more lines.
(ALT) to move them around.
(CTRL) to go to the end of the line.
Want to copy a line of code without too much fuss?
+ (SHIFT + ALT) and just move vertically in your codebase
This trick can be used also with multiple selected lines! Isn't it amazing?!
But you can also do nice stuff like manually adding cursors with your mouse! + Click
And for our last shortcut, behold!, the Search and Replace cursors!
+ to open up the Search input in VSCode
+ + to place the cursors
And there you have them, multicursors in all of their glory!
The goodies
You've learnt a lot in just a few minutes and gifs, congratulations! Now go and use your new found powers in VSCode, and remember, be good lazy.
Happy hacking!
The goodbye
I hope you found this article useful and to your liking and if you have any requests, drop a message on one of my social media accounts or open an issue/start a discussion on github, on this repository!