Skip to content

Commit

Permalink
Move yi-keymap-vim into more appropriate place
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercrow committed Jun 17, 2017
1 parent 3e60e01 commit bb92384
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 59 deletions.
77 changes: 77 additions & 0 deletions yi-keymap-vim/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Vim keymap for Yi
~~~~~~~~~~~~~~~~~

Please report incompatibilities not listed below in Github issues.

Intentionally not supported features of Vim
===========================================

* select mode (different from visual)
* folds
* 0<C-d> and ^<C-d> in insert mode
* After i_<C-o> only motions are allowed

Features incompatible with Vim because why not
==============================================

* Input events are consumed greedily. That is, if you have 'j' bound to Down
and 'jk' to Escape, 'j' always wins, unlike real Vim. This is because I
(Dmitry) dislike introducing timing stuff into logic. I'm not opposed to
having this behavior under a flag if it's simple to add.
* Y yanks to EOL
* A and I in linewise visual mode behave like in blockwise visual mode
* 999rZ turns ABC into ZZZ instead of doing nothing
* Operators in visual mode always leave cursor at selection start. Vim doesn't
do this in some cases and I (Dmitry) don't understand the pattern.
* Paragraph text object is slightly different
* Repeating insert actions with dot works differently when insertion events
contain oneshot normal commands, e.g. "ifoo<C-o>hbar<Esc>". In Vim dot would
insert only "bar", but yi dot inserts "fobaro"
* Scrolling motions (<C-f>, PageUp, etc) are treated like linewise motions.
* <C-w>, <C-u> remove whole region, not only entered characters.

Testing
=======

Single file test format
-----------------------

Files with names like "foo.test" are treated as single file tests.

::

-- Input <-- This marks beginning of initial buffer state
(1,1) <-- This is initial cursor position, (row, column), both 1-based
aaaaa <-- Here goes actual buffer content
b b b
ccccc
-- Output <-- This marks beginning of expected buffer state after test
(3,5) <-- This is expected cursor position
aaaaa <-- Expected buffer text
b bfoo b
ccccc
-- Events <-- This line starts event sequence that is fed to editor after loading initial state
2wifoo
<Esc>jj

Directory test format
---------------------

Directories that contain files "input", "output" and "events" and nothing else
are considered directory tests. These three files have the same format as the
sections of single file test described above.

Test file naming note
---------------------

Originally we've used names like "ddP.test" and "ddp.test". It turned out to
be really inconvenient on OSX, which uses case-insensitive filesystem by
default. We had to rename tests to avoid collisions: "ddP.test" became
"dd_capP.test".

Event notation
--------------

Event parsing expects a subset of vim notation (see :help <>). Backslash
escaping is not supported. So to enter left angle bracket one must write <lt>
and not \<.
59 changes: 0 additions & 59 deletions yi-keymap-vim/tests/vimtests/README.rst

This file was deleted.

0 comments on commit bb92384

Please sign in to comment.