update VIMTOKAK

This commit is contained in:
Maxime Coste 2013-12-24 01:46:08 +00:00
parent 22102951e2
commit 10fb96011e

View File

@ -1,11 +1,16 @@
Vi(m) to Kakoune: Vi(m) to Kakoune:
================= =================
Most operations in Kakoune are reversed compared to Vim: In kak, you first Kakoune is inspired heavily by Vim, it strives to be as efficient as Vim,
select the text you want to act on, then you edit it. This way, things are more consistent and simpler. A big differences is that a lot of special
much more consistent, as for example, kak does not need a key for delete features in Vim just become regular interaction of basic features in
character, the delete key handles this just fine as long as you did not Kakoune.
select more than a character (but clearing selection is only one space away).
Operations and moves are reversed in Kakoune. First select whatever text
you want to operate on, and then use an modifying operation. That makes
things more consistent (Vim needs a separate x and d operation because
of the operator -> move order, Kakoune only needs the d operation). That
also allows more complex selections.
delete a word: delete a word:
* vim: dw * vim: dw
@ -23,6 +28,22 @@ global replace:
* vim: :%s/word/replacement<ret> * vim: :%s/word/replacement<ret>
* kak: %sword<ret>creplacement<esc> * kak: %sword<ret>creplacement<esc>
Explanation: '%' selects the entire buffer, 's' opens a prompt for a
regex, <ret> validates the regex and replace the selection with one
per matches (hence, all occurences of word are selected). 'c' deletes
the selection contents and enter insert mode, replacement is typed
and <esc> goes back to normal mode.
Note that the Kakoune version is one key less, and is not a special
feature per se, but just a nice way Kakoune features work together.
replace in current curly braces block:
* vim: viB:s/word/replacement<ret>
* kak: <a-i>Bsword<ret>creplacement<esc>
Here again, we need to rely on another Vim special feature, visual
mode.
join line with next: join line with next:
* vim: J * vim: J
* kak: alt-J * kak: alt-J
@ -44,4 +65,4 @@ alphabetic chars had to change.
:[gv]/re/cmd :[gv]/re/cmd
to emulate :g or :v, use % to select the whole buffer, alt-s to get to emulate :g or :v, use % to select the whole buffer, alt-s to get
one selection by line, and then alt-k or alt-K in order to keep only the one selection by line, and then alt-k or alt-K in order to keep only the
selections matching (or not matching) the entered regex. selections matching (or not matching) the entered regex.