Summary of Visual Studio Code shortcuts starting with Alt
table of contents
Hello.
I'm Mandai, in charge of Wild on the development team.
Visual Studio Code (hereinafter referred to as VSCode) is constantly being updated, but the number of assigned shortcut keys is amazing.
There are too many to cover when you first start using them, so I've put together a list of useful ones.
Swapping rows
If you want to swap the line with the line immediately above, move the cursor to the line you want to swap and press Alt + up/down arrows to swap!
you can select multiple lines and Alt
It's convenient!
Copy row
Sometimes you may want to copy lines that have the same string.
Alt + Shift + Up and Down Arrows to copy more and more!
As an advanced version, you can also select multiple lines and Alt + Shift + Up/Down Arrows to copy multiple lines!
It's convenient!
rectangle selection
Rectangular selection is a useful feature when you want to batch edit table-like data or when you want to insert the same string at the beginning of each line.
Depending on the editor, you may need to use a mouse, but with VSCode you can do it with just the keyboard!
If you want to make a rectangular selection, you can use
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 it all at once!
If you want to cancel it, Esc .
It's convenient!
Split editor
Sometimes you might want to compare two editors side by side.
In such a case, you can split it with Ctrl + ¥
you can also split the editor into 2 screens and Ctrl + ¥
used Ctrl + Alt + → , but the shortcut key has recently changed.
This really freaked me out.
It's convenient!
Follow the history of edits
Sometimes you spend a lot of time looking for the place you just rewritten, wondering where it is.
In such cases, Alt + left and right arrows to move to past work areas!
Ctrl + Z which undoes changes , it simply moves the cursor to the changed area, so it is easy to use.
It's convenient!
Search like "grep -r" on VSCode
Searches that can be done quickly in a Linux environment are not so easy in a Windows environment.
But with VSCode, you can easily search with Ctrl + Shift + f
You can also replace search results all at once by Ctrl + Shift + h .
You can easily exclude files from being replaced from the search results by simply clicking the X button next to the file name.
It's convenient!
Use $1 when replacing
You can even handle backreferences!
In fact, you can easily perform replacements using regular expressions.
This isn't a shortcut.
It's convenient!
Above, I introduced some shortcut keys that involve Alt.
It would be convenient if I could make something like a cheat sheet all at once!
That's it.