Transferring Text

jEdit provides a rich set of commands for moving and copying text. Internally, jEdit stores text in so-called registers. A register is a holding area with a single-character name that can hold once piece of text at a time. Registers are global to the editor; all buffers share the same set.

The system clipboard is mapped to a register named $. For convenience, jEdit offers clipboard-manipulation commands similar to those found in other applications, in addition to a more flexible set of commands for working with registers directly.

The System Clipboard

Edit>Cut (shortcut: Control-X) places the selected text in the clipboard and removes it from the buffer.

Edit>Copy (shortcut: Control-C) places the selected text in the clipboard and leaves it in the buffer.

Edit>Cut Append (shortcut: Control-E Control-U) appends the selected text to the clipboard, then removes it from the buffer. After this command has been invoked, the clipboard will consist of the former clipboard contents, followed by a newline, followed by the selected text.

Edit>Copy Append (shortcut: Control-E Control-A) appends the selected text to the clipboard, and leaves it in the buffer. After this command has been invoked, the clipboard will consist of the former clipboard contents, followed by a newline, followed by the selected text.

Edit>Paste (shortcut: Control-V) inserts the clipboard contents in place of the selection (or at the caret position, if there is no selection).

Quick Copy

Quick copy is disabled by default, but it can be enabled in the Text Area pane of the Utilities>Global Options dialog box. When quick copy is enabled:

  • Clicking the middle mouse button in the text area inserts the most recently selected text at the clicked location. If you only have a two-button mouse, you can click the left mouse button while holding down Alt instead of middle-clicking.

    Internally, this is implemented by storing the most recently selected text in the % register (recall that registers have single-character names).

    If jEdit is being run under Java 2 version 1.4 on Unix, you will be able to transfer text with other X Windows applications using the quick copy feature. On other platforms and Java versions, the contents of the quick copy register are only accessible from within jEdit.

  • Dragging with the middle mouse button creates a selection without moving the caret. As soon as the mouse button is released, the selected text is inserted at the caret position and the selection is deactivated. A message is shown in the status bar while text is being selected to remind you that this is not an ordinary selection.

General Register Commands

These commands are slightly less convenient to use than the two methods of transferring text described above, but are more powerful.

These commands all expect a single-character register name to be typed at the keyboard after the command is invoked, and subsequently operate on that register. Pressing Escape instead of specifying a register name will cancel the operation.

Edit>Registers>Cut to Register (shortcut: Control-R Control-X key) stores the selected text in the specified register, removing it from the buffer.

Edit>Registers>Copy to Register (shortcut: Control-R Control-C key) stores the selected text in the specified register, leaving it in the buffer.

Edit>Registers>Cut Append to Register (shortcut: Control-R Control-U key) adds the selected text to the existing contents of the specified register, and removes it from the buffer.

Edit>Registers>Copy Append to Register (shortcut: Control-R Control-A key) adds the selected text to the existing contents of the specified register, without removing it from the buffer.

Edit>Registers>Paste from Register (shortcut: Control-R Control-V key) replaces the selection with the contents of the specified register.

Edit>Paste Previous (shortcut: Control-E Control-V) displays a dialog box listing recently copied and pasted text. By default, the last 20 strings are remembered; this can be changed in the General pane of the Utilities>Global Options dialog box; see the section called "The Global Options Dialog Box".

Edit>Registers>View Registers displays a dialog box for viewing the contents of registers (including the clipboard).