-
Notifications
You must be signed in to change notification settings - Fork 263
Differences from Vi(m)
Below we list some deliberate differences in behavior compared to vi(m).
Visual block mode is not implemented, instead vis has builtin support for multiple cursors/selections providing a more interactive experience.
Ex mode is not supported, instead we use sam's structural regular expressions based command language.
Instead of the mess that is Vimscript, we use Lua. A well designed, lightweight, general purpose programming language supporting multiple paradigms and featuring an efficient implementation.
No more {very-,}{no,}magic
modes with different semantics and escaping rules. Instead we use the familiar
and predictable POSIX Extended Regular Expression variant.
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.
Operations like 2itext<Escape>
are implemented in terms of itext<Escape>.
See also this related discussion.
These motions currently always search in forward (n
) and backward (N
)
directions irrespective on how the initial search was performed.
The following key mappings should replicate vi behaviour:
:map! normal n <vis-motion-search-repeat>
:map! normal N <vis-motion-search-repeat-reverse>
You can apply these changes to the config.h file before compiling vis:
{ "M", ACTION(CURSOR_WINDOW_LINE_MIDDLE) },
- { "n", ACTION(CURSOR_SEARCH_REPEAT_FORWARD) },
- { "N", ACTION(CURSOR_SEARCH_REPEAT_BACKWARD) },
+ { "n", ACTION(CURSOR_SEARCH_REPEAT) },
+ { "N", ACTION(CURSOR_SEARCH_REPEAT_REVERSE) },
{ "T", ACTION(TILL_LINE_LEFT) },
See also issue #470.
In vis gn
is an alias to vgn
and gN
is an alias to vgN
.
The following key mappings should replicate vim behaviour:
:map! normal gn nvgn
:map! normal gN Nvgn
You can also change it in the config.h file before compiling vis.
If cursor is before the character being searched for, in vis
that character is skipped.
If cursor is not on a special character ('{', '}', '(', ')', '[', ']' etc), pressing %
once will attempt to find one forward. Pressing %
again will jump to its match if any. In Vi(m), pressing %
once will always combine the two actions together.
Clipboard integration, digraph support and a menu used for a file selection dialog and word completion are all implemented as standalone tools.
A lot of vim's builtin functionality seems out of scope for an editor and its implementation has accumulated a lot of cruft over the years.