Previously, I haven't set textwidth in .vimrc and it was no autowrapping by default in all files. At some point (probably after an upgrade) it stared to do autowrap, but only for *.txt files, i.e. if I open such file and enter the command :set tw I get textwidth=78 Of course, I can set it manually to 0, but it'll be forgotten on the next run. So, I've added this string to my ~/.vimrc: set textwidth=0 But it turned out, that this doesn't change the behaviour at all. I've tested with latest versions for amd64 and ~amd64, i.e. 7.4.769 and 7.4.827. Reproducible: Always Steps to Reproduce: 1. echo 'set textwidth=0' >> ~/.vimrc 2. vim textfile.txt 3. type ":set textwidth" Actual Results: textwidth=78 Expected Results: textwidth=0
I've found where it comes from. This part of /etc/vim/vimrc: 159 " In text files, limit the width of text to 78 characters, but be careful 160 " that we don't override the user's setting. 161 autocmd BufNewFile,BufRead *.txt 162 \ if &tw == 0 && ! exists("g:leave_my_textwidth_alone") | 163 \ setlocal textwidth=78 | 164 \ endif It says, that it should not override the user's settings, but it does. Also, a few lines above it says, that it's one of the Gentoo-specific settings for ebuilds. But txt files are not ebuilds. The link with "more information" points to the page 404. I suggest to just remove this part of /etc/vim/vimrc The workaround is: echo 'let g:leave_my_textwidth_alone=1' >> ~/.vimrc
Really helpful workaround. Thank you. =)
Hi I haven't been able to reproduce this bug. Here's what I set in my ~/.vimrc file: set textwidth=79 and it is actually equal to 79 if I query it in vim. Maybe something is up in your setup? Somebody else in this bug report pointed out a workaround. Hopefully it helps solve this problem.