# Kakoune

> Modal code editor inspired by Vim that uses multiple selections as its core editing model, with a client-server architecture and external tool integration.

Stars: 11.1k · Language: C++ · License: Unlicense · Categories: Editor

- Repository: https://github.com/mawww/kakoune
- Website: http://kakoune.org
- Page: https://www.trmn.sh/tools/kakoune

## Install

- Homebrew: `brew install kakoune`
- apt: `sudo apt install kakoune`
- Build from source: `git clone https://github.com/mawww/kakoune.git`
- Build from source: `cd kakoune`
- Build from source: `make`
- Build from source: `./src/kak`

## Overview

Kakoune is a modal code editor that keeps Vi's model of keystrokes as a text editing language, but was redesigned around selections. It has normal and insertion modes. In normal mode, keys manipulate selections or the selected text. In insertion mode, keys are inserted before each selection's cursor. A selection is an oriented, inclusive range of characters with an anchor and a cursor, and there is always at least one.

Multiple selections are the central interaction mechanism. Selection primitives include selecting all regex matches inside current selections, keeping or discarding selections that match a regex, splitting selections with a regex, and text objects such as paragraphs, sentences and nestable blocks. Text manipulation primitives include aligning selections, rotating selection contents, case changes, indentation, and piping each selection through an external filter. Most commands give immediate, incremental feedback, and the project aims to match Vim on keystroke count.

Kakoune uses a client-server architecture, so several clients can attach to one editing session. Splits and panes are left to tmux, zellij, kitty, wezterm or the window manager, which spawn clients connected to the same session. Other documented features are macros, hooks, automatic contextual help, as-you-type completion, and syntax highlighting that supports multiple languages in one buffer and different highlighting per window. Configuration is loaded from `autoload` directories and a `kakrc` in `$XDG_CONFIG_HOME/kak/` (or `~/.config/kak/`).

It targets developers comfortable with modal editing who work in a Unix-like terminal environment. It builds with a C++20 compiler (GCC 10.3+ or clang 11+) on Linux, macOS and Cygwin. No native Windows version is planned.

### Installation

```bash
# via Homebrew
brew install kakoune
```

```bash
# via apt
sudo apt install kakoune
```

```bash
# via Build from source
git clone https://github.com/mawww/kakoune.git
cd kakoune
make
./src/kak
```

## Alternatives

- [Fresh](https://www.trmn.sh/tools/fresh.md): Terminal text editor with VS Code-style keybindings, mouse support, LSP, multi-cursor editing, and a command palette that requires no configuration. (Rust, 9.3k stars)
- [Edit](https://www.trmn.sh/tools/edit.md): Terminal text editor written in Rust, modeled on the MS-DOS Editor with VS Code-style input controls. Runs on Windows, macOS, and Linux. (Rust, 14.7k stars)
- [amp](https://www.trmn.sh/tools/amp.md): Vi/Vim-inspired terminal text editor built in Rust with simplified interaction model and modern features. (4.1k stars)
- [flowcontrol](https://www.trmn.sh/tools/flowcontrol.md): TUI text editor built with Zig, featuring tree-sitter syntax highlighting, LSP support, and multiple keybinding modes (Zig, 2.5k stars)
- [durdraw](https://www.trmn.sh/tools/durdraw.md): ASCII, Unicode and ANSI art editor for Unix-like systems with frame-based animation support (1.8k stars)

---

Canonical: https://www.trmn.sh/tools/kakoune
