Q:

When to use set vs let vs & to view variable value

I get a bit confused as to when we access a variable value like this:
:echom &textwidth
" 120

And when it's done like this:
:let a
" a                     #4

And when it's done like this:
:set textwidth?
textwidth=120

What is the difference between those three ways of getting the variable value, and when should they be properly used?

A:

A variable named &name is the Vim script representation of the option name.
So &textwidth is the Vim script representation of the option textwidth.
See :h :let-&.
The let a just prints the value of the variable a. I would prefer :echo a here.
Addon: You also might want to read :help internal-variables to understand the name spaces of variables.

