docs(tree-sitter): add rebinding keys section
This commit is contained in:
parent
def8c05371
commit
65207ab3dc
1 changed files with 18 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
- [[#goto-certain-nodes][Goto certain nodes]]
|
- [[#goto-certain-nodes][Goto certain nodes]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[#disable-text-objects-for-certain-modes][Disable text objects for certain modes]]
|
- [[#disable-text-objects-for-certain-modes][Disable text objects for certain modes]]
|
||||||
|
- [[#rebinding-text-objects][Rebinding text objects]]
|
||||||
- [[#adding-your-own-text-objects][Adding your own text objects]]
|
- [[#adding-your-own-text-objects][Adding your own text objects]]
|
||||||
- [[#disabling-highlighting-for-certain-modes][Disabling highlighting for certain modes]]
|
- [[#disabling-highlighting-for-certain-modes][Disabling highlighting for certain modes]]
|
||||||
- [[#troubleshooting][Troubleshooting]]
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
@ -85,6 +86,23 @@ want it for ruby we would use this snippet
|
||||||
(remove-hook 'ruby-mode-hook #'+tree-sitter-keys-mode)
|
(remove-hook 'ruby-mode-hook #'+tree-sitter-keys-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Rebinding text objects
|
||||||
|
Rebinding keys is the same as any other key but do notes they need to be bound
|
||||||
|
to the keymaps ~+tree-sitter-inner-text-object-map~ or
|
||||||
|
~+tree-sitter-outer-text-object-map~
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(map! (:map +tree-sitter-outer-text-objects-map
|
||||||
|
"f" nil
|
||||||
|
"f" (evil-textobj-tree-sitter-get-textobj "call.inner")
|
||||||
|
"F" nil
|
||||||
|
"F" (evil-textobj-tree-sitter-get-textobj "function.inner"))
|
||||||
|
(:map +tree-sitter-inner-text-objects-map
|
||||||
|
"f" nil
|
||||||
|
"f" (evil-textobj-tree-sitter-get-textobj "call.inner")
|
||||||
|
"F" nil
|
||||||
|
"F" (evil-textobj-tree-sitter-get-textobj "function.inner")))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Adding your own text objects
|
** Adding your own text objects
|
||||||
If you wish to [[https://github.com/meain/evil-textobj-tree-sitter#custom-textobjects][add your own custom text objects]] then you need to bind them and
|
If you wish to [[https://github.com/meain/evil-textobj-tree-sitter#custom-textobjects][add your own custom text objects]] then you need to bind them and
|
||||||
add them to the ~+tree-sitter-{inner, outer}-text-objects-map~
|
add them to the ~+tree-sitter-{inner, outer}-text-objects-map~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue