Features
This document describes the features of vim emulated by VimBindings.jl.
These symbols indicate the state of a feature
โ Implemented
โ Not implemented
๐ง Planned or In Progress
Motions
Commands for moving the cursor.
A motion command may be prepended with a count
to repeat the motion, for example the motion 3w
moves 3 words to the right.
Command Description Implemented h
left โ l
right โ j
down โ k
up โ w
next word โ W
next WORD โ e
end of word โ E
end of WORD โ b
previous word โ B
previous WORD โ ^
beginning of line (excluding whitespace) โ 0
first character of line (including whitespace) โ $
end of line โ f{x}
the next occurence of {x} โ F{x}
the Previous occurence of {x} โ t{x}
till before the next occurence of {x} โ T{x}
till after the previous occurence of {x} โ %
find the next item in the line and jump to its match. Items can be ([{}]) โ (
count
sentences backwardโ )
count
sentences forwardโ {
count
paragraphs backwardโ }
count
paragraphs forwardโ ]]
count
sections forward or to the next{
in the first columnโ ][
count
sections forward or to the next}
in the first columnโ [[
count
sections backward or to the previous{
in the first columnโ []
count
sections backward or to the previous}
in the first columnโ
Operators
A motion can be used in after an operator to have the command operate on the text in the motion.
Command Description Implemented c
change โ d
delete โ y
yank ๐ง (see issue)
An operator may be prepended with a count
to repeat the operation. For example, 3dW
will execute the dW
operation 3 times.
Text Objects
Text object commands can only be used after an operator. Commands that start with a
select "a"n object including white space, the commands starting with i
select an "inner" object without white space, or just the white space. Thus the "inner" commands always select less text than the "a" commands.
Definitions of text objects:
- word: a word consists of a sequence of letters, digits and underscores, or a sequence of other non-blank characters, separated with whitespace (spaces, tabs, newline). For example, the words in the text
function hello()
arefunction
,hello
, and()
. - WORD: a WORD consists of a sequence of non-blank characters, separated with whitespace. For example, the WORDs in the text
function hello()
arefunction
andhello()
.
Command Description Implemented aw
a word โ iw
inner word โ aW
a WORD โ iW
inner WORD โ a]/a[
a [] block ๐ง (see issue) i]/i[
inner [] block ๐ง a)/a(/ab
a block ๐ง i)/i(/ib
inner block ๐ง a>/a<
a <> block ๐ง i>/i<
inner <> block ๐ง a}/a{/aB
a Block ๐ง i}/i{/iB
inner Block ๐ง a"/a'/a
`a quoted string ๐ง i"/i'/i
`inner quoted string ๐ง as/is
a sentence, inner sentence โ ap/ip
a paragraph, inner paragraph โ at/at
a tag block, inner tag block โ
Inserting Text
Insert commands can be used to insert new text.
Command Description Implemented i
insert text before the cursor โ I
insert text before the first non-blank in the line โ a
append text after the cursor โ A
append text at the end of the line โ o
begin a new line below the cursor and insert text โ O
begin a new line above the cursor and insert text โ gI
insert text in column 1 โ gi
insert text where Insert mode was stopped last time โ
Deleting and Changing text
Command Description Implemented x
delete count
characters under and after the cursor. Equivalent todl
โ X
delete count
character before the cursor. Equivalent todh
โ D
delete from the cursor until the end of the line. Equivalent to d$
โ dd
delete line โ C
delete from the cursor position to the end of the line and start insert. Equivalent to c$
.โ cc
delete line and start insert โ s
delete the character under the cursor and start insert โ S
delete count
lines and start insert. Equivalent tocc
.โ r
replace the character under the cursor โ R
enter replace mode โ J
join lines โ
Undo and Redo
VimBindings.jl implements the core semantics of undo and redo as implemented by vim, with the exception that VimBindings.jl does not implement an undo tree or undo branches. Undo/redo is implemented as a list.
The undo and redo implementation is not vi compatible; "uu" will undo two times, like in vim, rather than "undoing" an undo as in vi.
Command Description Implemented u
undo count
changesโ C-r
redo count
changesโ U
undo the latest changes on oneline โ
Miscellaneous
Command Description Implemented v
start visual mode โ /
search forward โ ?
search backward โ n
repeat the latest "/" or "?" โ N
repeat the latest "/" or "?" in the opposite direction โ *
search forward for the word nearest to the cursor โ \#
same as "*" but search backward โ G
goto line count
, default last lineโ gg
go to line count
, default first lineโ [(
go to previous unmatched '(' โ [{
go to previous unmatched '{' โ ])
go to next unmatched ')' โ ]}
go to next unmatched '}' โ ]m
go to next start of a method โ ]M
go to next end of a method โ [m
go to previous start of a method โ [M
go to previous end of a method โ
Requesting Features
If there is a feature you would like to see implemented, please let us know by adding it to the "Key bind request" thread.
References
Many of these descriptions are adapted from the vim documentation of the respective commands.