On Wed, Jul 12, 2006 at 01:24:51PM -0400, Charles E Campbell Jr wrote: > Benji Fisher wrote: > > > I think I see the problem. In $VIMRUNTIME/autoload/netrw.vim , in > >the function netrw#DirBrowse() , there are the lines > > > > if &fo =~ '[ta]' > > set fo-=t > > set fo-=a > > echohl Warning > > echo '***warning*** directory browsing and formatoptions "ta" are > > incompatible' > > echohl None > > endif > > > >(I am not sure that I ever get to see that warning message.) I think > >that replacing :set with :setlocal will fix the problem. Remember, when > >dealing with a local option, :set changes both the local value and the > >global default; :setlocal changes only the value... > > > >I think it should be > > > > :let &l:spell = ... > > > > > Actually, I don't want to use local settings; just obstinate, I guess! > What netrw v102h does > (and its available at my website, > http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs > as "Network Oriented Reading, Writing, and Browsing) is save global > settings, make them > netrw-friendly, do the browsing thing, restore the settings.
In that case, use the &g: prefix. For example, try the following experiment: :set spell :new :setl spell! :echo &spell &l:spell &g:spell I think you should get 0 0 1 (as I do). So &spell references the local value of the option, not the global value. Now, consider the lines let w:spellkeep = &spell ... if exists("w:spellkeep")|let &spell = w:spellkeep |unlet w:spellkeep|endif in $VIMRUNTIME/autoload/netrw.vim . The first sets w:spellkeep to the local value, and the second sets the global value. Bottom line: while testing the OP's problem before my original post on this thread, I did find that options ended up being set in ways I did not want nor expext, and :verbose set spell? told me that netrw was the culprit. HTH --Benji Fisher