# Indentation and Whitespace

## Indentation

Indenting text is a common operation when dealing with source code editing, and Scintilla and Notepad++ have full support for it. Indentation is the addition of extra whitespace at the start of a line to separate blocks of text, adding a hierarchy.

Normally when editing, pressing the Tab key will insert a tab character at the current location. However, if some text is selected, pressing the Tab key (by default) will add additional whitespace at the beginning of each line that has any selected text, allowing to indent entire blocks of text at once. Pressing Shift-TAB will remove the indentation. These commands are available from Increase / Decrease Line Indent as well.

Indentation is done in levels, each level adding a predefined amount of whitespace (this amount can be configured on a per language basis, see Preferences). There is also an option of choosing whether to insert a TAB character or (multiple) spaces (for this, also see Preferences).

Scintilla can show a line/guide for each level, which can be toggled by selecting View->Show Symbol->Show Indent Guide or pressing . This guideline shows a visual cue to keep track of the current indentation level of lines. To change the color used, see Styler Configurator (note that if the guideline matches highlighted braces, it will assume the color of the brace highlight).

## Whitespace

Whitespace is the umbrella term for characters that do not show in print. The most frequent kinds are spaces and horizontal tabulations. Indenting uses these characters, but they can be present in a line, specially at the end. Notepad++ has a Edit → Blank operations submenu with commands to

- Trim either or both leading and trailing space;
- Remove duplicate whitespace or end of line characters
- Turn tabs into spaces or vice versa, taking the current language settings into account.