Terminal GuideTerminal Guide
kakoune icon

Kakoune

Text Editors
macOSLinux
C++

Selection-first modal editor with a different paradigm than Vim.

Official Website

Features

Selection FirstMultiple SelectionsClient-ServerMinimal Core

Installation

Homebrew
brew install kakoune
APT (Debian/Ubuntu)
apt install kakoune
Pacman (Arch)
pacman -S kakoune

Why Use Kakoune?

Kakoune reconsiders Vim's philosophy and adopts a consistent "select then operate" paradigm modal editor. Since the selection range can be visually confirmed before the operation, predictable and safe editing is possible.

Selection-First

All operations start with selection. You can clearly confirm what is affected before deletion, change, or yank.

Multi-Selection

Operate on multiple selections simultaneously. Batch editing is possible by splitting and filtering selections with regular expressions.

Client-Server

Connect multiple clients to one session. Flexible pair programming and window splitting.

Minimal Core

Keep core features minimal and extend with shell scripts. Design based on Unix philosophy.

Installation

Installation
# macOS (Homebrew)
brew install kakoune

# Ubuntu/Debian
sudo apt install kakoune

# Fedora
sudo dnf install kakoune

# Arch Linux
sudo pacman -S kakoune

# Build from source
git clone https://github.com/mawww/kakoune.git
cd kakoune
make
sudo make install

# Check version
kak -version

Selection-First Paradigm

In Vim, the order is "verb + noun" (e.g., dw = delete + word), but in Kakoune, the order is "noun + verb" (e.g., wd = select word + delete).

Vim Operation Order

dw - Delete word (d=delete, w=word)
ci" - Change content inside quotes
yap - Yank paragraph
Selection range is unclear until operation executes

Kakoune Operation Order

wd - Select word → delete
<a-i>"c - Select content inside quotes → change
<a-a>py - Select paragraph → yank
Selection range highlighted before operation

Mode Explanations

Kakoune has 3 basic modes.

Normal Mode (Default)

Navigation and selection mode. Always has something selected (at least 1 character).

Press Esc to return from other modes

Insert Mode

Text input mode. Works like a regular editor.

Enter with i (insert before), a (insert after), o (add line below)

Prompt Mode

Command input mode. : for commands, / for search, | for shell commands.

Enter with : / | ! etc.

Basic Operations

Basic Operations
# Open a file
kak filename.txt

# Open multiple files
kak file1.txt file2.txt

# Start new session
kak -s mysession filename.txt

# Connect to existing session
kak -c mysession

# List sessions
kak -l

# Open in read-only mode
kak -ro filename.txt

# Jump to specific line
kak +10 filename.txt

Common Commands

Navigation (Normal Mode)

KeyDescription
h j k lMove left, down, up, right (selection moves too)
w / bSelect next word / previous word
eSelect to end of word
xSelect entire line
%Select entire file
gh / glMove to start / end of line
gg / geMove to start / end of file
:line_numberJump to specified line

Selection

