What's New in Vim 8
The first draft documentation for Vim 8.0 has 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.
Vim now knows how 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. The functions
Vim can start a task, exchange data with it, and stop it. This is very useful for starting the completion process, checking syntax, and so on. Communication takes place through channels. Jobs can be read and written to the buffer or file.
Timers are also asynchronous. They can fire once or periodically and run the function for any work.
Vim already has Funcref, a reference to a function. The partial also refers to the function, and additionally binds the arguments and / or the dictionary. This is especially useful for callbacks on channels and timers. For example, in the aforementioned timer, we pass the argument to the function.
There are more and more plugins. To better manage the collection of plugins, package support has been added. This is a convenient way to get one or more plugins, put them in a directory, and possibly upgrade to new versions. Vim will download them automatically or only on demand.
This is for Vim developers. Writing tests for Vim so far has not been easy. Vim 8 introduced features
The following functions are added:
Previously, access to the window passed only by its number. And every time you open, close or move this number is changed. Each window now has a unique ID, so the window is easy to find.
An option has appeared
This option
GTK + 2 is already a thing of the past, it's time for GTK + 3. Support is already integrated, and it works pretty well, almost like GTK + 2.
The following script types have been added. Many functions and commands have been added to support these new types. Other improvements mentioned include adding blowfish2 encryption instead of blowfish. There is one “incompatible” change in Vim 8.0 - this is the discontinuation of MS-DOS support.
Asynchronous I / O Channels
Vim now knows how 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. The functions
|json_encode()|
and are used |json_decode()|
.Jobs
Vim can start a task, exchange data with it, and stop it. This is very useful for starting the completion process, checking syntax, and so on. Communication takes place through channels. Jobs can be read and written to the buffer or file.
Timers
Timers are also asynchronous. They can fire once or periodically and run the function for any work.
let tempTimer = timer_start(4000, 'CheckTemp')
Через четыре секунды вызов: >
call CheckTemp()
Partials
Vim already has Funcref, a reference to a function. The partial also refers to the function, and additionally binds the arguments and / or the dictionary. This is especially useful for callbacks on channels and timers. For example, in the aforementioned timer, we pass the argument to the function.
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, package support has been added. This is a convenient way to get one or more plugins, put them in a directory, and possibly upgrade to new versions. Vim will download them automatically or only on demand.
New tests
This is for Vim developers. Writing tests for Vim so far has not been easy. Vim 8 introduced features
assert
and a framework for running tests. Now it’s much easier to write tests and update them. The following functions are added:
|assert_equal()|
|assert_notequal()|
|assert_exception()|
|assert_fails()|
|assert_false()|
|assert_match()|
|assert_notmatch()|
|assert_true()|
|alloc_fail()|
|disable_char_avail_for_testing()|
Window ids
Previously, access to the window passed only by its number. And every time you open, close or move this number is changed. Each window now has a unique ID, so the window is easy to find.
Add indentation to lines
An option has appeared
'breakindent'
to insert indents without changing the indent value.Support for Direct-X (for Windows)
This 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, it's time for GTK + 3. Support is already integrated, and it works pretty well, almost like GTK + 2.
Script enhancements
The following script types have been added. Many functions and commands have been added to support these new types. Other improvements mentioned include adding blowfish2 encryption instead of blowfish. There is one “incompatible” change in Vim 8.0 - this is the discontinuation of MS-DOS support.
|Special| |v:false|, |v:true|, |v:none| and |v:null|
|Channel| подключение к другому процессу для асинхронного ввода/вывода
|Job| управление процессом