blob: d15d73a859a0f4150e8639afdbf197245e436c1e [file] [log] [blame]
Bram Moolenaar42ebd062016-07-17 13:35:14 +02001*version8.txt* For Vim version 8.0. Last change: 2016 Jul 16
Bram Moolenaar03413f42016-04-12 21:07:15 +02002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6NOTE: THIS FILE IS STILL BEING WORKED ON
7
8 *vim8* *vim-8* *version-8.0* *version8.0*
9Welcome to Vim 8! A large number of bugs have been fixed and several
10features have been added. This file mentions all the new items and changes to
11existing features since Vim 7.4. Bug fixes, the patches for Vim 7.4, can be
12found below |vim-7.4|. Use this command to see the version you are using: >
13 :version
14
15See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0.
Bram Moolenaar06d2d382016-05-20 17:24:11 +020016See |version4.txt|, |version5.txt|, |version6.txt| and |version7.txt| for
17differences between other versions.
Bram Moolenaar03413f42016-04-12 21:07:15 +020018
Bram Moolenaar03413f42016-04-12 21:07:15 +020019NEW FEATURES |new-8|
20
21Vim script enhancements |new-vim-script-8|
22
Bram Moolenaar063b9d12016-07-09 20:21:48 +020023INCOMPATIBLE CHANGES |incompatible-8|
24
Bram Moolenaar03413f42016-04-12 21:07:15 +020025IMPROVEMENTS |improvements-8|
26
27COMPILE TIME CHANGES |compile-changes-8|
28
29PATCHES |patches-8|
30
31
32==============================================================================
Bram Moolenaar03413f42016-04-12 21:07:15 +020033NEW FEATURES *new-8*
34
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +020035First a list of the bigger new features. A comprehensive list is below.
Bram Moolenaar03413f42016-04-12 21:07:15 +020036
37
38Asynchronous I/O support, channels ~
39
Bram Moolenaar063b9d12016-07-09 20:21:48 +020040Vim can now exchange messages with other processes in the background. This
41makes it possible to have servers do work and send back the results to Vim.
42See |channel-demo| for an example, this shows communicating with a Python
43server.
Bram Moolenaar03413f42016-04-12 21:07:15 +020044
45Closely related to channels is JSON support. JSON is widely supported and can
46easily be used for inter-process communication, allowing for writing a server
47in any language. The functions to use are |json_encode()| and |json_decode()|.
48
Bram Moolenaar063b9d12016-07-09 20:21:48 +020049This makes it possible to build very complex plugins, written in any language
50and running in a separate process.
51
Bram Moolenaar03413f42016-04-12 21:07:15 +020052
53Jobs ~
54
55Vim can now start a job, communicate with it and stop it. This is very useful
56to run a process for completion, syntax checking, etc. Channels are used to
57communicate with the job. Jobs can also read from or write to a buffer or a
58file. See |job_start()|.
59
60
61Timers ~
62
63Also asynchronous are timers. They can fire once or repeatedly and invoke a
64function to do any work. For example: >
65 let tempTimer = timer_start(4000, 'CheckTemp')
Bram Moolenaar063b9d12016-07-09 20:21:48 +020066This will call the CheckTemp() function four seconds (4000 milli seconds)
67later.
Bram Moolenaar03413f42016-04-12 21:07:15 +020068
69
70Partials ~
71
72Vim already had a Funcref, a reference to a function. A partial also refers
73to a function, and additionally binds arguments and/or a dictionary. This is
74especially useful for callbacks on channels and timers. E.g., for the timer
75example above, to pass an argument to the function: >
76 let tempTimer = timer_start(4000, function('CheckTemp', ['out']))
Bram Moolenaar063b9d12016-07-09 20:21:48 +020077This will call CheckTemp('out') four seconds later.
Bram Moolenaar03413f42016-04-12 21:07:15 +020078
79
Bram Moolenaar42ebd062016-07-17 13:35:14 +020080Lambda ~
81
82A short way to create a function has been added: {args -> expr}. See |lambda|.
83This is useful for functions such as `filter()` and `map()`, which now also
84accept a function argument. Example: >
85 :call filter(mylist, {idx, val -> val > 20})
86
87
Bram Moolenaar03413f42016-04-12 21:07:15 +020088Packages ~
89
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +020090Plugins keep growing and more of them are available than ever before. To keep
Bram Moolenaar03413f42016-04-12 21:07:15 +020091the collection of plugins manageable package support has been added. This is
92a convenient way to get one or more plugins, drop them in a directory and
93possibly keep them updated. Vim will load them automatically, or only when
94desired. See |packages|.
95
96
97New style tests ~
98
99This is for Vim developers. So far writing tests for Vim has not been easy.
100Vim 8 adds assert functions and a framework to run tests. This makes it a lot
Bram Moolenaar82af8712016-06-04 20:20:29 +0200101simpler to write tests and keep them updated. Also new are several functions
Bram Moolenaar063b9d12016-07-09 20:21:48 +0200102that are added specifically for testing. See |test-functions|.
Bram Moolenaar03413f42016-04-12 21:07:15 +0200103
104
105Window IDs ~
106
107Previously windows could only be accessed by their number. And every time a
108window would open, close or move that number changes. Each window now has a
Bram Moolenaar82af8712016-06-04 20:20:29 +0200109unique ID, so that they are easy to find. See |win_getid()| and |win_id2win()|.
Bram Moolenaar03413f42016-04-12 21:07:15 +0200110
111
Bram Moolenaar063b9d12016-07-09 20:21:48 +0200112Viminfo uses timestamps ~
113
114Previously the information stored in viminfo was whatever the last Vim wrote
115there. Now timestamps are used to always keep the most recent items.
116See |viminfo-timestamp|.
117
118
Bram Moolenaar03413f42016-04-12 21:07:15 +0200119Wrapping lines with indent ~
120
121The 'breakindent' option has been added to be able to wrap lines without
122changing the amount of indent.
123
124
125Windows: Direct-X support ~
126
127This adds the 'renderoptions' option to allow for switching on Direct-X
128(DirectWrite) support on MS-Windows.
129
130
131GTK+ 3 support ~
132
133GTK+ 2 is getting old, GTK+ 3 is here. Support has been added and it already
134works quite well, mostly just like GTK+ 2.
135
136
137Vim script enhancements *new-vim-script-8*
138-----------------------
139
Bram Moolenaaraa3b15d2016-04-21 08:53:19 +0200140In Vim script the following types have been added:
Bram Moolenaar03413f42016-04-12 21:07:15 +0200141
142 |Special| |v:false|, |v:true|, |v:none| and |v:null|
143 |Channel| connection to another process for asynchronous I/O
144 |Job| process control
145
146Many functions and commands have been added to support the new types.
147
148
149
150Various new items *new-items-8*
151-----------------
152
153Normal mode commands: ~
154
155
156Insert mode commands: ~
157
158
159Options: ~
160
161
162Ex commands: ~
163
164
165Ex command modifiers: ~
166
167
168Ex command arguments: ~
169
170
171New and extended functions: ~
172
173
174
175New Vim variables: ~
176
177|v:vim_did_enter| Set when VimEnter autocommands are triggered
178
179
180New autocommand events: ~
181
182
183
184New highlight groups: ~
185
186
187New items in search patterns: ~
188
189
190New Syntax/Indent/FTplugin files: ~
191
192
193New Keymaps: ~
194
195
196New message translations: ~
197
198
199Others: ~
200
201
202==============================================================================
Bram Moolenaar063b9d12016-07-09 20:21:48 +0200203INCOMPATIBLE CHANGES *incompatible-8*
204
205These changes are incompatible with previous releases. Check this list if you
206run into a problem when upgrading from Vim 7.4 to 8.0.
207
208The support for MS-DOS has been removed. It hasn't been working for a while
209and removing it cleans up the code quite a bit.
210
211The support for Windows 16 bit (Windows 95 and older) has been removed.
212
213Minor incompatibilities:
214
215For filetype detection: ...
216
217==============================================================================
Bram Moolenaar03413f42016-04-12 21:07:15 +0200218IMPROVEMENTS *improvements-8*
219
220The existing blowfish encryption turned out to be much weaker than it was
221supposed to be. The blowfish2 method has been added to fix that. Note that
222this still isn't a state-of-the-art encryption, but good enough for most
223usage. See 'cryptmethod'.
224
225==============================================================================
226COMPILE TIME CHANGES *compile-changes-8*
227
228Dropped the support for MS-DOS. It was too big to fit in memory.
229
230
231==============================================================================
232PATCHES *patches-8* *bug-fixes-8*
233
234The list of patches that got included since 7.4.0. This includes all the new
235features, but does not include runtime file changes (syntax, indent, help,
236etc.)
237
238TODO: INCLUDE PATCH LIST.
239
240 vim:tw=78:ts=8:ft=help:norl: