Automatically complete long lines in VIM

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

Here are the relevant lines of my .vimrc:

 set wrap set textwidth=80 
+13
vim textwrapping
Apr 09 2018-11-11T00:
source share
2 answers

The textwidth will contain the maximum line length. This will lead to the appearance of a new line at this point of the character (although white space can play with an accuracy of 80 bits). (This affects the actual formatting of your file).

wrap really what you want for your separation / packaging.

Make sure your .vimrc is in your home directory.

+11
Apr 09 2018-11-11T00:
source share

I use the following script in my vimrc to wrap a .txt file automatically. This may give you some advice.

 if has('autocmd') au BufRead,BufNewFile *.txt set wm=2 tw=80 endif 
+1
Apr 09 2018-11-11T00:
source share



All Articles