editing the NetBeans source formatting standard
Solution 1
You can change a very limited number of settings related to formatting.
open up netbeans IDE
Go to tools->options
click on Editor button on top left of the options dialog box
click on the formatting tab
select PHP from the language select box
then you would be able to see the required settings that can be changed.
Latest version 7.3 will solve most of your needs.
Solution 2
The formatting preferences are at two 'levels' in NetBeans 6.9 Beta and NetBeans 6.8. There is a global setting, which is available via the Options item of the Tools menu (Preferences item of the NetBeans menu on Mac OS X). This opens a Options dialog. Select the Formatting tab of the Editor 'category', and then change the language to PHP.
alt text http://www.freeimagehosting.net/uploads/587cd38396.png
You can also specify formatting on a per-project basis. To do that, select your PHP project in the Project explorer and the select the Project Properties item from the File menu. When the Properties dialog opens, select the Formatting category from the navigation list on the left side of the dialog.
alt text http://www.freeimagehosting.net/uploads/47904df6e4.png
Note: In 6.8, there are only two formatting categories that you can change: Tabs and Indents; Braces. It looks like the "preview" area is not rendered correctly. NetBeans 6.9 Beta extends the number of formatting categories (Tabs and Indents, Alignment, Braces, Blank Lines, Spaces, Wrapping). The issues with the preview area appear to be resolved, too.
Solution 3
This might help.
Tools->Options->Editor->Formatting
Victor Stanciu
Updated on July 09, 2022Comments
-
Victor Stanciu almost 2 years
Is there any way of changing the standard by which NetBeans automatically formats the code when doing "Source->Format"? I seem to remember seeing this option somewhere, but I can't find anything about it.
-
DaOgre almost 13 yearsThis worked perfectly for me. Worth noting is when I had "All Languages" selected I had a very limited number of Categories (1) to work with. Once I changed this to PHP there were a ton of helpful, changeable values. I'm using NetBeans 7.0
-
David Yell over 11 yearsI don't have Comments listed as an option. How can I prevent Netbeans auto-formatting my comments. I like them without any indent, and it's aligning them with my functions.
-
andrew about 8 yearsIf changing the settings in
tools->options->editor->format
have no affect, check the settings underfile->project properties->formatting
. You may haveUse project specific options
selected