After two and a half years of development, Vim 9.0 is now available, firmly focused on the new Vim9 scripting language capabilities.
In its 30-year history, the terminal-based text editor Vim has been one of the most recognizable names in the open-source world, loved by some and disliked by others. Using it has put Unix/Linux users to the test more than once.
However, Vim sticks to its original path, as evidenced by the recently released version 9.0. With that said, let’s take a look at the highlights of it.
Vim 9 Highlights
Everything important in Vim 9.0 revolves around one thing: Vim9 Script. But first, let me explain what this is all about.
Vim script is the scripting language built into Vim. It is a typical dynamic imperative language with the following features: variables, expressions, control structures, built-in functions, user-defined functions, regex pattern matching, exceptions, integrated debugger, and so on.
In other words, Vim scripts allow you to customize and extend the Vim editor core functionality. For example, it can be used to create new tools, simplify routine tasks, and even tweak current editor capabilities.
However, the speed was an issue in prior editions. Fortunately, this has changed substantially with Vim 9.0, including the brand new Vim9 script.
The main goal of Vim9 script is to drastically improve performance. This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected.
The key speedup in the Vim9 script is that instead of processing each line many times, it is parsed once and converted into instructions that may be executed quickly. Furthermore, it does not keep local variables in a dictionary but instead places them on the stack, where they can be accessed directly.
Of course, there have also been adjustments to the Vim9 script language syntax, such as how variables are defined, functions are called, and so on.
Changes have also been made to the aesthetic part of the editor, which is more visible to the end-user. These take the form of new color schemes included with Vim 9.
They were designed to perform consistently across a wide range of terminals. Although they represent a significant improvement, of course, it still all comes down to individual user preferences. The new color schemes are available here for anyone interested. In addition, if you prefer the old version, you can find it here.