Is it possible to enable multiline editing like in Sublime Text?
For example, press Ctrl to place additional cursor carets and being able to write/delete on multiple places in the document at one time.
Use Ctrl + D to use multi word edit of same words in Windows and Linux. Use CMD + D for Mac.
In Visual Studio to edit multiple lines which are vertically aligned at once press Alt and select the aligned block and then just start typing as in example 1 below. This approach overwrites the selected block.
“how to indent multiple lines in vscode” Code Answer's and also indent backward using Shift + TAB.
On Windows, you hold Ctrl+Alt while pressing the up ↑ or down ↓ arrow keys to add cursors.
Mac: ⌥ Opt+⌘ Cmd+↑/↓
Linux: Shift+Alt+↑/↓
Note that third-party software may interfere with these shortcuts, preventing them from working as intended (particularly Intel's HD Graphics software on Windows; see comments for more details).
If you experience this issue, you can either disable the Intel/other software hotkeys, or modify the VS Code shortcuts (described below).
Press Esc to reset to a single cursor.
Or, as Isidor Nikolic points out, you can hold Alt and left click to place cursors arbitrarily.
You can view and edit keyboard shortcuts via:
File → Preferences → Keyboard Shortcuts
Documentation:
https://code.visualstudio.com/docs/customization/keybindings
Official VS Code Keyboard shortcut cheat sheets:
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With