Selecting Text

A selection is a a block of text marked for further manipulation. jEdit supports both range and rectangular selections, and several chunks of text can be selected simultaneously.

Dragging the mouse creates a range selection from where the mouse was pressed to where it was released. Holding down Shift while clicking a location in the buffer will create a selection from the caret position to the clicked location.

Holding down Shift in addition to a caret movement key (Left, Up, Home, etc) will extend a selection in the specified direction.

Edit>Select All (shortcut: Control-A) selects the entire buffer.

Edit>Select None>Select None (shortcut: Escape) deactivates the selection.

Rectangular Selection

Dragging with the Control key held down will create a rectangular selection. Holding down Shift and Control while clicking a location in the buffer will create a rectangular selection from the caret position to the clicked location.

It is possible to select a rectangle with zero width but non-zero height. This can be used to insert a new column between two existing columns, for example. Such zero-width selections are shown as a thin vertical line.

Rectangles can be deleted, copied, pasted, and operated on using ordinary editing commands.

Note

Rectangular selections are implemented using character offsets, not absolute screen positions, so they might not behave as you might expect if a proportional-width font is being used or if soft wrap is enabled. The text area font can be changed in the Text Area pane of the Utilities>Global Options dialog box. For information about soft wrap, see Section , “Wrapping Long Lines”.

Multiple Selection

Edit>More Selection>Multiple Selection (keyboard shortcut: Control-\) turns multiple selection mode on and off. In multiple selection mode, multiple fragments of text can be selected and operated on simultaneously, and the caret can be moved independently of the selection. The status bar indicates if multiple selection mode is active; see Section , “The Status Bar”.

Various jEdit commands behave differently with multiple selections:

  • Commands that copy text place the contents of each selection, separated by line breaks, in the specified register.

  • Commands that insert (or paste) text replace each selection with the entire text that is being inserted.

  • Commands that filter text (such as Spaces to Tabs, Range Comment, Replace in Selection, and so on) behave as if each block was selected independently, and the command invoked on each in turn.

  • Line-based commands (such as Shift Indent Left, Shift Indent Right, and Line Comment) operate on each line that contains at least one selection.

  • Caret movement commands that would normally deactivate the selection (such as the arrow keys, while Shift is not being held down), move the caret, leaving the selection as-is.

  • Some older plugins may not support multiple selection at all.

Edit>More Selection>Select None (shortcut: Escape) deactivates the selection containing the caret, if there is one. Otherwise it deactivates all active selections.

Edit>More Selection>Invert Selection (shortcut: Control-E I) selects a set of text chunks such that all text that was formerly part of a selection is now unselected, and all text that wasn't, is selected.

Note

Deactivating multiple selection mode while multiple blocks of text are selected will leave the selections in place, but you will not be able to add new selections until multiple selection mode is reactivated.