The editor uses the Tab key to increase or decrease the indentation
level of the selected text.
To increase indentation:
- Select the text to indent.
- Choose Selection > Increase Line Indent or press Tab.
To decrease indentation:
- Select the text to indent.
- Choose Selection > Decrease Line Indent or press Shift+Tab.
The indentation size can be changed in the Language Properties pane of the
editor's Properties window, as can all the indent-related features
listed below.
To change indentation size:
- Choose Tools > Options or press Alt+,.
- Select the Languages page.
- Set the Indent Size environment option for the required language.
You can choose to use spaces or tab tab characters to fill whitespace
when indenting.
To set tab or space fill when indenting:
- Choose Tools > Options or press Alt+,.
- Select the Languages page.
- Set the Use Tabs environment option for the required language. Note: changing
this setting does not add or remove existing tabs from files, the change will
only affect new indents.
The editor can assist with source code indentation while inserting
text. There are three levels of indentation assistance:
- None: The indentation of the source code is left to the user.
- Indent: This is the default. The editor maintains the current
indentation level. When you press Return or Enter, the editor
moves the insertion point down one line and indented to the same level
as the now-previous line.
- Smart: The editor analyzes the source code to compute the
appropriate indentation level for each line. You can change how many lines
before the insertion point will be analyzed for context. The
smart-indent mode can be configured to indent either open and closing braces
or the lines following the braces.
Changing indentation options:
To change the indentation mode:
- Set the Indent Mode environment option for the required language.
To change whether opening braces are indented in smart-indent mode:
- Set the Indent Opening Brace environment option for the required language.
To change whether closing braces are indented in smart-indent mode:
- Set the Indent Closing Brace environment option for the required language.
To change the number of previous lines used for context in smart-indent mode:
- Set the Indent Context Lines environment option for the required language.