KeyDescription
;Shrink selection to cursor position only
<a-;>Reverse selection direction
<a-i> + delimiterSelect inside delimiters (e.g., <a-i>")
<a-a> + delimiterSelect entire delimiters (e.g., <a-a>")
sSearch within selection with regex and select each match
SSplit selection by regex
KKeep non-matching selections
<a-K>Keep matching selections

Editing (Use After Selection)

KeyDescription
dDelete selection
cDelete selection and enter Insert mode
yYank (copy) selection
p / PPaste after / before selection
RReplace selection with yanked text
u / UUndo / Redo
> / <Indent / Unindent
~Toggle uppercase/lowercase

Multi-Selection

KeyDescription
CDuplicate selection on line below
<a-C>Duplicate selection on line above
<space>Remove non-main selections
<a-space>Remove main selection
)Make next selection main
(Make previous selection main
<a-s>Split selection by lines

Configuration File

Kakoune configuration is written in ~/.config/kak/kakrc. Configuration uses shell script-like syntax.

~/.config/kak/kakrc
# Color scheme
colorscheme gruvbox

# Line numbers
add-highlighter global/ number-lines -relative

# Highlight cursor line
add-highlighter global/ line-numbers
add-highlighter global/ wrap -word -indent

# Show whitespace characters
add-highlighter global/ show-whitespaces -tab '' -tabpad ' '

# Clipboard integration (macOS)
hook global NormalKey y|d|c %{
    nop %sh{
        printf "%s" "$kak_main_reg_dquote" | pbcopy
    }
}

# Soft wrap
add-highlighter global/ wrap -word -indent -marker ''

# Status line
set-option global ui_options terminal_status_on_top=false

# Tab settings
set-option global tabstop 4
set-option global indentwidth 4

# Scroll offset
set-option global scrolloff 5,5

# Key mapping
# jk to normal mode
hook global InsertChar k %{ try %{
    exec -draft hH <a-k>jk<ret> d
    exec <esc>
}}

# Space as leader key
map global normal <space> , -docstring 'leader'
map global normal <backspace> <space> -docstring 'remove all sels except main'

# File picker (fzf integration)
map global user f ':fzf-mode<ret>' -docstring 'fzf mode'

# Save and quit
map global user w ':write<ret>' -docstring 'save'
map global user q ':quit<ret>' -docstring 'quit'

# Buffer operations
map global user b ':buffer ' -docstring 'switch buffer'
map global user n ':buffer-next<ret>' -docstring 'next buffer'
map global user p ':buffer-previous<ret>' -docstring 'previous buffer'

# Toggle comment
map global user c ':comment-line<ret>' -docstring 'comment line'

Plugin Management (plug.kak)

plug.kak is a popular plugin manager for Kakoune.

Installing plug.kak

Install plug.kak
# Install plug.kak
mkdir -p ~/.config/kak/plugins/
git clone https://github.com/andreyorst/plug.kak.git ~/.config/kak/plugins/plug.kak

Plugin Configuration Example

~/.config/kak/kakrc
# Load plug.kak
source "%val{config}/plugins/plug.kak/rc/plug.kak"

# Declare plugins
plug "andreyorst/plug.kak" noload

# fzf integration
plug "andreyorst/fzf.kak" config %{
    map global normal <c-p> ': fzf-mode<ret>'
}

# Color scheme
plug "dracula/kakoune" theme config %{
    colorscheme dracula
}

# Auto pairs
plug "alexherbo2/auto-pairs.kak" config %{
    enable-auto-pairs
}

# LSP support
plug "kak-lsp/kak-lsp" do %{
    cargo install --locked --force --path .
} config %{
    set global lsp_cmd "kak-lsp -s %val{session}"

    hook global WinSetOption filetype=(rust|python|javascript|typescript) %{
        lsp-enable-window
    }

    # Hover information
    map global user l ':enter-user-mode lsp<ret>' -docstring 'lsp mode'
}

# Git integration
plug "andreyorst/kak-git" config %{
    hook global WinSetOption filetype=.* %{
        git show-diff
    }
}

Plugin Commands

plug.kak Commands
:plug-install    # Install plugins
:plug-update     # Update plugins
:plug-clean      # Remove unused plugins
:plug-list       # List installed plugins

Client-Server Architecture

Kakoune has a unique architecture that allows multiple clients to connect to one session.

Client-Server Operations
# Start named session
kak -s myproject file.txt

# Connect to same session from another terminal
kak -c myproject

# List available sessions
kak -l

# Manage clients within session
:new                      # Open new client (window)
:quit                     # Close current client
:kill                     # End entire session

# Open buffer in another client
:new edit another-file.txt

# Send command to all clients
:eval -client client0 edit file.txt

Tips

  • Read detailed documentation with :doc command. Use :doc keys for key binding list.
  • Vim's dw is equivalent to wd in Kakoune. Think "select word then delete".
  • Select entire file with %, select search matches with s for batch replace.
  • You can pipe selection to shell commands with |. Leverage Unix philosophy.
  • <a-> represents Alt modifier. May require configuration on macOS.
  • Use kak-lsp for LSP features (completion, goto definition, diagnostics). Requires separate installation.
  • Helix editor design is strongly influenced by Kakoune. Understanding Kakoune's philosophy makes learning Helix easier.
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More