Add Cursor Above / Below
What is Add Cursor Above / Below?
Add Cursor Above / Below: Stack extra cursors on the lines above or below to type the same thing on many lines. Most editors let you add extra cursors on the lines above or below the current one. In VS Code it is Ctrl+Alt+Up/Down on Windows and Linux, or Option+Cmd+Up/Down on a Mac. JetBrains editors use a double tap of Ctrl or Option followed by the arrow keys.
Frequently asked questions about Add Cursor Above / Below
How is Add Cursor Above / Below used in practice?
Everything you type then happens on every line at once. It is perfect for aligned blocks of similar code, such as adding a comma to ten array entries or renaming a prefix in a column of config keys.
What should you keep in mind with Add Cursor Above / Below?
It works best when the lines have the same shape. For changes spread across a file, use find and replace, or select the next occurrence of a word with Ctrl+D. Multiple cursors are a small skill, but once you have them in your fingers, many tedious edits take seconds instead of minutes.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |