By default, the action of the tab key depends on the selected Keyboard Personality, file type, and position within the file as described under Default for Personality below.
To insert a real tab character regardless of the indentation mode or the position of the cursor on a line, type Ctrl-Tab or Ctrl-T.
The behavior of the tab key can be altered using the Tab Key Action preference, which provides the following options:
Default for Personality
This selects from the other tab key actions below according to the chosen keyboard personality, current file type, and in some cases the position of the caret within the file. In all non-Python files, the default is Move to Next Tab Stop. In Python files, the defaults are as follows by keyboard personality:
Indent to Match
This indents the current line or selected lines to position them at the computed indent level for their context in the file.
Move to Next Tab Stop
This enters indentation characters matching the current file's style of indentation so that the caret reaches the next tab stop.
Indent Region
This enters indentation characters matching the current file's style of indentation to increase the indentation of the current line or selected lines by one level.
Insert Tab Character
This inserts a Tab character (chr(9)) into the file.
Smart Tab
This option is available for Python files only. It implements the following behavior for the tab key:
When the caret is within a line or there is a non-empty selection, this performs Indent to Match. When the line or lines are already at the matching position, indentation is toggled between likely positions as follows:
When the caret is at the end of a non-empty line and there is no selection, one indent level is inserted. The Smart Tab End of Line Indents preference can be used to alter the type of indentation used or to disable this aspect of the Smart Tab feature.