Wednesday, October 31, 2012

Re: What do I need to read to understand g: and s: VIM variable prefixes?

On 30/10/12 20:27, Ben Fritz wrote:
> On Tuesday, October 30, 2012 1:10:16 PM UTC-5, herm...@free.fr wrote:
>>
>>> What is the s: for that precedes the second function's name, and why
>>> does it change scope (s for scope, perhaps)? Thanks.
>>
>> s: stands for script. The scope of the variable is the script. As file static variables in C.
>>
>
> Any of the [gvslawtb]: prefixed variables define the scope of the variable, as follows:
>
> g: global variable, accessible anywhere
> v: special variable predefined by Vim only useful in certain contexts, see the help entry for that variable
> s: script-local variable, accessible anywhere within a given script file
> l: function-local variable, only accessible with the defining function
> a: function argument
> w: window-local variable, global variable but with a separate copy for every single window
> t: tab-local variable, global variable but with a separate copy for each tab page
> b: buffer-local variable, global variable but with a separate copy for each buffer
>
Yes, and in addition, if you don't use a scope prefix Vim implies l: if
you're inside a function and g: otherwise.

See :help internal-variables


Best regards,
Tony.
--
Question:
Man Invented Alcohol,
God Invented Grass.
Who do you trust?

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

No comments:

Post a Comment