next up previous contents
Next: Files (Opening, Saving, etc.) Up: The Woodnotes Guide to Previous: Gvim vs. Vim   Contents

Line Wrapping and Text Width

Unless you choose otherwise, each line of text will extend off the screen with no wrapping. For authors, that's not convenient. So issue the command :set linebreak to wrap the text when it hits the screen edge. This is what other software calls ``soft wrapping'' in that it conveniently manages the text on screen but doesn't insert newlines or carriage returns in the file. For long text works, this is probably what you want.

If however, you want for example, 80 character hardwrapped text (text formatted with a new line after 80 characters) like in the good old days, issue :set textwidth=80. If you are writing, for example, a LATEX document in which your document is a source file, this latter method may be more useful over all. Using the former method, what Vim considers to be a ``line'' is actually what we would call a paragraph, and moving up by one line at a time (using j and k) actually moves the cursor up by one paragraph at a time. Using the latter method, moving up one line actually moves you up one line on the screen, which is convenient. Otherwise, use gj and gk to advance the cursor one screen line at a time.


next up previous contents
Next: Files (Opening, Saving, etc.) Up: The Woodnotes Guide to Previous: Gvim vs. Vim   Contents
Randall Wood 2009-08-04