Kakoune Is a Text Editor Kakoune, a modal screen-based text editor created in 2011 by French programmer Maxime Coste, offers a unique inverted grammar that prioritizes multiple selections and multi-cursor editing, with a design focused on interactivity, orthogonality, and Unix philosophy. The editor's client-server architecture and extensible hook and macro system distinguish it from Vim, and it has inspired but diverged from the Helix editor. The article serves as a comprehensive learning resource for both new and existing users, emphasizing a gradual, long-term approach to mastering its features. introduction Welcome My goal with this article is to help you develop a comprehensive understanding of the Kakoune https://kakoune.org text editor: what it is, how it works, and why it has that design. Although this is not exactly a tutorial, we build up these concepts gradually, and plenty concrete usage examples and demo videos are provided to supplement the discussion. This piece is quite long, and densely loaded with information. I suggest treating it like a long-term learning resource you can chip away at, rather than trying to tackle it all in one session. I hope this ends up being useful, both to new users and existing Kakoune enthusiasts. If you have any questions or comments about this post, please don’t hesitate to contact me /contact . This article was written without AI assistance. If you are interested in a more human internet, please consider subscribing to my RSS feed https://ficd.sh/rss.xml to be notified of future posts. What is kakoune? what-is-kakoune beyond vim beyond-vim What does subject : verb order even mean? what-does-subject-verb-order-even-mean kakoune’s inverted grammar kakounes-inverted-grammar orthogonality and atomic edits orthogonality-and-atomic-edits A deeper dive into keys & commands a-deeper-dive-into-keys-commands multiple selections multiple-selections registers & marks registers-marks iterative learning iterative-learning a server-client editor a-server-client-editor editing with pipes editing-with-pipes command expansions command-expansions writing plugins writing-plugins shell expansions shell-expansions conclusion conclusion What is kakoune? what-is-kakoune Kakoune https://kakoune.org French: kakun is a modal screen-based text editor created in 2011 by French programmer Maxime Coste 1, better known as mawww https://github.com/mawww . Having begun its life as a C++ rewrite of Vim, it has since evolved into a project with a strong identity and unique design goals. A non-exhaustive overview of Kakoune’s most interesting features 2: Multiple selections and multi-cursor editing are first-class regex filtering, splitting, aligning, etc. . Interactivity and experimentation are core design principles . Orthogonal design with powerful editing primitives selection rotation, indentation leveling, case manipulation… Client/Server architecture in which the windows of your session are managed by your terminal or window manager tmux, i3, niri… . Highly extendable with an easy-to-learn hook & macro system unofficially called “Kakscript” .- Large focus on Unix philosophy ; Kakoune not only integrates with, but relies on standard Unix tools. note on helix Kakoune https://kakoune.org has served as a major inspiration for the Helix https://github.com/helix-editor/helix editor. However, Helix has diverged on some key design points, and the two cannot be discussed interchangeably. Thus, Helix is outside the scope of this discussion. With that said, although much of this article won’t apply to Helix, some of it might, due to its shared DNA with Kakoune. Thus, Helix users may still find this discussion valuable. beyond vim beyond-vim Let’s consider “Vim motions” as an editing language. This “core” doesn’t need to be surrounded by Vim; there are many editors VS Code, JetBrains… that support Vim motions. Thus, a user that learns Vim motions in one tool can quickly adapt to another tool that supports them. A side effect of this is that, because of Vim’s ubiquity, a lot of people have come to view “Vim-like bindings” as the standard for keyboard-driven, modal editing. In other words, users expect editors to be mostly compatible with their existing “Vim binding muscle memory”. Some people won’t consider an editor that expects them to change their approach. I think that’s a shame, because although I’m sure Vim is so popular for a reason, we can certainly do better . No design is immune to being iterated on and improved. Kakoune does this in an innovative way: by inverting the subject–verb order . What does subject : verb order even mean? what-does-subject-verb-order-even-mean When people say they expect “Vim bindings”, what they really mean isn’t specific keys… sure, we’re used to hjkl for movement, but we can get used to something else just as fast. What matters most is Vim’s modal text editing grammar . It distinguishes between insert mode regular typing and normal mode : in which keys comprise words composed into sentences that describe text edits in the form verb followed by subject . This structure closely mirrors English, so it feels natural for us to reason about. For example, we might express “delete this word” as dw : d for “delete” as the verb, and w for “until the start of the next word” as the subject. There’s no shortage https://stackoverflow.com/a/1220118 of excellent writing https://takac.github.io/2013/01/30/vim-grammar/ on Vim’s text editing language https://learnvim.irian.to/basics/vim grammar . However, let me briefly challenge the intuitiveness of verb : subject for text editing. How often have you found yourself in the following situation? You’re editing the middle of a sentence, and now you want to delete from the cursor up to a certain word. You know exactly how far to go; since you can clearly see the target with your eyes. The challenge: how to share this information with the editor? Well, the optimal Vim-like command would be d