Make scaffold snippet follow `tabSize`
See original GitHub issueInfo
- 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.
Reproducible Case
- Set a blank
.vue
file to 4 space indentation. - Type
template
on the first line and hitTAB
.
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:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.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.