Ki modal editor - first impressions
Posted on in Modal editing, PESOS
I tried out a new modal editor called Ki, and inevitably measured my first impressions with Vim and Helix.
Copy-pasting my comment in a converstion on lobste.rs titled Wonderful vi:
I will put another one in the ring: Ki
Ki is similar to vim in that it uses modal editing.
Its similar to helix in that:
- It selects first, then acts on the selection.
- It has first-class multi-cursor support
- It aims to be low-config
- It has built-in LSP support. Adding a new language is a matter of declaring it. (I added 2 on my own yesterday, within 2 hours of using Ki. I could never have dared do this with vim/neovim).
Its different from both vim and Helix in that it splits the mental model into:
- selection mode;
- movement;
- action
such that:
- A selection mode sets the current unit - column/character, word, line, syntax node, the latter two of which are semantic units derived from tree-sitter grammar.
-
Because selection unit is already configured, movements are reduced to
hjkl
. - Actions, like helix, then act on the current selection.
I think I made the explanation more complicated than the actual execution.
I’ve only been exploring it for a day. Navigation through syntax nodes is impressive, but also heavily reliant on the language’s tree-sitter grammar being decent. Also, I’m not sure how much of a leg up it is against helix’s LSP jump to symbol. But helix’s operations on syntax nodes surely feels like a second thought, when compared to Ki’s.
There are other goodies:
- Everything is a buffer. So, same key-bindings are used everywhere.
- It has a built-in file-tree explorer (using yaml!), which can be fuzzy-searched too.
- Thought-out keybindings. For example, choosing between editor and system clipboard is a matter of \ key. y or p copies or pastes to editor clipboard, while \y or \p copies or pastes to the system clipboard.