wyc
wyc

Reputation: 55293

I need help with YASnippet and tab width

I'm used to have 4 spaces of Tab width. YASnippets uses 2 spaces in its snippets for instance:

<div id="$1">
  $0
</div>

I thought this would turn it into 4 spaces:

<div id="$1">
   $0
</div>

but no luck...

So I also tried:

(setq-default tab-width 4) 
(setq-default indent-tabs-mode t)
(setq tab-stop-list '(4 8 12 16))

but no luck again

Is there another setting that helps in this kind of situation?

Upvotes: 1

Views: 644

Answers (2)

John DeBord
John DeBord

Reputation: 705

This worked for me:
(setq yas-indent-line 'fixed)

Upvotes: 0

Demosthenex
Demosthenex

Reputation: 4451

Try:

(setf yas/indent-line NIL)

That should prevent yas from re-indenting to the current location and use the indendation built into your template.

Upvotes: 4

Related Questions