Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kakoune

> 开发工具
Open source

mawww's experiment for a better code editor

11.0K stars0 likes2 views
WebsiteGitHub

About

mawww's experiment for a better code editor

= image:{logo}[K,32,32,link="{website}",title="Kakoune logo by p0nce"] Kakoune image:{cirrus-img}[link="{cirrus-url}"] image:{srht-img}[link="{srht-url}"] image:{irc-img}[link="{irc-url}"] ifdef::env-github,env-browser[:outfilesuffix: .asciidoc] :logo: http://kakoune.org/img/kakoune_logo_32.png :website: https://kakoune.org :cirrus-img: https://api.cirrus-ci.com/github/mawww/kakoune.svg :cirrus-url: https://cirrus-ci.com/github/mawww/kakoune :srht-img: https://builds.sr.ht/~mawww/kakoune.svg :srht-url: https://builds.sr.ht/~mawww/kakoune? :irc-img: https://img.shields.io/badge/IRC-%23kakoune-blue.svg :irc-url: https://web.libera.chat/?channels=kakoune :icons: font :toc: right :pp: ++

TL;DR

{website}

Modal editor -- Faster as in fewer keystrokes -- Multiple selections -- Orthogonal design


git clone https://github.com/mawww/kakoune.git cd kakoune make ./src/kak

See https://github.com/mawww/golf for Kakoune solutions to vimgolf challenges, regularly beating the best Vim solution.

See the link:doc/design.asciidoc[design document] for more information on Kakoune's philosophy and design.

Introduction

Kakoune is a code editor that implements Vi's "keystrokes as a text editing language" model. As it is also a modal editor, it is somewhat similar to the Vim editor (after which Kakoune was originally inspired).

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 being competitive with Vim in terms of keystroke count.

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 selections, where the anchor character stays fixed and the cursor moves around.

See https://vimeo.com/82711574

Join us on libera IRC #Kakoune

Features


 * Multiple selections as a central way of interacting
 * Powerful selection manipulation primitives
   - Select all regex matches in current selections
   - Keep selections containing/not containing a match for a given regex
   - Split current selections with a regex
   - Text objects (paragraph, sentence, nestable blocks)
 * Powerful text manipulation primitives
   - Align selections
   - Rotate selection contents
   - Case manipulation
   - Indentation
   - Piping each selection to external filter
 * Client-Server architecture
   - Multiple clients on the same editing session
   - Use tmux, zellij, kitty, wezterm or your X11/Wayland window manager to
     manage splits/panes by spawning clients connected to the same session
 * Simple interaction with external programs
 * Automatic contextual help
 * Automatic as you type completion
 * Macros
 * Hooks
 * Syntax Highlighting
   - Supports multiple languages in the same buffer
   - Highlight a buffer differently in different windows

Screenshots

[[screenshot-i3]] .Kakoune in i3 image::doc/screenshot-i3.gif[Kakoune in i3]

[[screenshot-tmux]] .Kakoune in tmux image::doc/screenshot-tmux.gif[Kakoune in tmux]

Getting started

Building


Kakoune's dependencies are:

 * A {cpp}20 compliant compiler (GCC >= 10.3 or clang >= 11) along with its
   associated {cpp} standard library (libstdc{pp} >= 10 or libc{pp})

To build, just type *make* in the root directory.
To generate man pages, type *make man* in the root directory.

Kakoune can be built on Linux, MacOS, and Cygwin. Due to Kakoune relying heavily
on being in a Unix-like environment, no native Windows version is planned.

Installing

In order to install kak on your system, rather than running it directly from its source directory, type make install. You can specify the PREFIX and DESTDIR if needed.

[TIP] .Homebrew (macOS) or Linuxbrew


brew install kakoune

====

[TIP] .MacPorts (macOS)


sudo port selfupdate sudo port install kakoune

====

[TIP] .Fedora supported versions and Rawhide


dnf install kakoune

====

[TIP] .Fedora daily builds

Use the https://copr.fedoraproject.org/coprs/jkonecny/kakoune/[copr] repository.

dnf copr enable jkonecny/kakoune dnf install kakoune

====

[TIP] .RHEL/CentOS 8

Kakoune can be found in the https://src.fedoraproject.org/rpms/kakoune/tree/epel8[EPEL8 repositories].

dnf install kakoune

====

[TIP] .Arch Linux

Kakoune is found in the https://www.archlinux.org/packages/community/x86_64/kakoune/[repositories].

pacman -S kakoune

====

[TIP] .Gentoo

Kakoune is found in portage as https://packages.gentoo.org/packages/app-editors/kakoune[app-editors/kakoune].

emerge kakoune

https://wiki.gentoo.org/wiki/Kakoune[Installation and Gentoo specific documentation] is available.

[TIP] .Exherbo


cave resolve -x repository/mawww cave resolve -x kakoune

====

[TIP] .openSUSE

Kakoune can be found in the https://software.opensuse.org/package/kakoune[repositories].


sudo zypper install kakoune

====

[TIP] .Ubuntu

Kakoune can be found in the Ubuntu repositories.


sudo apt install kakoune

If you want to compile from source on 20.04 or earlier, you must force the build to use GCC 10, which is not the default. Also, make sure you have .local/bin in your path so that kak is available after the installation.


git clone https://github.com/mawww/kakoune.git && cd kakoune/src CXX=g++-10 make make PREFIX=$HOME/.local install

====

[TIP] .Debian

Kakoune can be found in Debian 9 (Stretch) and later releases.


sudo apt install kakoune

====

[TIP] .FreeBSD

