1. To set the wrapmargin:
:set wm=5
This sets the wrapmargin to five characters. In insert mode, text will automatically wrap to a new line when the cursor is five characters from the right edge of the screen.
2. To display line numbers:
:set number
This causes vi to display a line number (starting at 1) at the start of every line of text.