From 806c281b3491b165d01be561f005dada24107363 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 19 Dec 2020 19:22:55 +0100 Subject: 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 Reviewed-by: tazjin Reviewed-by: Profpatsch Tested-by: BuildkiteCI --- users/Profpatsch/emacs-tree-sitter-move/tmp.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 users/Profpatsch/emacs-tree-sitter-move/tmp.el (limited to 'users/Profpatsch/emacs-tree-sitter-move/tmp.el') diff --git a/users/Profpatsch/emacs-tree-sitter-move/tmp.el b/users/Profpatsch/emacs-tree-sitter-move/tmp.el new file mode 100644 index 000000000000..dcd17aa5757f --- /dev/null +++ b/users/Profpatsch/emacs-tree-sitter-move/tmp.el @@ -0,0 +1,13 @@ +(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-") #'tree-sitter-move-right) +;; (define-key evil-normal-state-map (kbd "C-") 'sp-backward-parallel-sexp) +;; (define-key evil-normal-state-map (kbd "C-") 'sp-down-sexp) +;; (define-key evil-normal-state-map (kbd "C-") 'sp-backward-up-sexp) -- cgit 1.4.1