'\" t
.\" Title: kakoune
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1
.\" Date: 11/16/2018
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH KAK_SHORTCUTS 1 "" "" "shortcuts"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
shortcuts \- a
.SH "INSERT MODE"
.PP
\fB\fR
.RS 4
leave insert mode
.RE
.PP
\fB\fR
.RS 4
delete characters before cursors
.RE
.PP
\fB\fR
.RS 4
delete characters under cursors
.RE
.PP
\fB\fR, \fB\fR, \fB\fR, \fB\fR
.RS 4
move the cursors in given direction
.RE
.PP
\fB\fR
.RS 4
move cursors to the start of their lines
.RE
.PP
\fB\fR
.RS 4
move cursors to the end of their lines
.RE
.PP
\fB\fR
.RS 4
select next completion candidate
.RE
.PP
\fB\fR
.RS 4
select previous completion candidate
.RE
.PP
\fB\fR
.RS 4
explicit insert completion query, followed by:
.PP
\fBf\fR
.RS 4
explicit file completion
.RE
.PP
\fBw\fR
.RS 4
explicit word completion
.RE
.PP
\fBl\fR
.RS 4
explicit line completion
.RE
.RE
.PP
\fB\fR
.RS 4
disable automatic completion for this insert session
.RE
.PP
\fB\fR
.RS 4
insert contents of the register given by next key
.RE
.PP
\fB\fR
.RS 4
insert next keystroke directly into the buffer, without interpreting it
.RE
.PP
\fB\fR
.RS 4
commit changes up to now as a single undo group
.RE
.PP
\fB\fR
.RS 4
escape to normal mode for a single command
.RE
.SH "MOVEMENT"
.sp
\fIword\fR is a sequence of alphanumeric characters or underscore, and \fIWORD\fR is a sequence of non whitespace characters
.PP
\fBh\fR
.RS 4
select the character on the left of selection end
.RE
.PP
\fBj\fR
.RS 4
select the character below the selection end
.RE
.PP
\fBk\fR
.RS 4
select the character above the selection end
.RE
.PP
\fBl\fR
.RS 4
select the character on the right of selection end
.RE
.PP
\fBw\fR
.RS 4
select the word and following whitespaces on the right of selection end
.RE
.PP
\fBb\fR
.RS 4
select preceding whitespaces and the word on the left of selection end
.RE
.PP
\fBe\fR
.RS 4
select preceding whitespaces and the word on the right of selection end
.RE
.PP
\fB\fR
.RS 4
same as [wbe] but select WORD instead of word
.RE
.PP
\fBf\fR
.RS 4
select to the next occurrence of given character
.RE
.PP
\fBt\fR
.RS 4
select until the next occurrence of given character
.RE
.PP
\fB\fR
.RS 4
same as [ft] but in the other direction
.RE
.PP
\fBm\fR
.RS 4
select to matching character
.RE
.PP
\fBM\fR
.RS 4
extend selection to matching character
.RE
.PP
\fBx\fR
.RS 4
select line on which selection end lies (or next line when end lies on an end\-of\-line)
.RE
.PP
\fB\fR
.RS 4
expand selections to contain full lines (including end\-of\-lines)
.RE
.PP
\fB\fR
.RS 4
trim selections to only contain full lines (not including last end\-of\-line)
.RE
.PP
\fB%\fR
.RS 4
select whole buffer
.RE
.PP
\fB\fR
.RS 4
select to the start of the line
.RE
.PP
\fB\fR
.RS 4
select to the end of the line
.RE
.PP
\fB/\fR
.RS 4
search (select next match)
.RE
.PP
\fB\fR
.RS 4
search (select previous match)
.RE
.PP
\fB?\fR
.RS 4
search (extend to next match)
.RE
.PP
\fB\fR
.RS 4
search (extend to previous match)
.RE
.PP
\fBn\fR
.RS 4
select next match
.RE
.PP
\fBN\fR
.RS 4
add a new selection with next match
.RE
.PP
\fB\fR
.RS 4
select previous match
.RE
.PP
\fB\fR
.RS 4
add a new selection with previous match
.RE
.PP
\fBpageup\fR
.RS 4
scroll up
.RE
.PP
\fBpagedown\fR
.RS 4
scroll down
.RE
.PP
\fB\*(Aq\fR
.RS 4
rotate selections (the main selection becomes the next one)
.RE
.PP
\fB;\fR
.RS 4
reduce selections to their cursor
.RE
.PP
\fB\fR
.RS 4
flip the selections direction
.RE
.PP
\fB\fR
.RS 4
ensure selections are in forward direction (cursor after anchor)
.RE
.PP
\fB\fR
.RS 4
repeat last object or
\fBf\fR/\fBt\fR
selection command
.RE
.SH "CHANGES"
.PP
\fBi\fR
.RS 4
enter insert mode before current selection
.RE
.PP
\fBa\fR
.RS 4
enter insert mode after current selection
.RE
.PP
\fBd\fR
.RS 4
yank and delete current selection
.RE
.PP
\fBc\fR
.RS 4
yank and delete current selection and enter insert mode
.RE
.PP
\fB\&.\fR
.RS 4
repeat last insert mode change (\fBi\fR,
\fBa\fR, or
\fBc\fR, including the inserted text)
.RE
.PP
\fBI\fR
.RS 4
enter insert mode at current selection begin line start
.RE
.PP
\fBA\fR
.RS 4
enter insert mode at current selection end line end
.RE
.PP
\fBo\fR
.RS 4
enter insert mode in one (or given count) new lines below current selection end
.RE
.PP
\fBO\fR
.RS 4
enter insert mode in a on (or given count) lines above current selection begin
.RE
.PP
\fBy\fR
.RS 4
yank selections
.RE
.PP
\fBp\fR
.RS 4
paste after current selection end
.RE
.PP
\fBP\fR
.RS 4
paste before current selection begin
.RE
.PP
\fB\fR
.RS 4
paste all after current selection end, and select each pasted string
.RE
.PP
\fB\fR
.RS 4
paste all before current selection begin, and select each pasted string
.RE
.PP
\fBR\fR
.RS 4
replace current selection with yanked text
.RE
.PP
\fBr\fR
.RS 4
replace each character with the next entered one
.RE
.PP
\fB\fR
.RS 4
join selected lines
.RE
.PP
\fB\fR
.RS 4
join selected lines and select spaces inserted in place of line breaks
.RE
.PP
\fB\fR
.RS 4
merge contiguous selections together (works across lines as well)
.RE
.PP
\fB>\fR
.RS 4
indent selected lines
.RE
.PP
\fB>\fR
.RS 4
indent selected lines, including empty lines
.RE
.PP
\fB<\fR
.RS 4
deindent selected lines
.RE
.PP
\fB\fR
.RS 4
deindent selected lines, do not remove incomplete indent (3 leading spaces when indent is 4)
.RE
.PP
\fB|\fR
.RS 4
pipe each selection through the given external filter program and replace the selection with its output
.RE
.PP
\fB\fR
.RS 4
pipe each selection through the given external filter program and ignore its output
.RE
.PP
\fB!\fR
.RS 4
insert command output before selection
.RE
.PP
\fBa\-!\fR
.RS 4
append command output after selection
.RE
.PP
\fBu\fR
.RS 4
undo last change
.RE
.PP
\fB\fR
.RS 4
move backward in history
.RE
.PP
\fBU\fR
.RS 4
redo last change
.RE
.PP
\fB\fR
.RS 4
move forward in history
.RE
.PP
\fB&\fR
.RS 4
align selection, align the cursor of selections by inserting spaces before the first character of the selection
.RE
.PP
\fB\fR
.RS 4
copy indent, copy the indentation of the main selection (or the count one if a count is given) to all other ones
.RE
.PP
\fB`\fR
.RS 4
to lower case
.RE
.PP
\fB~\fR
.RS 4
to upper case
.RE
.PP
\fB\fR
.RS 4
swap case
.RE
.PP
\fB@\fR
.RS 4
convert tabs to spaces in current selections, uses the buffer tabstop option or the count parameter for tabstop
.RE
.PP
\fB\fR
.RS 4
convert spaces to tabs in current selections, uses the buffer tabstop option or the count parameter for tabstop
.RE
.PP
\fB\fR
.RS 4
rotate selections content, if specified, the count groups selections, so the following command
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
3
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
rotate (1, 2, 3) and (3, 4, 6) independently
.fi
.if n \{\
.RE
.\}
.SH "GOTO COMMANDS"
.sp
If a count is given prior to hitting \fBg\fR, \fBg\fR will jump to the given line
.PP
\fBgh\fR
.RS 4
go to the start of the line
.RE
.PP
\fBgl\fR
.RS 4
go to the end of the line
.RE
.PP
\fBgg\fR, \fBgk\fR
.RS 4
go to the first line
.RE
.PP
\fBgj\fR
.RS 4
go to the last line
.RE
.PP
\fBge\fR
.RS 4
go to last char of the last line
.RE
.PP
\fBgt\fR
.RS 4
go to the first displayed line
.RE
.PP
\fBgc\fR
.RS 4
go to the middle displayed line
.RE
.PP
\fBgb\fR
.RS 4
go to the last displayed line
.RE
.PP
\fBga\fR
.RS 4
go to the previous (alternate) buffer
.RE
.PP
\fBgf\fR
.RS 4
open the file whose name is selected
.RE
.PP
\fBg\&.\fR
.RS 4
go to last buffer modification position
.RE
.SH "VIEW COMMANDS"
.PP
\fBV\fR
.RS 4
lock view mode until is hit
.RE
.PP
\fBvv\fR, \fBvc\fR
.RS 4
center the main selection in the window
.RE
.PP
\fBvt\fR
.RS 4
scroll to put the main selection on the top line of the window
.RE
.PP
\fBvb\fR
.RS 4
scroll to put the main selection on the bottom line of the window
.RE
.PP
\fBvh\fR
.RS 4
scroll the window count columns left
.RE
.PP
\fBvj\fR
.RS 4
scroll the window count line downward
.RE
.PP
\fBvk\fR
.RS 4
scroll the window count line upward
.RE
.PP
\fBvl\fR
.RS 4
scroll the window count columns right
.RE
.SH "MARKS"
.sp
Marks use the \fB^\fR register by default\&.
.PP
\fBZ\fR
.RS 4
will save the current selections to the register
.RE
.PP
\fB\fR
.RS 4
will append the current selections to the register
.RE
.PP
\fBz\fR
.RS 4
will restore the selections from the register
.RE
.PP
\fB\fR
.RS 4
will append the selections from the register to the existing ones
.RE
.SH "MACROS"
.sp
Macros use the \fB@\fR register by default
.PP
\fBQ\fR
.RS 4
record a macro
.RE
.PP
\fBq\fR
.RS 4
play a recorded macro
.RE
.SH "SEARCHING"
.sp
Searches use the \fB/\fR register by default
.PP
\fB*\fR
.RS 4
set the search pattern to the current selection (automatically detects word boundaries)
.RE
.PP
\fB\fR
.RS 4
set the search pattern to the current selection (verbatim, no smart detection)
.RE
.SH "JUMP LIST"
.PP
\fB\fR
.RS 4
Jump forward
.RE
.PP
\fB\fR
.RS 4
Jump backward
.RE
.PP
\fB\fR
.RS 4
save current selections
.RE
.SH "MULTIPLE SELECTIONS"
.PP
\fBs\fR
.RS 4
create a selection
.RE
.PP
\fB\fR
.RS 4
split the current selections on line boundaries
.RE
.PP
\fBS\fR
.RS 4
split the current selection
.RE
.PP
\fBC\fR
.RS 4
copy the current selection to the next line
.RE
.PP
\fB\fR
.RS 4
copy the current selection to the previous line
.RE
.PP
\fB\fR
.RS 4
clear a multiple selection
.RE
.PP
\fB\fR
.RS 4
clear the current selection
.RE
.PP
\fB\fR
.RS 4
keep the selections that match the given regex
.RE
.PP
\fB\fR
.RS 4
clear selections that match the given regex
.RE
.PP
\fB$\fR
.RS 4
pipe each selection to the given shell command and keep the ones for which the shell returned 0
.RE
.SH "OBJECT SELECTION"
.PP
\fB\fR
.RS 4
selects the whole object
.RE
.PP
\fB\fR
.RS 4
selects the inner object, that is the object excluding it\(cqs surrounder
.RE
.PP
\fB[\fR
.RS 4
selects to object start
.RE
.PP
\fB]\fR
.RS 4
selects to object end
.RE
.PP
\fB{\fR
.RS 4
extends selections to object start
.RE
.PP
\fB}\fR
.RS 4
extends selections to object end
.RE
.sp
After these keys, you need to enter a second key in order to specify which object you want
.PP
\fBb\fR, \fB(\fR, \fB)\fR
.RS 4
select the enclosing parenthesis
.RE
.PP
\fBB\fR, \fB{\fR, \fB}\fR
.RS 4
select the enclosing {} block
.RE
.PP
\fBr\fR, \fB[\fR, \fB]\fR
.RS 4
select the enclosing [] block
.RE
.PP
\fBa\fR, \fB<\fR, \fB>\fR
.RS 4
select the enclosing <> block
.RE
.PP
\fB"\fR, \fBQ\fR
.RS 4
select the enclosing double quoted string
.RE
.PP
\fB\*(Aq\fR, \fBq\fR
.RS 4
select the enclosing single quoted string
.RE
.PP
\fB`\fR, \fBg\fR
.RS 4
select the enclosing grave quoted string
.RE
.PP
\fBw\fR
.RS 4
select the whole word
.RE
.PP
\fBW\fR
.RS 4
select the whole WORD
.RE
.PP
\fBs\fR
.RS 4
select the sentence
.RE
.PP
\fBp\fR
.RS 4
select the paragraph
.RE
.PP
\fB␣\fR
.RS 4
select the whitespaces
.RE
.PP
\fBi\fR
.RS 4
select the current indentation block
.RE
.PP
\fBn\fR
.RS 4
select the number
.RE
.PP
\fBu\fR
.RS 4
select the argument
.RE
.PP
\fB:\fR
.RS 4
select user defined object, will prompt for open and close text
.RE
.SH "PROMPT COMMANDS"
.PP
\fB\fR
.RS 4
validate prompt
.RE
.PP
\fB\fR
.RS 4
abandon without
.RE
.PP
\fB\fR, \fB\fR
.RS 4
move cursor to previous character
.RE
.PP
\fB\fR, \fB\fR
.RS 4
move cursor to previous character
.RE
.PP
\fB\fR
.RS 4
move cursor to first character
.RE
.PP
\fB\fR
.RS 4
move cursor to passed last character
.RE
.PP
\fB\fR, \fB\fR
.RS 4
erase character before cursor
.RE
.PP
\fB\fR, \fB\fR
.RS 4
erase character under cursor
.RE
.PP
\fB\fR
.RS 4
avance to next word begin
.RE
.PP
\fB\fR
.RS 4
advance to next WORD begin
.RE
.PP
\fB\fR
.RS 4
go back to previous word begin
.RE
.PP
\fB\fR
.RS 4
go back to previous WORD begin
.RE
.PP
\fB\fR
.RS 4
advance to next word end
.RE
.PP
\fB\fR
.RS 4
advance to next word end
.RE
.PP
\fB\fR, \fB\fR
.RS 4
select previous entry in history
.RE
.PP
\fB\fR, \fB\fR
.RS 4
select next entry in history
.RE
.PP
\fB\fR
.RS 4
select next completion candidate
.RE
.PP
\fB\fR
.RS 4
select previous completion candidate
.RE
.PP
\fB\fR
.RS 4
insert then content of the register given by next key
.RE
.PP
\fB\fR
.RS 4
insert next keystroke without interpreting it
.RE
.PP
\fB\fR
.RS 4
disable auto completion for this prompt
.RE
.SH "KEY MAPPING"
.sp
Mapping a combination of keys to another one (a\&.k\&.a\&. key mapping or binding) can be done with the following command:
.sp
.if n \{\
.RS 4
.\}
.nf
map
.fi
.if n \{\
.RE
.\}
.PP
\fBscope\fR
.RS 4
can be one of
\fBglobal\fR,
\fBwindow\fR
or
\fBbuffer\fR
.RE
.PP
\fBmode\fR
.RS 4
can be one of
\fBinsert\fR,
\fBnormal\fR,
\fBprompt\fR,
\fBmenu\fR,
\fBuser\fR
or a one character long arbitrary prefix (the
\fBuser\fR
mode uses the
\fB,\fR
prefix)
.RE
.PP
\fBkey\fR
.RS 4
the key to which the combination will be bound
.RE
.PP
\fBkeys\fR
.RS 4
string that lists the keys that will be executed when
\fBkey\fR
is hit
.RE
.sp
Keys are always executed within the \fBnormal\fR mode\&.