dotlinux blog

Kakoune: A Better Code Editor Heavily Inspired by Vim

For decades, the debate over the best text editor has raged in developer circles. While modern Graphical User Interface (GUI) editors like VS Code and Sublime Text dominate in popularity, a dedicated faction swears by the efficiency and power of modal editors, with Vim standing as the undisputed champion. Vim's philosophy of keeping your hands on the keyboard and composing commands for powerful text manipulation is a paradigm shift that, once learned, feels unrivaled.

But what if we could take that powerful philosophy and refine it? What if we could address some of Vim's quirks and create a more consistent, intuitive, and interactive experience? Enter Kakoune.

Kakoune is a free, open-source code editor that stands on the shoulders of the Vim giant. It shares the same core principles: modal editing (with Normal, Insert, and Selection modes), a focus on keyboard-driven efficiency, and a powerful command language. However, Kakoune inverts the classic Vim verb-motion model (delete word) into a more logical object-verb model (select word, then delete). This simple yet profound change leads to a more predictable, discoverable, and visually interactive editing experience.

This blog post will serve as a deep dive into Kakoune, exploring why it might just be the "better" Vim-inspired editor you've been looking for.


2026-05

Table of Contents#

  1. The Core Philosophy: Inverting the Vim Model
  2. Key Features That Set Kakoune Apart
  3. A Practical Example: Vim vs. Kakoune
  4. Getting Started with Kakoune
  5. The Learning Curve and Community
  6. Is Kakoune for You?
  7. Conclusion
  8. References

The Core Philosophy: Inverting the Vim Model#

To understand Kakoune, you must first understand its fundamental departure from Vim. Vim operates on a verb-motion paradigm.

  • Verb: An action you want to perform (e.g., d for delete, c for change, y for yank/copy).
  • Motion: A text object you want to perform the action on (e.g., w for word, $ for end of line, t for until a character).

You compose these together: dw means "delete word." The problem for many learners is that this is a bit abstract. You have to mentally calculate what dw will do before you execute it.

Kakoune flips this to an object-verb model.

  • First, you select the object. You use motions to define the selection (e.g., w to select a word, s to select a sentence).
  • Then, you apply the verb. Once the text is highlighted, you perform the action (e.g., d to delete the selection, c to change it).

This model is inherently more visual and interactive. You see exactly what text will be affected before you execute the command, making it much harder to make mistakes.

Key Features That Set Kakoune Apart#

The Object-Verb Command Model#

As explained above, this is Kakoune's flagship feature. The selection-first approach reduces cognitive load. Instead of memorizing countless verb-motion combinations, you primarily learn the motions (selection commands). The verbs then become simple, predictable keys that act upon whatever is selected.

Multiple Selections#

This is arguably Kakoune's killer feature. While Vim operates on one cursor location, Kakoune can easily manage multiple selections.

  • Example: You need to change the name of a variable in several places on a line but not the entire file.
    • In Vim, you might use * to search and then cgn to change each instance one-by-one, or use a substitute command :%s/old/new/g for the whole file.
    • In Kakoune, you can simply select the first instance with x (which selects the word under the cursor) and then press . (or n) to add the next occurrence to the selection. You now have multiple cursors, each highlighting an instance of the variable. A single c command followed by the new name will change all selected instances simultaneously.

This makes repetitive, multi-location edits incredibly fast and intuitive.

Client-Server Architecture#

Kakoune is built with a client-server model. When you start Kakoune, it launches a background server process that holds your editing session. Every window or terminal tab you open is just a client connecting to that server.

Why is this useful?

  • Session Management: You can close all client windows and your session (open files, undo history, etc.) is preserved. Reopening Kakoune restores everything exactly as you left it.
  • Remote Editing: It's inherently designed for editing files on remote servers, as the server can run remotely while you use a local client.
  • Scripting and Integration: External scripts can send commands to the Kakoune server to manipulate text, enabling powerful integration with other tools.

Consistency and Simplicity#

Kakoune aims for a more orthogonal design than Vim. Commands are more consistent. For instance, in Visual mode in Vim, some commands behave differently than in Normal mode. In Kakoune, since you're always acting on a selection, the commands are universally consistent. The codebase is also much smaller and more focused than Vim's, making it easier to understand and hack on for those interested.

A Practical Example: Vim vs. Kakoune#

Let's change the function name from calculateTotal to computeSum in the following code:

// Before
function calculateTotal(items) {
    let total = 0;
    for (let item of items) {
        total += item.price;
    }
    return calculateTotal;
}

