问题
I'm working with ExtJs framework and so have to code a lot of JS in vs2008, however, VS2008 keeps removing my indentation and its driving me nuts.
How do I remove the "auto-indent" feature? Thanks
回答1:
The simple answer is: Turn off the Automatic formatting in the Formatting tab
Extracted from the documentation here
JScript specific settings are available under the new Tools / Options / Text Editor / JScript node
These four tabs are:
General & Tabs
Options here are standard across all editors (including JScript)
Formatting
This tab was designed for JScript and contains the most of the JScript specific formatting features
Automatic formatting: This section refers to WHEN formatting will occur as the user is typing in and manipulating code in ‘real time’. Basically, formatting is being performed as the user is constructing the code.
- Format completed line on enter (default ON): Once {ENTER} is pressed, the line will be formatted according to the options set
- Format completed statement on ; (default ON): Once ; is pressed, the line will be formatted according to the options set
- Format completed block on } (default ON): Once } pressed, the block will be formatted according to the options set
- Format on paste (default ON): Once code is pasted into the editor, it will be formatted according to the options set
Miscellaneous
This tab is also JScript specific and contains validation rules as well as statement completion options
来源:https://stackoverflow.com/questions/605461/vs2008-removes-my-indentation-in-js-file