3

It is possible to set lang-based tabe sizes in VSC like this:

"[sass]": {
    "editor.tabSize": 2
},
"[html]": {
    "editor.tabSize": 4
},
"[javascript]": {
    "editor.tabSize": 2
}

But its doesnt work for pug language, where identation is always 4 spaces. It doesnt even overwrite with "editor.tabSize: 2". How do i make another value of tabsize for pug ?

Graham
  • 7,431
  • 18
  • 59
  • 84
Anton
  • 516
  • 1
  • 6
  • 22
  • Possible duplicate of [How to set tab-space style?](https://stackoverflow.com/questions/29972396/how-to-set-tab-space-style) – Graham Oct 20 '18 at 19:13

1 Answers1

2

Found a solution:

"[jade]": {
      "editor.detectIndentation": false,
      "editor.insertSpaces": true,
      "editor.tabSize": 2
}

Jade was name of the Pug template before. https://github.com/pugjs/pug/issues/2184

Dinko Pehar
  • 5,454
  • 4
  • 23
  • 57
  • not working for me still. after i add this settings, my guides extension stops showing vertical lines for indentation. and tabsize doesnt react to any value http://prntscr.com/l9t9f0 – Anton Oct 24 '18 at 09:41
  • 1
    It worked for me with jade (pug configuration doesn't exist beucase name is jade). If you want to have 2 spaces tab, you can configure every file when you create it. If you create some new .pug file, on bottom right you have label spaces. Click on that label and select "Indent using spaces" and select space value (2), and also select "Indent using tabs and put value 2. – Dinko Pehar Oct 24 '18 at 13:23