Share via


Setting Tabs and Indents

Home Page (Text Editor)OverviewHow Do I ... TopicsFAQReference

You can indent text with tab characters several ways:

  • Use the INDENT SELECTION key.

  • Use Auto Indent (without Smart Indent).

  • Use Auto Indent (with Smart Indent enabled).

When you press the TAB key, the insertion point moves to the next indent level. You can display (or hide) the tab symbols by selecting Advanced from the Edit menu, and then selecting View Whitespace.

You can also use Auto Indent (without Smart Indent) to automatically indent new lines to match the previous line.

What do you want to do?

Set Auto Indent

Set Smart Indent

Change tab and indent settings

Display or hide tab symbols

Indent a group of lines

Unindent a group of lines

To set Auto Indent

  1. From the Tools menu, choose Options.

  2. Select the Tabs tab.

  3. Under Auto indent, select the option you want:

    • None: to disable Auto Indent

    • Default: to set the tab and indent size to match that of the previous level

    • Smart: to use Smart Indent

  4. Click OK.

If you use Auto Indent (with Smart Indent enabled), the Text editor automatically indents the text based on the context of the previous lines.

To set Smart Indent

  1. From the Tools menu, choose Options.

  2. Select the Tabs tab.

  3. Under Auto Indent, select Smart.

  4. Under Smart indent options, select the language element and specify the number of previous lines to use for the context of smart indenting.

  5. Click OK.

Backspacing over a tab character deletes that tab character, regardless of the indent setting.

If you select the Insert spaces option, a tab character is not inserted, and only spaces are inserted to reach the next indent level.

Note   The File type box on the Tabs tab contains a list of file types. The initial tab settings for each file you load are assigned based on the file extension and the setting of this box. You can use the Tab size and Indent size boxes on the Tabs tab or on the Source File Properties page to specify individual settings for these two fields on a per-file basis, as needed.

To change tab and indent settings

  1. From the Tools menu, choose Options.

  2. Select the Tabs tab.

  3. In the Tab size box, type the number of spaces to use as a tab stop. The default is four spaces.

  4. In the Indent size box, type the number of spaces to use for indents. The default is four spaces.

  5. Select the Keep tabs option to treat each tab as a single tab character when the file is saved.

    –or–

    Select the Insert spaces option to use spaces as specified in the Tab size box.

  6. Click OK.

To display or hide tab symbols

  1. From the Edit menu, choose Advanced.

  2. Select View Whitespace.

    Spaces are displayed as dots and tab symbols are displayed as >> whenever they appear in a source file.

To indent a group of lines

  1. Select the group of lines.

  2. Press the LineIndentkey combination.

To unindent a group of lines

  1. Select the group of lines.

  2. Press the LineUnindentkey combination.

    Note   The LineUnindent command only returns to previous tab stops.