
The first draft
documentation for Vim 8.0 appeared
in the Vim repository on Github . It states that a large number of bugs have been fixed and several new features have been added.
Asynchronous I / O, channels
Vim is now able to exchange messages with another process in the background (for example, with a Python server). Messages are received and processed when Vim is waiting for a character to be entered.
Broad support for JSON is associated with channels, it is easy to use for communication between processes, which allows you to write a server in any language. Functions are used
|json_encode()|
and
|json_decode()|
.
Jobs
Vim can start a task, exchange data with it and stop it. This is very useful for starting the completion process, syntax checking and so on. Communication takes place through the channels. Tasks can read and write to the clipboard or file.
')
Timers
Timers are also asynchronous. They can be triggered once or periodically and run a function for any job.
let tempTimer = timer_start(4000, 'CheckTemp') : > call CheckTemp()
Partials
Vim already has Funcref, a reference to a function. The partial also refers to a function, and additionally binds arguments and / or a dictionary. This is especially useful for callbacks on channels and timers. For example, in the aforementioned timer, we pass the function argument.
let tempTimer = timer_start(4000, function('CheckTemp', ['out'])) : > call CheckTemp('out')
Packages
There are more and more plugins. To better manage the collection of plugins, added support for packages. This is a convenient way to get one or more plugins, put them in a directory and, possibly, update to new versions. Vim will load them automatically or only on demand.
New tests
This is for Vim developers. Until now, writing tests for Vim was not easy. In Vim 8, there were
assert
functions and a framework for running tests. Now it is much easier to write tests and update them.
Added the following functions:
|assert_equal()|
|assert_notequal()|
|assert_exception()|
|assert_fails()|
|assert_false()|
|assert_match()|
|assert_notmatch()|
|assert_true()|
|alloc_fail()|
|disable_char_avail_for_testing()|
Window identifiers
Previously, access to the window took place only by its number. And every time you open, close or move this number changed. Now each window has a unique ID, so the window is easy to find.
Add indents to lines
The option
'breakindent'
to insert indents without changing the amount of indent.
Direct-X support (under Windows)
The option
'renderoptions'
allows you to switch to Direct-X (DirectWrite) mode under Windows.
GTK + 3 support
GTK + 2 is already a thing of the past, GTK + 3 has come. Support is already integrated, and it works quite well, almost like GTK + 2.
Script improvements
Added the following types of scripts.
|Special| |v:false|, |v:true|, |v:none| and |v:null|
|Channel| /
|Job|
Many features and commands have been added to support these new types.
Of the other improvements, adding blowfish2 encryption instead of blowfish is mentioned.
There is one "incompatible" change in Vim 8.0 - this is the termination of MS-DOS support.