A summary of Visual Studio Code shortcuts starting with Alt

table of contents
Hello.
I'm Mandai, the Wild team member in charge of development.
Visual Studio Code (hereinafter referred to as VSCode) is constantly being updated, and the number of shortcut keys assigned to it is incredible
When you first start using it, there are so many things that it's impossible to cover them all, so I've put together a list of some useful ones
Swap lines
If you want to swap it with the line immediately above, move the cursor to the line you want to swap and press Alt + up/down arrows!
As an advanced technique, you can select multiple lines and swap them all at once using Alt + Up/Down Arrows!
That's convenient!
Copying a row
Sometimes you want to copy lines that contain the same text, right? You can do that easily by pressing Alt + Shift + Up/Down Arrows!
As an advanced technique, you can also select multiple lines and copy them using Alt + Shift + Up/Down Arrows!
That's convenient!
Rectangle Selection
Rectangular selection is a handy feature for batch editing of data in a table format or for quickly inserting the same string at the beginning of each row.
Some editors require mouse operation, but with VS Code, you can do it with just the keyboard!
When making a rectangular selection, you can extend the cursor vertically by pressing Ctrl + Alt + Up/Down Arrows! You can also move the cursor while it's extended.
In this state, you can adjust the selection range using Shift + arrow keys! You can rewrite it all at once!
pressingEsc.
That's convenient!
Split Editor
Sometimes you want to compare two editors side-by-side, right? In those cases, you can split them using Ctrl + ¥ !
As an advanced technique, if you press Ctrl + ¥ again while the editor is split into two panes , you can split it into three panes!
It used toCtrl + Alt + →, but the shortcut key was recently changed.
I was genuinely shocked.
That's convenient!
Follow the edit history
Have you ever spent a lot of time searching for the place you just edited?
In those situations,Alt + left/right arrow keys to move back to your previous work location!
Unlike Ctrl + z , which undoes changes , this function simply moves the cursor to the changed location, making it easy to use.
That's convenient!
Search like "grep -r" on VSCode
Searching is quick and easy in a Linux environment, but it's not so simple in a Windows environment. However, with VS Code, you can easily search using Ctrl + Shift + f !
You can also perform a batch replacement of search resultsCtrl + Shift + h.
It's also easy to exclude items from the replacement; simply click the "X" button next to the file name.
That's convenient!
Use $1 when replacing
It can handle backreferences too!
In fact, it can even perform substitutions using regular expressions.
This isn't a shortcut
That's convenient!
Above, we have introduced some shortcut keys involving Alt
It would be convenient if we could eventually create something like a cheat sheet!
That's all
4
