From the course: Learning vi

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Indenting, auto-indent, and word wrap

Indenting, auto-indent, and word wrap - vi Tutorial

From the course: Learning vi

Start my 1-month free trial

Indenting, auto-indent, and word wrap

Now, I'm going to talk about indenting and word wrap. The angle bracket commands, indent and outdent the current line. Two pointed brackets to the right indent the current line, that is to say they move it to the right. Two pointed brackets to the left outdent the current line, that is to say they move it to the left. Both of these perform their indent or outdent by a single tab stop. The pointy bracket commands, like with delete, can use a number beforehand or any movement command. For example, you can say, two pointed bracket, pointed bracket to indent two lines. Or you can say, bracket brace to indent an entire paragraph. Vi also includes an auto-indent capability. When auto-indent is turned on, whenever you are in a line that is indented. If you add a new line after it, either by hitting a return in insert mode or by using the O command to open a new line. The new line will be indented at the same level as the character above it. If you want to undo an indent while you are in…

Contents