2023-11-12 23:29:11 +01:00
|
|
|
# tree-sitter
|
2023-11-12 22:57:29 +01:00
|
|
|
tree-always-highlight
|
|
|
|
set-option global tree_highlight_style ",rgb:404040"
|
|
|
|
declare-user-mode tree
|
|
|
|
map global normal 't' ":enter-user-mode tree<ret>"
|
2023-11-12 23:29:11 +01:00
|
|
|
map global normal '<tab>' ":enter-user-mode tree<ret>"
|
2023-11-12 22:57:29 +01:00
|
|
|
map global normal 'T' ":enter-user-mode -lock tree<ret>"
|
|
|
|
|
2023-11-12 23:29:11 +01:00
|
|
|
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>"
|
2023-11-12 22:57:29 +01:00
|
|
|
map -docstring "select children of type" global tree 'c' ":enter-user-mode tree-children<ret>"
|
2023-11-12 23:29:11 +01:00
|
|
|
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>"
|
2023-11-12 22:57:29 +01:00
|
|
|
|
|
|
|
declare-user-mode tree-children
|
|
|
|
declare-user-mode tree-next
|
|
|
|
declare-user-mode tree-prev
|
|
|
|
|
2023-11-12 23:29:11 +01:00
|
|
|
map global normal 'f' ":enter-user-mode tree-next<ret>"
|
|
|
|
map global normal 'F' ":enter-user-mode tree-children<ret>"
|
|
|
|
|
2023-11-12 22:57:29 +01:00
|
|
|
evaluate-commands %sh{
|
|
|
|
echo "i,identifier
|
2023-11-12 23:29:11 +01:00
|
|
|
t,type
|
2023-11-12 22:57:29 +01:00
|
|
|
c,call
|
|
|
|
a,arguments
|
2023-11-12 23:29:11 +01:00
|
|
|
s,statement
|
|
|
|
d,declaration
|
|
|
|
n,number
|
|
|
|
\",string" |
|
2023-11-12 22:57:29 +01:00
|
|
|
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
|
|
|
|
}
|
2023-11-12 23:29:11 +01:00
|
|
|
|