Questions tagged [yasnippet]
YASnippet is a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates. Bundled language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS and more.
236 questions
1 vote
1 answer
115 views
Eglot + Corfu + Cape + Yasnippet integration in Emacs - snippet completions not showing with LSP
I’m trying to set up Emacs 30.2 with the following packages: Eglot (built-in) for LSP Corfu for completion UI Cape for multiple completion sources Yasnippet for snippets Eldoc + Eldoc-box for hover ...
2 votes
1 answer
52 views
How do I rename a snippet?
I observe 2 fundamental-mode snippets (current-date bound to dd and current-date-and-time bound to dt) which conflict with delete-directory in emacs-lisp-mode and deftest in python-mode respectively. ...
0 votes
1 answer
59 views
How to turn off yasnippet highlight active field?
When I use yas and am in an active field the text is highlighted. Is there a way to disable the highlighting? By active field I mean when I type "mk" it replaces this with $$ and puts my ...
0 votes
1 answer
49 views
How to fix "does not contain : exactly once" Yasnippet warning?
I have the following yasnippet warning message for each major mode and .yas-parents directory: yatemplate: ~/snippets/org-mode does not contain : exactly once yatemplate: ~/snippets/lua-mode does not ...
0 votes
1 answer
82 views
Use contents of a heading in Yasnippet
Is it possible to define a yasnippet that will pick up contents of a heading? Say, I have something like this: * Heading 1 :PROPERTIES: :CUSTOM_ID: MyHead :END: Text under Heading 1 I will like to ...
0 votes
2 answers
130 views
In LaTex mode, check if we are not in math mode for aas package
I am using the aas package (auto-activating snippets). When I want a snippet to expand we can do so by putting the following in the use-package declaration in the .emacs file: :cond #'texmathp "...
1 vote
0 answers
49 views
Arbitrary number of fields in yasnippet
Is it possible in a yasnippet snippet to create an arbitrary number of fields following a template, stopping only once the user indicates they are done entering fields? Example One use case is to ...
1 vote
1 answer
132 views
Inserting newline in snippet start with YASnippet
I have the snippet # -*- mode: snippet -*- # name: LaTeX display math block # key: dm # -- \[\begin{align*} $1 \end{align*}\] $0 which works fine except for the fact that the newline at the start is ...