forked from mawww/kakoune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkak.1
290 lines (290 loc) · 5.55 KB
/
kak.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
.Dd June 15, 2021
.Dt KAK 1
.Os
.Sh NAME
.Nm kak
.Nd a vim-inspired, selection oriented code editor
.
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl n
.Op Fl ro
.Op Fl c Ar session_id | Fl s Ar session_id
.Op Fl ui Ar ui_type
.Op Fl e Ar command
.Op Fl E Ar command
.Op Sy + Ns Ar line Ns Oo Sy \&: Ns Ar column Oc | Sy +:
.Op Ar file ...
.
.Nm
.Fl f Ar keys
.Op Fl q
.Op Fl i Ar suffix
.Op Ar file ...
.
.Nm
.Fl p Ar session_id
.
.Nm
.Fl l
.Nm
.Fl clear
.
.Nm
.Fl version
.
.Nm
.Fl help
.
.Sh DESCRIPTION
.Sy Kakoune
is a code editor heavily inspired by
.Xr vim 1
and
.Xr vi 1 .
As such, most of its commands are similar to
.Xr vi 1 Ap s,
sharing its
.Dq keystrokes as a text editing language
model.
.Pp
.Sy Kakoune
operates 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.
.Pp
.Sy Kakoune
has a strong focus on interactivity.
Most commands provide immediate and incremental results, while still
being competitive in keystroke count with vim.
.Pp
.Sy 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.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl help
Display a help message and quit.
.
.It Fl version
Display Kakoune version and quit.
.
.It Fl n
Do not load the system's kakrc.
.Pq often, Pa /usr/share/kak/kakrc
.
.It Fl l
List existing sessions.
.
.It Fl d
Run as a headless session
.Pq requires Fl s .
.
.It Fl e Ar command
Execute
.Ar command
after the client initialization phase.
.
.It Fl E Ar command
Execute
.Ar command
after the server initialization phase.
.
.It Fl f Ar keys
Run Kakoune in
.Sq filter mode ,
like
.Xr sed 1 .
For standard input and each file named on the command line,
the whole buffer is selected
(as with
.Li % )
then
.Ar keys
are executed.
The filtered version of standard input
is written to standard output.
Any files mentioned on the command line
are modified in-place,
but if
.Fl i
is provided then Kakoune makes a backup of the original version.
.
.It Fl i Ar suffix
Backup the files on which a filter is applied, using the given suffix.
.
.It Fl q
When in
.Sq filter mode ,
don't print any errors
.
.It Fl p Ar session_id
Send the commands written on the standard input to session
.Ar session_id .
.
.It Fl c Ar session_id
Connect to the given session
.Ar session_id .
.
.It Fl s Ar session_id
Set the current session name to
.Ar session_id .
.
.It Fl ui Ar type
Select the user interface type, which can be
.Em terminal ,
.Em dummy ,
or
.Em json .
.
.It Fl clear
Remove sessions that were terminated in an incorrect state
.Pq e.g. after a crash .
.
.It Fl ro
Begin in
.Em readonly mode ,
all the buffers opened will not be written to disk.
.
.It Sy + Ns Ar line Ns Oo Sy \&: Ns Ar column Oc | Sy +:
Specify a target line and column 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.
.
.It Ar file ...
One or more
.Ar file(s)
to edit.
.El
.
.Sh ENVIRONMENT
.Bl -tag -width 6n
.It Ev KAKOUNE_POSIX_SHELL
Overrides the POSIX shell used for
.Em %sh{...}
expansion, which is
.Pa /bin/sh
.Pq Xr sh 1
if unset.
.
.It Ev KAKOUNE_CONFIG_DIR
Overrides the location of the directory containing Kakoune user
configuration.
If unset,
.Pa $XDG_CONFIG_HOME/kak
is used.
.
.It Ev XDG_CONFIG_HOME
Path to the user's configuration directory.
If unset,
.Pa $HOME/.config
is used.
.
.It Ev XDG_RUNTIME_DIR
Path to the user's session's sockets.
If unset,
.Pa $TMPDIR/kakoune
is used.
.El
.
.Sh FILES
In the paths documented below,
.Pa <rtdir>
refers to the runtime directory, whose value is determined in relation
to the path to
.Nm Ap s
binary location:
.Pa <rtdir>
=
.Pa <path_to_kak_binary>/../share/kak .
.
.Pp
If not started with the
.Fl n
switch,
.Nm
will first load
.Pa <rtdir>/kakrc ,
which will in turn load the following additional files:
.
.Bl -bullet
.It
If the
.Pa $KAKOUNE_CONFIG_DIR/autoload
directory exists, recursively load every
.Pa *.kak
file in it, and its sub-directories.
.
.It
If it does not exist, fall back to the system-wide autoload directory in
.Pa <rtdir>/autoload ,
and recursively load all files in a similar way.
.
.It
.Pa <rtdir>/kakrc.local ,
if it exists; this is a user-defined system-wide configuration.
.
.It
.Pa $KAKOUNE_CONFIG_DIR/kakrc ,
if it exists; this is the user configuration.
.
.El
.
.Pp
Consequently, if the
.Pa $KAKOUNE_CONFIG_DIR/autoload
directory exists, only scripts stored within that directory will be
loaded \(em the built-in
.Pa *.kak
files will not be.
.
.Pp
Users who still want the built-in scripts to be loaded along their own
can create a symbolic link to
.Pa <rtdir>/autoload
.Pq or to individual scripts in it
in their user-configuration directory:
.
.Pp
.Dl ln -s \fI<rtdir>\fR/autoload "${XDG_CONFIG_HOME:-$HOME/.config}"/kak/autoload
.
.Sh EXAMPLES
.Bl -tag -width 6n
.It Edit a file:
.Nm
.Pa /path/to/file
.
.It Edit multiple files (multiple buffers will be created):
.Nm
.Pa ./file1.txt
.Pa /path/to/file2.c
.
.It Prepend a modeline that sets the tabstop to multiple files:
.Nm
.Fl f Qq ggO// kak: tabstop=8<esc>
.Pa *.c
.El
.
.Sh SEE ALSO
For the complete on-line documentation, use the
.Ic :doc
command after starting
.Nm .
.
.Pp
.Lk https://github.com/mawww/kakoune/wiki The Kakoune wiki .
.Pp
.Lk https://kakoune.org The main Kakoune web site .
.Pp
.Xr vi 1 ,
.Xr vim 1 ,
.Xr sam 1plan9 .
.
.Sh AUTHORS
.An Maxime Coste Aq Mt frrrwww@gmail.com
and many others.