Features

This document describes the features of vim emulated by VimBindings.jl.

Info

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.

CommandDescriptionImplemented
hleftโœ…
lrightโœ…
jdownโœ…
kupโœ…
wnext wordโœ…
Wnext WORDโœ…
eend of wordโœ…
Eend of WORDโœ…
bprevious wordโœ…
Bprevious WORDโœ…
^beginning of line (excluding whitespace)โœ…
0first 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.

CommandDescriptionImplemented
cchangeโœ…
ddeleteโœ…
yyank๐Ÿšง (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() are function, 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() are function and hello().
CommandDescriptionImplemented
awa wordโœ…
iwinner wordโœ…
aWa WORDโœ…
iWinner WORDโœ…
a]/a[a [] block๐Ÿšง (see issue)
i]/i[inner [] block๐Ÿšง
a)/a(/aba block๐Ÿšง
i)/i(/ibinner block๐Ÿšง
a>/a<a <> block๐Ÿšง
i>/i<inner <> block๐Ÿšง
a}/a{/aBa Block๐Ÿšง
i}/i{/iBinner Block๐Ÿšง
a"/a'/a`a quoted string๐Ÿšง
i"/i'/i`inner quoted string๐Ÿšง
as/isa sentence, inner sentenceโŒ
ap/ipa paragraph, inner paragraphโŒ
at/ata tag block, inner tag blockโŒ

Inserting Text

Insert commands can be used to insert new text.

CommandDescriptionImplemented
iinsert text before the cursorโœ…
Iinsert text before the first non-blank in the lineโœ…
aappend text after the cursorโœ…
Aappend text at the end of the lineโœ…
obegin a new line below the cursor and insert textโœ…
Obegin a new line above the cursor and insert textโœ…
gIinsert text in column 1โŒ
giinsert text where Insert mode was stopped last timeโŒ

Deleting and Changing text

CommandDescriptionImplemented
xdelete count characters under and after the cursor. Equivalent to dlโœ…
Xdelete count character before the cursor. Equivalent to dhโœ…
Ddelete from the cursor until the end of the line. Equivalent to d$โœ…
dddelete lineโœ…
Cdelete from the cursor position to the end of the line and start insert. Equivalent to c$.โœ…
ccdelete line and start insertโœ…
sdelete the character under the cursor and start insertโœ…
Sdelete count lines and start insert. Equivalent to cc.โœ…
rreplace the character under the cursorโœ…
Renter replace modeโŒ
Jjoin 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.

CommandDescriptionImplemented
uundo count changesโœ…
C-rredo count changesโœ…
Uundo the latest changes on onelineโŒ

Miscellaneous

CommandDescriptionImplemented
vstart visual modeโŒ
/search forwardโŒ
?search backwardโŒ
nrepeat the latest "/" or "?"โŒ
Nrepeat the latest "/" or "?" in the opposite directionโŒ
*search forward for the word nearest to the cursorโŒ
\#same as "*" but search backwardโŒ
Ggoto line count, default last lineโŒ
gggo to line count, default first lineโŒ
[(go to previous unmatched '('โŒ
[{go to previous unmatched '{'โŒ
])go to next unmatched ')'โŒ
]}go to next unmatched '}'โŒ
]mgo to next start of a methodโŒ
]Mgo to next end of a methodโŒ
[mgo to previous start of a methodโŒ
[Mgo 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.