document updated 13 years ago, on Dec 21, 2010
Variables can be prefixed with a letter and a colon. Vim doco calls these name spaces for variables
b: |
Buffer |
w: |
Window |
g: |
Global
|
l: |
Function |
s: |
Script variable (or Sourced script?)
|
a: |
Arguments to Function |
v: |
Global, predefined |
@ |
registers |
&XYZ |
The value of an option (for example ic) |
If a function is declared with
range, the the special variables
a:firstline and
a:lastline give
the numbers where the selection starts and ends.
Additionally, the value of an option can be set/gotten by preceding the option name with a & (For example &shell
or &term
).
The value of environment variables can be gotten by preceding the variable's name with a $ (For example $VIM
).
@/ is the value of the last search pattern. This value can be
assigned to.