Categories


Popular topics

Multi-caret editing allows you to activate two or more non-contiguous insertion points (identified by the blinking caret) within the active file. Each caret acts and operates independently of any other caret, and most edit operations you execute are performed in all caret locations simultaneously. This is an optional feature and can be disabled completely under Settings » Editor display » Cursor / caret.

Multi-caret editing is not supported in column mode or hex edit mode.

Multi-caret via mouse

Creating multiple carets via mouse

Regardless of how many carets are active, you can add a new caret by holding the Ctrl key and left-mouse-button clicking at any location within the file where you can normally click to reposition the caret, including beyond a line end if "Allow positioning beyond line end" is set under Settings » Editor display » Cursor / caret

Adding a new caret to an existing set via mouse

If you have created a caret set and released Ctrl and wish to add a new caret to the active set, then, prior to clicking anywhere else in the file, you can press Ctrl again and click in a new position to add a new caret to the existing set.

Removing a caret via mouse

You may remove a caret from the active set by holding Ctrl and clicking on the caret you wish to remove. No other carets are affected. You can also undo the last-added caret by pressing Shift + Alt + Z.

Clearing all multiple carets via mouse

To remove multiple carets, you can release Ctrl and then click elsewhere in the file (not on an active selection). All carets will be removed and the clicked position will become the only active caret. Alternatively, you can press Ctrl + Shift + / to remove all but the primary caret.

Multi-select via mouse

Multi-select is a component of multi-caret in that it allows you to select multiple non-contiguous sections of data.

Creating multiple selections via mouse

Regardless of how many selections are active, you can add a new selection by holding the Ctrl key and selecting any text within the file where you can normally do so.

The selection can be created via:

  • Click-and-drag (standard selection)
  • Double-/triple-click
  • Click on line number

Adding a new selection to an existing set via mouse

If you create a set of multiple selections and have released Ctrl and wish to add a new caret / selection to the active set, then, prior to clicking anywhere else in the file, you can press Ctrl again and select new text to add to the existing set.

Removing a selection via mouse

You can remove a selection from the active set by holding Ctrl and clicking anywhere on the selection you want to remove. No other selections are affected. No caret is left where you clicked.

Clearing all multiple selections via mouse

To remove multiple selections, you must release Ctrl and then click elsewhere in the file (not on an active caret / selection). All carets will be removed and the clicked position will become the only active caret.

Multi-select strings

Select all occurrences of string

You can use multi-caret editing to quickly select all occurrences of a word regardless of its position in the file. To do this, make your selection and press Ctrl , (comma). If no selection exists, the editor will select all occurrences of the word under the active caret.

Select next occurrence of string

To select the next occurrence of the selected string, press Ctrl ; (semicolon). If no selection exists, the editor will first select the word under the caret, and subsequent keypresses will select subsequent occurrences.

Select all Find matches

You can also load all matches from a search into multiple selections. To do this, first do a Quick find or Find with "Highlight all items found" enabled. After the matched items are highlighted, press Ctrl , (comma) to load them into selections. When combined with Perl regular expressions, this provides you with a very powerful way of selecting multiple different strings all at once.

Movement of multi-carets

With a caret / selection set active, you can reposition them as you normally would by using basic movement keys on the keyboard. For example, pressing Left Arrow will move all carets to the left 1 position. Pressing Down Arrow will move all carets down 1 line. Pressing the Home key will move all carets to the beginning of each line. Page Up will move all carets up 1 page. Any movement which would cause the carets to converge into a unified location will result in a single caret. Examples include Ctrl + Home, Ctrl + End, Ctrl + Shift + Home, Ctrl + Shift + End, etc.

General editing with multi-caret

Once you have a set of multi-carets and / or selections, you can do any number of general editing operations.

Copy/Cut
All selections are copied or cut into the clipboard. Non-contiguous selections are separated on the clipboard by a line terminator.

If "Enable copy/cut of current line with no selection active" is set under Settings » Editor » Miscellaneous, then all lines where a non-selection caret is active are copied / cut.

Paste
All selections are overwritten with whatever data is on the clipboard, with one notable exception: if the number of line endings on the clipboard equals the number of active carets in the file, then each individual line on the clipboard will be inserted into each individual caret/selection, in respective order. This is helpful in cases where you wish to copy a plain text list into a pre-formatted code container, for example.

Select
Using Shift, you can select from each caret at once just as you would with a single caret.

Backspace / delete
All backspace / delete functionality is available and operates independently upon each caret.

MediaWiki spam blocked by CleanTalk.