Automatic word wrapping
From Vim Tips Wiki
Tip 850 Previous Tip • Next Tip
Created: January 11, 2005 Complexity: basic Author: mmj Minimum version: 5.7 Karma: 42/27 Imported from: Tip#850
To automatically wrap words in Vim
:set wm=2
which sets a wrap margin of 2 characters at the end of each line, and does automatic word-wrapping as you type in text.
To set textwidth as of your screen width do
:set textwidth=0 " If you want to set it yourself do :set textwidth=78
If you want to apply this to specific areas; bring the cursor at the beginning of the text you want to format and type gq. Now specify the range, say $ to format a large line.
[edit] References
[edit] Comments
set textwidth=72 " is more useful
Categories: Review | VimTip | Usage
