• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H07-Nov-2021-183146

colors/H07-Nov-2021-1,5831,419

contrib/H07-Nov-2021-1,004830

doc/H03-May-2022-5,3893,956

gdb/H07-Nov-2021-229159

libexec/kak/H07-Nov-2021-

rc/H07-Nov-2021-14,03211,523

share/kak/H07-Nov-2021-5143

src/H03-May-2022-36,80630,919

test/H07-Nov-2021-6,2524,215

.cirrus.ymlH A D07-Nov-20211.2 KiB4946

.gitignoreH A D07-Nov-2021145 1716

CHANGELOGH A D07-Nov-20219 KiB262171

CONTRIBUTINGH A D07-Nov-2021776 1913

MakefileH A D07-Nov-202172 85

README.asciidocH A D07-Nov-202127.8 KiB902676

UNLICENSEH A D07-Nov-20211.2 KiB2520

VIMTOKAKH A D07-Nov-20212.2 KiB6851

README.asciidoc

1= image:{logo}[K,30,30,link="{website}",title="Kakoune logo by p0nce"] Kakoune image:{cirrus-img}[link="{cirrus-url}"] image:{irc-img}[link="{irc-url}"]
2ifdef::env-github,env-browser[:outfilesuffix: .asciidoc]
3:logo: https://rawgit.com/mawww/kakoune/master/doc/kakoune_logo.svg
4:website: https://kakoune.org
5:cirrus-img: https://api.cirrus-ci.com/github/mawww/kakoune.svg
6:cirrus-url: https://cirrus-ci.com/github/mawww/kakoune
7:irc-img: https://img.shields.io/badge/IRC-%23kakoune-blue.svg
8:irc-url: https://web.libera.chat/?channels=kakoune
9:icons: font
10:toc: right
11:pp: ++
12
13TL;DR
14-----
15
16{website}
17
18*Modal editor* -- *Faster as in fewer keystrokes* --
19*Multiple selections* -- *Orthogonal design*
20
21---------------------------------------------
22git clone https://github.com/mawww/kakoune.git
23cd kakoune/src
24make
25./kak
26---------------------------------------------
27
28See https://github.com/mawww/golf for Kakoune solutions to vimgolf challenges,
29regularly beating the best Vim solution.
30
31See the link:doc/design.asciidoc[design document] for more information on
32Kakoune philosophy and design.
33
34:numbered:
35
36Introduction
37------------
38
39Kakoune is a code editor that implements Vi's "keystrokes as a text editing
40language" model. As it's also a modal editor, it is somewhat similar to the
41Vim editor (after which Kakoune was originally inspired).
42
43Kakoune can operate in two modes, normal and insertion. In insertion mode,
44keys are directly inserted into the current buffer. In normal mode, keys
45are used to manipulate the current selection and to enter insertion mode.
46
47Kakoune has a strong focus on interactivity, most commands provide immediate
48and incremental results, while still being competitive (as in keystroke count)
49with Vim.
50
51Kakoune works on selections, which are oriented, inclusive ranges of characters.
52Selections have an anchor and a cursor. Most commands move both of
53them except when extending selections, where the anchor character stays fixed
54and the cursor moves around.
55
56See https://vimeo.com/82711574
57
58Join us on libera IRC `#Kakoune`
59
60Features
61~~~~~~~~
62
63 * Multiple selections as a central way of interacting
64 * Powerful selection manipulation primitives
65   - Select all regex matches in current selections
66   - Keep selections containing/not containing a match for a given regex
67   - Split current selections with a regex
68   - Text objects (paragraph, sentence, nestable blocks)
69 * Powerful text manipulation primitives
70   - Align selections
71   - Rotate selection contents
72   - Case manipulation
73   - Indentation
74   - Piping each selection to external filter
75 * Client-Server architecture
76   - Multiple clients on the same editing session
77   - Use tmux or your X11 window manager to manage windows
78 * Simple interaction with external programs
79 * Automatic contextual help
80 * Automatic as you type completion
81 * Macros
82 * Hooks
83 * Syntax Highlighting
84   - Supports multiple languages in the same buffer
85   - Highlight a buffer differently in different windows
86
87Screenshots
88~~~~~~~~~~~
89
90[[screenshot-i3]]
91.Kakoune in i3
92image::doc/screenshot-i3.gif[Kakoune in i3]
93
94[[screenshot-tmux]]
95.Kakoune in tmux
96image::doc/screenshot-tmux.gif[Kakoune in tmux]
97
98Getting started
99---------------
100
101Building
102~~~~~~~~
103
104Kakoune dependencies are:
105
106 * A {cpp}17 compliant compiler (GCC >= 8 or clang >= 6) along with its
107   associated {cpp} standard library (libstdc{pp} or libc{pp})
108
109To build, just type *make* in the src directory.
110To generate man pages, type *make man* in the src directory.
111
112Kakoune can be built on Linux, MacOS, and Cygwin. Due to Kakoune relying heavily
113on being in a Unix-like environment, no native Windows version is planned.
114
115Installing
116~~~~~~~~~~
117
118In order to install kak on your system, rather than running it directly from
119its source directory, type *make install*. You can specify the `PREFIX` and
120`DESTDIR` if needed.
121
122[TIP]
123.Homebrew (macOS) or Linuxbrew
124====
125---------------------------------
126brew install kakoune
127---------------------------------
128====
129
130[TIP]
131.MacPorts (macOS)
132====
133---------------------------------
134sudo port selfupdate
135sudo port install kakoune
136---------------------------------
137====
138
139[TIP]
140.Fedora supported versions and Rawhide
141====
142---------------------------------
143dnf install kakoune
144---------------------------------
145====
146
147[TIP]
148.Fedora daily builds
149====
150Use the https://copr.fedoraproject.org/coprs/jkonecny/kakoune/[copr] repository.
151---------------------------------
152dnf copr enable jkonecny/kakoune
153dnf install kakoune
154---------------------------------
155====
156
157[TIP]
158.RHEL/CentOS 8
159====
160Kakoune can be found in the https://src.fedoraproject.org/rpms/kakoune/tree/epel8[EPEL8 repositories].
161---------------------------------
162dnf install kakoune
163---------------------------------
164====
165
166[TIP]
167.Arch Linux
168====
169Kakoune is found in the https://www.archlinux.org/packages/community/x86_64/kakoune/[repositories].
170--------------------------------------------------
171pacman -S kakoune
172--------------------------------------------------
173====
174
175[TIP]
176.Gentoo
177====
178Kakoune is found in portage as
179https://packages.gentoo.org/packages/app-editors/kakoune[app-editors/kakoune].
180--------------------------------
181emerge kakoune
182--------------------------------
183https://wiki.gentoo.org/wiki/Kakoune[Installation and Gentoo specific documentation] is available.
184====
185
186[TIP]
187.Exherbo
188====
189--------------------------------
190cave resolve -x repository/mawww
191cave resolve -x kakoune
192--------------------------------
193====
194
195[TIP]
196.openSUSE
197====
198Kakoune can be found in the https://software.opensuse.org/package/kakoune[repositories].
199
200---------------------------
201sudo zypper install kakoune
202---------------------------
203====
204
205[TIP]
206.Ubuntu
207====
208Building on Ubuntu 16.04 and 18.04.
209Make sure you have .local/bin in your path to make the kak binary available from your shell.
210
211----------------------------------------------------------------
212git clone https://github.com/mawww/kakoune.git && cd kakoune/src
213make
214PREFIX=$HOME/.local make install
215----------------------------------------------------------------
216====
217
218[TIP]
219.Debian
220====
221Kakoune can be found in Debian 9 (Stretch) and later releases.
222
223---------------------------
224sudo apt install kakoune
225---------------------------
226====
227
228[TIP]
229.FreeBSD
230====
231Kakoune is available in the official ports tree as
232https://www.freshports.org/editors/kakoune[editors/kakoune].
233
234A binary package is also available and can be installed with
235--------------------------------------------------
236pkg install kakoune
237--------------------------------------------------
238====
239
240[TIP]
241.OpenBSD
242====
243Building on OpenBSD 6.7 amd64.
244
245--------------------------------------------------
246# pkg_add git gmake
247# git clone https://github.com/mawww/kakoune
248# cd kakoune
249# export CXX=clang++
250# gmake install
251--------------------------------------------------
252
253Kakoune is available in the 6.7-current port tree as
254http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/kakoune/[editors/kakoune]
255
256A binary package is also available for -current snapshot and can be installed with
257--------------------------------------------------
258# pkg_add kakoune
259--------------------------------------------------
260
261Running with support for plugins.
262--------------------------------------------------
263# pkg_add dash
264$ export KAKOUNE_POSIX_SHELL=/usr/local/bin/dash
265$ kak
266--------------------------------------------------
267====
268
269[TIP]
270.Solus
271====
272Kakoune is available in the Solus stable repository.
273
274It can be installed with
275---------------------
276eopkg install kakoune
277---------------------
278====
279
280[TIP]
281.Void
282====
283Kakoune is available in the repositories.
284
285It can be installed with
286-----------------------
287xbps-install -S kakoune
288-----------------------
289====
290
291[TIP]
292.Termux
293====
294Kakoune is available in the repositories.
295
296It can be installed with
297-------------------
298pkg install kakoune
299-------------------
300====
301
302[TIP]
303.Nix
304====
305--------------------------------
306nix-env -iA nixpkgs.kakoune
307--------------------------------
308====
309
310Running
311~~~~~~~
312
313Just running *kak* launches a new kak session with a client on local terminal.
314Run *kak -help* to discover the valid command line flags.
315
316Configuration
317^^^^^^^^^^^^^
318
319There are two directories containing Kakoune's scripts:
320
321* `runtime`: located in `../share/kak/` relative to the `kak` binary
322  contains the system scripts, installed with Kakoune.
323* `userconf`: located in `$XDG_CONFIG_HOME/kak/`, which will fallback
324  to `$HOME/.config/kak/` if `$XDG_CONFIG_HOME` is not set, containing
325  the user configuration.
326
327Unless `-n` is specified, Kakoune will load its startup script located
328at `${runtime}/kakrc` relative to the `kak` binary. This startup script
329is responsible for loading the user configuration.
330
331First, Kakoune will search recursively for `.kak` files in the `autoload`
332directory. It will first look for an `autoload` directory at
333`${userconf}/autoload` and will fallback to `${runtime}/autoload` if
334it does not exist.
335
336Once all those files are loaded, Kakoune will try to source
337`${runtime}/kakrc.local` which is expected to contain distribution provided
338configuration.
339
340And finally, the user configuration will be loaded from `${userconf}/kakrc`.
341
342NOTE: If you create a user `autoload` directory in `${userconf}/autoload`,
343the system one at `${runtime}/autoload` will not be loaded anymore. You can
344add a symbolic link to it (or to individual scripts) inside
345`${userconf}/autoload` to keep loading system scripts.
346
347Basic Interaction
348-----------------
349
350Selections
351~~~~~~~~~~
352
353The main concept in Kakoune is the selection. A selection is an inclusive,
354directed range of characters. A selection has two ends, the anchor and the
355cursor.
356
357There is always at least one selection, and a selection is always at least
358one character (in which case the anchor and cursor of the selections are
359on the same character).
360
361Normal Mode
362~~~~~~~~~~~
363
364In normal mode, keys are not inserted directly inside the buffer, but are editing
365commands. These commands provide ways to manipulate either the selections themselves,
366or the selected text.
367
368Insert Mode
369~~~~~~~~~~~
370
371When entering insert mode, keys are now directly inserted before each
372selection's cursor. Some additional keys are recognised in insert mode:
373
374 * `<esc>`: leave insert mode
375 * `<backspace>`: delete characters before cursors
376 * `<del>`: delete characters under cursors
377 * `<left>, <right>, <up>, <down>`: move the cursors in given direction
378 * `<home>`: move cursors to line begin
379 * `<end>`: move cursors to end of line
380
381 * `<c-n>`: select next completion candidate
382 * `<c-p>`: select previous completion candidate
383 * `<c-x>`: explicit insert completion query, followed by:
384   - `f`: explicit file completion
385   - `w`: explicit word completion
386   - `l`: explicit line completion
387 * `<c-o>`: disable automatic completion for this insert session
388
389 * `<c-r>`: insert contents of the register given by next key
390 * `<c-v>`: insert next keystroke directly into the buffer,
391    without interpreting it.
392
393 * `<c-u>`: commit changes up to now as a single undo group.
394
395 * `<a-;>`: escape to normal mode for a single command
396
397Movement
398~~~~~~~~
399
400See <<Appending>> below for instructions on extending (appending to) the current selection, in order to select more text in multiple steps.
401
402 * `h`: select the character on the left of selection end
403 * `j`: select the character below the selection end
404 * `k`: select the character above the selection end
405 * `l`: select the character on the right of selection end
406
407 * `w`: select the word and following whitespaces on the right of selection end
408 * `b`: select preceding whitespaces and the word on the left of selection end
409 * `e`: select preceding whitespaces and the word on the right of selection end
410 * `<a-[wbe]>`: same as [wbe] but select WORD instead of word
411
412 * `f`: select to (including) the next occurrence of the given character
413 * `t`: select until (excluding) the next occurrence of the given character
414 * `<a-[ft]>`: same as [ft] but in the other direction
415
416 * `m`: select to matching character
417 * `M`: extend selection to matching character
418
419 * `x`: select line on which selection end lies (or next line when end lies on
420        an end-of-line)
421 * `X`: similar to `x`, except the current selection is extended
422 * `<a-x>`: expand selections to contain full lines (including end-of-lines)
423 * `<a-X>`: trim selections to only contain full lines (not including last
424            end-of-line)
425
426 * `%`: select whole buffer
427
428 * `<a-h>`: select to line begin
429 * `<a-l>`: select to line end
430
431 * `/`: search (select next match)
432 * `<a-/>`: search (select previous match)
433 * `?`: search (extend to next match)
434 * `<a-?>`: search (extend to previous match)
435 * `n`: select next match
436 * `N`: add a new selection with next match
437 * `<a-n>`: select previous match
438 * `<a-N>`: add a new selection with previous match
439
440 * `pageup, <c-b>`: scroll one page up
441 * `pagedown, <c-f>`: scroll one page down
442 * `<c-u>`: scroll half a page up
443 * `<c-d>`: scroll half a page down
444
445 * `)`: rotate selections (the main selection becomes the next one)
446 * `(`: rotate selections backwards
447
448 * `;`: reduce selections to their cursor
449 * `<a-;>`: flip the selections' direction
450 * `<a-:>`: ensure selections are in forward direction (cursor after anchor)
451
452 * `<a-.>`: repeat last object or `f`/`t` selection command.
453
454 * `_`: trim selections
455
456A word is a sequence of alphanumeric characters or underscore, a WORD is a
457sequence of non whitespace characters.
458
459Appending
460~~~~~~~~~
461
462For most <<Movement>> commands, using `Shift` extends the current selection
463instead of replacing it.
464
465Examples:
466
467 * `wWW` selects 3 consecutive words: first `w` selects a word, then `WW` extends the selection two words further.
468 * `f/F/` selects up to and including the second `/` character forward.
469
470Using Counts
471~~~~~~~~~~~~
472
473Most selection commands also support counts, which are entered before the
474command itself.
475
476For example, `3W` selects 3 consecutive words and `3w` select the third word on
477the right of selection end.
478
479Disabling Hooks
480~~~~~~~~~~~~~~~
481
482Any normal mode command can be prefixed with `\` which will disable hook execution
483for the duration for the command (including the duration of modes the command could
484move to, so `\i` will disable hooks for the whole insert session).
485
486As autoindentation is implemented in terms of hooks, this can be used to disable
487it when pasting text.
488
489Changes
490~~~~~~~
491
492 * `i`: enter insert mode before current selection
493 * `a`: enter insert mode after current selection
494 * `d`: yank and delete current selection
495 * `c`: yank and delete current selection and enter insert mode
496 * `.`: repeat last insert mode change (`i`, `a`, or `c`, including
497        the inserted text)
498
499 * `<a-d>`: delete current selection
500 * `<a-c>`: delete current selection and enter insert mode
501
502 * `I`: enter insert mode at current selection begin line start
503 * `A`: enter insert mode at current selection end line end
504 * `o`: enter insert mode in one (or given count) new lines below
505        current selection end
506 * `O`: enter insert mode in one (or given count)  new lines above
507        current selection begin
508
509 * `<a-o>`: add an empty line below cursor
510 * `<a-O>`: add an empty line above cursor
511
512 * `y`: yank selections
513 * `p`: paste after current selection end
514 * `P`: paste before current selection begin
515 * `<a-p>`: paste all after current selection end, and
516            select each pasted string.
517 * `<a-P>`: paste all before current selection begin, and
518            select each pasted string.
519 * `R`: replace current selection with yanked text
520 * `<a-R>`: replace current selection with every yanked text
521
522 * `r`: replace each character with the next entered one
523
524 * `<a-j>`: join selected lines
525 * `<a-J>`: join selected lines and select spaces inserted
526            in place of line breaks
527 * `<a-m>`: merge contiguous selections together (works across lines as well)
528
529 * `<gt> (>)`: indent selected lines
530 * `<a-gt>`: indent selected lines, including empty lines
531 * `<lt> (<)`: deindent selected lines
532 * `<a-lt>`: deindent selected lines, do not remove incomplete
533        indent (3 leading spaces when indent is 4)
534
535 * `|`: pipe each selection through the given external filter program
536        and replace the selection with it's output.
537 * `<a-|>`: pipe each selection through the given external filter program
538        and ignore its output
539
540 * `!`: insert command output before selection
541 * `<a-!>`: append command output after selection
542
543 * `u`: undo last change
544 * `<a-u>`: move backward in history
545 * `U`: redo last change
546 * `<a-U>`: move forward in history
547
548 * `&`: align selection, align the cursor of selections by inserting
549        spaces before the first character of the selection
550 * `<a-&>`: copy indent, copy the indentation of the main selection
551        (or the count one if a count is given) to all other ones
552
553 * ```: to lower case
554 * `~`: to upper case
555 * ``<a-`>``: swap case
556
557 * `@`: convert tabs to spaces in current selections, uses the buffer
558        tabstop option or the count parameter for tabstop.
559 * `<a-@>`: convert spaces to tabs in current selections, uses the buffer
560            tabstop option or the count parameter for tabstop.
561
562 * `<a-)>`: rotate selections content, if specified, the count groups
563            selections, so `3<a-)>` rotate (1, 2, 3) and (3, 4, 6)
564            independently.
565 * `<a-(>`: rotate selections content backwards
566
567Goto Commands
568~~~~~~~~~~~~~
569
570Commands beginning with `g` are used to goto certain position and or buffer.
571If a count is given prior to hitting `g`, `g` will jump to the given line.
572Using `G` will extend the selection rather than jump.
573
574See <<doc/pages/keys#goto-commands,`:doc keys goto-commands`>>.
575
576View commands
577~~~~~~~~~~~~~
578
579Commands beginning with `v` permit to center or scroll the current
580view. Using `V` will lock view mode until `<esc>` is hit
581
582See <<doc/pages/keys#view-commands,`:doc keys view-commands`>>.
583
584Marks
585~~~~~
586
587Current selections position can be saved in a register and restored later on.
588
589See <<doc/pages/keys#marks,`:doc keys marks`>>.
590
591Jump list
592~~~~~~~~~
593
594Some commands, like the goto commands, buffer switch or search commands,
595push the previous selections to the client's jump list.
596
597See <<doc/pages/keys#jump-list,`:doc keys jump-list`>>.
598
599Multi Selection
600~~~~~~~~~~~~~~~
601
602Kak was designed from the start to handle multiple selections.
603One way to get a multiselection is via the `s` key.
604
605For example, to change all occurrences of word 'roger' to word 'marcel'
606in a paragraph, here is what can be done:
607
608 * select the paragraph with enough `X`
609 * press `s` and enter roger, then enter
610 * now paragraph selection was replaced with multiselection of each roger in
611the paragraph
612 * press `c` and marcel<esc> to replace rogers with marcels
613
614A multiselection can also be obtained with `S`, which splits the current
615selection according to the regex entered. To split a comma separated list,
616use `S` then ', *'
617
618The regex syntax supported by Kakoune is the based on the ECMAScript script
619syntax and is described at <<doc/pages/regex#,`:doc regex`>>.
620
621`s` and `S` share the search pattern with `/`, and hence entering an empty
622pattern uses the last one.
623
624As a convenience, `<a-s>` allows you to split the current selections on
625line boundaries.
626
627To clear multiple selections, use `space`. To keep only the nth selection
628use `n` followed by `space`, in order to remove a selection, use `<a-space>`.
629
630`<a-k>` allows you to enter a regex and keep only the selections that
631contains a match for this regex. Using `<a-K>` you can keep the selections
632not containing a match.
633
634`C` copies the current selection to the next line (or lines if a count is given)
635`<a-C>` does the same to previous lines.
636
637`$` allows you to enter a shell command and pipe each selection to it.
638Selections whose shell command returns 0 will be kept, other will be dropped.
639
640Object Selection
641~~~~~~~~~~~~~~~~
642
643Objects are specific portions of text, like sentences, paragraphs, numbers…
644Kakoune offers many keys allowing you to select various text objects.
645
646See <<doc/pages/keys#object-selection,`:doc keys object-selection`>>.
647
648Commands
649--------
650
651When pressing `:` in normal mode, Kakoune will open a prompt to enter a command.
652
653Commands are used for non editing tasks, such as opening a buffer, writing the
654current one, quitting, etc.
655
656See <<doc/pages/keys#prompt-commands,`:doc keys prompt-commands`>>.
657
658Basic Commands
659~~~~~~~~~~~~~~
660
661Some commands take an exclamation mark (`!`), which can be used to force
662the execution of the command (i.e. to quit a modified buffer, the
663command `q!` has to be used).
664
665Commands starting with horizontal whitespace (e.g. a space) will not be
666saved in the command history.
667
668 * `cd [<directory>]`: change the current directory to `<directory>`, or the home directory if unspecified
669 * `doc <topic>`: display documentation about a topic. The completion list
670     displays the available topics.
671 * `e[dit][!] <filename> [<line> [<column>]]`: open buffer on file, go to given
672     line and column. If file is already opened, just switch to this file.
673     Use edit! to force reloading.
674 * `w[rite][!] [<filename>]`: write buffer to <filename> or use its name if
675     filename is not given. If the file is write-protected, its
676     permissions are temporarily changed to allow saving the buffer and
677     restored afterwards when the write! command is used.
678 * `w[rite]a[ll]`: write all buffers that are associated to a file.
679 * `q[uit][!] [<exit status>]`: exit Kakoune, use quit! to force quitting even
680     if there is some unsaved buffers remaining. If specified, the client exit
681     status will be set to <exit status>.
682 * `w[a]q[!] [<exit status>]`: write the current buffer (or all buffers when
683     `waq` is used) and quit. If specified, the client exit status will be set
684     to <exit status>.
685 * `kill[!]`: terminate the current session, all the clients as well as the server,
686     use kill! to ignore unsaved buffers
687 * `b[uffer] <name>`: switch to buffer <name>
688 * `b[uffer]n[ext]`: switch to the next buffer
689 * `b[uffer]p[rev]`: switch to the previous buffer
690 * `d[el]b[uf][!] [<name>]`: delete the buffer <name>
691 * `source <filename>`: execute commands in <filename>
692 * `colorscheme <name>`: load named colorscheme.
693 * `rename-client <name>`: set current client name
694 * `rename-buffer <name>`: set current buffer name
695 * `rename-session <name>`: set current session name
696 * `echo [options] <text>`: show <text> in status line, with the following options:
697   ** `-markup`: expand the markup strings in <text>
698   ** `-debug`: print the given text to the `\*debug*` buffer
699 * `nop`: does nothing, but as with every other commands, arguments may be
700     evaluated. So nop can be used for example to execute a shell command
701     while being sure that it's output will not be interpreted by kak.
702     `:%sh{ echo echo tchou }` will echo tchou in Kakoune, whereas
703     `:nop %sh{ echo echo tchou }` will not, but both will execute the
704     shell command.
705 * `fail <text>`: raise an error, uses <text> as its description
706
707Multiple commands
708~~~~~~~~~~~~~~~~~
709
710Multiple commands can be separated either by new lines or by semicolons,
711as such a semicolon must be escaped with `\;` to be considered as a literal
712semicolon argument.
713
714String syntax and expansions
715^^^^^^^^^^^^^^^^^^^^^^^^^^^^
716
717Values, options and shell context can be interpolated in strings.
718
719See <<doc/pages/expansions#,`:doc expansions`>>.
720
721Configuration & Autoloading
722---------------------------
723
724Kakrc
725~~~~~
726
727If not launched with the `-n` switch, Kakoune will source the
728`../share/kak/kakrc` file relative to the `kak` binary, which
729will source additional files:
730
731If the `$XDG_CONFIG_HOME/kak/autoload` directory exists, load every
732`*.kak` files in it, and load recursively any subdirectory.
733
734If it does not exist, falls back to the site wide autoload directory
735in `../share/kak/autoload/`.
736
737After that, if it exists, source the `$XDG_CONFIG_HOME/kak/kakrc` file
738which should be used for user configuration.
739
740In order to continue autoloading site-wide files with a local autoload
741directory, just add a symbolic link to `../share/kak/autoload/` into
742your local autoload directory.
743
744Color Schemes
745~~~~~~~~~~~~~
746
747Kakoune ships with some color schemes that are installed to
748`../share/kak/colors/`. If `$XDG_CONFIG_HOME/kak/colors/` is present
749the builtin command `colorscheme` will offer completion for those
750color schemes. If a scheme is duplicated in userspace, it will take
751precedence.
752
753Options
754-------
755
756Kakoune can store named and typed values that can be used both to
757customize the core editor behaviour, and to keep data used by extension
758scripts.
759
760See <<doc/pages/options#,`:doc options`>>.
761
762
763Advanced topics
764---------------
765
766Faces
767~~~~~
768
769Faces describe how characters are displayed on the screen: color, bold, italic...
770
771See <<doc/pages/faces#,`:doc faces`>>.
772
773Registers
774~~~~~~~~~
775
776Registers are named lists of text. They are used for various purposes,
777like storing the last yanked text, or the captured groups associated with the selections.
778
779See <<doc/pages/registers#,`:doc registers`>>.
780
781Macros
782~~~~~~
783
784Kakoune can record and replay a sequence of key presses.
785
786See <<doc/pages/keys#macros,`:doc keys macros`>>.
787
788Search selection
789~~~~~~~~~~~~~~~~
790
791Using the `*` key, you can set the search pattern to the current selection.
792See <<doc/pages/keys#searching,`:doc keys searching`>>.
793
794Regex syntax
795~~~~~~~~~~~~
796
797Kakoune regex syntax is based on the ECMAScript syntax (ECMA-262 standard).
798It always runs on Unicode codepoint sequences, not on bytes.
799
800See <<doc/pages/regex#,`:doc regex`>>.
801
802Exec and Eval
803~~~~~~~~~~~~~
804
805The `execute-keys` and `evaluate-commands` are useful for scripting
806in non interactive contexts.
807
808See <<doc/pages/execeval#,`:doc execeval`>>.
809
810Insert mode completion
811~~~~~~~~~~~~~~~~~~~~~~
812
813Kakoune can propose completions while inserting text: filenames, words, lines…
814
815See <<doc/pages/keys#insert-mode-completion,`:doc keys insert-mode-completion`>>.
816
817Escape to normal mode
818~~~~~~~~~~~~~~~~~~~~~
819
820From insert mode, pressing `<a-;>` allows you to execute a single normal mode
821command. This provides a few advantages:
822
823 * The selections are not modified: when leaving insert mode using `<esc>` the
824   selections can change, for example when insert mode was entered with `a` the
825   cursor will go back one char. Or if on an end of line the cursor will go back
826   left (if possible).
827
828 * The modes are nested: that means the normal mode can enter prompt (with `:`),
829   or any other modes (using `:on-key` or `:menu` for example), and these modes
830   will get back to the insert mode afterwards.
831
832This feature is tailored for scripting/macros, as it provides a more predictable
833behaviour than leaving insert mode with `<esc>`, executing normal mode command
834and entering back insert mode (with which binding ?)
835
836See <<doc/pages/modes#,`:doc modes`>>.
837
838Highlighters
839~~~~~~~~~~~~
840
841Manipulation of the displayed text, such as syntax coloration and wrapping
842is done through highlighters.
843
844See <<doc/pages/highlighters#,`:doc highlighters`>>.
845
846Hooks
847~~~~~
848
849Commands can be registered to be executed when certain events arise with hooks.
850
851See <<doc/pages/hooks#,`:doc hooks`>>.
852
853Key Mapping
854~~~~~~~~~~~
855
856Custom key shortcuts can be registered through mappings.
857
858See <<doc/pages/mapping#,`:doc mapping`>>.
859
860Defining Commands and Aliases
861~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
862
863New commands can be created using `:define-command`.
864
865See <<doc/pages/commands#declaring-new-commands,`:doc commands declaring-new-commands`>>.
866
867They can be given additional short names depending of the scope with `:alias`.
868
869See <<doc/pages/commands#aliases,`:doc commands aliases`>>.
870
871Some helper commands are available to define composite commands.
872
873See <<doc/pages/commands#helpers,`:doc commands helpers`>>.
874
875FIFO Buffers
876~~~~~~~~~~~
877
878FIFO buffers are very useful for running some commands asynchronously while
879progressively displaying their result in Kakoune.
880
881See <<doc/pages/buffers#fifo-buffers,`:doc buffers fifo-buffers`>>.
882
883Menus
884~~~~~
885
886When a menu is displayed, you can use `j`, `<c-n>` or `<tab>` to select the next
887entry, and `k`, `<c-p>` or `<shift-tab>` to select the previous one.
888
889Using the `/` key, you can enter some regex in order to restrict available choices
890to the matching ones.
891
892Credits
893-------
894
895Thanks to https://github.com/p0nce[p0nce] for designing the
896https://github.com/mawww/kakoune/blob/master/doc/kakoune_logo.svg[Kakoune
897logo].
898
899And thanks to all the
900https://github.com/mawww/kakoune/graphs/contributors[contributors] who help
901move the project forward!
902