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. NEdit-ng therefore offers "smart" indent, in addition to the traditional automatic indent which simply lines up the cursor position with the previous line.

Smart Indent

A set of default smart indent macros are available 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 NEdit-ng 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 Shift while pressing the Return or Enter key.

Auto-Indent

With Indent set to Auto (the default), NEdit-ng keeps a running indent. When you press Return or Enter, 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 Edit → Shift Right. 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 Shift while selecting either Edit → Shift Left or Edit → Shift Right will shift the text by one tab stop (or by one emulated tab stop if tab emulation is turned on). Shifting and Filling has details.