Introduction
Kakoune is a modal code editor built around the idea that selections should come before actions. Where Vim uses verb-then-object (d3w to delete three words), Kakoune reverses this: you select first (3w to extend selection three words), see exactly what is selected with visual highlighting, then act (d to delete). Every operation provides immediate visual feedback.
What Kakoune Does
- Implements a selection-first modal editing model where every operation shows its effect before committing
- Provides native multi-selection editing as a core primitive, not an add-on
- Integrates with external tools via shell pipes for filtering, formatting, and completion
- Supports client-server architecture where multiple editing clients share one session
- Offers syntax highlighting for hundreds of languages via regex-based highlighters
Architecture Overview
Kakoune uses a client-server model written in C++. The server manages buffers, selections, and undo history, while clients handle rendering and input. Communication happens over Unix domain sockets. The editing model is based on selections, which are ranges of text that all commands operate on simultaneously. External tools are invoked through shell expansions (%sh{...}) that pipe buffer content to commands and read back results. Configuration uses a simple command language evaluated at startup from kakrc files.
Self-Hosting & Configuration
- Install via system package manager or build from source with a C++20 compiler
- Configuration lives in
~/.config/kak/kakrcand autoload directories - Add language support via the built-in
filetypehooks or third-party plugins - Plugins are plain shell scripts loaded from
~/.config/kak/autoload/ - Use
kak-lsp(Language Server Protocol client) for IDE features like completion and diagnostics
Key Features
- Selection-first editing with immediate visual feedback on every keystroke
- True multi-selection as a first-class primitive for parallel edits
- Client-server model for collaborative editing and session persistence
- Shell integration via
%sh{}blocks for piping text through any Unix tool - Minimal codebase (~20k lines of C++) for fast startup and low resource usage
Comparison with Similar Tools
- Vim/Neovim — verb-object model with cursor-based editing; Kakoune uses selection-first with multi-cursor
- Helix — Rust-based editor inspired by Kakoune with built-in LSP; Kakoune relies on external
kak-lsp - Emacs — extensible via Emacs Lisp; Kakoune extends via shell commands and simple scripting
- VS Code — GUI editor with multi-cursor support; Kakoune is terminal-native and modal
- Micro — simple terminal editor; Kakoune targets power users who want modal editing
FAQ
Q: How hard is it to switch from Vim? A: The modal concepts transfer, but the selection-first model requires relearning muscle memory. Most users adapt within a few days because the visual feedback makes commands predictable.
Q: Does Kakoune have plugin management?
A: There is no built-in plugin manager, but plug.kak is a community plugin manager. Plugins are shell scripts dropped into the autoload directory.
Q: Can I get IDE features like autocompletion?
A: Yes. Install kak-lsp to connect Kakoune to any Language Server Protocol server for completions, diagnostics, go-to-definition, and hover info.
Q: Does it support GUI mode? A: Kakoune is terminal-only. It renders via ncurses and relies on your terminal emulator for font rendering and color support.