Edit Vim to Kakoune guide for ease of reading
- Some run-ons and comma splices broken into more sentences - Minor fixes like mismatched singular/plurals - Fixed one incorrect instruction that mistook <space> for ;
This commit is contained in:
parent
22bdd527cb
commit
d29535ec0d
37
VIMTOKAK
37
VIMTOKAK
|
@ -1,16 +1,16 @@
|
||||||
Vi(m) to Kakoune:
|
Vi(m) to Kakoune:
|
||||||
=================
|
=================
|
||||||
|
|
||||||
Kakoune is inspired heavily by Vim, it strives to be as efficient as Vim,
|
Kakoune is inspired heavily by Vim. It strives to be as efficient as Vim,
|
||||||
more consistent and simpler. A big difference is that a lot of special
|
more consistent and simpler. A big difference is that a lot of special
|
||||||
features in Vim just become regular interactions of basic features in
|
features in Vim just become regular interactions of basic features in
|
||||||
Kakoune.
|
Kakoune.
|
||||||
|
|
||||||
Operations and moves are reversed in Kakoune. First select whatever text
|
Operations and moves are reversed in Kakoune. First select whatever text
|
||||||
you want to operate on, and then use an modifying operation. That makes
|
you want to operate on, and then use a modifying operation. That makes
|
||||||
things more consistent (Vim needs a separate x and d operation because
|
things more consistent: Vim needs separate x and d operations because
|
||||||
of the operator -> move order, Kakoune only needs the d operation). That
|
of the operator -> move order, while Kakoune only needs the d operation.
|
||||||
also allows more complex selections.
|
Selecting first also allows more complex selections.
|
||||||
|
|
||||||
delete a word:
|
delete a word:
|
||||||
* vim: dw
|
* vim: dw
|
||||||
|
@ -29,9 +29,9 @@ global replace:
|
||||||
* kak: %sword<ret>creplacement<esc>
|
* kak: %sword<ret>creplacement<esc>
|
||||||
|
|
||||||
Explanation: '%' selects the entire buffer, 's' opens a prompt for a
|
Explanation: '%' selects the entire buffer, 's' opens a prompt for a
|
||||||
regex, <ret> validates the regex and replace the selection with one
|
regex, <ret> validates the regex and replaces the selection with one
|
||||||
per matches (hence, all occurences of word are selected). 'c' deletes
|
per match (hence all occurences of "word" are selected). 'c' deletes
|
||||||
the selection contents and enter insert mode, replacement is typed
|
the selection contents and enters insert mode where "replacement" is typed,
|
||||||
and <esc> goes back to normal mode.
|
and <esc> goes back to normal mode.
|
||||||
|
|
||||||
Note that the Kakoune version is one key less, and is not a special
|
Note that the Kakoune version is one key less, and is not a special
|
||||||
|
@ -41,8 +41,7 @@ replace in current curly braces block:
|
||||||
* vim: viB:s/word/replacement<ret>
|
* vim: viB:s/word/replacement<ret>
|
||||||
* kak: <a-i>Bsword<ret>creplacement<esc>
|
* kak: <a-i>Bsword<ret>creplacement<esc>
|
||||||
|
|
||||||
Here again, we need to rely on another Vim special feature, visual
|
Here again, Vim had to rely on a special feature, visual mode.
|
||||||
mode.
|
|
||||||
|
|
||||||
join line with next:
|
join line with next:
|
||||||
* vim: J
|
* vim: J
|
||||||
|
@ -52,17 +51,17 @@ delete to line end:
|
||||||
* vim: d$
|
* vim: d$
|
||||||
* kak: <a-l>d or Gld
|
* kak: <a-l>d or Gld
|
||||||
|
|
||||||
some classic vim moves are not bound to the same key, this is due to Kakoune
|
Some classic Vim moves are not bound to the same key. Kakoune
|
||||||
using shifted moves to append to selection, so moves that were bound to non
|
uses shifted moves to extend the selection, so Vim moves that were bound to
|
||||||
alphabetic chars had to change.
|
shifted characters had to change.
|
||||||
|
|
||||||
* % become m (for matching), however m will replace selection with the next
|
* % became m (for "matching"). However, m replaces the selection with the next
|
||||||
block, if you want to get a selection from current point to next block end,
|
block. If you want to get a selection from the current point to the next
|
||||||
you should use <space>M (<space> clears the selection to one character)
|
block's end, you should use ;M (; reduces the selection to one character).
|
||||||
|
|
||||||
* 0 and $ became <a-h> and <a-l>. Another binding is gh and gl.
|
* 0 and $ became <a-h> and <a-l>. Equivalent bindings are gh and gl.
|
||||||
|
|
||||||
:[gv]/re/cmd
|
:[gv]/re/cmd
|
||||||
to emulate :g or :v, use % to select the whole buffer, <a-s> to get
|
To emulate :g or :v, use % to select the whole buffer, <a-s> to get
|
||||||
one selection by line, and then <a-k> or <a-K> in order to keep only the
|
one selection per line, and then <a-k> or <a-K> to keep only the
|
||||||
selections matching (or not matching) the entered regex.
|
selections matching (or not matching) the entered regex.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user