stopping VS from automatically indenting code?
When you close a block of cose in C# using }, VS.NET automatically adjusts the indentation for all lines of code in that block. This annoying me, as I sometimes want to indent things manually. Is there any way to stop VS from automatically indenting code when you close a block of code?
hope it's clear
Re: stopping VS from automatically indenting code?
In the editor.... Tools menu... Options.....
Text Editr -> All Languages -> Tabs.... Set to "None"
That will set it for all languages in VS.... or you can go to individual languages and set the tab option there.
Tg
Re: stopping VS from automatically indenting code?
no that's not what I meant. That removed auto-indenting completely. I just don't like the text being automatically re-indented when you close a block of code :(
Re: stopping VS from automatically indenting code?
I always type the opening and closing braces first, and then fill in the code for that block, although not for the reason you want. You should find that this will allow you to indent your code however you like.
Re: stopping VS from automatically indenting code?
ah hmm maybe I do that then:D
I wish there was a way to disable it though:(
sometimes I come back to review my code and I realize that somehow all the indentations are messed up. bleh
Re: stopping VS from automatically indenting code?
You can always write a plug-in for VS to do it. At work I have the Vissual Assist plug-in. I can't test now, but I am pretty sure you can do it with it. At least I can remeber that it adds the } automaticaly when you write a {, and on the right place too.
http://www.wholetomato.com/
- ØØ -
Re: stopping VS from automatically indenting code?
ah you got me excited all of a sudden and then I saw the "trial" button:D I thought it's free heh
It looks really good, and yeah automatically closing the block might stop me from accidentally messing up my code:D
will look into it, thanks
Re: stopping VS from automatically indenting code?
Yeah, that is why I have it at work and not here. But I really like it though. It isn't as easy to break as the Intely Sense in VS. And you can have costum syntax highlighting and so on and so on.
I think I will buy it for my home computer later this year. It is a pain in the ass not coding with it at home.....dangerous to be so dependendt by a tool...:)