blob: d947b9346895c116657a93f6651720397b01185d [file] [log] [blame]
Bram Moolenaar7b0294c2004-10-11 10:16:09 +00001*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 11
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Bram Moolenaar
5
6
7Welcome to Vim 7! A large number of features has been added. This file
8mentions all the new items, changes to existing features and bug fixes
9compared to Vim 6.x.
10
11See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0.
12See |version4.txt| for differences between Vim 3.x and Vim 4.x.
13See |version5.txt| for differences between Vim 4.x and Vim 5.x.
14See |version6.txt| for differences between Vim 5.x and Vim 6.x.
15
16INCOMPATIBLE CHANGES |incompatible-7|
17
18NEW FEATURES |new-7|
19
20New data types |new-data-types|
Bram Moolenaar325b7a22004-07-05 15:58:32 +000021KDE support |new-KDE|
Bram Moolenaar071d4272004-06-13 20:20:40 +000022Various new items |new-items-7|
23
24IMPROVEMENTS |improvements-7|
25
26COMPILE TIME CHANGES |compile-changes-7|
27
28BUG FIXES |bug-fixes-7|
29
30==============================================================================
31INCOMPATIBLE CHANGES *incompatible-7*
32
33These changes are incompatible with previous releases. Check this list if you
34run into a problem when upgrading from Vim 6.x to 7.0
35
Bram Moolenaarf4b8e572004-06-24 15:53:16 +000036":helpgrep" now uses a help window to display a match.
37
38
39Minor incompatibilities:
40
41For filetype detection: For many types, instead of ~/.dir/filename use
42*/.dir/filename, so that it also works for other user's files.
43
44":0verbose" now sets 'verbose' to zero instead of one.
45
46Removed the old and incomplete "VimBuddy" code.
47
48Buffers without a name report "No Name" instead of "No File". It was
49confusing for buffers with a name and 'buftype' set to "nofile".
Bram Moolenaar071d4272004-06-13 20:20:40 +000050
Bram Moolenaar7b0294c2004-10-11 10:16:09 +000051When ":file xxx" is used in a buffer without a name, the alternate file name
52isn't set. This avoids creating buffers without a name that are not useful.
53
54The "2html.vim" script now converts closed folds to HTML. This means the HTML
55looks like its displayed, with the same folds open and closed. Use "zR" if no
56folds should appear in the HTML. (partly by Carl Osterwisch)
57
Bram Moolenaar071d4272004-06-13 20:20:40 +000058==============================================================================
59NEW FEATURES *new-7*
60
61New data types *new-data-types*
62--------------
63
64In Vim scripts the following types have been added:
65
66 list ordered list of items
67 dictionary associative array of items
68 function reference to a function
69
70Many functions and commands have been added to support the new types.
71
Bram Moolenaar843ee412004-06-30 16:16:41 +000072NOT IMPLEMENTED YET!
73
74
Bram Moolenaar325b7a22004-07-05 15:58:32 +000075KDE support *new-KDE*
Bram Moolenaar843ee412004-06-30 16:16:41 +000076-----------
77
78Kvim is the KDE version of Vim. It uses the Qt toolkit. See |KVim|.
79(Thomas Capricelli, Philippe Fremy, Mickael Marchand, Mark Westcott, et al.)
80
Bram Moolenaar071d4272004-06-13 20:20:40 +000081
Bram Moolenaar325b7a22004-07-05 15:58:32 +000082MzScheme interface *new-MzScheme*
83------------------
84
85The MzScheme interpreter is supported. |MzScheme|
86The |:mzscheme| command can be used to execute MzScheme commands.
87The |:mzfile| command can be used to execute an MzScheme script file.
88
Bram Moolenaar8299df92004-07-10 09:47:34 +000089Printing multi-byte text *new-print-multi-byte*
90------------------
91
92The |:hardcopy| command now supports printing multi-byte characters.
93The 'printmbcharset' and 'printmbfont' options are used for this.
94Also see |postscript-cjk-printing|. (Mike Williams)
95
Bram Moolenaar325b7a22004-07-05 15:58:32 +000096
Bram Moolenaar071d4272004-06-13 20:20:40 +000097Various new items *new-items-7*
98-----------------
99
100Normal mode commands: ~
101
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000102a", a' and a` New text objects to select quoted strings. |a'|
103i", i' and i' (Taro Muraoka)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
105Options: ~
106
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000107'completefunc' The name of a function used for user-specified Insert
108 mode completion. CTRL-X CTRL-U can be used in Insert
109 mode to do any kind of completion. (Taro Muraoka)
110'quoteescape' Characters used to escape quotes inside a string.
111 Used for the a", a' and a` text objects. |a'|
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000112'numberwidth' Minimal width of the space used for the 'number'
113 option. (Emmanuel Renieris)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000114'mzquantum' Time in msec to schedule MzScheme threads.
Bram Moolenaar8299df92004-07-10 09:47:34 +0000115'printmbcharset' CJK character set to be used for :hardcopy
116'printmbfont' font names to be used for CJK output of :hardcopy
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000117
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118
119Ex commands: ~
120
Bram Moolenaar843ee412004-06-30 16:16:41 +0000121Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
122
Bram Moolenaar8299df92004-07-10 09:47:34 +0000123|:startreplace| Start Replace mode. (Charles Campbell)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000124
Bram Moolenaar8299df92004-07-10 09:47:34 +0000125|:0file| Removes the name of the buffer. (Charles Campbell)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000126
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000127|:diffoff| Switch off diff mode in the current window or in all
128 windows.
129
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000130|:keepalt| Do not change the alternate file.
131
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000132|:delmarks| Delete marks.
133
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000134|:sandbox| Command modifier: execute the argument in the sandbox.
135
Bram Moolenaar071d4272004-06-13 20:20:40 +0000136
137New functions: ~
138
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000139browsedir(title, init) |browsedir()| Dialog to select a directory.
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000140byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher)
141finddir(name) |finddir()| Find a directory in 'path'.
142findfile(name) |findfile()| Find a file in 'path'. (Johannes
143 Zellner)
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000144foldtextresult(lnum) |foldtextresult()| The text displayed for a closed
145 fold at line "lnum".
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000146getfperm(fname) |getfperm()| Get file permission string. (Nikolai
147 Weibull)
148getftype(fname) |getftype()| Get type of file. (Nikolai Weibull)
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000149repeat(expr, count) |repeat()| Repeat "expr" "count" times.
150 (Christophe Poucet)
151tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000152system(cmd, input) |system()| Filters {input} through a shell
153 command.
Bram Moolenaar8299df92004-07-10 09:47:34 +0000154
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
156New autocommand events: ~
157
Bram Moolenaar8299df92004-07-10 09:47:34 +0000158|InsertEnter| starting Insert or Replace mode
159|InsertChange| going from Insert to Replace mode or back
160|InsertLeave| leaving Insert or Replace mode
Bram Moolenaar843ee412004-06-30 16:16:41 +0000161
Bram Moolenaar8299df92004-07-10 09:47:34 +0000162|ColorScheme| after loading a color scheme
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000164
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000165New items in search patterns: ~
166|/\%d| \%d123 search for character with decimal number
167|/\]| [\d123] idem, in a colletion
168|/\%o| \%o103 search for character with octal number
169|/\]| [\o1o3] idem, in a colletion
170|/\%x| \%x1a search for character with 2 pos. hex number
171|/\]| [\x1a] idem, in a colletion
172|/\%u| \%u12ab search for character with 4 pos. hex number
173|/\]| [\u12ab] idem, in a colletion
174|/\%U| \%U1234abcd search for character with 8 pos. hex number
175|/\]| [\U1234abcd] idem, in a colletion
176 (The above partly by Ciaran McCreesh)
177
178
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000179New Syntax/Indent/FTplugin files: ~
180
181MuPAD source syntax, indent and ftplugin. (Dave Silvia)
182
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000183ABAB/4 syntax file. (Marius van Wyk)
184
185SQL-Informix syntax file. (Dean L Hill)
186
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000187PHP compiler plugin. (Doug Kearns)
188
189
190New message translations: ~
191
192The Ukranian messages are now also available in cp1251.
193
Bram Moolenaar071d4272004-06-13 20:20:40 +0000194
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000195Others: ~
196
197Mac: Add the selection type to the clipboard, so that Block, line and
198character selections can be used between two Vims. (Eckehard Berns)
199Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
200"yyp".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000201
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000202Mac: GUI font selector. (Peter "Rain Dog" Cucka)
203
Bram Moolenaar843ee412004-06-30 16:16:41 +0000204The netrw plugin now also supports viewing a directory, when "scp://" is used.
205Deleting and renaming files is possible. (Charles Campbell)
206
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207==============================================================================
208IMPROVEMENTS *improvements-7*
209
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000210":helpgrep" accepts a language specifier after the pattern: "pat@it".
211
Bram Moolenaar8299df92004-07-10 09:47:34 +0000212Move the help for printing to a separate help file. It's quite a lot now.
213
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000214":breakadd here" and ":breakdel here" can be used to set or delete a
215breakpoint at the cursor.
216
Bram Moolenaar843ee412004-06-30 16:16:41 +0000217The tutor was updated to make it simpler to use and added text to explain a
218few more important commands. Used ideas from Gabriel Zachmann.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000219
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000220Unix: When libcall() fails obtain an error message with dlerror() and display
221it. (Johannes Zellner)
222
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000223Added "nbsp" in 'listchars'. (David Blanchet)
224
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000225Added the "acwrite" value for the 'buftype' option. This is for a buffer that
226doesn not have a name that refers to a file and is written with BufWriteCmd
227autocommands.
228
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000229For lisp indenting and matching parenthesis: (Sergey Khorev)
230- square brackets are recognized properly
231- #\(, #\), #\[ and #\] are recognized as character literals
232- Lisp line comments (delimited by semicolon) are recognized
233
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000234Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher)
235
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000236winnr() takes an optional "$" and "#" arguments. (Nikolai Weibull, Yegappan
237Lakshmanan)
238
239Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull)
240
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000241When uncompressing fails in the gzip plugin, give an error message but don't
242delete the raw text. Helps if the file has a .gz extension but is not
243actually compressed. (Andrew Pimlott)
244
245When C, C++ or IDL syntax is used, may additionally load doxygen syntax.
246Also support setting the filetype to "cdoxygen" for C plus doxygen syntax.
247(Michael Geddes)
248
249The ":registers" command now displays multi-byte characters properly.
250
251VMS: In the usage message mention that a slash can be used to make a flag
252upper case. Add color support to the builtin vt320 terminal codes.
253(Zoltan Arpadffy)
254
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000255For the '%' item in 'viminfo', allow a number to set a maximum for the number
256of buffers.
257
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +0000258When a file looks like a shell script, check for an "exec" command that starts
259the tcl interpreter. (suggested by Alexios Zavras)
260
261Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that
262digraphs still work when iconv is not available.
263
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264==============================================================================
265COMPILE TIME CHANGES *compile-changes-7*
266
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000267Mac: "make" now creates the Vim.app directory and "make install" copies it to
268its final destination. (Raf)
269
270Mac: Made it possible to compile with Motif, Athena or GTK without tricks and
271still being able to use the MacRoman conversion. Added the os_mac_conv.c
272file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000273
274==============================================================================
275BUG FIXES *bug-fixes-7*
276
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000277When using PostScript printing on MS-DOS the default 'printexpr' used "lpr"
278instead of "copy". When 'printdevice' was empty the copy command did not
279work. Use "LPT1" then.
280
281The GTK font dialog uses a font size zero when the font name doesn't include a
282size. Use a default size of 10.
283
284This example in the documentation didn't work:
285 :e `=foo . ".c" `
286Skip over the expression in `=expr` when looking for comments, |, % and #.
287
288When ":helpgrep" doesn't find anything there is no error message.
289
290"L" and "H" did not take closed folds into account.
291
292Win32: The "-P title" argument stopped at the first title that matched, even
293when it doesn't support MDI.
294
295Mac GUI: CTRL-^ and CTRL-@ did not work.
296
297"2daw" on "word." at the end of a line didn't include the preceding white
298space.
299
300Win32: Using FindExecutable() doesn't work to find a program. Use
301SearchPath() instead. For executable() use $PATHEXT when the program searched
302for doesn't have an extension.
303
304When 'virtualedit' is set, moving the cursor up after appending a character
305may move it to a different column. Was caused by auto-formatting moving the
306cursor and not putting it back where it was.
307
308When indent was added automatically and then moving the cursor, the indent was
309not deleted (like when pressing ESC). The "I" flag in 'cpoptions' can be used
310to make it work the old way.
311
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000312When opening a command-line window, 'textwidth' gets set to 78 by the Vim
313filetype plugin. Reset 'textwidth' to 0 to avoid lines are broken.
314
315After using cursor(line, col) moving up/down doesn't keep the same column.
316
317Win32: Borland C before 5.5 requires using ".u." for LowPart and HighPart
318fields. (Walter Briscoe)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000319
Bram Moolenaar843ee412004-06-30 16:16:41 +0000320On Sinix SYS_NMLN isn't always defined. Define it ourselves. (Cristiano De
321Michele)
322
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000323Printing with PostScript may keep the printer waiting for more. Append a
324CTRL-D to the printer output. (Mike Williams)
325
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000326When converting a string with a hex or octal number the leading '-' was
327ignored. ":echo '-05' + 0" resulted in 5 instead of -5.
328
329Using "@:" to repeat a command line didn't work when it contains control
330characters.
331
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000332When using file completion for a user command, it would not expand environment
333variables like for a regular command with a file argument.
334
335'cindent': When the argument of a #define looks like a C++ class the next line
336is indented too much.
337
338When 'comments' includes multi-byte characters inserting the middle part and
339alignment may go wrong. 'cindent' also suffers from this for right-aligned
340items.
341
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000342The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use
343"cn" or "tw" as intended.
344
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000345When 'bin' is set and 'eol' is not set then line2byte() added the line break
346after the last line while it's not there.
347
348Using foldlevel() in a WinEnter autocommand may not work. Noticed when
349resizing the GUI shell upon startup.
350
351Python: Using buffer.append(f.readlines()) didn't work. Allow appending a
352string with a trailing newline. The newline is ignored.
353
Bram Moolenaar269ec652004-07-29 08:43:53 +0000354When using the ":saveas f2" command for buffer "f1", the Buffers menu would
355contain "f2" twice, one of them leading to "f1". Also trigger the BufFilePre
356and BufFilePost events for the alternate buffer that gets the old name.
357
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000358strridx() did not work well when the needle is empty. (Ciaran McCreesh)
359
360GTK: Avoid a potential hang in gui_mch_wait_for_chars() when input arrives
361just before it is invoked
362
363VMS: Occasionally CR characters were inserted in the file. Expansion of
364environment variables was not correct. (Zoltan Arpadffy)
365
366UTF-8: When 'delcombine' is set "dw" only deleted the last combining character
367from the first character of the word.
368
369When using ":sball" in an autocommand only the filetype in one buffer was
370detected. Reset did_filetype in enter_buffer().
371
372When using ":argdo" and the window already was at the first argument index,
373but not actually editing it, the current buffer would be used instead.
374
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000375When ":next dir/*" includes many matches, adding the names to the argument
376list may take an awful lot of time and can't be interrupted. Allow
377interrupting this.
378
379When editing a file that was already loaded in a buffer, modelines were not
380used. Now window-local options in the modeline are set. Buffer-local options
381and global options remain unmodified.
382
383Win32: When 'encoding' is set to "utf-8" in the vimrc file, files from the
384command line with non-ASCII characters are not used correctly. Recode the
385file names when 'encoding' is set, using the Unicode command line.
386
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000387Win32 console: When the default for 'encoding' ends up to be "latin1", the
388default value of 'isprint' was wrong.
389
390When an error message is given while waiting for a character (e.g., when an
391xterm reports the number of colors), the hit-enter prompt overwrote the last
392line. Don't reset msg_didout in normal_cmd() for K_IGNORE.
393
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +0000394Mac GUI: Shift-Tab didn't work.
395
396When defining tooltip text, don't translate terminal codes, since it's not
397going to be used like a command.
398
399GTK 2: Check the tooltip text for valid utf-8 characters to avoid getting a
400GTK error. Invalid characters may appear when 'encoding' is changed.
401
402GTK 2: Add a safety check for invalid utf-8 sequences, they can crash pango.
403
404Win32: When 'encoding' is changed while starting up, use the Unicode command
405line to convert the file arguments to 'encoding'. Both for the GUI and the
406console version.
407
408Win32 GUI: latin9 text (iso-8859-15) was not displayed correctly, because
409there is no codepage for latin9. Do our own conversion from latin9 to UCS2.
410
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000411When two versions of GTK+ 2 are installed it was possible to use the header
412files from one and the library from the other. Use GTK_LIBDIR to put the
413directory for the library early in the link flags.
414
415With the GUI find/replace dialog a replace only worked if the pattern was
416literal text. Now it works for any pattern.
417
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418 vim:tw=78:ts=8:ft=help:norl: