Scroll to navigation

KAK(1) General Commands Manual KAK(1)


kak - a vim inspired, selection oriented code editor


kak -help

kak -version

kak -l

kak -clear

kak -f keys [-q] [-i] file...

kak -p session_id

kak -s session_id -d [-n] [-ro] [-E command] [+line[:column]|+:] file...

kak [-c session_id|-s session_id] [-n] [-ro] [-ui ui_type] [-e command] [-E command] [+line[:column]|+:] file...


Kakoune is a code editor heavily inspired by Vim, as such most of its commands are similar to Vi's ones, and it shares Vi's "keystrokes as a text editing language" model.

Kakoune can operate in two modes, normal and insertion. In insertion mode, keys are directly inserted into the current buffer. In normal mode, keys are used to manipulate the current selection and to enter insertion mode.

Kakoune has a strong focus on interactivity, most commands provide immediate and incremental results, while still being competitive (as in keystroke count) with Vim.

Kakoune works on selections, which are oriented, inclusive range of characters, selections have an anchor and a cursor character. Most commands move both of them, except when extending selection where the anchor character stays fixed and the cursor one moves around.

For more information, use the :doc command after starting Kakoune, the Kakoune wiki at or the main Kakoune web site:


display a help message and quit

display kakoune version and quit

do not load resource files on startup (kakrc, autoload, rc etc)

list existing sessions

run as a headless session (requires -s)

execute command after the client initialization phase

execute command after the server initialization phase

enter in filter mode: select the whole file, then execute keys

backup the files on which a filter is applied using the given suffix

when in filter mode, don't print any errors

send the commands written on the standard input to session session_id

connect to the given session

set the current session name to session_id

select the user interface, can be one of ncurses, dummy or json

remove sessions that terminated in an incorrect state (e.g. after a crash)

enter in readonly mode, all the buffers opened will not be written to disk

specify a target line and column for the first file; when the plus sign is followed by only a colon, then the cursor is sent to the last line of the file

one or more files to edit


Overrides the posix shell binary path to use for %sh{...} expansion.

Overrides the location of the directory containing kakoune user configuration, defaults to $XDG_CONFIG_HOME/kak if unset.

Path to the user configuration directory, defaults to $HOME/.config/kak if unset.

Path to the user session sockets, defaults to $TMPDIR/kakoune if unset.


In the paths documented below, <rtdir> refers to the runtime directory, whose value is determined in relation to the path to the kak binary: <rtdir> = <path_to_kak_binary>/../share/kak.

If not started with the -n switch, Kakoune will first load <rtdir>/kakrc, which will in turn load the following additional files:

if the $KAKOUNE_CONFIG_DIR/kak/autoload directory exists, recursively load every
*.kak files in it and its sub-directories

if it does not exist, fall back to the system-wide autoload directory
in <rtdir>/autoload, and recursively load all files in a similar way

<rtdir>/kakrc.local, if it exists; this is a user-defined system-wide

$KAKOUNE_CONFIG_DIR/kak/kakrc, if it exists; this is the user configuration

Consequently, if the $KAKOUNE_CONFIG_DIR/kak/autoload directory exists, only scripts stored within that directory will be loaded - the built-in *.kak files will not be.

Users who still want to have the built-in scripts loaded along their own can create a symbolic link to <rtdir>/autoload (or to individual scripts in it) in their user-configuration directory:

ln -s <rtdir>/autoload "${XDG_CONFIG_HOME:-$HOME/.config}"/kak/autoload


Edit a file:

kak /path/to/file

Edit multiple files (multiple buffers will be created):

kak ./file1.txt /path/to/file2.c

Insert a modeline that sets the tabstop variable at the beginning of several source code files:

kak -f "ggO// kak: tabstop=8<esc>" *.c


vi(1), vim(1), sam(1plan9)