The first Vim major release since 2016 has been released. The new syntax enables fast script processing and adaptation to well-known programming languages.
Version 9 of the text-based editor Vim was a long time coming, now it’s here. The last major release was six years ago, which is not unusual for the tool – the previous version from 2016 was only replaced by 7.x after ten years. The team behind Vim is considered manageable, and development is said to be primarily in the hands of Vim author Bram Moolenaar and a small circle around the Dutch open source developer. At first glance, it all seems very retro, and some readers might now ask: Who still needs a text-based editor?
Precise, on-demand configurable tool for connoisseurs
There is quite practical reasons for this. Linux fans should be the least stranger to Vim, because it is still a common editor in the Unix and Linux environment, and in some cases even standard for editing configuration files. According to those in the know, anyone who gets involved will get an astonishingly modern editor that can also be useful under other operating systems as a precise, extensively configurable tool. The basics are considered easy to learn, while more professional use requires a slightly steeper learning curve. The new version might whet the appetite of some who previously had reservations.
So far, Vim’s extensive configurability has had a catch, it has slowed down the editor considerably. This is where the Vim team came in for the new main version and fundamentally revised the tool: Vim 9 breaks with the local variables and dictionaries of the previous version, the Vimscripts have largely been rewritten and, according to the publishers in the release notification, should be repeated ten to a hundred times when executed be as fast as before. This means that backwards compatibility is no longer a given, but the speed up gained in this way should reconcile developers.
New syntax, but no drama like Python 2
The syntax of the Vim scripting language was previously considered to be complicated and had regularly irritated or even deterred beginners, here too the Vim team has completely overhauled it. According to the release notes, the structure of the scripts has been simplified since version 9, making the scripting language easier to understand. Moolenaar and his team have begun to adapt the syntax, at least in part, to other scripting and programming languages that developers are more familiar with, such as JavaScript, TypeScript, and Java.
The Vim team has thrown out historical legacy, so let it be arguments and local variables are no longer defined with a: and s: with Vim 9. Basically, the team also promises everyone with large collections of legacy scripts that old scripts should continue to do their job as usual and assures concerned users in the Vim community mailing list that they do not intend to drop legacy scripts from support “No drama like with the deprecation of Python 2” is the motto.
Local plug-ins frozen, popup menu replaces wildmenu
There is an interpreter in the tool that can execute various script languages directly. Previously, each programming language contained its own program, which is why administrators had to install individual, language-specific packages to use this functionality. Vim 9 imposed a feature freeze for the interface and heralded a change of direction: in future, Vim should use the interpreters of the script languages externally instead of as local plug-ins and execute all supported languages directly. Vim will also support new languages in the future, including Go.
One of the new features is the popup menu, which instead of the previously offered “wildoptions” can be changed by changing the settings to “pum” (for popup menu instead of the previous wildmenu or wmnu). If you use Vim with it, you should see more hits in the future. Previously, the display of matches was quite limited. The team has also added new color schemes, which can be found in Vim’s GitHub repository. One change is considered incompatible with the previous release: it affects the Lua arrays, which are now based on one instead of zero (more on this in the release notes, especially in the differences section).
One List of all changes and new commands in Vim 9 can be found on the project website.There, Bram Moolenaar provides a guide on how to use the text editor and there is an FAQ section to clarify common questions. The Vimlog maintained by Martin Tournoij, a changelog for the Vim editor that lists all changes since version 8.2, is also clearly arranged. Anyone interested in the history of the editor might find an article from c’t on the use of Vim that is still worth reading.
Vim’s roots and obituary of Vim friend Sven Guckes
Vim is a clone of the original Unix editor Vi, where Vim stands for “improved Vi” (Vi iMproved). In terms of operation, both are almost identical, although Vim is equipped with more functions and is more flexible to use. If you type vi into macOS or a Linux distribution these days, you are usually also working with Vim, which only simulates the limited range of functions of Vi. Followers of Vim value the scripting engine, with which they can adapt Vim to their own needs as much as possible using the Vimscript function, in order to be able to better control the behavior of the editor. The most popular features include syntax highlighting, the dynamic integration of dictionaries and various settings based on external factors that can be integrated using an if statement.
Vim 9 is dedicated to the developer Sven, who died early in February 2022 Dedicated to Guckes, who was well known in the Linux and open source community and had supported the Vim project. He is said to have been significantly involved in the preparations for the current release. More about Sven Guckes and his work can be found in the obituary in iX.