vim 下 :help internal-variables
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.
:set is for setting options, :let for assigning a value to a variable.
It happens that the value for an option is linked to the name of the option prepended by a & (the &option-name construct then behaves very similar to “ordinary” variables). So, the following are equivalent:
But, for example, assigning 50 to the global variable foo (:let g:foo=50) cannot be achieved with a :set command (because g:foo is a variable and not an option).
Some options are boolean like. When setting these, no value is needed (as in :set noic and the opposite :set ic).