Skip to content

Differences from Vi(m)

Marc André Tanner edited this page Feb 21, 2017 · 10 revisions

Below we list some deliberate differences in behavior compared to vi(m).

Newline addressability

In vis newlines are directly addressable irrespective of the current mode like any other character of the underlying file.

$ moves the cursor over the new line (not the last character of the line). As a consequence x can be used to join lines.

Leaving insert mode does not move the cursor one character back. Repeatedly switching in and out of insert mode is idempotent with respect to the cursor position.

See also this related discussion.

Motions always behave the same way irrespective of context

In vim the range covered by certain motions can vary depending on whether they are used in an operator context or not. Advancing to the next word using w starting from #

The brown fox jumps #ver 
           the lazy dog.

results in:

The brown fox jumps over 
           #he lazy dog.

but issuing dw from the same starting position produces:

The brown fox jumps 
           the lazy dog.

Search direction of n and N

These motions currently always search in forward (n) and backward (N) directions irrespective on how the initial search was performed.

See also issue #470.

Ex mode is not supported

Instead we use sam's structural regular expressions based command language.

Clone this wiki locally