Question

Sometimes it would be convenient if I could temporarily turn off the auto formatting feature of Visual Studio, do some editing stuff and then turn it on again.

I don't want to go the long way into the options menu to do this.

Do you know a shortcut, addin or anything to do this?

Or maybe I can surround a section of my code with something like "#pragma dontformat" to tell the editor not to format this code?

Était-ce utile?

La solution 2

The answer for pasting is CTRL[Z].

When you paste a block of code, it gets pasted and then auto formatted. Hitting CTRL[Z] the 1st time will undo the auto formatting but leave the original pasted text. Hitting CTRL[Z] the 2nd time will then undo the pasted text as you'd expect.

I'm using Visual Studio 2013 - haven't tried this in earlier versions.

Autres conseils

Unfortunately there are no Pre-Defined shortcuts for this purpose so you have to do it manually.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top