Auto/Smart Indent

Programmers who use structured languages usually require some form of automatic indent, so that they don't have to continually re-type the sequences of tabs and/or spaces needed to maintain lengthy running indents. XNEdit therefore offers "smart" indent, in addition to the traditional automatic indent which simply lines up the cursor position with the previous line.

Smart Indent

Smart indent macros are only available by default for C and C++, and while these can easily be configured for different default indentation distances, they may not conform to everyone's exact C programming style. Smart indent is programmed in terms of macros in the XNEdit macro language which can be entered in: Preferences -> Default Settings -> Indent -> Program Smart Indent. Hooks are provided for intervening at the point that a newline is entered, either via the user pressing the Enter key, or through auto-wrapping; and for arbitrary type-in to act on specific characters typed.

To type a newline character without invoking smart-indent when operating in smart-indent mode, hold the Shift key while pressing the Return or Enter key.

Auto-Indent

With Indent set to Auto (the default), XNEdit keeps a running indent. When you press the Return or Enter key, spaces and tabs are inserted to line up the insert point under the start of the previous line.

Regardless of indent-mode, Ctrl+Return always does the automatic indent; Shift+Return always does a return without indent.

Block Indentation Adjustment

The Shift Left and Shift Right commands as well as rectangular dragging can be used to adjust the indentation for several lines at once. To shift a block of text one character to the right, select the text, then choose Shift Right from the Edit menu. Note that the accelerator keys for these menu items are Ctrl+9 and Ctrl+0, which correspond to the right and left parenthesis on most keyboards. Remember them as adjusting the text in the direction pointed to by the parenthesis character. Holding the Shift key while selecting either Shift Left or Shift Right will shift the text by one tab stop (or by one emulated tab stop if tab emulation is turned on). The help section "Shifting and Filling" under "Basic Operation" has details.