Table of Contents
Quick Summary
Vim project announced the release of latest Vim 9.2 version. Vim 9.2 introduces significant updates to the Vim9 scripting language, including native support for complex data types.
This release also features a modernized diff mode with improved alignment algorithms, experimental Wayland support, and adherence to the XDG Base Directory Specification for configuration files.
Major Changes in Vim 9.2 Release
1. Vim9 Scripting Enhancements
The language now supports Enums, Generic functions, and Tuples. Built-in functions are integrated as object methods, and classes now support protected _new() methods and :defcompile for full method compilation.
2. Diff Mode Improvements
- Added the "linematch" algorithm to the
diffoptsetting to better align similar lines between buffers. - New 'diffanchors' option allows users to set comma-separated addresses as anchor points to diff buffer sections independently.
- Improved inline highlighting for changes within a single line, configurable via the "inline" sub-option.
3. Completion Features
- Added fuzzy matching support for insert-mode completion.
- Users can now complete words directly from registers using
CTRL-X CTRL-R. - New
completeoptflags,nosortandnearest, provide finer control over match display and ordering.
4. Platform and UI Support
- Full support for Wayland UI and clipboard has been added.
- On Linux/Unix systems, Vim now adheres to the XDG Base Directory Specification, using
$HOME/.config/vimfor user configuration by default. - Introduction of a vertical tabpanel as an alternative to the horizontal tabline.
- MS-Windows GUI improvements include native dark mode for menus/title bars and higher-quality toolbar icons.
Changed Default Values
Several internal defaults have been updated to suit modern hardware:
- 'history': Increased from 50 to 200.
- 'backspace': Changed from empty to "indent,eol,start" for standard behavior.
- 'diffopt': Now includes "closeoff,indent-heuristic,inline:char" by default.
- 'fontsize' (GTK): Increased from 10pt to 12pt for High-DPI monitors.
- 'showcmd' and 'ruler': Now On by default.
Performance Improvements
- Completion Responsiveness: The standard completion feature now checks for user input while searching for matches, maintaining responsiveness regardless of file size.
Known Issues
- Wayland Support: Support for the Wayland UI is currently classified as experimental.
- macOS Bundled Vim: The version of Vim bundled with macOS (
/usr/bin/vim) is noted to have "gimped" diff functionality and disabled features due to local modifications and licensing restrictions regarding the xdiff library. - MacVim Lag: MacVim is maintained separately and typically experiences a delay of up to a few months before syncing with upstream Vim releases.
Who Should Update
- Users requiring Wayland clipboard support or those wishing to move configurations to XDG-compliant paths.
- Developers utilizing Vim9 script who require modern programming constructs like Enums and Generics.
- Users performing complex file comparisons who require more accurate diff alignment.
Upgrade Considerations
- Configuration Migration: Users on Unix-like systems should be aware that their configuration directory may now be expected at
~/.config/vim/rather than~/.vim/. - Default Behavior Changes: Because several long-standing defaults (like backspace and history) have changed, users with minimal
.vimrcfiles may notice different behavior in navigation and undo history. - Interactive Learning: A new built-in interactive tutor plugin is available via the
:Tutorcommand, replacing the traditionalvimtutorfor new users.
Why Upgrade to 9.2 on Linux?
Upgrading to the latest Vim version on Linux provides several platform-specific benefits:
- Wayland Support: Vim 9.2 includes experimental support for the Wayland UI and clipboard.
- XDG Compliance: It now adheres to the XDG Base Directory Specification, meaning it will look for your user configuration in
$HOME/.config/vimby default. - Improved Navigation: You can take advantage of the new interactive tutor plugin (via
:Tutor) and enhanced diff mode features.
Install Latest Vim 9.2 in Linux
While individual Linux distributions may take some time to update their official repositories, you can obtain the latest Vim 9.2 version directly through several methods.
Here are the primary ways to install Vim 9.2 on Linux according to the sources:
1. Building from Source (Recommended)
The best way to install Vim on Unix-like systems (including Linux) is to compile it from the source code. This ensures you have the most up-to-date version with all recent patches.
Step 1: Install Development Tools
To compile and install software from source, we need to install Development tools first.
Step 2: Obtain the sources
Clone the Vim project repository using git:
git clone https://github.com/vim/vim.git
Step 3: Navigate to the source directory
cd vim/src
Step 4: Build the application
make
Step 5: Install Vim 9.2 version from source
sudo make install
2. Using the Daily AppImage
If you prefer not to compile the code yourself, a daily AppImage is available. This is a portable format designed to run on many different Linux distributions without traditional installation.
For more details, check the official Vim 9.2 release announcement.
Vim Tricks Worth Learning
Most users learn enough to open, edit, save files and then stop. We have compiled and put together 20 Vim tricks that will take you to next level. Check the following link for details:
