0

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?

1 Answer 1

1

If 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

1
  • 1
    I looked at the snippet and confirmed it wasn't CRLF line endings. But on inspection I'd left out that there was one character of elisp before the $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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.