0

for some reason the content of my default +new-snippet+ file has changed from

# -*- mode: snippet -*-
# name: 
# key: 
# --

to

# -*- mode: snippet -*-
    # name: 
        # key: 
    # --

The whitespace breaks the snippet compilation it would seem. I was wondering if it is possible to reset the default snippet file text so that I don't have to manually fix it each time?

1 Answer 1

0

You can manually set the value of yas-new-snippet-default to its default value by adding the following to your config.

(setq yas-new-snippet-default "# -*- mode: snippet -*-
# name: $1
# key: ${2:${1:$(yas--key-from-desc yas-text)}}
# --
$0`(yas-escape-text yas-selected-text)`")

Nevertheless, having to add this to your config is annoying, try to update Yasnippet and/or Emacs and make sure no made no mistake with your Yasnippet configuration.

2
  • Thanks a lot for the answer. Unfortunately for some reason the weird tabs still persist even when I use this in my config and after updating yasnippet. Do you know where I can check my Yasnippet config? Jun 7, 2023 at 15:28
  • You can put a copy of your Yasnippet configuration at the end of your post to allow people to correct it if necessary. Also, you can read Yasnippet documentation and known issues. Jun 7, 2023 at 18:52

Your Answer

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

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