question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make scaffold snippet follow `tabSize`

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Ubuntu 16.04
  • Vetur version: 0.11.7
  • VS Code version: 1.19.3

Problem

Typing template and pressing TAB doesn’t respect the file indentation settings. Even if I have it set at 4 spaces (both in the file and with .editorconfig, it only indents by 2.

spaces-vetur

Reproducible Case

  1. Set a blank .vue file to 4 space indentation.
  2. Type template on the first line and hit TAB.

Expected behavior: I want to end up between two <template> tags indented by four spaces. Actual behavior: I end up between two <template> tags indented by two spaces.

This is my first day using VS Code. I don’t know how VS Code does it, but I think that in Sublime Text 3, if you indent with tabs in the template, ST3 will convert the tabs to whatever indentation is specified for that file.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
LasyIsLazycommented, Jun 15, 2018

In my .vue file, indentation in template tag is 4 spaces, but in script tag, indentation is 2spaces. In my user setting, I set "editor.tabSize": 4. I tried setting "editor.detectIndentation": true, but there are also 2 spaces.

2reactions
misenhowercommented, Feb 8, 2018

I believe this could be fixed by simply replacing the space indentation in the snippets with \t – that’s what I use for my own custom snippets and VS Code automatically converts it to the right number of spaces.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I customize the tab-to-space conversion factor?
We can control tab size by file type with EditorConfig and its EditorConfig for VS Code extension. We then can make ...
Read more >
Snippet | Vetur - GitHub Pages
Vetur provides scaffolding snippets for quickly defining regions. They are vue snippets and can be used outside language regions. To start using them,...
Read more >
Why tabs are clearly superior - Lea Verou
The width of a tab character can be adjusted per editor. This is not a disadvantage of tabs as commonly evangelized, but a...
Read more >
How To Tab In Stackoverflow
Assign Appbar widget to Appbar property of the Scaffold to make the header part of the tabs. Fixed tabs should be used with...
Read more >
Configure tab size for Dart/Flutter in Android Studio Arctic Fox ...
Coding example for the question Configure tab size for ... and add the following snippet just before the closing </closeScheme> tag:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found