Kakoune is available in the official ports tree as https://www.freshports.org/editors/kakoune[editors/kakoune].

A binary package is also available and can be installed with

pkg install kakoune

====

[TIP] .OpenBSD

Building on OpenBSD 6.7 amd64.


pkg_add git gmake

git clone https://github.com/mawww/kakoune

cd kakoune

export CXX=clang++

gmake install


Kakoune is available in the 6.7-current port tree as http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/kakoune/[editors/kakoune]

A binary package is also available for -current snapshot and can be installed with

pkg_add kakoune


Running with support for plugins.

pkg_add dash

$ export KAKOUNE_POSIX_SHELL=/usr/local/bin/dash $ kak

====

[TIP] .Solus

Kakoune is available in the Solus stable repository.

It can be installed with

eopkg install kakoune

====

[TIP] .Void

Kakoune is available in the repositories.

It can be installed with

xbps-install -S kakoune

====

[TIP] .Termux

Kakoune is available in the repositories.

It can be installed with

pkg install kakoune

====

[TIP] .Nix


nix-env -iA nixpkgs.kakoune

====

[TIP] .pkgsrc (NetBSD, SmartOS, macOS, Linux, etc)


pkg_add kakoune

==== https://repology.org/project/kakoune/versions[image:https://repology.org/badge/vertical-allrepos/kakoune.svg[Packaging status]]

Running


Running *kak* launches a new kak session with a client on local terminal.
Run *kak -help* to discover the valid command line flags.

Configuration
^^^^^^^^^^^^^

There are two directories containing Kakoune's scripts:

* `runtime`: located in `../share/kak/` relative to the `kak` binary
  contains the system scripts, installed with Kakoune.
* `userconf`: located in `$XDG_CONFIG_HOME/kak/`, which will fallback
  to `$HOME/.config/kak/` if `$XDG_CONFIG_HOME` is not set, containing
  the user configuration.

Unless `-n` is specified, Kakoune will load its startup script located
at `${runtime}/kakrc` relative to the `kak` binary. This startup script
is responsible for loading the user configuration.

First, Kakoune will search recursively for `.kak` files in the `autoload`
directory. It will first look for an `autoload` directory at
`${userconf}/autoload` and will fallback to `${runtime}/autoload` if
it does not exist.

Once all those files are loaded, Kakoune will try to source
`${runtime}/kakrc.local`, which is expected to contain distribution provided
configuration.

Finally, the user configuration will load from `${userconf}/kakrc`.

NOTE: If you create a user `autoload` directory in `${userconf}/autoload`,
the system one at `${runtime}/autoload` will not load anymore. You can
add a symbolic link to it (or to individual scripts) inside
`${userconf}/autoload` to keep loading system scripts.

Basic Interaction
-----------------

Selections

The main concept in Kakoune is the selection. A selection is an inclusive, directed range of characters. A selection has two ends, the anchor and the cursor.

There is always at least one selection, and a selection is always at least one character (in which case the anchor and cursor of the selection are on the same character).

Normal Mode


In normal mode, keys are not inserted directly inside the buffer, but are editing
commands. These commands provide ways to manipulate either the selections themselves
or the selected text.

Insert Mode

When entering insert mode, keys are now directly inserted before each selection's cursor. Some additional keys are recognised in insert mode:

  • <esc>: leave insert mode

  • <backspace>: delete characters before cursors

  • <del>: delete characters under cursors

  • <left>, <right>, <up>, <down>: move cursors in given direction

  • <home>: move cursors to line beginning

  • <end>: move cursors to line ending

  • <c-n>: select next completion candidate

  • <c-p>: select previous completion candidate

  • <c-x>: explicit insert completion query, followed by:

    • f: explicit file completion
    • w: explicit word completion
    • l: explicit line completion
  • <c-o>: disable automatic completion for this insert session

  • <c-r>: insert contents of the register given by next key

  • <c-v>: insert next keystroke directly into the buffer, without interpreting it

  • <c-u>: commit changes up to now as a single undo group

  • <a-;>: escape to normal mode for a single command

Movement


See <<Appending>> below for instructions on extending (appending to) the current selection in order to select more text.

 * `h`: select the character on the left of selection end
 * `j`: select the character below th

Issues· 926 open

View all issuesOpen on GitHub
  • #5550

    [REQUEST] autocompletion after N chars

    feature requestUpdated Sep 28, 2026
  • #5557

    [REQUEST] An Offical Kakoune `SKILL.md` for authoring and validation of `*.kak`

    feature requestUpdated Sep 28, 2026
  • #5551

    [BUG] Compile error: 'invalid use of ‘auto’'

    bugUpdated Sep 23, 2026
  • #5546

    [BUG] incorrect selection with zero-width characters in terminal.app

    bugUpdated Sep 16, 2026
  • #5401

    [BUG] `gd` and `gu` do not interact correctly with counts

    bugUpdated Sep 16, 2026
  • #5549

    [BUG] Performance deterioration in draft contexts with many cursors

    bugUpdated Sep 16, 2026
  • #5543

    [REQUEST] move cursor to start/end of line with wrap highlighter

    feature requestUpdated Sep 12, 2026
  • #4028

    Enabling mouse support and setting high `scrolloff` values causes an unequal amount of cursor movement per unit of mouse scroll movement.

    bugUpdated Sep 9, 2026
  • #3989

    JSON-RPC interaction with running client(s)

    feature requestUpdated Sep 8, 2026
  • #4043

    Scrollable info box?

    feature requestUpdated Sep 8, 2026

> Tags

C++c-plus-plusconsole-applicationkakounemodal-editing

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具