Add kakrc for kak-tree

This commit is contained in:
xenia 2023-11-12 22:57:44 +01:00
parent 28dde8e2a5
commit f52f28b84e
2 changed files with 40 additions and 4 deletions

View File

@ -82,6 +82,42 @@ map global lsp '"' ':lsp-clear-references<ret>' -docstring "Clear references"
face global Reference white,rgb:550055 face global Reference white,rgb:550055
face global ReferenceBind white,rgb:552200 face global ReferenceBind white,rgb:552200
# tree-sitter
tree-always-highlight
set-option global tree_highlight_style ",rgb:404040"
declare-user-mode tree
map global normal 't' ":enter-user-mode tree<ret>"
map global normal 'T' ":enter-user-mode -lock tree<ret>"
map -docstring "select node" global tree 'n' ":tree-select-node<ret>"
map -docstring "select parent" global tree 'k' ":tree-select-parent-node<ret>"
# map -docstring "select children" global tree 'c' ":tree-select-children<ret>"
map -docstring "select children" global tree 'C' ":tree-select-children<ret>"
map -docstring "select children of type" global tree 'c' ":enter-user-mode tree-children<ret>"
map -docstring "select next node of type" global tree 'l' ":enter-user-mode tree-next<ret>"
map -docstring "select previous node of type" global tree 'h' ":enter-user-mode tree-prev<ret>"
map -docstring "show sexp" global tree 's' ":tree-node-sexp<ret>"
map -docstring "enable highlighting" global tree '"' ":tree-always-highlight<ret>"
map -docstring "disable highlighting" global tree '&' ":tree-always-highlight-disable<ret>"
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<ret>'"
echo "map -docstring 'next $group' global tree-next '$cmd' ':tree-select-next-node $group<ret>'"
echo "map -docstring 'previous $group' global tree-prev '$cmd' ':tree-select-previous-node $group<ret>'"
done
}
#TODO #TODO
# map global user '&' ':qhl-word<ret>' -docstring "Highlight current word" # map global user '&' ':qhl-word<ret>' -docstring "Highlight current word"
# map global user '"' ':unqhl<ret>' -docstring "Remove highlight" # map global user '"' ':unqhl<ret>' -docstring "Remove highlight"

View File

@ -333,11 +333,11 @@
"tree-sitters": "tree-sitters" "tree-sitters": "tree-sitters"
}, },
"locked": { "locked": {
"lastModified": 1699785742, "lastModified": 1699826096,
"narHash": "sha256-FIM8vTHA73oPcsTw296ZzCZwFFW07A7iD0lfwHkqt2I=", "narHash": "sha256-cLD24AUAc/vqWIty1bxA7q2qc8AWEwyCrdsOk0glKKI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "d62b1657c3b50b8d33a1064518f05884325440a6", "rev": "6e6ad7a82b0dc4142f4db2c06a0a80f1c1ca151a",
"revCount": 3, "revCount": 11,
"type": "git", "type": "git",
"url": "https://githug.xyz/xenia/kak-tree.git" "url": "https://githug.xyz/xenia/kak-tree.git"
}, },