Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto wrap long lines in VIM

Tags:

vim

word-wrap

When I edit a haskell file in Vim, my editor automatically wraps comments that go past 80 characters to the next line. I'd like Vim to use the same behavior for python files (and text files), but I can't find the setting that does this anywhere, in my ~/.vim/syntax folder or vimrc.

Here are relevant lines of my .vimrc:

set wrap
set textwidth=80
like image 992
Kevin Burke Avatar asked Apr 09 '11 04:04

Kevin Burke


1 Answers

Setting textwidth will put your maximum line length. This would put a new line at that character point (white space could play with an exact 80 a bit though). (This effects the actual formatting of your file).

wrap is indeed what you want for your splitting/wrapping though.

Make sure your .vimrc is in your home directory.

like image 184
wilbbe01 Avatar answered Sep 29 '22 12:09

wilbbe01