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.
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
| Flag | What it does |
|---|---|
-c COMMANDS | Execute commands after opening files; separate multiple commands with semicolons |
-n | Do not load standard rc configuration file |
-l | List all open sessions and exit |
-d | Run as daemon; start server without connecting a client UI |
-s SESSION | Attach to or create an existing session |
-e COMMAND | Execute command in the context of the server (for kak -l or existing session) |
-p SESSION | Print the version and exit |
-ui UI | Specify the UI type: ncurses (default) or dummy |
Examples
Open myfile.txt in Kak editor
kak myfile.txtOpen two C++ files in a named session for easier management
kak -s mysession file1.cpp file2.cppOpen config.py and set tab stops to 4 spaces on startup
kak -c 'set tabstop 4' config.pyStart a Kak server session named 'work' running as a daemon
kak -d -s workList all currently running Kak sessions
kak -lExecute a sequence of keys in an existing 'work' session (join lines and delete)
kak -e 'execute-keys %{jd}' -s workOpen script.sh without loading the default rc configuration
kak -n script.shOpen document.txt and position cursor on line 5
kak +5 document.txt