2017-11-02 03:03:24 +01:00
|
|
|
= Keys
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Key Syntax
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-01-25 01:14:11 +01:00
|
|
|
Usual keys are written using their ascii character, including capital
|
|
|
|
keys. Non printable keys use an alternate name, written between *<*
|
|
|
|
and *>*, such as *<esc>* or *<del>*. Modified keys are written between
|
|
|
|
*<* and *>* as well, with the modifier specified as either *c* for
|
|
|
|
Control, or *a* for Alt, followed by a *-* and the key (either its
|
2017-11-06 10:08:59 +01:00
|
|
|
name or ascii character), for example *<c-x>*, *<a-space>*, *<c-a-w>*.
|
2017-01-25 01:14:11 +01:00
|
|
|
|
2017-11-06 10:08:59 +01:00
|
|
|
In order to bind some keys to arbitrary ones, refer to <<mapping#,`:doc mapping`>>
|
2017-03-07 15:39:40 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Insert mode
|
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*<esc>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
leave insert mode
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<backspace>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
delete characters before cursors
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<del>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
delete characters under cursors
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<left>*, *<right>*, *<up>*, *<down>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move the cursors in given direction
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<home>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursors to line begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<end>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursors to end of line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-n>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select next completion candidate
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-p>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select previous completion candidate
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-x>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
explicit insert completion query, followed by:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*f*:::
|
|
|
|
explicit file completion
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*w*:::
|
|
|
|
explicit word completion (current buffer)
|
2017-10-24 22:41:13 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*W*:::
|
|
|
|
explicit word completion (all buffers)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*l*:::
|
|
|
|
explicit line completion
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-o>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
disable automatic completion for this insert session
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-r>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
insert contents of the register given by next key
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-v>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
insert next keystroke directly into the buffer, without interpreting it
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-u>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
commit changes up to now as a single undo group
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-;>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
escape to normal mode for a single command
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Using Counts
|
2017-02-19 14:18:00 +01:00
|
|
|
|
|
|
|
In normal mode, commands can be prefixed with a numeric count, which can control
|
|
|
|
the command behaviour.
|
|
|
|
|
2017-04-21 12:32:47 +02:00
|
|
|
For example, *3W* selects 3 consecutive words and *3w* select the third word on
|
2017-02-19 14:18:00 +01:00
|
|
|
the right of selection end.
|
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Disabling Hooks
|
2017-02-19 14:18:00 +01:00
|
|
|
|
|
|
|
Any normal mode command can be prefixed with *\* which will disable hook execution
|
|
|
|
for the duration for the command (including the duration of modes the command could
|
|
|
|
move to, so *\i* will disable hooks for the whole insert session).
|
|
|
|
|
|
|
|
As autoindentation is implemented in terms of hooks, this can be used to disable
|
|
|
|
it when pasting text.
|
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Movement
|
|
|
|
|
2016-02-10 22:03:49 +01:00
|
|
|
'word' is a sequence of alphanumeric characters or underscore, and 'WORD'
|
|
|
|
is a sequence of non whitespace characters
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*h*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the character on the left of selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*j*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the character below the selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*k*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the character above the selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*l*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the character on the right of selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*w*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the word and following whitespaces on the right of selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*b*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select preceding whitespaces and the word on the left of selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*e*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select preceding whitespaces and the word on the right of selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-[wbe]>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
same as [wbe] but select WORD instead of word
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*f*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select to the next occurrence of given character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*t*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select until the next occurrence of given character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-[ft]>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
same as [ft] but in the other direction
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*m*::
|
2017-11-06 10:08:59 +01:00
|
|
|
select to matching character, see the `matching_pairs` option
|
|
|
|
in <<options#,`:doc options`>>
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*M*::
|
2017-11-02 10:37:39 +01:00
|
|
|
extend selection to matching character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*x*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select line on which selection end lies (or next line when end lies
|
|
|
|
on an end-of-line)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-06 10:08:59 +01:00
|
|
|
*X*::
|
|
|
|
similar to *x*, except the current selection is extended
|
2017-04-25 10:39:50 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*<a-x>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
expand selections to contain full lines (including end-of-lines)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-X>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
trim selections to only contain full lines (not including last
|
|
|
|
end-of-line)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*%*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select whole buffer
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-h>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select to line begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-l>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select to line end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*/*::
|
2017-11-02 10:37:39 +01:00
|
|
|
search (select next match)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-/>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
search (select previous match)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*?*::
|
2017-11-02 10:37:39 +01:00
|
|
|
search (extend to next match)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-?>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
search (extend to previous match)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*n*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select next match
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*N*::
|
2017-11-02 10:37:39 +01:00
|
|
|
add a new selection with next match
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-n>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select previous match
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-N>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
add a new selection with previous match
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-10-04 12:47:56 +02:00
|
|
|
*pageup, <c-b>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
scroll one page up
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-10-04 12:47:56 +02:00
|
|
|
*pagedown, <c-f>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
scroll one page down
|
2017-10-04 12:47:56 +02:00
|
|
|
|
|
|
|
*<c-u>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
scroll half a page up
|
2017-10-04 12:47:56 +02:00
|
|
|
|
|
|
|
*<c-d>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
scroll half a page down
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*'*::
|
2017-11-02 10:37:39 +01:00
|
|
|
rotate selections (the main selection becomes the next one)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-02-01 21:54:29 +01:00
|
|
|
*<a-'>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
rotate selections backwards
|
2017-02-01 21:54:29 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*;*::
|
2017-11-02 10:37:39 +01:00
|
|
|
reduce selections to their cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-;>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
flip the selections direction
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-:>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
ensure selections are in forward direction (cursor after anchor)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-12-14 21:45:15 +01:00
|
|
|
*<a-.>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
repeat last object or *f*/*t* selection command
|
2016-12-14 21:45:15 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Changes
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*i*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode before current selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*a*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode after current selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*d*::
|
2017-11-02 10:37:39 +01:00
|
|
|
yank and delete current selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*c*::
|
2017-11-02 10:37:39 +01:00
|
|
|
yank and delete current selection and enter insert mode
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*.*::
|
2017-11-02 10:37:39 +01:00
|
|
|
repeat last insert mode change (*i*, *a*, or *c*, including the
|
|
|
|
inserted text)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-07-11 06:49:29 +02:00
|
|
|
*<a-d>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
delete current selection (not yanking)
|
2017-07-11 06:49:29 +02:00
|
|
|
|
|
|
|
*<a-c>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
delete current selection and enter insert mode (not yanking)
|
2017-07-11 06:49:29 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*I*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode at current selection begin line start
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*A*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode at current selection end line end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*o*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode in a new line (or in a given count of new lines) below
|
|
|
|
current selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*O*::
|
2017-11-02 10:37:39 +01:00
|
|
|
enter insert mode in a new line (or in a given count of new lines) above
|
|
|
|
current selection begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-07-10 11:55:19 +02:00
|
|
|
*<a-o>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
add an empty line below cursor
|
2017-07-10 11:55:19 +02:00
|
|
|
|
|
|
|
*<a-O>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
add an empty line above cursor
|
2017-07-10 11:55:19 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*y*::
|
2017-11-02 10:37:39 +01:00
|
|
|
yank selections
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*p*::
|
2017-11-02 10:37:39 +01:00
|
|
|
paste after current selection end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*P*::
|
2017-11-02 10:37:39 +01:00
|
|
|
paste before current selection begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-p>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
paste all after current selection end, and select each pasted string
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-P>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
paste all before current selection begin, and select each pasted string
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*R*::
|
2017-11-02 10:37:39 +01:00
|
|
|
replace current selection with yanked text
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-07-09 12:00:28 +02:00
|
|
|
*<a-R>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
replace current selection with every yanked text
|
2017-07-09 12:00:28 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*r*::
|
2017-11-02 10:37:39 +01:00
|
|
|
replace each character with the next entered one
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-j>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
join selected lines
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-J>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
join selected lines and select spaces inserted in place of line breaks
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-08-29 10:48:40 +02:00
|
|
|
*<a-m>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
merge contiguous selections together (works across lines as well)
|
2016-08-29 10:48:40 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
indent selected lines
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-03-12 10:13:49 +01:00
|
|
|
*<a\->>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
indent selected lines, including empty lines
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<*::
|
2017-11-02 10:37:39 +01:00
|
|
|
deindent selected lines
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-<>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
deindent selected lines, do not remove incomplete indent (3 leading
|
|
|
|
spaces when indent is 4)
|
2016-02-10 22:03:49 +01:00
|
|
|
|
|
|
|
*|*::
|
2017-11-02 10:37:39 +01:00
|
|
|
pipe each selection through the given external filter program and
|
2018-01-23 05:59:46 +01:00
|
|
|
replace the selection with its output. Shell expansions are available,
|
|
|
|
(See <<expansions#shell-expansions,`:doc expansions shell-expansions`>>)
|
2016-02-10 22:03:49 +01:00
|
|
|
|
|
|
|
*<a-|>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
pipe each selection through the given external filter program and
|
2018-01-23 05:59:46 +01:00
|
|
|
ignore its output. Shell expansions are available,
|
|
|
|
(See <<expansions#shell-expansions,`:doc expansions shell-expansions`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*!*::
|
2018-01-23 05:59:46 +01:00
|
|
|
insert command output before selection. Shell expansions are available,
|
|
|
|
(See <<expansions#shell-expansions,`:doc expansions shell-expansions`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-05-31 19:22:01 +02:00
|
|
|
*<a-!>*::
|
2018-01-23 05:59:46 +01:00
|
|
|
append command output after selection. Shell expansions are available,
|
|
|
|
(See <<expansions#shell-expansions,`:doc expansions shell-expansions`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*u*::
|
2017-11-02 10:37:39 +01:00
|
|
|
undo last change
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-07-26 08:26:13 +02:00
|
|
|
*<a-u>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move backward in history
|
2016-07-26 08:26:13 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*U*::
|
2017-11-02 10:37:39 +01:00
|
|
|
redo last change
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-07-26 08:26:13 +02:00
|
|
|
*<a-U>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move forward in history
|
2016-07-26 08:26:13 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*&*::
|
2017-11-02 10:37:39 +01:00
|
|
|
align selection, align the cursor of selections by inserting spaces
|
|
|
|
before the first character of the selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-&>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
copy indent, copy the indentation of the main selection (or the
|
|
|
|
count one if a count is given) to all other ones
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*`*::
|
2017-11-02 10:37:39 +01:00
|
|
|
to lower case
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*~*::
|
2017-11-02 10:37:39 +01:00
|
|
|
to upper case
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-`>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
swap case
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*@*::
|
2017-11-02 10:37:39 +01:00
|
|
|
convert tabs to spaces in current selections, uses the buffer tabstop
|
|
|
|
option or the count parameter for tabstop
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-@>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
convert spaces to tabs in current selections, uses the buffer tabstop
|
|
|
|
option or the count parameter for tabstop
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2018-02-13 14:35:10 +01:00
|
|
|
*_*::
|
|
|
|
trim selections
|
|
|
|
|
2017-02-01 21:54:29 +01:00
|
|
|
*<a-">*::
|
2017-11-02 10:37:39 +01:00
|
|
|
rotate selections content, if specified, the count groups selections,
|
|
|
|
so the following command
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-03-12 10:13:49 +01:00
|
|
|
----------
|
2017-02-11 08:56:27 +01:00
|
|
|
3<a-">
|
2016-03-12 10:13:49 +01:00
|
|
|
----------
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
rotate (1, 2, 3) and (3, 4, 6) independently
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
== Goto commands
|
2017-01-23 00:53:08 +01:00
|
|
|
|
2017-06-15 14:14:05 +02:00
|
|
|
*g*, *G*::
|
2017-11-02 10:37:39 +01:00
|
|
|
When a count is specified, *G* only extends the current selection to the given line,
|
|
|
|
*g* sends the anchor to the given line and a menu is then displayed which waits
|
|
|
|
for one of the following additional keys:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*h*:::
|
|
|
|
go to line begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*l*:::
|
|
|
|
go to line end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*i*:::
|
|
|
|
go to non blank line start
|
2017-01-23 00:53:08 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*g*, *k*:::
|
|
|
|
go to the first line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*j*:::
|
|
|
|
go to the last line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*e*:::
|
|
|
|
go to last char of last line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*t*:::
|
|
|
|
go to the first displayed line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*c*:::
|
|
|
|
go to the middle displayed line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*b*:::
|
|
|
|
go to the last displayed line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*a*:::
|
|
|
|
go to the previous (alternate) buffer
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*f*:::
|
|
|
|
open the file whose name is selected
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*.*:::
|
|
|
|
go to last buffer modification position
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== View commands
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-06-15 14:14:05 +02:00
|
|
|
*v*, *V*::
|
2017-11-02 10:37:39 +01:00
|
|
|
*V* enters lock view mode (which will be left when the <esc> is hit),
|
|
|
|
and *v* modifies the current view; a menu is then displayed which waits
|
|
|
|
for one of the following additional keys:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*v*, *c*:::
|
|
|
|
center the main selection in the window (vertically)
|
2017-10-06 17:49:13 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*m*:::
|
|
|
|
center the main selection in the window (horizontally)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*t*:::
|
|
|
|
scroll to put the main selection on the top line of the window
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*b*:::
|
|
|
|
scroll to put the main selection on the bottom line of the window
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*h*:::
|
|
|
|
scroll the window count columns left
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*j*:::
|
|
|
|
scroll the window count line downward
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*k*:::
|
|
|
|
scroll the window count line upward
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*l*:::
|
|
|
|
scroll the window count columns right
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Marks
|
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
Current selections position can be saved in a register and restored later on.
|
|
|
|
Marks use the *^* register by default (See <<registers#,`:doc registers`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*Z*::
|
2017-11-02 10:37:39 +01:00
|
|
|
save the current selections to the register
|
2016-11-09 14:57:05 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*z*::
|
2017-11-02 10:37:39 +01:00
|
|
|
restore the selections from the register
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-06-15 14:14:05 +02:00
|
|
|
*<a-z>*, *<a-Z>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
*<a-z>* combines the selections from the register with the current ones, whereas
|
|
|
|
*<a-Z>* combines the current selections with the register; a menu is then
|
|
|
|
displayed which waits for one of the following additional keys:
|
2017-05-20 11:31:49 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*a*:::
|
|
|
|
append the selections
|
2017-05-20 11:31:49 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*u*:::
|
|
|
|
keep a union of the selections
|
2017-06-15 14:14:05 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*i*:::
|
|
|
|
keep an intersection of the selections
|
2017-06-15 14:14:05 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*<*:::
|
|
|
|
select the selection with the leftmost cursor for each pair
|
2017-06-15 14:14:05 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*>*:::
|
|
|
|
select the selection with the rightmost cursor for each pair
|
2017-06-15 14:14:05 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*+*:::
|
|
|
|
select the longest selection
|
2017-06-15 14:14:05 +02:00
|
|
|
|
2017-11-02 10:37:39 +01:00
|
|
|
*-*:::
|
|
|
|
select the shortest selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Macros
|
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
Macros use the *@* register by default (See <<registers#,`:doc registers`>>)
|
2017-05-17 14:22:27 +02:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Q*::
|
2017-11-02 10:37:39 +01:00
|
|
|
start or end macro recording
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*q*::
|
2017-11-02 10:37:39 +01:00
|
|
|
play a recorded macro
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
*<esc>*::
|
|
|
|
end macro recording
|
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Searching
|
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
Searches use the */* register by default (See <<registers#,`:doc registers`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
***::
|
2017-11-02 10:37:39 +01:00
|
|
|
set the search pattern to the current selection (automatically
|
|
|
|
detects word boundaries)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-***>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
set the search pattern to the current selection (verbatim, no smart
|
|
|
|
detection)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Jump list
|
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
Some commands, like the goto commands, buffer switch or search commands,
|
|
|
|
push the previous selections to the client's jump list. It is possible
|
|
|
|
to skim through the jump list using:
|
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*<c-i>*::
|
2017-11-10 18:06:38 +01:00
|
|
|
jump forward
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-o>*::
|
2017-11-10 18:06:38 +01:00
|
|
|
jump backward
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-s>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
save current selections
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Multiple selections
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*s*::
|
2017-11-02 10:37:39 +01:00
|
|
|
create a selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-13 10:36:04 +01:00
|
|
|
*S*::
|
|
|
|
split the current selection
|
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*<a-s>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
split the current selections on line boundaries
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-13 10:36:04 +01:00
|
|
|
*<a-S>*::
|
|
|
|
select first and last characters of each selections
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*C*::
|
2017-11-02 10:37:39 +01:00
|
|
|
copy the current selection to the next line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-C>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
copy the current selection to the previous line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<space>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
clear a multiple selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-space>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
clear the current selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-k>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
keep the selections that match the given regex
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-K>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
clear selections that match the given regex
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*$*::
|
2017-11-02 10:37:39 +01:00
|
|
|
pipe each selection to the given shell command and keep the ones
|
2018-01-23 05:59:46 +01:00
|
|
|
for which the shell returned 0. Shell expansions are available,
|
|
|
|
(See <<expansions#shell-expansions,`:doc expansions shell-expansions`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Object Selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
For nestable objects, a count can be used in order to specify which surrounding
|
|
|
|
level to select.
|
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*<a-a>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
selects the whole object
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<a-i>*::
|
2017-11-10 18:06:38 +01:00
|
|
|
selects the inner object, that is the object excluding its surrounder.
|
|
|
|
For example, for a quoted string, this will not select the quote, and
|
|
|
|
for a word this will not select trailing spaces.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*[*::
|
2017-11-02 10:37:39 +01:00
|
|
|
selects to object start
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*]*::
|
2017-11-02 10:37:39 +01:00
|
|
|
selects to object end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*{*::
|
2017-11-02 10:37:39 +01:00
|
|
|
extends selections to object start
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*}*::
|
2017-11-02 10:37:39 +01:00
|
|
|
extends selections to object end
|
2016-02-02 20:15:12 +01:00
|
|
|
|
2017-11-12 15:44:04 +01:00
|
|
|
After these keys, a second key needs to be entered in order to specify
|
|
|
|
the wanted object:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*b*, *(*, *)*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing parenthesis
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*B*, *{*, *}*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing {} block
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*r*, *[*, *]*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing [] block
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*a*, *<*, *>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing <> block
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
*Q*, *"*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing double quoted string
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
*q*, *'*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing single quoted string
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
*g*, *`*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the enclosing grave quoted string
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*w*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the whole word
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*W*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the whole WORD
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*s*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the sentence
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*p*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the paragraph
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*␣*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the whitespaces
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*i*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the current indentation block
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*n*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the number
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-04-13 10:51:51 +02:00
|
|
|
*u*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select the argument
|
2016-04-13 10:51:51 +02:00
|
|
|
|
2017-10-06 17:49:13 +02:00
|
|
|
*c*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select user defined object, will prompt for open and close text
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-10 18:06:38 +01:00
|
|
|
== Prompt commands
|
|
|
|
|
|
|
|
When pressing `:` in normal mode, Kakoune will open a prompt to enter a command.
|
|
|
|
The following keys are recognized by this mode to help edition.
|
|
|
|
(See <<commands#,`:doc commands`>>)
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<ret>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
validate prompt
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<esc>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
abandon without
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<left>*, *<a-h>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursor to previous character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<right>*, *<a-l>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursor to previous character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<home>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursor to first character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<end>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
move cursor past the last character
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<backspace>*, *<a-x>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
erase character before cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<del>*, *<a-d>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
erase character under cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-w>*::
|
2017-11-25 17:18:12 +01:00
|
|
|
advance to next word begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-a-w>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
advance to next WORD begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-b>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
go back to previous word begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-a-b>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
go back to previous WORD begin
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-e>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
advance to next word end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-a-e>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
advance to next word end
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<up>*, *<c-p>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select previous entry in history
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<down>*, *<c-n>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select next entry in history
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<tab>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select next completion candidate
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<backtab>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
select previous completion candidate
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-r>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
insert then content of the register given by next key
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-v>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
insert next keystroke without interpreting it
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*<c-o>*::
|
2017-11-02 10:37:39 +01:00
|
|
|
disable auto completion for this prompt
|