tvl-depot/users/Profpatsch/emacs-tree-sitter-move/tmp.el
Profpatsch 806c281b34 feat(users/Profpatsch): moving around via the tree-sitter parse tree
Has a little setup to get the cursor position and map it onto a tree
sitter node. The current node is saved in a cursor variable, and a
highlight overlay marks the range of the current node in the buffer.

Change-Id: I0af56115f928732e993fbefe978a246ca7c757ee
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2258
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 19:03:30 +00:00

13 lines
481 B
EmacsLisp

(tree-sitter-load
'python
(format "%s/bin/python"
(getenv "TREE_SITTER_GRAMMAR_DIR")))
(setq tree-sitter-major-mode-language-alist
'((python-mode . python)))
(define-key evil-normal-state-map (kbd "C-<right>") #'tree-sitter-move-right)
;; (define-key evil-normal-state-map (kbd "C-<left>") 'sp-backward-parallel-sexp)
;; (define-key evil-normal-state-map (kbd "C-<down>") 'sp-down-sexp)
;; (define-key evil-normal-state-map (kbd "C-<up>") 'sp-backward-up-sexp)