Kakoune

From NixOS Wiki
Revision as of 19:45, 27 March 2020 by imported>Nhey (Configuring kakoune under NixOS.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Kakoune[1] is a modal text editor that operates on selections. Unlike Vim's command-motion paradigme, text is first selected, then operated upon (a motion-command paradigme, if you will). This allows Kakoune to provide strong visual feedback and incremental results while requiring keystroke counts similar to that of Vim. More on the design of Kakoune can be found here [2] and on https://kakoune.org.

Configuration

Kakoune may be configured without use of the nix build system [3],

environment.systemPackages = with pkgs; [ kakoune ];

or it may be configured using the wrapKakoune function defined in Nixpkgs[4]:

let
  myKakoune =
  let
    config = pkgs.writeTextFile (rec {
      name = "kakrc.kak";
      destination = "/share/kak/autoload/${name}";
      text = ''
        set global ui_options ncurses_assistant=cat
      '';
    });
  in
  wrapKakoune kakoune-unwrapped {
    configure = {
      plugins = [ config ];
    };
  };
in
environment.systemPackages = [ myKakoune ];