'\" t
.\" Title: kak
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1
.\" Date: 12/21/2016
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "KAK" "1" "12/21/2016" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
kak \- a vim inspired, selection\-oriented code editor
.SH "SYNOPSIS"
.sp
\fBkak\fR [\-q] [\-n] [\-l] [\-ro] [\-clear] [\-ui ui_type] [\-e command] [\-f keys] [\-p session_id] [\-c session_id|[[\-d] \-s session_id] file \&...
.SH "DESCRIPTION"
.sp
Kakoune is a code editor heavily inspired by Vim; as such most of its commands are similar to Vi\(cqs ones, and it shares Vi\(cqs "keystrokes as a text editing language" model\&.
.sp
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\&.
.sp
Kakoune has a strong focus on interactivity \- most commands provide immediate and incremental results, while still being competitive (as in keystroke count) with Vim\&.
.sp
Kakoune works on selections, which are oriented, inclusive ranges 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\&.
.SH "OPTIONS"
.PP
\-n
.RS 4
do not load resource files on startup (\fIkakrc\fR,
\fIautoload\fR,
\fIrc\fR
etc)
.RE
.PP
\-l
.RS 4
list existing sessions
.RE
.PP
\-d
.RS 4
run as a headless session (requires \-s)
.RE
.PP
\-e
.RS 4
execute the
\fBcommand\fR
after the initialization phase
.RE
.PP
\-f
.RS 4
enter in
\fIfilter mode\fR
and execute
\fBkeys\fR
on the files passed as arguments
.RE
.PP
\-q
.RS 4
when in
\fIfilter mode\fR, don\(cqt print any errors
.RE
.PP
\-p
.RS 4
send the commands written on the standard input to session
\fBsession_id\fR
.RE
.PP
\-c
.RS 4
connect to the given session
.RE
.PP
\-s
.RS 4
rename the current session name to
\fBsession_id\fR
.RE
.PP
\-ui
.RS 4
select the user interface, can be one of
\fIncurses\fR,
\fIdummy\fR
or
\fIjson\fR
.RE
.PP
\-clear
.RS 4
remove sessions that terminated in an incorrect state (e\&.g\&. after a crash)
.RE
.PP
\-ro
.RS 4
enter in
\fIreadonly mode\fR, all the buffers opened will not be written to disk
.RE
.PP
file
.RS 4
one or more files to edit
.RE
.sp
At startup, if \-n is not specified, Kakoune will try to source the file \fI\&.\&./share/kak/kakrc\fR relative to the kak binary\&. This kak file will then try to recursively source any files in \fB$XDG_CONFIG_HOME\fR\fI/kak/autoload\fR (with \fB$XDG_CONFIG_HOME\fR defaulting to \fB$HOME\fR\fI/\&.config\fR, and falling back to \fI\&.\&./share/kak/autoload\fR if that autoload directory does not exist), and finally \fB$XDG_CONFIG_HOME\fR\fI/kak/kakrc\fR\&.
.sp
That leads to the following behaviour: by default, with no user autoload directory, the system\-wide autoload directory is used; once the user wants control of autoloading, they can create an autoload directory and eventually symlink individual scripts, or the whole system wide autoload directory\&. They can as well add any new scripts not provided with Kakoune\&.
.SH "EXAMPLES"
.PP
kak /path/to/file
.RS 4
Edit a file
.RE
.PP
kak \&./file1\&.txt /path/to/file2\&.c
.RS 4
Edit multiple files (multiple buffers will be created)
.RE
.PP
kak \-f "ggO// kak: tabstop=8" *\&.c
.RS 4
Insert a modeline that sets the tabstop variable at the beginning of several source code files
.RE
.SH "FILES"
.sp
If not started with the \-n switch, Kakoune will source the \fI\&.\&./share/kak/kakrc\fR file relative to the kak binary, which will source additional files:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
if the
\fB$XDG_CONFIG_HOME\fR\fI/kak/autoload\fR
directory exists, load every
\fI*\&.kak\fR
file in it, and load recursively any subdirectory
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
if it does not exist, fall back to the system\-wide autoload directory in
\fI\&.\&./share/kak/autoload\fR
.RE
.sp
After that, if it exists, source the \fB$XDG_CONFIG_HOME\fR\fI/kak/kakrc\fR file which should be used for user configuration\&. In order to continue autoloading site\-wide files with a local autoload directory, just add a symbolic link to \fI\&.\&./share/kak/autoload\fR into your local autoload directory\&.
.SH "SEE ALSO"
.sp
For more information, look at the individual Kakoune\-related manual pages:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_commands(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_execeval(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_expansions(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_faces(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_faq(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_highlighters(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_hooks(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_options(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_registers(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_scopes(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kak_shortcuts(1)
.RE