Kakoune
Selection-first modal editor with a different paradigm than Vim.
Official WebsiteFeatures
Installation
brew install kakouneapt install kakounepacman -S kakouneWhy 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
# 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 -versionSelection-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 quotesyap - Yank paragraphKakoune Operation Order
wd - Select word → delete<a-i>"c - Select content inside quotes → change<a-a>py - Select paragraph → yankMode 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 modesInsert 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
# 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.txtCommon Commands
Navigation (Normal Mode)
| Key | Description |
|---|---|
h j k l | Move left, down, up, right (selection moves too) |
w / b | Select next word / previous word |
e | Select to end of word |
x | Select entire line |
% | Select entire file |
gh / gl | Move to start / end of line |
gg / ge | Move to start / end of file |
:line_number | Jump to specified line |
Selection
| Key | Description |
|---|---|
; | Shrink selection to cursor position only |
<a-;> | Reverse selection direction |
<a-i> + delimiter | Select inside delimiters (e.g., <a-i>") |
<a-a> + delimiter | Select entire delimiters (e.g., <a-a>") |
s | Search within selection with regex and select each match |
S | Split selection by regex |
K | Keep non-matching selections |
<a-K> | Keep matching selections |
Editing (Use After Selection)
| Key | Description |
|---|---|
d | Delete selection |
c | Delete selection and enter Insert mode |
y | Yank (copy) selection |
p / P | Paste after / before selection |
R | Replace selection with yanked text |
u / U | Undo / Redo |
> / < | Indent / Unindent |
~ | Toggle uppercase/lowercase |
Multi-Selection
| Key | Description |
|---|---|
C | Duplicate 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.
# 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
mkdir -p ~/.config/kak/plugins/
git clone https://github.com/andreyorst/plug.kak.git ~/.config/kak/plugins/plug.kakPlugin Configuration Example
# 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-install # Install plugins
:plug-update # Update plugins
:plug-clean # Remove unused plugins
:plug-list # List installed pluginsClient-Server Architecture
Kakoune has a unique architecture that allows multiple clients to connect to one session.
# 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.txtTips
- •Read detailed documentation with
:doccommand. Use:doc keysfor key binding list. - •Vim's
dwis equivalent towdin Kakoune. Think "select word then delete". - •Select entire file with
%, select search matches withsfor 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.