-
Book Overview & Buying
-
Table Of Contents
Mastering Vim - Second Edition
By :
Vim 9 introduced Vimscript 9 (or Vim9script), which significantly improves performance and gives users access to programming constructs available in common programming languages. Vimscript 9 is best treated as an addition to Vimscript, to be used alongside prior versions of Vimscript.
Outside of improved performance, differences come down to syntax – for example, signifying comments with # instead of ", declaring variables with var, explicit boolean support, required use of whitespace for readability, and so on. I’ll call out the differences between Vim9script and previous versions of Vimscript throughout this chapter.
Vimscript 9 use is opt-in and can be invoked by starting your script with vim9script, defining functions through the def keyword (rather than function), or prefixing a command with vim9cmd.
I recommend using Vimscript 9 if you intend to get more serious about writing custom plugins or start fiddling with performance...