Hi Ken, Thanks, it says "Last set from /etc/vim/vimrc"
I've found the place in that file, where it sets the variable. This is apparently distribution (Gentoo) specific settings: 147 augroup gentoo 148 au! 149 150 " Gentoo-specific settings for ebuilds. These are the federally-mandated 151 " required tab settings. See the following for more information: 152 " http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml 153 " Note that the rules below are very minimal and don't cover everything. 154 " Better to emerge app-vim/gentoo-syntax, which provides full syntax, 155 " filetype and indent settings for all things Gentoo. 156 au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh 157 au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab 158 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 165 166 " When editing a file, always jump to the last cursor position 167 autocmd BufReadPost * 168 \ if ! exists("g:leave_my_cursor_position_alone") | 169 \ if line("'\"") > 0 && line ("'\"") <= line("$") | 170 \ exe "normal g'\"" | 171 \ endif | 172 \ endif 173 174 " When editing a crontab file, set backupcopy to yes rather than auto. See 175 " :help crontab and bug #53437. 176 autocmd FileType crontab set backupcopy=yes 177 178 " If we previously detected that the default encoding is not UTF-8 179 " (g:added_fenc_utf8), assume that a file with only ASCII characters (or no 180 " characters at all) isn't a Unicode file, but is in the default encoding. 181 " Except of course if a byte-order mark is in effect. 182 autocmd BufReadPost * 183 \ if exists("g:added_fenc_utf8") && &fileencoding == "utf-8" && 184 \ ! &bomb && search('[\x80-\xFF]','nw') == 0 && &modifiable | 185 \ set fileencoding= | 186 \ endif 187 188 augroup END Commenting the string #163 resolves the issue. But I still wonder why it is not being overridden by my ~/.vimrc, where I have "set textwidth=0"? -----Original Message----- Date: Fri, 1 Jan 2016 20:32:46 -0800 (PST) From: Ken Takata <[email protected]> To: vim_dev <[email protected]> Cc: [email protected], [email protected] Subject: Re: Bug: Unable to set textwidth via vimrc Hi tot-to, 2016/1/2 Sat 13:19:05 UTC+9 tot-to wrote: > https://bugs.gentoo.org/show_bug.cgi?id=559800 > > 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 Try using :verbose to find where it is set. E.g. :verbose set textwidth? Regards, Ken Takata -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