In Vim:

  1. Place cursor on the first calculateTotal.
  2. * to search for the next occurrence (jumps to the function name in the body).
  3. cgn to change the next searched term, type computeSum, and press <Esc>.
  4. Press n to jump to the last occurrence (the return statement).
  5. Press . to repeat the last change.

(Alternatively, use :%s/calculateTotal/computeSum/gc and confirm each change.)

In Kakoune:

  1. Place cursor on the first calculateTotal.
  2. x to select the whole word.
  3. * to extend the selection to all other occurrences in the file. Instantly, all three instances are highlighted.
  4. c to change all selected instances simultaneously.
  5. Type computeSum and press <Esc>.

The Kakoune workflow is more direct, visual, and requires fewer keystrokes for this common refactoring task.

Getting Started with Kakoune#

Installation#

Kakoune is available on most package managers.

  • macOS: brew install kakoune
  • Ubuntu/Debian: sudo apt-get install kakoune
  • Arch Linux: sudo pacman -S kakoune
  • Windows (WSL): Install via the package manager within your WSL distribution.

Check the official repository for more detailed instructions.

Basic Movement and Modes#

When you start Kakoune (kak filename), you are in Normal mode.

  • Normal Mode: For navigation, selection, and command execution. This is where you spend most of your time.
  • Insert Mode: For typing text. Press i to enter Insert mode from Normal mode. Press <Esc> to return to Normal mode.
  • Selection Mode: This is an extension of Normal mode. As soon as you make a selection (e.g., with w, l, x), you are effectively in Selection mode, where verbs will act upon the highlighted text.

Essential Commands#

CommandAction
h, j, k, lMove left, down, up, right.
w, bSelect to the start of next/previous word.
xSelect the whole word under the cursor.
sSelect the whole line.
iEnter Insert mode.
<Esc>Return to Normal mode from Insert mode.
dDelete the current selection.
cChange (delete and enter Insert mode) the current selection.
yYank (copy) the current selection.
pPaste after the selection.
uUndo.
.Repeat the last command.
:Enter command prompt (e.g., :w to save, :q to quit).

The Learning Curve and Community#

If you're already a Vim user, learning Kakoune will feel familiar yet frustrating at first—your muscle memory will betray you. However, many Vim veterans find that after an initial adjustment period, the Kakoune way feels more natural.

The community is smaller but growing and is very passionate. While the plugin ecosystem is not as vast as Vim's (or especially VS Code's), it is robust and covers essential needs like syntax highlighting, auto-completion (kak-lsp), and file explorers. The focus is on a solid core editing experience rather than an all-encompassing IDE-like platform.

Is Kakoune for You?#

You might love Kakoune if:

  • You appreciate Vim's philosophy but want a more consistent and intuitive model.
  • You frequently perform edits on multiple lines or locations.
  • You value a simple, focused tool that does one thing (text editing) exceptionally well.
  • You enjoy tinkering with and learning new, efficient workflows.

You might want to stick with Vim/Neovim if:

  • You have decades of Vim muscle memory that you're unwilling to retrain.
  • You rely on a very specific, complex Vim plugin ecosystem.
  • You need deep, mature IDE-like features (debugging, complex language support) that are more readily available in Neovim with LSP.

Conclusion#

Kakoune is not a Vim-killer; it's a Vim-evolver. It takes the genius of modal editing and presents it in a way that many find to be a logical improvement. The object-verb model and multiple selections are not just gimmicks—they fundamentally change how you interact with text, often making complex edits simpler and less error-prone.

While it may never reach the monumental user base of Vim, Kakoune has carved out a well-deserved niche as a thoughtful, powerful, and elegant code editor. It is a testament to the idea that even classic tools can be reimagined for the better. If you're a Vim curious or a Vim veteran looking for a fresh perspective, Kakoune is absolutely worth exploring.


References#

  1. Kakoune Official Website & Repository: https://github.com/mawww/kakoune - The primary source for installation, documentation, and code.
  2. Kakoune Documentation: https://github.com/mawww/kakoune/blob/master/README.asciidoc - The excellent built-in documentation, accessible via :doc inside Kakoune.
  3. kakoune.org: https://kakoune.org/ - A community-run hub with links to tutorials, plugins, and resources.
  4. "Why Kakoune" - A developer's perspective: https://kakoune.org/why-kakoune/why-kakoune.html - An article diving deeper into the design philosophy.
  5. "From Vim to Kakoune" Blog Post: https://delapouite.com/opinion/from-vim-to-kakoune.html - A detailed personal account of switching.