From 0be350c0ac4158bf21e486949c9717c36e49bcae Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 21 Jan 2020 15:34:57 -0600 Subject: [PATCH] add tree selections --- dotfiles/kakoune.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dotfiles/kakoune.nix b/dotfiles/kakoune.nix index dde67ef..704cc08 100644 --- a/dotfiles/kakoune.nix +++ b/dotfiles/kakoune.nix @@ -11,6 +11,8 @@ let similar-sort-files-cmd = arg: "git ls-files --others --cached --exclude-standard | ${similar-sort}/bin/similar-sort ${arg} | fzf --tiebreak index"; + kak-tree = pkgs.callPackages ../pkgs/kak-tree { }; + # plugins pluginSources = lib.filterAttrs (_: source: lib.attrByPath [ "kakoune" ] "" source == "plugin") sources; @@ -22,7 +24,12 @@ let name = name; src = source; }) pluginSources; - plugins = lib.mapAttrsToList (_: plugin: plugin) pluginAttrs; + plugins = (lib.mapAttrsToList (_: plugin: plugin) pluginAttrs) ++ [ + (kakoune.mkPlugin { + name = "kak-tree"; + src = "${kak-tree.src}/rc"; + }) + ]; colorAttrs = lib.mapAttrs (name: source: kakoune.mkColorPlugin { @@ -209,6 +216,18 @@ in { exec -draft hH fd d exec }} + + # kak-tree + set global tree_cmd '${kak-tree.kak-tree}/bin/kak-tree -vvv' + + declare-user-mode tree + map global user t ': enter-user-mode -lock tree' -docstring 'Tree Selection' + map global tree h ': tree-select-parent-node' -docstring 'Parent' + map global tree l ': tree-select-children' -docstring 'Children' + map global tree ': tree-select-first-child' -docstring 'First Child' + map global tree j ': tree-select-next-node' -docstring 'Next Node' + map global tree k ': tree-select-previous-node' -docstring 'Previous Node' + map global tree ? ': tree-node-sexp' -docstring 'Show Node' ''; }; @@ -217,4 +236,5 @@ in { "${kakoune.mkColors colors}/share/kak/colors"; home.file.".config/kak/autoload".source = "${kakoune.mkPlugins plugins}/share/kak/autoload"; + home.file.".config/kak/kak-tree.toml".text = ""; }