Categories


Popular topics

 
Line 1: Line 1:
 
[[Category:General]]
 
[[Category:General]]
 
[[File:UltraEdit multi-caret.png|right|alt=screenshot of UltraEdit's multi-caret editing feature]]
 
[[File:UltraEdit multi-caret.png|right|alt=screenshot of UltraEdit's multi-caret editing feature]]
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 may be disabled completely  under [[Settings:Editor display:Cursor / caret|Settings » Editor display » Cursor / caret]].
+
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|Settings » Editor display » Cursor / caret]].
  
 
Multi-caret editing is not supported in [[column mode]] or [[hex edit]] mode.
 
Multi-caret editing is not supported in [[column mode]] or [[hex edit]] mode.
Line 8: Line 8:
  
 
===Creating multiple carets via mouse===
 
===Creating multiple carets via mouse===
Regardless of how many carets are active, you may 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|Settings » Editor display » Cursor / caret]]  
+
Regardless of how many carets are active, you can add a new caret by holding the <strong>Ctrl</strong> key and <strong>left-mouse-button clicking</strong> 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|Settings &raquo; Editor display &raquo; Cursor / caret]]  
  
 
===Adding a new caret to an existing set via mouse===
 
===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.
+
If you have created a caret set and released <strong>Ctrl</strong> and wish to add a new caret to the active set, then, prior to clicking anywhere else in the file, you can press <strong>Ctrl</strong> again and click in a new position to add a new caret to the existing set.
  
 
===Removing a caret via mouse===
 
===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.
+
You may remove a caret from the active set by holding <strong>Ctrl</strong> and clicking on the caret you wish to remove.  No other carets are affected.  You can also undo the last-added caret by pressing <strong>Shift</strong> + <strong>Alt</strong> + <strong>Z</strong>.
  
 
===Clearing all multiple carets via mouse===
 
===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.
+
To remove multiple carets, you can release <strong>Ctrl</strong> 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 <strong>Ctrl</strong> + <strong>Shift</strong> + <strong>/</strong> to remove all but the primary caret.
  
 
==Multi-select via mouse==
 
==Multi-select via mouse==
Line 24: Line 24:
  
 
===Creating multiple selections via mouse===
 
===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.
+
Regardless of how many selections are active, you can add a new selection by holding the <strong>Ctrl</strong> key and selecting any text within the file where you can normally do so.
  
 
The selection can be created via:
 
The selection can be created via:
Line 33: Line 33:
  
 
===Adding a new selection to an existing set via mouse===
 
===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.
+
If you create a set of multiple selections and have released <strong>Ctrl</strong> and wish to add a new caret / selection to the active set, then, prior to clicking anywhere else in the file, you can press <strong>Ctrl</strong> again and select new text to add to the existing set.
  
 
===Removing a selection via mouse===
 
===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.
+
You can remove a selection from the active set by holding <strong>Ctrl</strong> 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===
 
===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.
+
To remove multiple selections, you must release <strong>Ctrl</strong> 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==
 
==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.
+
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 <strong>Left Arrow</strong> will move all carets to the left 1 position.  Pressing <strong>Down Arrow</strong> will move all carets down 1 line. Pressing the <strong>Home</strong> key will move all carets to the beginning of each line. <strong>Page Up</strong> 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 <strong>Ctrl + Home</strong>, <strong>Ctrl + End</strong>, <strong>Ctrl + Shift + Home</strong>, <strong>Ctrl + Shift + End</strong>, etc.
  
 
==General editing with multi-caret==
 
==General editing with multi-caret==
Line 53: Line 64:
  
 
'''Paste'''<br>
 
'''Paste'''<br>
All selections are overwritten with whatever data is on the clipboard.
+
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'''<br>
 
'''Select'''<br>
Using Shift, you can select from each caret at once just as you would with a single caret.   
+
Using <strong>Shift</strong>, you can select from each caret at once just as you would with a single caret.   
  
 
'''Backspace / delete'''<br>
 
'''Backspace / delete'''<br>
 
All backspace / delete functionality is available and operates independently upon each caret.
 
All backspace / delete functionality is available and operates independently upon each caret.
 
=="End of line" carets==
 
Special handling is provided for multiple contiguous "end of line" (EOL) carets. This allows you to first create a regular selection of multiple lines then hold Ctrl and click '''beyond''' one of the selected lines' EOL to dismiss the selection and create a caret at the end of each line.  This way, you don't have to manually Ctrl + Click to insert multiple carets at the end of each line.
 

Latest revision as of 20:25, 30 June 2022

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.