blob: 3b0a06c8f5d9a20dd6fb2299b965b305c51e2ec6 [file] [log] [blame]
Bram Moolenaar47136d72004-10-12 20:02:24 +00001*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 12
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)
Bram Moolenaar47136d72004-10-12 20:02:24 +000057Diff mode now is also converted as it is displayed.
Bram Moolenaar7b0294c2004-10-11 10:16:09 +000058
Bram Moolenaar071d4272004-06-13 20:20:40 +000059==============================================================================
60NEW FEATURES *new-7*
61
62New data types *new-data-types*
63--------------
64
65In Vim scripts the following types have been added:
66
67 list ordered list of items
68 dictionary associative array of items
69 function reference to a function
70
71Many functions and commands have been added to support the new types.
72
Bram Moolenaar843ee412004-06-30 16:16:41 +000073NOT IMPLEMENTED YET!
74
75
Bram Moolenaar325b7a22004-07-05 15:58:32 +000076KDE support *new-KDE*
Bram Moolenaar843ee412004-06-30 16:16:41 +000077-----------
78
79Kvim is the KDE version of Vim. It uses the Qt toolkit. See |KVim|.
80(Thomas Capricelli, Philippe Fremy, Mickael Marchand, Mark Westcott, et al.)
81
Bram Moolenaar071d4272004-06-13 20:20:40 +000082
Bram Moolenaar325b7a22004-07-05 15:58:32 +000083MzScheme interface *new-MzScheme*
84------------------
85
86The MzScheme interpreter is supported. |MzScheme|
87The |:mzscheme| command can be used to execute MzScheme commands.
88The |:mzfile| command can be used to execute an MzScheme script file.
89
Bram Moolenaar8299df92004-07-10 09:47:34 +000090Printing multi-byte text *new-print-multi-byte*
91------------------
92
93The |:hardcopy| command now supports printing multi-byte characters.
94The 'printmbcharset' and 'printmbfont' options are used for this.
95Also see |postscript-cjk-printing|. (Mike Williams)
96
Bram Moolenaar325b7a22004-07-05 15:58:32 +000097
Bram Moolenaar071d4272004-06-13 20:20:40 +000098Various new items *new-items-7*
99-----------------
100
101Normal mode commands: ~
102
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000103a", a' and a` New text objects to select quoted strings. |a'|
104i", i' and i' (Taro Muraoka)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105
106Options: ~
107
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000108'completefunc' The name of a function used for user-specified Insert
109 mode completion. CTRL-X CTRL-U can be used in Insert
110 mode to do any kind of completion. (Taro Muraoka)
111'quoteescape' Characters used to escape quotes inside a string.
112 Used for the a", a' and a` text objects. |a'|
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000113'numberwidth' Minimal width of the space used for the 'number'
114 option. (Emmanuel Renieris)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000115'mzquantum' Time in msec to schedule MzScheme threads.
Bram Moolenaar8299df92004-07-10 09:47:34 +0000116'printmbcharset' CJK character set to be used for :hardcopy
117'printmbfont' font names to be used for CJK output of :hardcopy
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000118
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119
120Ex commands: ~
121
Bram Moolenaar843ee412004-06-30 16:16:41 +0000122Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
123
Bram Moolenaar8299df92004-07-10 09:47:34 +0000124|:startreplace| Start Replace mode. (Charles Campbell)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000125
Bram Moolenaar8299df92004-07-10 09:47:34 +0000126|:0file| Removes the name of the buffer. (Charles Campbell)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000127
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000128|:diffoff| Switch off diff mode in the current window or in all
129 windows.
130
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000131|:keepalt| Do not change the alternate file.
132
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000133|:delmarks| Delete marks.
134
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000135|:sandbox| Command modifier: execute the argument in the sandbox.
136
Bram Moolenaar071d4272004-06-13 20:20:40 +0000137
138New functions: ~
139
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000140browsedir(title, init) |browsedir()| Dialog to select a directory.
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000141byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher)
142finddir(name) |finddir()| Find a directory in 'path'.
143findfile(name) |findfile()| Find a file in 'path'. (Johannes
144 Zellner)
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000145foldtextresult(lnum) |foldtextresult()| The text displayed for a closed
146 fold at line "lnum".
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000147getfperm(fname) |getfperm()| Get file permission string. (Nikolai
148 Weibull)
149getftype(fname) |getftype()| Get type of file. (Nikolai Weibull)
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000150repeat(expr, count) |repeat()| Repeat "expr" "count" times.
151 (Christophe Poucet)
152tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000153system(cmd, input) |system()| Filters {input} through a shell
154 command.
Bram Moolenaar8299df92004-07-10 09:47:34 +0000155
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156
157New autocommand events: ~
158
Bram Moolenaar8299df92004-07-10 09:47:34 +0000159|InsertEnter| starting Insert or Replace mode
160|InsertChange| going from Insert to Replace mode or back
161|InsertLeave| leaving Insert or Replace mode
Bram Moolenaar843ee412004-06-30 16:16:41 +0000162
Bram Moolenaar8299df92004-07-10 09:47:34 +0000163|ColorScheme| after loading a color scheme
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000165
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000166New items in search patterns: ~
167|/\%d| \%d123 search for character with decimal number
168|/\]| [\d123] idem, in a colletion
169|/\%o| \%o103 search for character with octal number
170|/\]| [\o1o3] idem, in a colletion
171|/\%x| \%x1a search for character with 2 pos. hex number
172|/\]| [\x1a] idem, in a colletion
173|/\%u| \%u12ab search for character with 4 pos. hex number
174|/\]| [\u12ab] idem, in a colletion
175|/\%U| \%U1234abcd search for character with 8 pos. hex number
176|/\]| [\U1234abcd] idem, in a colletion
177 (The above partly by Ciaran McCreesh)
178
179
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000180New Syntax/Indent/FTplugin files: ~
181
182MuPAD source syntax, indent and ftplugin. (Dave Silvia)
183
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000184ABAB/4 syntax file. (Marius van Wyk)
185
186SQL-Informix syntax file. (Dean L Hill)
187
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000188PHP compiler plugin. (Doug Kearns)
189
190
Bram Moolenaar47136d72004-10-12 20:02:24 +0000191New Keymaps: ~
192
193Sinhala (Sri Lanka) (Harshula Jayasuriya)
194
195
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000196New message translations: ~
197
198The Ukranian messages are now also available in cp1251.
199
Bram Moolenaar071d4272004-06-13 20:20:40 +0000200
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000201Others: ~
202
203Mac: Add the selection type to the clipboard, so that Block, line and
204character selections can be used between two Vims. (Eckehard Berns)
205Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
206"yyp".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000208Mac: GUI font selector. (Peter "Rain Dog" Cucka)
209
Bram Moolenaar843ee412004-06-30 16:16:41 +0000210The netrw plugin now also supports viewing a directory, when "scp://" is used.
211Deleting and renaming files is possible. (Charles Campbell)
212
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213==============================================================================
214IMPROVEMENTS *improvements-7*
215
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000216":helpgrep" accepts a language specifier after the pattern: "pat@it".
217
Bram Moolenaar8299df92004-07-10 09:47:34 +0000218Move the help for printing to a separate help file. It's quite a lot now.
219
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000220":breakadd here" and ":breakdel here" can be used to set or delete a
221breakpoint at the cursor.
222
Bram Moolenaar843ee412004-06-30 16:16:41 +0000223The tutor was updated to make it simpler to use and added text to explain a
224few more important commands. Used ideas from Gabriel Zachmann.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000225
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000226Unix: When libcall() fails obtain an error message with dlerror() and display
227it. (Johannes Zellner)
228
Bram Moolenaar592e0a22004-07-03 16:05:59 +0000229Added "nbsp" in 'listchars'. (David Blanchet)
230
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000231Added the "acwrite" value for the 'buftype' option. This is for a buffer that
232doesn not have a name that refers to a file and is written with BufWriteCmd
233autocommands.
234
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000235For lisp indenting and matching parenthesis: (Sergey Khorev)
236- square brackets are recognized properly
237- #\(, #\), #\[ and #\] are recognized as character literals
238- Lisp line comments (delimited by semicolon) are recognized
239
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000240Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher)
241
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000242winnr() takes an optional "$" and "#" arguments. (Nikolai Weibull, Yegappan
243Lakshmanan)
244
245Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull)
246
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000247When uncompressing fails in the gzip plugin, give an error message but don't
248delete the raw text. Helps if the file has a .gz extension but is not
249actually compressed. (Andrew Pimlott)
250
251When C, C++ or IDL syntax is used, may additionally load doxygen syntax.
252Also support setting the filetype to "cdoxygen" for C plus doxygen syntax.
253(Michael Geddes)
254
255The ":registers" command now displays multi-byte characters properly.
256
257VMS: In the usage message mention that a slash can be used to make a flag
258upper case. Add color support to the builtin vt320 terminal codes.
259(Zoltan Arpadffy)
260
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000261For the '%' item in 'viminfo', allow a number to set a maximum for the number
262of buffers.
263
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +0000264When a file looks like a shell script, check for an "exec" command that starts
265the tcl interpreter. (suggested by Alexios Zavras)
266
267Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that
268digraphs still work when iconv is not available.
269
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270==============================================================================
271COMPILE TIME CHANGES *compile-changes-7*
272
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000273Mac: "make" now creates the Vim.app directory and "make install" copies it to
274its final destination. (Raf)
275
276Mac: Made it possible to compile with Motif, Athena or GTK without tricks and
277still being able to use the MacRoman conversion. Added the os_mac_conv.c
278file.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000279
280==============================================================================
281BUG FIXES *bug-fixes-7*
282
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000283When using PostScript printing on MS-DOS the default 'printexpr' used "lpr"
284instead of "copy". When 'printdevice' was empty the copy command did not
285work. Use "LPT1" then.
286
287The GTK font dialog uses a font size zero when the font name doesn't include a
288size. Use a default size of 10.
289
290This example in the documentation didn't work:
291 :e `=foo . ".c" `
292Skip over the expression in `=expr` when looking for comments, |, % and #.
293
294When ":helpgrep" doesn't find anything there is no error message.
295
296"L" and "H" did not take closed folds into account.
297
298Win32: The "-P title" argument stopped at the first title that matched, even
299when it doesn't support MDI.
300
301Mac GUI: CTRL-^ and CTRL-@ did not work.
302
303"2daw" on "word." at the end of a line didn't include the preceding white
304space.
305
306Win32: Using FindExecutable() doesn't work to find a program. Use
307SearchPath() instead. For executable() use $PATHEXT when the program searched
308for doesn't have an extension.
309
310When 'virtualedit' is set, moving the cursor up after appending a character
311may move it to a different column. Was caused by auto-formatting moving the
312cursor and not putting it back where it was.
313
314When indent was added automatically and then moving the cursor, the indent was
315not deleted (like when pressing ESC). The "I" flag in 'cpoptions' can be used
316to make it work the old way.
317
Bram Moolenaarf4b8e572004-06-24 15:53:16 +0000318When opening a command-line window, 'textwidth' gets set to 78 by the Vim
319filetype plugin. Reset 'textwidth' to 0 to avoid lines are broken.
320
321After using cursor(line, col) moving up/down doesn't keep the same column.
322
323Win32: Borland C before 5.5 requires using ".u." for LowPart and HighPart
324fields. (Walter Briscoe)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000325
Bram Moolenaar843ee412004-06-30 16:16:41 +0000326On Sinix SYS_NMLN isn't always defined. Define it ourselves. (Cristiano De
327Michele)
328
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000329Printing with PostScript may keep the printer waiting for more. Append a
330CTRL-D to the printer output. (Mike Williams)
331
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000332When converting a string with a hex or octal number the leading '-' was
333ignored. ":echo '-05' + 0" resulted in 5 instead of -5.
334
335Using "@:" to repeat a command line didn't work when it contains control
336characters.
337
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000338When using file completion for a user command, it would not expand environment
339variables like for a regular command with a file argument.
340
341'cindent': When the argument of a #define looks like a C++ class the next line
342is indented too much.
343
344When 'comments' includes multi-byte characters inserting the middle part and
345alignment may go wrong. 'cindent' also suffers from this for right-aligned
346items.
347
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000348The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use
349"cn" or "tw" as intended.
350
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000351When 'bin' is set and 'eol' is not set then line2byte() added the line break
352after the last line while it's not there.
353
354Using foldlevel() in a WinEnter autocommand may not work. Noticed when
355resizing the GUI shell upon startup.
356
357Python: Using buffer.append(f.readlines()) didn't work. Allow appending a
358string with a trailing newline. The newline is ignored.
359
Bram Moolenaar269ec652004-07-29 08:43:53 +0000360When using the ":saveas f2" command for buffer "f1", the Buffers menu would
361contain "f2" twice, one of them leading to "f1". Also trigger the BufFilePre
362and BufFilePost events for the alternate buffer that gets the old name.
363
Bram Moolenaard4755bb2004-09-02 19:12:26 +0000364strridx() did not work well when the needle is empty. (Ciaran McCreesh)
365
366GTK: Avoid a potential hang in gui_mch_wait_for_chars() when input arrives
367just before it is invoked
368
369VMS: Occasionally CR characters were inserted in the file. Expansion of
370environment variables was not correct. (Zoltan Arpadffy)
371
372UTF-8: When 'delcombine' is set "dw" only deleted the last combining character
373from the first character of the word.
374
375When using ":sball" in an autocommand only the filetype in one buffer was
376detected. Reset did_filetype in enter_buffer().
377
378When using ":argdo" and the window already was at the first argument index,
379but not actually editing it, the current buffer would be used instead.
380
Bram Moolenaar15d0a8c2004-09-06 17:44:46 +0000381When ":next dir/*" includes many matches, adding the names to the argument
382list may take an awful lot of time and can't be interrupted. Allow
383interrupting this.
384
385When editing a file that was already loaded in a buffer, modelines were not
386used. Now window-local options in the modeline are set. Buffer-local options
387and global options remain unmodified.
388
389Win32: When 'encoding' is set to "utf-8" in the vimrc file, files from the
390command line with non-ASCII characters are not used correctly. Recode the
391file names when 'encoding' is set, using the Unicode command line.
392
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000393Win32 console: When the default for 'encoding' ends up to be "latin1", the
394default value of 'isprint' was wrong.
395
396When an error message is given while waiting for a character (e.g., when an
397xterm reports the number of colors), the hit-enter prompt overwrote the last
398line. Don't reset msg_didout in normal_cmd() for K_IGNORE.
399
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +0000400Mac GUI: Shift-Tab didn't work.
401
402When defining tooltip text, don't translate terminal codes, since it's not
403going to be used like a command.
404
405GTK 2: Check the tooltip text for valid utf-8 characters to avoid getting a
406GTK error. Invalid characters may appear when 'encoding' is changed.
407
408GTK 2: Add a safety check for invalid utf-8 sequences, they can crash pango.
409
410Win32: When 'encoding' is changed while starting up, use the Unicode command
411line to convert the file arguments to 'encoding'. Both for the GUI and the
412console version.
413
414Win32 GUI: latin9 text (iso-8859-15) was not displayed correctly, because
415there is no codepage for latin9. Do our own conversion from latin9 to UCS2.
416
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000417When two versions of GTK+ 2 are installed it was possible to use the header
418files from one and the library from the other. Use GTK_LIBDIR to put the
419directory for the library early in the link flags.
420
421With the GUI find/replace dialog a replace only worked if the pattern was
422literal text. Now it works for any pattern.
423
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424 vim:tw=78:ts=8:ft=help:norl: