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