2018-10-21 13:02:23 +02:00
|
|
|
.TH KAK 1
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
|
|
|
|
kak \- a vim inspired, selection oriented code editor
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
2019-01-23 22:52:01 +01:00
|
|
|
.PP
|
|
|
|
.B kak \-help
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-version
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-l
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-clear
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-f
|
|
|
|
.I keys
|
|
|
|
[\fB\-q\fR] [\fB\-i\fR]
|
|
|
|
.IR file ...
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-p
|
|
|
|
.I session_id
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B kak \-s
|
|
|
|
.I session_id
|
|
|
|
.B \-d
|
|
|
|
[\fB\-n\fR] [\fB\-ro\fR]
|
|
|
|
[\fB\-E\fR \fIcommand\fR]
|
|
|
|
[\fB+line\fR[\fB:column\fR]|\fB+:\fR]
|
|
|
|
.IR file ...
|
|
|
|
|
|
|
|
.PP
|
2018-10-21 13:02:23 +02:00
|
|
|
.B kak
|
2019-01-23 22:52:01 +01:00
|
|
|
[\fB\-c\fR \fIsession_id\fR|\fB\-s\fR \fIsession_id\fR]
|
|
|
|
[\fB\-n\fR] [\fB\-ro\fR]
|
|
|
|
[\fB\-ui\fR \fIui_type\fR] [\fB\-e\fR \fIcommand\fR]
|
|
|
|
[\fB\-E\fR \fIcommand\fR]
|
|
|
|
[\fB+line\fR[\fB:column\fR]|\fB+:\fR]
|
2018-10-21 13:02:23 +02:00
|
|
|
.IR file ...
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
2020-09-09 20:00:59 +02:00
|
|
|
Kakoune is a code editor heavily inspired by Vim. As such, most of its commands
|
|
|
|
are similar to Vi's and it shares Vi's "keystrokes as a text editing
|
2018-10-21 13:02:23 +02:00
|
|
|
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.
|
|
|
|
|
2020-09-09 20:00:59 +02:00
|
|
|
Kakoune works on selections, which are oriented, inclusive ranges of
|
|
|
|
characters. Selections have an anchor and a cursor. Most commands
|
|
|
|
move both of them except when extending selection, where the anchor character
|
|
|
|
stays fixed and the cursor moves around.
|
2018-10-21 13:02:23 +02:00
|
|
|
|
2019-01-23 23:09:07 +01:00
|
|
|
For more information, use the \fB:doc\fR command after starting Kakoune,
|
|
|
|
the Kakoune wiki at https://github.com/mawww/kakoune/wiki
|
|
|
|
or the main Kakoune web site: https://kakoune.org/
|
|
|
|
|
2018-10-21 13:02:23 +02:00
|
|
|
.SH OPTIONS
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-help
|
|
|
|
display a help message and quit
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-version
|
|
|
|
display kakoune version and quit
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-n
|
|
|
|
do not load resource files on startup (\fIkakrc\fR, \fIautoload\fR, \fIrc\fR etc)
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-l
|
|
|
|
list existing sessions
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-d
|
|
|
|
run as a headless session (requires \fB\-s\fR)
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-e " " \fIcommand\fR
|
|
|
|
execute \fIcommand\fR after the client initialization phase
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-E " " \fIcommand\fR
|
|
|
|
execute \fIcommand\fR after the server initialization phase
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-f " " \fIkeys\fR
|
|
|
|
enter in \fIfilter mode\fR: select the whole file, then execute \fIkeys\fR
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-i " " \fIsuffix\fR
|
|
|
|
backup the files on which a filter is applied using the given suffix
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-q
|
|
|
|
when in \fIfilter mode\fR, don't print any errors
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-p " " \fIsession_id\fR
|
|
|
|
send the commands written on the standard input to session \fIsession_id\fR
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-c " " \fIsession_id\fR
|
|
|
|
connect to the given session
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-s " " \fIsession_id\fR
|
|
|
|
set the current session name to \fIsession_id\fR
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-ui " " \fItype\fR
|
|
|
|
select the user interface, can be one of \fIncurses\fR, \fIdummy\fR or \fIjson\fR
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-clear
|
|
|
|
remove sessions that terminated in an incorrect state (e.g. after a crash)
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-ro
|
|
|
|
enter in \fIreadonly mode\fR, all the buffers opened will not be written to disk
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR +line "[:" column "]"
|
|
|
|
specify a target \fIline\fR and \fIcolumn\fR 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
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR file
|
|
|
|
one or more \fIfile\fRs to edit
|
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.SH ENVIRONMENT
|
2018-10-21 13:02:23 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.TP
|
|
|
|
.BR KAKOUNE_POSIX_SHELL
|
|
|
|
Overrides the posix shell binary path to use for \fI%sh{...}\fR expansion.
|
2018-10-21 13:02:23 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.TP
|
|
|
|
.BR KAKOUNE_CONFIG_DIR
|
|
|
|
Overrides the location of the directory containing kakoune user configuration,
|
|
|
|
defaults to \fI$XDG_CONFIG_HOME/kak\fR if unset.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR XDG_CONFIG_HOME
|
2020-06-01 15:23:23 +02:00
|
|
|
Path to the user configuration directory, defaults to \fI$HOME/.config\fR if unset.
|
2019-10-20 12:44:56 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR XDG_RUNTIME_DIR
|
|
|
|
Path to the user session sockets, defaults to \fI$TMPDIR/kakoune\fR if unset.
|
|
|
|
|
|
|
|
.SH FILES
|
|
|
|
|
|
|
|
In the paths documented below, \fI<rtdir>\fR refers to the runtime directory,
|
|
|
|
whose value is determined in relation to the path to the \fBkak\fR binary:
|
|
|
|
\fI<rtdir>\fR = \fI<path_to_kak_binary>/../share/kak\fR.
|
|
|
|
|
|
|
|
If not started with the \fB\-n\fR switch, Kakoune will first load
|
|
|
|
\fI<rtdir>/kakrc\fR, which will in turn load the following additional files:
|
2018-10-21 13:02:23 +02:00
|
|
|
|
|
|
|
.nf
|
|
|
|
.RS
|
2020-06-01 15:46:24 +02:00
|
|
|
if the \fI$KAKOUNE_CONFIG_DIR/autoload\fR directory exists, recursively load every
|
2019-10-20 12:44:56 +02:00
|
|
|
\fI*.kak\fR files in it and its sub-directories
|
2018-10-21 13:02:23 +02:00
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
|
|
|
.nf
|
|
|
|
.RS
|
2019-10-20 12:44:56 +02:00
|
|
|
if it does not exist, fall back to the system\-wide autoload directory
|
|
|
|
in \fI<rtdir>/autoload\fR, and recursively load all files in a similar way
|
2018-10-21 13:02:23 +02:00
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.nf
|
|
|
|
.RS
|
|
|
|
\fI<rtdir>/kakrc.local\fR, if it exists; this is a user\-defined system\-wide
|
|
|
|
configuration
|
|
|
|
.RE
|
|
|
|
.fi
|
2018-10-21 13:02:23 +02:00
|
|
|
|
|
|
|
.nf
|
|
|
|
.RS
|
2020-06-01 15:46:24 +02:00
|
|
|
\fI$KAKOUNE_CONFIG_DIR/kakrc\fR, if it exists; this is the user configuration
|
2018-10-21 13:02:23 +02:00
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
2020-06-01 15:46:24 +02:00
|
|
|
Consequently, if the \fI$KAKOUNE_CONFIG_DIR/autoload\fR directory exists,
|
2019-10-20 12:44:56 +02:00
|
|
|
only scripts stored within that directory will be loaded \- the built-in
|
|
|
|
\fI*.kak\fR files \fBwill not be\fR.
|
2019-10-10 11:26:27 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
Users who still want to have the built\-in scripts loaded along their own
|
|
|
|
can create a symbolic link to \fI<rtdir>/autoload\fR (or to individual
|
|
|
|
scripts in it) in their user\-configuration directory:
|
2019-10-10 11:26:27 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.nf
|
|
|
|
.RS
|
|
|
|
ln -s \fI<rtdir>\fR/autoload "${XDG_CONFIG_HOME:-$HOME/.config}"/kak/autoload
|
|
|
|
.RE
|
|
|
|
.fi
|
2019-10-10 11:26:27 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.SH EXAMPLES
|
2018-10-21 13:02:23 +02:00
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.PP
|
|
|
|
Edit a file:
|
2018-10-21 13:02:23 +02:00
|
|
|
|
|
|
|
.nf
|
|
|
|
.RS
|
2019-10-20 12:44:56 +02:00
|
|
|
kak /path/to/file
|
2018-10-21 13:02:23 +02:00
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.PP
|
|
|
|
Edit multiple files (multiple buffers will be created):
|
|
|
|
|
2018-10-21 13:02:23 +02:00
|
|
|
.nf
|
|
|
|
.RS
|
2019-10-20 12:44:56 +02:00
|
|
|
kak ./file1.txt /path/to/file2.c
|
2018-10-21 13:02:23 +02:00
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
2019-10-20 12:44:56 +02:00
|
|
|
.PP
|
|
|
|
Insert a modeline that sets the tabstop variable at the beginning of several
|
|
|
|
source code files:
|
|
|
|
|
|
|
|
.nf
|
|
|
|
.RS
|
|
|
|
kak \-f "ggO// kak: tabstop=8<esc>" *.c
|
|
|
|
.RE
|
|
|
|
.fi
|
2019-01-23 23:09:07 +01:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
|
|
.BR vi (1),
|
|
|
|
.BR vim (1),
|
|
|
|
.BR sam (1plan9)
|