The selection is the highlighted region (by default blue) of the buffer. A Copy operation copies the contents of the selection to the clipboard. View and line-edit modes have extra shortcuts and other conveniences for working with the selection. Unless otherwise noted, this section applies to both.
The two end-points of the selection are called the anchor and the focus points. The anchor is where you start the selection (typically on mouse-down), while the focus is current/active end of the selection: As you drag the mouse the focus follow the mouse, until mouse-up. In paging and line-edit modes the focus end is indicated with a vertical bar, by default purple.
The commands in this section do not move the edit caret, only the focus position.
Commands that move the focus will scroll the view so the focus remains in the view.
Copy selection to clipboard. (Selection can be partly or fully outside input area.)
copy-text-or-interrupt) (Not MacOS)
If there is no selection send Ctrl+C to the process - which normally interrupts it. If the previous keycommand was also a Ctrl+C, do as the no-selection case, so typing Ctrl+C twice will always interrupt. If there is a selection, copy it to the clipboard.
If there is a non-collapsed selection, swap focus and anchor (selection ends).
The following commands modify the buffer, so are only available in line-edit mode, not view mode:
Paste selection from clipboard.
Cut (delete) the selection and copy the contents to clipboard. Only removes text within the input area.
Pressing Shift while executing a movement command (such as Left) will extend the selection: The focus is moved as specified by the unshifted command (such as Left to move one character left), but the anchor stays where it was. The selected area expands or shrinks, depending on the movement. If there was no selection, the anchor is set to the initial location of the focus (in view mode) or the edit caret (in line-edit mode).
These operations will scroll as needed so the focus remains visible.
A mouse click (button-1) with Shift held will extend the selection by moving the focus position leaving the anchor position in place.
Extends the current selection by count characters (If there is no selection, the caret position is treated as a zero-size selection.)
Extend(or reduce) the current selection by count words
Extend selection to start/end of line.
Extend selection by moving focus up/down count lines.
Extend selection by moving focus position to start/end of the buffer.
Extend selection by moving focus position to start/end of the input area.
Extend mode allows extending (or shrinking) the
selection using keyboard commands without pressing Shift.
The effect is similar to setting the mark in the Emacs editor.
For example when extend mode is active,
pressing the Right key extends the selection by one character
as if Shift+Right was pressed.
Toggle extend mode.
A visual indication of extend mode is that the focus caret changes color from purple to orange, and the color of the selection changes.
Generally, if some key X is pressed in extend mode
Shift+X is bound to a command
whose name ends with
-extend, that command is executed instead.
Extends the selection, as if Shift was pressed.
Exit extend mode, returning to plain view or line-edit mode.