From 9cd09ff0fe98d8c12bd4ecf578d301f10c81a947 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 15 Dec 2019 22:30:25 -0700 Subject: [PATCH] develop#kakoune: wrap binary to load plugins --- profiles/develop/default.nix | 2 +- profiles/develop/kakoune/default.nix | 6 +++++- profiles/develop/kakoune/plugins/git.kak | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 profiles/develop/kakoune/plugins/git.kak diff --git a/profiles/develop/default.nix b/profiles/develop/default.nix index f2ed65f..8ad42df 100644 --- a/profiles/develop/default.nix +++ b/profiles/develop/default.nix @@ -7,7 +7,7 @@ ]; environment.shellAliases = { - v = "XDG_CONFIG_HOME=/etc/xdg $EDITOR"; + v = "$EDITOR"; }; environment.sessionVariables = { diff --git a/profiles/develop/kakoune/default.nix b/profiles/develop/kakoune/default.nix index 52b9b44..097561d 100644 --- a/profiles/develop/kakoune/default.nix +++ b/profiles/develop/kakoune/default.nix @@ -3,7 +3,7 @@ environment.systemPackages = with pkgs; [ cquery kak-lsp - kakoune + kakoune-config kakoune-unwrapped nixpkgs-fmt python3Packages.python-language-server @@ -29,6 +29,10 @@ ]; }; + kakoune-config = super.writeShellScriptBin "kak" '' + XDG_CONFIG_HOME=/etc/xdg ${self.kakoune}/bin/kak "$@" + ''; + kakoune-unwrapped = super.kakoune-unwrapped.overrideAttrs ( o: rec { version = "2019.12.10"; diff --git a/profiles/develop/kakoune/plugins/git.kak b/profiles/develop/kakoune/plugins/git.kak new file mode 100644 index 0000000..3181562 --- /dev/null +++ b/profiles/develop/kakoune/plugins/git.kak @@ -0,0 +1,17 @@ +## +## git.kak by lenormf +## + +# http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# Faces that highlight text that overflows the following limits: +# - title: 50 characters +# - body: 72 characters +set-face global GitOverflowTitle yellow +set-face global GitOverflowBody yellow + +hook -group git-commit-highlight global WinSetOption filetype=git-(commit|rebase) %{ + add-highlighter window/git-commit-highlight/ regex "^\h*[^#\s][^\n]{71}([^\n]+)" 1:GitOverflowBody + add-highlighter window/git-commit-highlight/ regex "\A[\s\n]*[^#\s][^\n]{49}([^\n]+)" 1:GitOverflowTitle +}