Edit ~/.exrc and add the following line:
set ai sw=4 wm=5 sm
* ai - This tells vi to use auto-indent for insertions.
* sw=4 - This tells vi to use 4 spaces for each level of indentation in auto-indent mode.
* wm=5 - This tells vi to wrap a line 5 spaces from the right margin.
* sm - This tells vi to show matching parentheses, brackets, and braces in insert mode. When you type a closing parenthesis, bracket, or brace the cursor will briefly jump to the matching parentesis, bracket or brace.