Skip to content

Does not work with (treesit-defun-at-point) #118

Answered by minad
drshapeless asked this question in Q&A
Discussion options

You must be logged in to vote

In order for this to work (treesit-defun-name (treesit-defun-at-point)) should be evaluated first and bound to a variable name. You can do this using (p FORM <NAME> <NOINSERT>):

(p (treesit-defun-name (treesit-defun-at-point)) name t)

The variable can then be used later. See also https://github.com/minad/tempel#template-syntax for the supported syntax. In case you want to reuse a pattern often, you can define custom elements: https://github.com/minad/tempel#defining-custom-elements.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by minad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #117 on November 01, 2023 12:15.