vim の変数のスコープ
とりあえず、「s:」と「l:」だけ覚えておけばよさそう。
:help internal-variables で調べられる
There are several name spaces for variables. Which one is to be used is specified by what is prepended: (nothing) In a function: local to a function; otherwise: global |buffer-variable| b: Local to the current buffer. |window-variable| w: Local to the current window. |tabpage-variable| t: Local to the current tab page. |global-variable| g: Global. |local-variable| l: Local to a function. |script-variable| s: Local to a |:source|'ed Vim script. |function-argument| a: Function argument (only inside a function). |vim-variable| v: Global, predefined by Vim.
参考
Software Design (ソフトウエア デザイン) 2008年 07月号 [雑誌](p.144)
ViIMproved‐Vim完全バイブル(p.427)