7

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 Answers1

8

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

E.g.

# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
Tianxiang Xiong
  • 3,848
  • 16
  • 27