This is my snippet, in org-mode:
# key: quote
# name: quote block
# --
#+begin_quote
`%`$0
#+end_quote
Result:
#+begin_quote
| <- cursor
#+end_quote
Desired:
#+begin_quote
| <- cursor
#+end_quote
How do I get rid of this extra line?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityIf you check the invisible characters in the snippet file it likely has CR LF line endings.
If you've edited the snippet in another editor for example or have line endings set this way by accident, this can happen.
The usual behavior of yasnippet is the same as your desired outcome.
For reference this problem came up on Stack overflow a few years back https://stackoverflow.com/questions/7619640/emacs-latex-yasnippet-why-are-newlines-inserted-after-a-snippet
$0
- the `%`
in backquotes. It seems like it's part of a macro which Doom uses to expand similar snippets. Removing it fixed the issue.
Jun 19, 2022 at 8:31