Lokyr
Documentation

copy-mode: the copy mode

On this page

lokyr/copy-mode · bundled · source

A cursor of the keyboard's over the pane's scrollback and screen, which vi's keys move, to select text and copy it without the mouse.

The mode

Keys

The keys are those of the US layout: $ is shift+4, as it types there. Each key can be rebound in [keys], in the context copy-mode.open && pane.focused.

KeysWhat they do
h j k l, the arrowsA cell left or right, a row down or up
w b eThe next word's start, the start of the word before, the word's end: a word is of letters, digits and _, or of punctuation
W B EThe same of big words, of anything but blanks
0, HomeThe line's start: of the whole line that the program wrote, across the rows that it wraps over
^The line's first character but a blank
$, EndThe line's last character but a blank
ggThe scrollback's first row
GThe last row that shows something, or the terminal's cursor's, which is later
H M LThe view's top row, its middle one, its bottom one
⌃U ⌃DHalf a page up or down, the view with the cursor
⌃B ⌃F, Page Up, Page DownA page up or down
{ }The blank line before the paragraph, or after it
1 to 9, then 0 to 9A count of the next move, as 12j moves 12 rows down
v V ⌃VA selection of cells, of lines, of a block
oSwaps the selection's ends
y, ReturnCopies the selection, or the cursor's line, and ends
YCopies the cursor's line, and ends
EscapeTakes the count away, or else the selection, or else ends
q, ⌃CEnds, the selection taken away

A line's copy leaves the blanks at its end out.

Commands

CommandMenuDefault keysWhat it does
copy-mode.toggleEdit › Copy Mode⇧⌘CStarts the mode in the pane that has the keyboard, or ends it
copy-mode.moveh, ←, l, →, k, ↑, j, ↓, w, b, e, W, B, E, Home, ⇧6, ⇧4, End, g g, G, H, M, L, ⌃U, ⌃D, ⌃B, Page Up, ⌃F, Page Down, ⇧[, ⇧] while copy-mode.open && pane.focusedMoves the cursor to a place: left, right, up, down, word-next, word-previous, word-end, big-word-next, big-word-previous, big-word-end, line-start, line-first, line-end, top, bottom, view-top, view-middle, view-bottom, half-page-up, half-page-down, page-up, page-down, paragraph-previous or paragraph-next
copy-mode.selectv, V, ⌃V while copy-mode.open && pane.focusedStarts a selection of a kind, cells, lines or block, changes its kind, or takes it away
copy-mode.count0 to 9 while copy-mode.open && pane.focusedAdds a digit to the count of the next move; 0 of no count goes to the line's start
copy-mode.acto, y, Return, Y, Escape, q, ⌃C while copy-mode.open && pane.focusedIts action: swap, copy, copy-line, back or exit

To leave the mode with x as well:

[keys]
"x" = { command = "copy-mode.act", args = { action = "exit" }, when = "copy-mode.open && pane.focused" }

Turning it off

[plugins.copy-mode]
enabled = false

The mode and its commands go, with their keys: ⇧⌘C then does nothing in Lokyr.