List vim inconsistencies

Hello,

Like many, I have a hard time deciding if Kakoune’s object-verb is “better” than Vim’s verb-object. It is tough to answer this question without being biased, and also the answer is not yes/no as there are advantages and drawbacks in both models.

However, I’d like to address at least one facet that could be part of the answer: which one of the two solutions has more “inconsistencies”. It feels to me that Kakoune has fewer special cases. A word always represents the same object whatever the verb as it is first defined. Same for inner-objects. They seem to be more consistent.

When I execute <a-i>{ it will select all characters inside the braces, including whitespace and newline characters. Then, if I want to only take full-line (and not include enclosing braces if they are on a different line for example), I can do <a-x> and it will trim the current selection to only contain full lines. It composes well. Also _ can unselect whitespace around selections. So instead of trying to guess what I want, Kakoune gives me the exact definition of what I executed, and then it is up to me to adjust this selection to my use-case.

In Vim, this is a different story. I know about those inconsistencies for instance:

  • cw is ce and so w means something different than in dw.
  • as operators are “pending-operator”, they cannot act upon “nothing” (current character under cursor), so it needs multiple operators for the same thing such as x and d, or s and c.
  • ci{ or di{ won’t delete the newline if the brace is on a different line and keep the indentation (which can be handy but which is not “pure” by definition).

Do you guys see other examples of such inconsistencies?

By the way, I am also interested in more global inconsistencies that are present in Vim and not in Kakoune (that are not necessarily related to the verb-object).

Thanks for your help.

One of my favorites:

  • Vim: u for undo <c-r> redo.
  • Kakoune: u for undo U for redo.

In Vim, moving to the beginning of the buffer is gg, moving to the beginning of the current line is g^, moving to the end of the current line is g$, and moving to the end of the buffer is G.

One of these is not like the others.

Meanwhile, Kakoune uses the hjkl keys to determine where to jump to, which is much more intuitive as we already use those keys for basic movement. gk is the beginning of the buffer, gl is the end of the current line, etc.

1 Like

I’m not an expert on vim or kakoune, but I’ve been trying out vim, Kakoune, and helix in parallel for a few weeks. I see it sometimes mentioned how vim has both ‘x’ and ‘d’ while in Kakoune does not need this. But I think one of the big differences between Vim and Kakoune is that in Vim the cursor is of zero width. It can be considered a line between two adjacent characters (even if it is displayed as a block highlighting a character). That being the case, one can delete either to the left or the right, the commands being dh and dl. I see ‘x’ in Vim as a convenient shortcut for ‘dl’ to save a keypress for this frequently needed operation. I don’t see ‘x’ as part of the Vim grammar. Kakoune also has a couple of shortcuts that are not part of the grammar, ALT-o and ALT-O are shortcut for o-ESC and O-ESC. So I don’t see the presence of ‘x’ in Vim as a major point.
Kakoune is defined around a cursor which is a selection of one character. In Kakoune, if we have abcdefghi where def is a selection, then if we delete this selection with ‘d’, then we get abcghi where g is selected. But it would be natural perhaps to have a zero-width cursor positioned between the ‘c’ and the ‘g’ (shown as a line).

Also, in Kakoune ‘w’ and ‘W’ sometimes give the same result (if the current selection is a character in a word), instead of having distinct meanings. If the Kakoune cursor were zero-width, then ‘W’ would mean select to the next word, while ‘w’ could mean move the cursor to the start of the next word, and there would be less overlap in the meaning of ‘w’ and ‘W’. I tend to think if Kakoune has a zero-width cursor, then it could be even more orthogonal.