Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio replace tab with 4 spaces?

Is there a way to set TAB button to work as 4 spaces in Visual Studio 2010 instead of going to Edit->Advanced->Untabify Selected Lines?

like image 316
Nickolay Kondratyev Avatar asked Jan 05 '13 00:01

Nickolay Kondratyev


People also ask

How do you change a tab to 4 spaces in Vscode?

Type “Indentation” into the search field then head to the “Editor: Tab Size” section. Replace the default space number with your preferred one: Your setting will be applied and reflected immediately. If this doesn't happen (it's a little lag sometimes), just reload or restart your VS Code.


2 Answers

You can edit this behavior in:

Tools->Options->Text Editor->All Languages->Tabs 

Change Tab to use "Insert Spaces" instead of "Keep Tabs".

Note you can also specify this per language if you wish to have different behavior in a specific language.

like image 179
Reed Copsey Avatar answered Oct 20 '22 01:10

Reed Copsey


For VS2010 and above (VS2010 needs a plugin). If you have checked/set the options of the tab size in Visual Studio but it still won't work. Then check if you have a .editorconfig file in your project! This will override the Visual Studio settings. Edit the tab-size in that file.

This can happen if you install an Angular application in your project with the Angular-Cli.

See MSDN blog

like image 31
Jeroen VL Avatar answered Oct 20 '22 01:10

Jeroen VL