wbyv_a
Last Updated: February 25, 2016
·
1.194K
· chip
Chip avatar

Vim automatic wrapping at 80 characters

If you want to force vim to always automatically wrap lines when it hits the 80 character mark, I would suggest doing the following:

First, edit your vim resource file:

vim ~/.vimrc

Next, set the option for textwidth to the number of characters limit:

set textwidth=80

Here's an alternative shorthand version of the textwidth option:

set tw=80

Last, set the option for formatoptions:

set formatoptions+=t

Here's an alternative shorthand version of the formatoptions option:

set fo+=t

For more UNIX tips, please check out
Learning the UNIX Command Line.

Enjoy,

Chip

Say Thanks
Respond