No no, the options is local to a buffer. The only way
I can think of is to create a hook of some sort
(events) and do 'set tw=0' after a file loads, but
gurus might know better.
Ah, I see the problem. Yes, vim has hooks (autocommands,
verbosely detailed at ":help autocmd.txt" where you can read more
than any sane person should want to :) to do just the sort of
thing you describe.
You put a line something like the following in your vimrc:
autocmd BufNewFile,BufRead * set tw=0
You can adjust the "*" to be whatever filespecs you might want.
If you just want .html or .txt files, it's easy enough to isolate
them:
augroup TextFiles
au!
autocmd BufNewFile,BufRead *.htm set tw=0
autocmd BufNewFile,BufRead *.html set tw=0
autocmd BufNewFile,BufRead *.txt set tw=0
augroup END
However, vim *should default to having 'tw' set to zero. If you
start vim with "vim -u NONE", and
:set tw?
it comes back as 0. This leads me to believe that some
plugin/script that you load is monkeying with your setting. You
can use
:verbose set tw?
to learn where it was last set. You might also find
":scriptnames" helfpul for nailing down the troublesome script.
Once you find the troublemaker, you can either edit it or remove it.
Just a few ideas.
-tim