2021-03-07 - kak vs nvim
yesterday, i mentioned that i started using kakoune a few months ago in a youtube thread. someone then asked me what the differences are between kakoune and neovim. i ended up writing a consideral amount of thoughts of the pros and cons of neovim vs kakoune. so i'll share that in a blog post too!
kakoune is not for everyone, but here are some of the pros and cons for me.
pros of kakoune over neovim
in my opinion, kakoune follows the unix philosophy more closely than neovim does. for example, kakoune doesn't have multiple windows or floating windows. instead it encourages you to make use of your terminal multiplexer or window manager. that can be seen as a drawback, but i see it as a benefit, since it encourages more thought & development towards the editor experience.
kakoune is built with shell integration in mind. one way to demonstrate this is that it doesn't have much of a configuration language. to create any complex logic or plugins for kakoune, you have to write it in another language and kakoune will comunicate with it via environment variables and stdout. this encourages people to write programs that can server both as useful unix scripting utilities and also kakoune plugins. i wish other editors followed a similar pattern, because that promotes plugin authors to write programs that could be useful to other editors or useful for scripting.
kakoune makes use of multiple cursors instead of visual selection or global search and replace. in my experience so far, multiple cursors are much more fun than global search and replace. i'm pretty sure they can do everything visual selection can do. plus they can do other cool things, like rotating all text multiple cursor selections, which is something i don't know if other ide multiple cursor implementations can handle. you can also filter through your selections, which isn't really a concept in vim.
plus there are a bunch of nice small things like:
- easy shell integration with the pipe character, instead of the ":%!" thing in vim.
- macros default to one register, so just type "q" to playback your macro, instead of "@q".
- modes outside of normal & insert have a menu that shows and describes keybindings. this makes it easy to add documentation for user and plugin keybindings.
- there is a built in keybinding for inserting a blank line (alt+o). that's something i had to create myself in neovim because i noticed i was typing "o<esc>k" too much.
- kakoune uses standard regex, instead of vim's specific regex format that i always forget.
- generally, the default editor keybindings in kakoune are somewhat similar to neovim's, but much more thoughtout. neovim can't do this, because they aim to be fully compatible with vi/vim out of the box.
pros of neovim over kakoune
neovim has a lot more plugins than kakoune, because there are far more users. just looking at stars on github, neovim has almost 6 times more stars than kakoune. plugin management is also more difficult with kakoune, because plugins tend to be written in different languages.
kakoune doesn't handly formatting or indentation well, at least not out of the box. the idea is that you should let an external command help you format things that are specific to your file. but that doesn't apply to every file format. neovim sometimes guesses what tab should do based on context or the file format, which sometimes seems magic to me, but it's usually nice.
neovim is starting to support treesitter, which kakoune doesn't support at all. kakoune's regex highlighting also doesn't feel as mature as neovim's.
i was also having some problems getting some of kakoune's keybindings working with terminal emulators on my macbook. i had to switch from alacritty to kitty to get this working.
i really like the philosophy behind kakoune, which is what intrigued me enough to make an editor switch. in practice, neovim's large plugin library makes up for the less eficient keybindings that kakoune proposes, but hopefully kakoune will acquire more plugins and features in time.