Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 3.23 KB

differences-with-vim.md

File metadata and controls

66 lines (46 loc) · 3.23 KB

Differences with Vi(m)

A linguistic twist

A big difference is that Krabby reverses the vi bindings (action, object) to (selection, action).

vi basic grammar is verb (immediately) followed by object; it’s nice because it matches well with the order we use in English. On the other hand, it does not match well with the nature of what we express: there is only a handful of verbs in web browsing, and they don’t compose, contrarily to objects which can be arbitrarily complex, and difficult to express in a single motion.

Kakoune’s grammar is one (or more) objects followed by verb, which allows chaining actions, combined with instantaneous feedback.

For example, in Vimium, you have f to open a link, y f to yank a link, while in Krabby, objects and actions are two building blocks: f to select a link, followed by the action: Enter to open, y to yank, etc.

After selecting a link, you can apply your actions, or continue refining your selection(s) to reach something more complex (see the 3-gatsu no Lion example at the bottom).

Multiple selections

Another particular feature of Krabby is its support for, and emphasis towards the use of multiple selections. Multiple selections in Krabby are not just one additional feature, it is the central way of interacting with your objects.

For example, there is no Alt + f command to open multiple links. What you would do is get multiple selections with F aka hint lock mode, select multiple links and exit with Escape. You would end up with a set of selections and use Control + Enter to open them in background.

Another way to get multi-selection is with f we viewed before to focus a link, s to create a selection out of the active element, Alt + a to expand the region, followed by Alt + I to select all links within the selection.

Here is an example to open links in a paragraph:

Opening links in a paragraph

Or videos with mpv:

Play videos with mpv

Multiple selections provides us with a very powerful to express structural selection: we can subselect elements inside the current selections, keep selections containing / not containing a match.

For example, here is how you could do to download 3-gatsu no Lion episodes from HorribleSubs:

Download 3-gatsu no Lion episodes from HorribleSubs

Or extract the list of cities and towns in Russia from Wikipedia:

Extract from Wikipedia the list of cities and towns in Russia