Showing posts with label IndentSize. Show all posts
Showing posts with label IndentSize. Show all posts

Tuesday, 12 August 2014

Setting tab options with Visual Studio 2013

Most shared code projects demand that you follow their convention when it comes to Tab spacing, i.e. whether to use tabs or space characters and how much indentation to use. With Visual Studio you can change this setting on a per language basis. This means that if you work on different projects across programming languages that require different settings you won't get caught out.

To alter this setting go to Tools -> Options and select Text Editor from the side bar. You can then select All Languages to set a global tab setting across languages or select a specific language to change. Once an option is selected, the Tabs option will display the settings available.

Here I am demonstrating my Tab setting for C#:


As you can see the main options I am interested in are Tab and Indent size which set how many white space characters a tab represents. Also you have the option of using Tab characters or inserting white space characters into the document when the Tab key is pressed. The number inserted will be resolved using the Tab and Indent size options.

As long as you remember to set this up correctly you should never find yourself falling foul of your projects tabbing conventions.