On Jan 10, 4:50 pm, Cesar Romani <[email protected]> wrote:
> I'm using vim 7.3.401 on windows 7. I'm trying to edit a list of text
> files, say test1.txt, test2.txt and test3.txt, with a single vim. When
> I'm on test1.txt and do: set tw=72, this isn't set on the other files!
> If I do :n to go to the next file and do set tw? I get 78.
>
> Not long ago, before updating to 7.3.401, I used to edit a bunch of
> files, set tw=72 in one of them, and this was globally set on the other
> files. What happened?
>
> If I set sw=8 in one of them, it will be set on the other files, but not
> with tw.
>

I cannot reproduce this, either with:

gvim -N -u NONE -i NONE test1.txt test2.txt test3.txt

nor with (to load with just the vimrc_example.vim script and the
official runtime with none of my customizations):

gvim -N -u "C:\Program Files (x86)\vim\vim73\vimrc_example.vim" --
noplugin -i NONE --cmd "set runtimepath-=U:\vimfiles runtimepath-=U:
\vimfiles/after" test1.txt test2.txt test3.txt

When I do it, I get textwidth=72 in every buffer.

However, I do note this line in the vimrc_example.vim:

  autocmd FileType text setlocal textwidth=78

By default, Vim does not (last I checked) automatically set the
filetype to "text" for anything, so I'm not sure why this is even in
here. But you have a couple of options until/unless it is removed:

1. stop sourcing vimrc_example.vim, and just copy the stuff you want
into your own .vimrc
2. remove the autocmd after sourcing vimrc_example.vim, with "au!
vimrcEx FileType"
3. define your own textwidth for text files, in a later autocmd

Sadly with the autocmd method instead of a filetype plugin method, I
don't think you can just use the after directory to override it.

-- 
You received this message from the "vim_use" 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

Reply via email to