1*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 11 2 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| 21KDE support |new-KDE| 22Various 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 36":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". 50 51When ":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 58============================================================================== 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 72NOT IMPLEMENTED YET! 73 74 75KDE support *new-KDE* 76----------- 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 81 82MzScheme 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 89Printing 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 96 97Various new items *new-items-7* 98----------------- 99 100Normal mode commands: ~ 101 102a", a' and a` New text objects to select quoted strings. |a'| 103i", i' and i' (Taro Muraoka) 104 105Options: ~ 106 107'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'| 112'numberwidth' Minimal width of the space used for the 'number' 113 option. (Emmanuel Renieris) 114'mzquantum' Time in msec to schedule MzScheme threads. 115'printmbcharset' CJK character set to be used for :hardcopy 116'printmbfont' font names to be used for CJK output of :hardcopy 117 118 119Ex commands: ~ 120 121Win32: The ":winpos" command now also works in the console. (Vipin Aravind) 122 123|:startreplace| Start Replace mode. (Charles Campbell) 124 125|:0file| Removes the name of the buffer. (Charles Campbell) 126 127|:diffoff| Switch off diff mode in the current window or in all 128 windows. 129 130|:keepalt| Do not change the alternate file. 131 132|:delmarks| Delete marks. 133 134|:sandbox| Command modifier: execute the argument in the sandbox. 135 136 137New functions: ~ 138 139browsedir(title, init) |browsedir()| Dialog to select a directory. 140byteidx(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) 144foldtextresult(lnum) |foldtextresult()| The text displayed for a closed 145 fold at line "lnum". 146getfperm(fname) |getfperm()| Get file permission string. (Nikolai 147 Weibull) 148getftype(fname) |getftype()| Get type of file. (Nikolai Weibull) 149repeat(expr, count) |repeat()| Repeat "expr" "count" times. 150 (Christophe Poucet) 151tr(expr, from, to) |tr()| Translate characters. (Ron Aaron) 152system(cmd, input) |system()| Filters {input} through a shell 153 command. 154 155 156New autocommand events: ~ 157 158|InsertEnter| starting Insert or Replace mode 159|InsertChange| going from Insert to Replace mode or back 160|InsertLeave| leaving Insert or Replace mode 161 162|ColorScheme| after loading a color scheme 163 164 165New 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 179New Syntax/Indent/FTplugin files: ~ 180 181MuPAD source syntax, indent and ftplugin. (Dave Silvia) 182 183ABAB/4 syntax file. (Marius van Wyk) 184 185SQL-Informix syntax file. (Dean L Hill) 186 187PHP compiler plugin. (Doug Kearns) 188 189 190New message translations: ~ 191 192The Ukranian messages are now also available in cp1251. 193 194 195Others: ~ 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". 201 202Mac: GUI font selector. (Peter "Rain Dog" Cucka) 203 204The netrw plugin now also supports viewing a directory, when "scp://" is used. 205Deleting and renaming files is possible. (Charles Campbell) 206 207============================================================================== 208IMPROVEMENTS *improvements-7* 209 210":helpgrep" accepts a language specifier after the pattern: "pat@it". 211 212Move the help for printing to a separate help file. It's quite a lot now. 213 214":breakadd here" and ":breakdel here" can be used to set or delete a 215breakpoint at the cursor. 216 217The tutor was updated to make it simpler to use and added text to explain a 218few more important commands. Used ideas from Gabriel Zachmann. 219 220Unix: When libcall() fails obtain an error message with dlerror() and display 221it. (Johannes Zellner) 222 223Added "nbsp" in 'listchars'. (David Blanchet) 224 225Added 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 229For 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 234Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher) 235 236winnr() takes an optional "$" and "#" arguments. (Nikolai Weibull, Yegappan 237Lakshmanan) 238 239Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull) 240 241When 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 255For the '%' item in 'viminfo', allow a number to set a maximum for the number 256of buffers. 257 258When 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 264============================================================================== 265COMPILE TIME CHANGES *compile-changes-7* 266 267Mac: "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. 273 274============================================================================== 275BUG FIXES *bug-fixes-7* 276 277When 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 312When 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) 319 320On Sinix SYS_NMLN isn't always defined. Define it ourselves. (Cristiano De 321Michele) 322 323Printing with PostScript may keep the printer waiting for more. Append a 324CTRL-D to the printer output. (Mike Williams) 325 326When 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 332When 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 342The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use 343"cn" or "tw" as intended. 344 345When '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 354When 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 358strridx() 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 375When ":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 387Win32 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 394Mac 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 411When 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 418 vim:tw=78:ts=8:ft=help:norl: 419