VimScript has the following variable scopes, denoted by a corresponding prifix letter:
| Scope | Prefix | Purpose |
|---|---|---|
| global | g: or none |
|
| buffer-local | b: |
Separate values between buffers |
| window-local | w: |
Separate values between windows(splits) |
| tab-local | t: |
Separate values between tabs (views) |
| script-local | s: |
accessible only within the script file |
| funtion-locat | l: |
Local variables in functions |
| function-formal parameter | a: |
Access funtion parameters |
| built-in | v: |
Variables built into Vim |
References:
#literature-note #plugins