my .vimrc setting for wrapping line:
set nowrap " Don't auto wrap on load
set fo-=t " Don't wrap text when type
"set colorcolumn= 80
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityUse :set tw=80
. Also make sure you are not in “paste” mode. (https://stackoverflow.com/a/1272371/4752883)
If you need visual guidance on where you are with respect to 80 characters you can use :set colorcolumn = 80
(https://vi.stackexchange.com/a/576/13848)
set wrap
andset textwidth=80
should do it. You can control Vim wrapping pretty precisely see:h 'wrap'
,:h 'textwidth'
and have a look at:h 'linebreak'
gq
to format long lines according to your textwidth setting