In my ~/.vimrc
if I write set tabstop = 2
, it will be a syntax error:
set tabstop = 2 " E521: Number required after =: tabstop =
set tabstop=2 " no errors
But I can write let @/ = ""
let @/ = "" " no errors
let @/="" " no errors
Why are they different?
Note: Reading the help menu for both :h let
and :h set
you can find examples using the proper syntax; however, I'm still curious why they are different.
vi
, which has aset
command, but not alet
.let
forvim
? It seems strange that they would choose to havelet foo = 42
be valid whenset foo = 42
is invalid. Does my question make sense?