3 ms·
Obviously the defaults are going to be more popular than my non-default preference, and I would even agree that if there was no default, and people were forced
by TheNewAndy 5y ago
Obviously the defaults are going to be more popular than my non-default preference, and I would even agree that if there was no default, and people were forced to choose, they mostly wouldn't choose what I want.
However, if you can tell me how to get visual studio to do this, then I would be incredibly grateful.
In my opinion mixing spaces and tabs is completely fine because they are for different things. Tabs for indentation, and spaces for alignment.
Why no auto indent? Because the editor doesn't have enough information to do it correctly (e.g. perhaps you are about to paste some code which is already indented as you want it). I am not saying you should have the same preferences as me, but I am pretty happy with this behaviour, and perfectly ok with pressing tab after enter (or even pressing space 4 times - again, this is just my personal preference and I know that there was a time in my life when I would have looked at this with disgust).
So - how do I configure VS to do what I want?
- jayd16 5y agoJust google "visual studio disable auto format." The first hit most likely provides exactly what you want. https://stackoverflow.com/questions/737222/turn-off-auto-formatting-in-visual-studio https://stackoverflow.com/questions/737222/turn-off-auto-for... You won't get much more help unless you describe what you've tried and why it didn't work for you. As far as I can tell the settings you're looking for aren't very hidden.
- TheNewAndy 5y agoWhen I tried last time (sorry, I don't have visual studio in front of me), I would get things like: - Pressing enter results in just adding a newline, without copying the whitespace from the previous line OR - Pressing enter results in addine a newline, copying the whitespace, but replacing spaces with tabs on the new line I guess if someone could once show how to make it so adding a newline to: <tab><space><space><space><space>foo (when configured with 4 space tabs) I get: <tab><space><space><space><space>foo <tab><space><space><space><space> Instead of: <tab><space><space><space><space>foo <tab><tab>
- tracker1 5y agoDrop an appropriate .editorconfig file in the root of your solution. IIRC that will cover most of what you want to do. As to the format on paste.. you can explore the settings. Generally speaking, I have VS Code configured how I want it and will use that over 95% of the time... even for C# projects.