Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Differences from Vi(m)

Nick Hanley edited this pageNov 16, 2022 ·10 revisions

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

Multiple cursors/selections instead of visual block mode

Visual block mode is not implemented, instead vis has builtin support formultiple cursors/selections providing a moreinteractive experience.

Structural regular expressions instead of Ex mode

Ex mode is not supported, instead we use sam'sstructural regular expressionsbased command language.

Lua instead of Vimscript

Instead of the mess that is Vimscript, we useLua. A well designed, lightweight,general purpose programming language supporting multiple paradigms andfeaturing an efficient implementation.

POSIX Extended Regular Expressions instead of a custom, non-standard variation

No more{very-,}{no,}magicmodes with different semantics and escaping rules. Instead we use the familiarand predictable POSIX Extended Regular Expression variant.

Newline addressability

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.

Cursor positioning when leaving insert mode

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.

Search direction ofn andN

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.

Behavior ofgn andgN in Normal mode

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.

Searching witht andT

If cursor is before the character being searched for, invis that character is skipped.

Behavior of%

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.

Modular design

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.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp