diff --git a/kakrc.sample b/kakrc.sample new file mode 100644 index 0000000..ef534bf --- /dev/null +++ b/kakrc.sample @@ -0,0 +1,34 @@ +tree-always-highlight +set-option global tree_highlight_style ",rgb:404040" +declare-user-mode tree +map global normal 't' ":enter-user-mode tree" +map global normal 'T' ":enter-user-mode -lock tree" + +map -docstring "select node" global tree 'n' ":tree-select-node" +map -docstring "select parent" global tree 'k' ":tree-select-parent-node" +# map -docstring "select children" global tree 'c' ":tree-select-children" +map -docstring "select children" global tree 'C' ":tree-select-children" +map -docstring "select children of type" global tree 'c' ":enter-user-mode tree-children" +map -docstring "select next node of type" global tree 'l' ":enter-user-mode tree-next" +map -docstring "select previous node of type" global tree 'h' ":enter-user-mode tree-prev" +map -docstring "show sexp" global tree 's' ":tree-node-sexp" +map -docstring "enable highlighting" global tree '"' ":tree-always-highlight" +map -docstring "disable highlighting" global tree '&' ":tree-always-highlight-disable" + +declare-user-mode tree-children +declare-user-mode tree-next +declare-user-mode tree-prev + +evaluate-commands %sh{ +echo "i,identifier +f,function +d,declaration +c,call +a,arguments +s,statement" | +while IFS=, read -r cmd group ; do + echo "map -docstring '$group child' global tree-children '$cmd' ':tree-select-children $group'" + echo "map -docstring 'next $group' global tree-next '$cmd' ':tree-select-next-node $group'" + echo "map -docstring 'previous $group' global tree-prev '$cmd' ':tree-select-previous-node $group'" +done +} diff --git a/start_test.sh b/start_test.sh new file mode 100755 index 0000000..4a1f7fd --- /dev/null +++ b/start_test.sh @@ -0,0 +1,3 @@ +set -e +nix build .#kak-tree -o /tmp/kak-tree -L +kak -n -E 'source /tmp/kak-tree/share/kak/autoload/plugins/kak-tree/tree.kak ; source kakrc.sample' src/main.rs -e 'set buffer filetype rust'