Skip to content

Commit

Permalink
add tree selections
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jan 21, 2020
1 parent dbc2409 commit 0be350c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dotfiles/kakoune.nix
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -209,6 +216,18 @@ in {
exec -draft hH <a-k>fd<ret> d
exec <esc>
}}
# 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<ret>' -docstring 'Tree Selection'
map global tree h ': tree-select-parent-node<ret>' -docstring 'Parent'
map global tree l ': tree-select-children<ret>' -docstring 'Children'
map global tree <a-l> ': tree-select-first-child<ret>' -docstring 'First Child'
map global tree j ': tree-select-next-node<ret>' -docstring 'Next Node'
map global tree k ': tree-select-previous-node<ret>' -docstring 'Previous Node'
map global tree ? ': tree-node-sexp<ret>' -docstring 'Show Node'
'';
};

Expand All @@ -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 = "";
}

0 comments on commit 0be350c

Please sign in to comment.