Thomas schrieb:
Yakov Lerner schrieb:
wish: allow a: in the function definition line:
      function foo(a:line1, a:line2)

yeah, occasionally I do

  :setl isk+=:

to get completion of variable names in vim scripts.
I'd like to have this for function arguments, too.

Counterwish: implement better semantics for VimScript so that the
lookup order of variables alleviates the need for explicit
environments.  Yes, this will break backwards compatibility.

I personally like both wishes. I don't think that this has to necessarily break backwards compatibility as variables can already have implicit prefixes: eg foo could be l:foo when used in a function or g:foo when used in global scope.

So maybe one could make vimscript search a variable foo as l:foo, a:foo, (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an undefined variable name error if none exists. Or so.

Don't like the idea.
In Vim script there is no need or possibility to declare variables.
Now, if I forget to init a fun-local variable (happens often to me)
Vim gives me a helpful error ("undefined variable").

This wouldn't be the case anymore if Vim could find obscure variables with
the same name I've never heard of (e.g. set by some weird plugin).

Also would it be _recommended_ to ever use a window-local variable without
the "w:" prefix? ... IMHO not.

--
Regards,
Andy

EOM

Reply via email to