A summary of Visual Studio Code shortcuts starting with Alt

table of contents
Hello,
I'm Mandai, the Wild Team member of the development team.
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 example, you can select multiple lines and swap them all at once by pressing Alt
That's convenient!
Copying a row
Sometimes you may want to copy lines that contain the same text.
Alt + Shift + up/down arrows to copy more!
As an advanced version, you can select multiple lines and copy them by Alt + Shift
That's convenient!
Rectangle Selection
Rectangular selection is a convenient feature when you want to bulk edit table-like data or insert the same string at the beginning of each line.
Depending on the editor, you may need to use the mouse, but with VSCode, you can do it with just the keyboard!
When making a rectangular selection, you can expand the cursor up and down by pressing
Ctrl + Alt You can also move the cursor while it is expanded.
In this state, you can adjust the selection range with
Shift You can rewrite everything in one go!
To cancel it, press Esc
That's convenient!
Split Editor
Sometimes you might want to compare two editors side by side.
In that case, you can split them with Ctrl + ¥
As an advanced version, if you split the editor into two screens and Ctrl + ¥ , you can split it into three screens!
Previously Ctrl + Alt + → , but recently the shortcut key was changed.
This really scared me.
That's convenient!
Follow the edit history
You might find yourself spending a lot of time searching for the place you just edited.
In that case, Alt + left/right arrow to move back to the previous work location!
Ctrl + z which undoes changes , this is easy to use as it simply moves the cursor to the changed area.
That's convenient!
Search like "grep -r" on VSCode
Searching is easy in a Linux environment, but not so easy in a Windows environment.
However, in VSCode, you can easily search by pressing Ctrl + Shift + f
You can also bulk replace all search results Ctrl + Shift + h .
You can also easily exclude a search result from the replacement by simply clicking the cross button next to the file name.
That's convenient!
Use $1 when replacing
It can also handle backreferences!
In fact, it can even do regular expression substitutions.
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