Re: question for charles (or anyone): netrw whacking t
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
Re: question for charles (or anyone): netrw whacking t
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. Regards, Chip Campbell
Re: question for charles (or anyone): netrw whacking t
On Tue, Jul 11, 2006 at 06:53:23PM -0500, scott wrote: > charles-- > > i have formatoptions set in my .vimrc to tcroqn > > i have a script i call gvime that starts 'vim -g -c Explore' > (i tried 'gvim -c Explore' with the same result) > > if i run gvime, and select a file to edit, i find > formatoptions is now croqn -- the t has been whacked, > and even with a modeline setting textwidth, i am > manually formatting paragraphs, running scriptnames, > and generally having a bad day 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 other options are being affected, too. I am too bleary-eyed to be sure, but I think that 'spell' and 'tw' in other buffers are being affected by the netrw window. I think the problem comes from lines like if exists("w:spellkeep")|let &spell = w:spellkeep |unlet w:spellkeep|endif if exists("w:twkeep") |let &tw = w:twkeep |unlet w:twkeep |endif Instead of :let &spell = ... I think it should be :let &l:spell = ... :help local-options :help expr-option HTH --Benji Fisher
question for charles (or anyone): netrw whacking t
charles-- i have formatoptions set in my .vimrc to tcroqn i have a script i call gvime that starts 'vim -g -c Explore' (i tried 'gvim -c Explore' with the same result) if i run gvime, and select a file to edit, i find formatoptions is now croqn -- the t has been whacked, and even with a modeline setting textwidth, i am manually formatting paragraphs, running scriptnames, and generally having a bad day i have a python enabled gvim, version 7.0.35, on linux (rel 2.6.13-15.10-smp) kde version 3.4.2 level "b" in other words i just installed suse linux 10.0 and i'm a linux newbie any help will be appreciated, scott