Selecting Text

A selection is a a block of text marked for further manipulation. Unlike many other applications, 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 the selection in the specified direction. If no selection exists, one will be created.

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

Edit>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, hard tabs are enabled, or soft wrap is enabled. For information about changing the font used in the text area, see the section called "The Global Options Dialog Box". For information about tabs and wrapping, see the section called "Soft Tabs" and the section called "Word Wrap".

Multiple Selection

Pressing 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 text multi is shown in the status bar.

While multiple selection mode is active, you can click and drag the mouse to reposition the caret and create new selections.

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, and even Replace in Selection) operate on each selection, 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>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.

Tip

Deactivating multiple selection mode while a fragmented selection exists will leave the selection in place, but it will prevent you from making further fragmented selections.