8

When I create a new yasnippet template using the 'yas-new-snippet' command, I'm unable to get the leading whitespace to show when the template is expanded in a new document or even tested using 'yas-tryout-snippet'.

For example:

interface t1 description no shutdown 

Becomes:

interface t1 description no shutdown 

How can I get the leading whitespace to show when I expand?

The snippet is saved as text-mode.

I'm using GNU Emacs24 with a new installation of Yasnippet from MELPA.

1 Answer 1

9

Use the expand-env directive, as described in the manual.

E.g.

# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) 
1
  • (yas-indent-line 'fixed) should be the default behavior. Commented Sep 8, 2024 at 16:54

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.