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
Written by Chip Castle
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Viml
Authors
Related Tags
#viml
#vimscript
#vim
#vi
#text formatting
#textwidth
#visual mode
#80 characters
#formatoptions
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#