- Notifications
You must be signed in to change notification settings - Fork271
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 formultiple cursors/selections providing a moreinteractive experience.
Ex mode is not supported, instead we use sam'sstructural regular expressionsbased command language.
Instead of the mess that is Vimscript, we useLua. A well designed, lightweight,general purpose programming language supporting multiple paradigms andfeaturing an efficient implementation.
No more{very-,}{no,}magic
modes with different semantics and escaping rules. Instead we use the familiarand predictable POSIX Extended Regular Expression variant.
In vis newlines are directly addressable irrespective of the current modelike any other character of the underlying file.
$
moves the cursor over the new line (not the last character of the line).As a consequencex
can be used to join lines.
Leaving insert mode does not move the cursor one character back. Repeatedlyswitching in and out of insert mode is idempotent with respect to the cursorposition.
Operations like2itext<Escape>
are implemented in terms ofitext<Escape>.
See also thisrelated 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 alsoissue #470.
Invisgn
is an alias tovgn
andgN
is an alias tovgN
.
The following key mappings should replicatevim 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, invis
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 selectiondialog and word completion are all implemented as standalone tools.
A lot of vim's builtin functionality seemsout of scope for an editor anditsimplementation has accumulated a lot of cruftover the years.