-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathevil-textobj-tree-sitter.el
38 lines (31 loc) · 1.6 KB
/
evil-textobj-tree-sitter.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;;; evil-textobj-tree-sitter.el --- Provides evil textobjects using tree-sitter -*- lexical-binding: t; -*-
;; URL: https://github.com/meain/evil-textobj-tree-sitter
;; Keywords: evil, tree-sitter, text-object, convenience
;; SPDX-License-Identifier: Apache-2.0
;; Package-Requires: ((emacs "25.1"))
;; Version: 0.5
;;; Commentary:
;; This package is a port of nvim-treesitter/nvim-treesitter-textobjects.
;; This package will let you create evil textobjects using the power
;; of tree-sitter grammars. You can easily create
;; function,class,comment etc textobjects in multiple languages.
;;
;; You can do a sample map like below to create a function textobj.
;; (define-key evil-outer-text-objects-map "f"
;; (evil-textobj-tree-sitter-get-textobj "function.outer"))
;; `evil-textobj-tree-sitter-get-textobj' will return you a function
;; that you can use in a define-key map. You can pass in any of the
;; supported queries as an arg of that function. You can also pass in
;; multiple queries as a list and we will match on all of them, ranked
;; on which ones comes up first in the file.
;; You can find more info in the README.md file at
;; https://github.com/meain/evil-textobj-tree-sitter
;; This package also provides with thing-at-point functions for common
;; textobjects like functions, loops, conditionals etc.
;; You need to either have elisp-tree-sitter installed or have Emacs
;; version >=29 for this package to work.
;;; Code:
(require 'evil-textobj-tree-sitter-core)
(require 'evil-textobj-tree-sitter-thing-at-point)
(provide 'evil-textobj-tree-sitter)
;;; evil-textobj-tree-sitter.el ends here