$linuxjunkies
>

kak(1)

Kak is a code editor that combines the elegance of Vi with the power of Kakoune's multiple selections and client-server architecture.

UbuntuDebianFedoraArch

Synopsis

kak [OPTION]... [FILE]...

Description

Kak is a modal text editor inspired by Vi/Vim but with a focus on interactive editing through multiple selections and a unique command language. It operates in normal mode (navigation and selection) and insert mode (text entry), allowing you to select multiple locations and edit them simultaneously.

The editor uses a client-server model where the main Kak process runs as a server and the UI connects as a client, enabling multiple windows and seamless session management. Commands are executed through a powerful command language that supports macros, hooks, and custom configurations.

Common options

FlagWhat it does
-c COMMANDSExecute commands after opening files; separate multiple commands with semicolons
-nDo not load standard rc configuration file
-lList all open sessions and exit
-dRun as daemon; start server without connecting a client UI
-s SESSIONAttach to or create an existing session
-e COMMANDExecute command in the context of the server (for kak -l or existing session)
-p SESSIONPrint the version and exit
-ui UISpecify the UI type: ncurses (default) or dummy

Examples

Open myfile.txt in Kak editor

kak myfile.txt

Open two C++ files in a named session for easier management

kak -s mysession file1.cpp file2.cpp

Open config.py and set tab stops to 4 spaces on startup

kak -c 'set tabstop 4' config.py

Start a Kak server session named 'work' running as a daemon

kak -d -s work

List all currently running Kak sessions

kak -l

Execute a sequence of keys in an existing 'work' session (join lines and delete)

kak -e 'execute-keys %{jd}' -s work

Open script.sh without loading the default rc configuration

kak -n script.sh

Open document.txt and position cursor on line 5

kak +5 document.txt

Related commands