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