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 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 ([{}]) โ (countsentences backwardโ )countsentences forwardโ {countparagraphs backwardโ }countparagraphs forwardโ ]]countsections forward or to the next{in the first columnโ ][countsections forward or to the next}in the first columnโ [[countsections backward or to the previous{in the first columnโ []countsections 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 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()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()arefunctionandhello().
Command Description Implemented 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.
Command Description Implemented 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
Command Description Implemented xdelete countcharacters under and after the cursor. Equivalent todlโ Xdelete countcharacter before the cursor. Equivalent todhโ 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 countlines and start insert. Equivalent tocc.โ 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.
Command Description Implemented uundo countchangesโ C-rredo countchangesโ Uundo the latest changes on oneline โ
Miscellaneous
Command Description Implemented 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.