diff --git a/profiles/develop/default.nix b/profiles/develop/default.nix index f2ed65f1..8ad42dfa 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 52b9b44c..097561d9 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 00000000..31815628 --- /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 +}