From 2c17cea19ee8d2b93f48e619b59912b1e5dc0ca0 Mon Sep 17 00:00:00 2001 From: xenia Date: Sun, 12 Nov 2023 23:29:11 +0100 Subject: [PATCH] Change groups slightly --- kakrc.sample | 31 +++++++++++++++++++------------ rc/default_config.toml | 7 ++++--- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/kakrc.sample b/kakrc.sample index ef534bf..ef04b4d 100644 --- a/kakrc.sample +++ b/kakrc.sample @@ -1,34 +1,41 @@ +# 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" +map global normal '' ":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 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 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" +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 +map global normal 'f' ":enter-user-mode tree-next" +map global normal 'F' ":enter-user-mode tree-children" + evaluate-commands %sh{ echo "i,identifier -f,function -d,declaration +t,type c,call a,arguments -s,statement" | +s,statement +d,declaration +n,number +\",string" | 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/rc/default_config.toml b/rc/default_config.toml index f9204c3..c00db6e 100644 --- a/rc/default_config.toml +++ b/rc/default_config.toml @@ -1,8 +1,9 @@ [filetype.rust] group.identifier = ["identifier", "scoped_identifier"] -group.function = ["function_item"] -group.declaration = ["function_item", "struct_item", "enum_item"] +group.declaration = ["const_item", "macro_invocation", "macro_definition", "empty_statement", "attribute_item", "inner_attribute_item", "mod_item", "foreign_mod_item", "struct_item", "union_item", "enum_item", "type_item", "function_item", "function_signature_item", "impl_item", "trait_item", "associated_type", "let_declaration", "use_declaration", "extern_crate_declaration", "static_item"] group.call = ["macro_invocation", "call_expression"] group.arguments = ["arguments", "token_tree"] group.statement = ["expression_statement", "let_declaration"] - +group.string = ["string_literal", "raw_string_literal"] +group.number = ["integer_literal", "float_literal", "negative_literal"] +group.type = ["abstract_type", "reference_type", "metavariable", "pointer_type", "generic_type", "scoped_type_identifier", "tuple_type", "unit_type", "array_type", "function_type", "macro_invocation", "empty_type", "dynamic_type", "bounded_type", "primitive_type"]