On Fri, Mar 15, 2013  2:25:10 PM, I wrote:
>On Mar 15, 11:22 am, Ben Fritz <fritzophre...@gmail.com> wrote:
>>On Thursday, March 14, 2013 6:13:10 PM UTC-5, Paul wrote:
>>> In a window with nofoldenable and foldcolumn=0, I issue the
>>> command :new.  This creates a window that has foldcolumn=5.  Two
>>> of my other windows have foldcolumn=5, but why would the new
>>> window have this?
>>
>> 'foldcolumn' has both a global and a local value. When you create a
>> new widow, the local value of the option is initialized to the
>> global value. You can use :setlocal to set only the local value
>> without affecting the global value, or :setglobal for the reverse.
>>
>> You probably created you windows something like this:
>>
>> :set foldcolumn=0
>> :new
>> :set foldcolumn=5
>> :wincmd p
>> :new
>>
>> This will create the new window with foldcolumn of 5, because you
>> used :set, which sets both the global and the local value.
>>
>> If you use this instead, the new window will have foldcolumn of 0:
>>
>> :set foldcolumn=0
>> :new
>> :setlocal foldcolumn=5
>> :wincmd p
>> :new
>>
>> Also this:
>>
>> :set foldcolumn=0
>> :new
>> :set foldcolumn=5
>> :setglobal foldcolumn=0
>> :wincmd p
>> :new
>>
>> I'd actually suggest putting a :setglobal in your .vimrc for the
>> preferred default setting, and always using :setlocal to set
>> individual windows.
>
> Thanks, Ben.  The thought did occur to me about the global versus
> local, and I explicitly used setl and setg to make foldcolumn=0.
> The problem persisted, albeit in a random manner (sometimes I
> succeeded).  That's when I looked at the help for foldcolumn.  The
> strange thing is that the documentation says it is local.  Is there
> something about how to interpret the documentation that I should be
> aware of?
>
> Thanks for clarifying that "set" simultaneously does a setl and
> setg.  Always wondered about that.

Just as an interesting point of confusion, ":setg foldcolumn?" does
not return the global value.  The value depends on the window, so I
assume that it returns the local value.

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to