1KAK(1) General Commands Manual KAK(1)
2
3
4
6 kak - a vim inspired, selection oriented code editor
7
8
10 kak -help
11
12
13 kak -version
14
15
16 kak -l
17
18
19 kak -clear
20
21
22 kak -f keys [-q] [-i] file...
23
24
25 kak -p session_id
26
27
28 kak -s session_id -d [-n] [-ro] [-E command] [+line[:column]|+:]
29 file...
30
31
32 kak [-c session_id|-s session_id] [-n] [-ro] [-ui ui_type] [-e command]
33 [-E command] [+line[:column]|+:] file...
34
35
37 Kakoune is a code editor heavily inspired by Vim, as such most of its
38 commands are similar to Vi's ones, and it shares Vi's "keystrokes as a
39 text editing language" model.
40
41 Kakoune can operate in two modes, normal and insertion. In insertion
42 mode, keys are directly inserted into the current buffer. In normal
43 mode, keys are used to manipulate the current selection and to enter
44 insertion mode.
45
46 Kakoune has a strong focus on interactivity, most commands provide
47 immediate and incremental results, while still being competitive (as in
48 keystroke count) with Vim.
49
50 Kakoune works on selections, which are oriented, inclusive range of
51 characters, selections have an anchor and a cursor character. Most com‐
52 mands move both of them, except when extending selection where the
53 anchor character stays fixed and the cursor one moves around.
54
55 For more information, use the :doc command after starting Kakoune, the
56 Kakoune wiki at https://github.com/mawww/kakoune/wiki or the main Kak‐
57 oune web site: https://kakoune.org/
58
59
61 -help display a help message and quit
62
63
64 -version
65 display kakoune version and quit
66
67
68 -n do not load resource files on startup (kakrc, autoload, rc etc)
69
70
71 -l list existing sessions
72
73
74 -d run as a headless session (requires -s)
75
76
77 -e command
78 execute command after the client initialization phase
79
80
81 -E command
82 execute command after the server initialization phase
83
84
85 -f keys
86 enter in filter mode: select the whole file, then execute keys
87
88
89 -i suffix
90 backup the files on which a filter is applied using the given
91 suffix
92
93
94 -q when in filter mode, don't print any errors
95
96
97 -p session_id
98 send the commands written on the standard input to session ses‐
99 sion_id
100
101
102 -c session_id
103 connect to the given session
104
105
106 -s session_id
107 set the current session name to session_id
108
109
110 -ui type
111 select the user interface, can be one of ncurses, dummy or json
112
113
114 -clear remove sessions that terminated in an incorrect state (e.g.
115 after a crash)
116
117
118 -ro enter in readonly mode, all the buffers opened will not be writ‐
119 ten to disk
120
121
122 +line[:column]
123 specify a target line and column for the first file; when the
124 plus sign is followed by only a colon, then the cursor is sent
125 to the last line of the file
126
127
128 file one or more files to edit
129
130
132 KAKOUNE_POSIX_SHELL
133 Overrides the posix shell binary path to use for %sh{...} expan‐
134 sion.
135
136
137 KAKOUNE_CONFIG_DIR
138 Overrides the location of the directory containing kakoune user
139 configuration, defaults to $XDG_CONFIG_HOME/kak if unset.
140
141
142 XDG_CONFIG_HOME
143 Path to the user configuration directory, defaults to
144 $HOME/.config/kak if unset.
145
146
147 XDG_RUNTIME_DIR
148 Path to the user session sockets, defaults to $TMPDIR/kakoune if
149 unset.
150
151
153 In the paths documented below, <rtdir> refers to the runtime directory,
154 whose value is determined in relation to the path to the kak binary:
155 <rtdir> = <path_to_kak_binary>/../share/kak.
156
157 If not started with the -n switch, Kakoune will first load
158 <rtdir>/kakrc, which will in turn load the following additional files:
159
160 if the $KAKOUNE_CONFIG_DIR/kak/autoload directory exists, recursively load every
161 *.kak files in it and its sub-directories
162
163 if it does not exist, fall back to the system-wide autoload directory
164 in <rtdir>/autoload, and recursively load all files in a similar way
165
166 <rtdir>/kakrc.local, if it exists; this is a user-defined system-wide
167 configuration
168
169 $KAKOUNE_CONFIG_DIR/kak/kakrc, if it exists; this is the user configuration
170
171 Consequently, if the $KAKOUNE_CONFIG_DIR/kak/autoload directory exists,
172 only scripts stored within that directory will be loaded - the built-in
173 *.kak files will not be.
174
175 Users who still want to have the built-in scripts loaded along their
176 own can create a symbolic link to <rtdir>/autoload (or to individual
177 scripts in it) in their user-configuration directory:
178
179 ln -s <rtdir>/autoload "${XDG_CONFIG_HOME:-$HOME/.config}"/kak/autoload
180
181
183 Edit a file:
184
185 kak /path/to/file
186
187
188 Edit multiple files (multiple buffers will be created):
189
190 kak ./file1.txt /path/to/file2.c
191
192
193 Insert a modeline that sets the tabstop variable at the beginning of
194 several source code files:
195
196 kak -f "ggO// kak: tabstop=8<esc>" *.c
197
198
200 vi(1), vim(1), sam(1plan9)
201
202
203
204 KAK(1)