feat(tree-sitter): add function call text object
Changes: - Bind `F` to the function call text object - Add the text object to the table - Realign table so it looks right to people who don't hide emphasis markers
This commit is contained in:
parent
c0637e9e00
commit
cb269deed6
2 changed files with 11 additions and 8 deletions
|
@ -1,7 +1,6 @@
|
|||
;;; tools/tree-sitter/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! tree-sitter
|
||||
:when (bound-and-true-p module-file-suffix)
|
||||
:hook (prog-mode . turn-on-tree-sitter-mode)
|
||||
:hook (tree-sitter-after-on . tree-sitter-hl-mode)
|
||||
:config
|
||||
|
@ -16,10 +15,13 @@
|
|||
(use-package! evil-textobj-tree-sitter
|
||||
:after tree-sitter
|
||||
:config
|
||||
;; FIXME: only bind when using a supported major mode
|
||||
(map!
|
||||
:textobj "f" nil nil
|
||||
:textobj "f" (evil-textobj-tree-sitter-get-textobj "function.inner") (evil-textobj-tree-sitter-get-textobj "function.outer") ;; redef
|
||||
|
||||
:textobj "F" (evil-textobj-tree-sitter-get-textobj "call.inner") (evil-textobj-tree-sitter-get-textobj "call.outer")
|
||||
|
||||
:textobj "C" (evil-textobj-tree-sitter-get-textobj "class.inner") (evil-textobj-tree-sitter-get-textobj "class.outer")
|
||||
|
||||
:textobj "c" nil nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue