Indenting your code
As you write code, you can insert an indent manually, or you can let the Editor indent your code based on common coding standards.
To set the size of indents code
You can change the size of indents that you manually insert, or that are automatically inserted by the Editor.
- Choose Config > Options....
- On the Editor tab, change the Indent size field to specify the size of indents.
To manually insert or remove an indent
- Place the cursor on the line of code you want to indent or unindent.
- To insert an indent, choose Block > Indent.
To remove an indent, choose Block > Unindent.
To let the Editor indent your code
The Editor has an auto-indent feature that indents your code according to common coding standards.
- If you want to auto-indent a single line of code, move the cursor to that line. If you want to auto-indent multiple lines of code, highlight those lines.
- Choose Block > Auto-Indent, or press Ctrl+2, or press Ctrl+; (semi-colon). Pressing Tab also automatically indents everything to the right of the cursor.
- Select the block you wish to indent, right-click it and choose Auto Indent from the pop-up menu.
Influencing how the Editor auto-indents your code
You can change how far the Editor auto-indents the lines of a lexical block of code. At the start of the lexical block, indent the code how you want the entire block to look. Then, highlight the rest of the block and start the auto-indent. This prevents the Editor from breaking the conventions of a pre-existing block.
How indenting multiple lines affects your comments
If you are auto-indenting multiple lines of code and do not want to indent the comments within those lines:
- Choose Config > Options....
- On the Editor tab, deselect Indent Comments when Indenting Multiple Lines.
Characters that auto-indent your code
By default, the Editor automatically makes indenting adjustments when you enter the following characters:
To disable characters from auto-indenting your code and comments
- Choose Config > Options....
- On the Editor tab, deselect Implicit Auto Indent.
To disable characters from auto-indenting your comments only
You might want special characters to auto-indent your code, but to disable them if you use them within a comment.
- Choose Config > Options....
- On the Editor tab, deselect Implicit Auto Indent In Comments.
Indenting the line following a left parenthesis `('
You can configure how the Editor indents the line of code that follows a left parenthesis `('.
- Choose Config > Options....
- Go to the Editor tab.
- In the C Paren Indent Mode, select one of the following according to your preferred coding standard:
- If you want the Editor to indent by two levels the line of code that follows a left parenthesis `(', select "Indent in two". Your code will look like this:
int main (
int argc
- If you want to indent the line of code that follows a left parenthesis `(' so that it lines up with the parenthesis, select "Even with parentheses". Your code will look like this:
int main (
int argc
Related topic:
Copyright © 1999, Green Hills Software. All rights
reserved.