Vim 9.2 brings Wayland support and new Vim9-Script features
The command-line editor receives full Wayland support for the first time. Vim9-Script gets new data types, and the Diff mode becomes more powerful.
(Image: heise medien)
Vim 9.2 is here: The command-line editor's release offers full Wayland support for the first time – for both the user interface and the clipboard. The project is thus responding to the increasing prevalence of the graphics server under Linux. At the same time, Vim will in future follow the XDG Base Directory Specification and store configuration files under Linux and Unix in $HOME/.config/vim.
Vim9-Script, the editor's modern scripting language, receives new data types: Enums enable type-safe enumerations, Generic Functions allow the definition of functions with type parameters, and the new Tuple data type provides ordered collections of fixed size. Built-in Functions can now also be used as object methods. New features such as protected _new() constructors and the :defcompile command for full method compilation round off the language extensions.
The Diff mode receives a new linematch algorithm that more precisely maps lines between buffers. The new diffanchors option allows anchor points to be set to divide complex files into sections and compare them independently. Inline highlighting has been improved, now highlighting changes within a line in more detail.
Practical Improvements
Vim 9.2 has made several adjustments to the default settings: The command history grows from 50 to 200 entries (history), the backspace key behaves as expected by default (backspace set to "indent,eol,start"), and the cursor position and typed commands are always displayed (ruler and showcmd enabled). Under GTK, the default font size increases from 10 to 12 points, which is beneficial for users with high-resolution displays.
Insert mode completion now supports fuzzy matching and can complete words directly from registers. The new nosort and nearest flags for completeopt give users finer control over the display and sorting of suggestions. A new interactive tutor, callable via :Tutor, aims to offer a more modern way to learn the editor compared to the classic vimtutor program.
Videos by heise
Platform Optimizations
Windows users get native dark mode support for menus and title bars, as well as higher-quality toolbar icons. Full-screen support has been improved. As an alternative to the horizontal tabline, Vim 9.2 now offers a vertical tab panel, which can be more organized with many open files.
Contributor Yegappan Lakshmanan demonstrates the capabilities of Vim9-Script in the release notes using two projects generated with GitHub Copilot: A full implementation of the Battleship game shows the use of classes and type aliases, while a Number Puzzle game demonstrates the suitability of modern Vim9 constructs for interactive plugins.
The release also fixes several security vulnerabilities, memory leaks, and potential crash causes that became known since Vim 9.1. Following the death of Vim creator Bram Moolenaar in August 2023, Christian Brabandt continues to lead the project as lead maintainer.
(fo)