Entering carriage returns

For vi, a line is the string of characters between two <RETURN> characters.

Although vi will automatically wrap the text onto a new line when it reaches the right-hand side of the screen, it does not insert a <RETURN> character. Lines of text as they appear on your screen do not necessarily correspond to how vi understands their structure. This can give you problems when you use vi commands to move around the text as you edit it.

Adding a <RETURN> at the end of every line ensures that the appearance of the text on your screen corresponds to vi's understanding of how text is structured.

Setting the wrapmargin option automatically inserts a <RETURN> character whenever vi wraps text.


[Home] [Search] [Index] This site maintained by webmaster@cs.auckland.ac.nz