If I run e.g. :var a = 1
from the command line I end up in E1124: "var" cannot be used in legacy vimscript. Running on MacVim 9.0.1276.
Is it normal behavior?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityTo use the vim9 script syntax your script must include as the first command vim9script
.
vim9script
var a = 1
On the command line to run vim9 script command you have to prefix them with :vim9
:vim9 g:a = 1
This is because the commandline runs :legacy
-mode by default unless :vim9cmd
is used.