History Report a problem
Article Edit this page Discussion

Automatic word wrapping

From Vim Tips Wiki

Jump to: navigation, search

Tip 850 Previous TipNext 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

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pushing Daisies
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Astronomy Wiki
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions


Vote for featured Wikia!

Send this article to a friend
"Automatic word wrapping"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation