Vim Tips Wiki
(Adding categories)
(thanks, but Category:word doesn't exist, and it's hard to see which tips would use it, so I removed it)
Line 43: Line 43:
   
 
----
 
----
[[Category:word]]
 

Revision as of 04:08, 18 April 2009

Tip 850 Printable Monobook Previous Next

created January 11, 2005 · complexity basic · author mmj · version 5.7


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.

References

Comments

set textwidth=72       " is more useful