From 078e927e51cbfa18e26bd35076a0eb5b5bf1ffb8 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Fri, 9 Oct 2015 09:58:02 +0200 Subject: Add needed files --- Aufgabe5/doc.einfach/doc1.txt | 1 + Aufgabe5/doc.einfach/doc2.txt | 1 + Aufgabe5/doc.einfach/doc3.txt | 1 + Aufgabe5/doc.einfach/doc4.txt | 3 + Aufgabe5/doc.lang/arabic.txt | 322 + Aufgabe5/doc.lang/autocmd.txt | 1269 ++++ Aufgabe5/doc.lang/change.txt | 1579 ++++ Aufgabe5/doc.lang/cmdline.txt | 1048 +++ Aufgabe5/doc.lang/debug.txt | 151 + Aufgabe5/doc.lang/debugger.txt | 140 + Aufgabe5/doc.lang/develop.txt | 490 ++ Aufgabe5/doc.lang/diff.txt | 404 ++ Aufgabe5/doc.lang/digraph.txt | 349 + Aufgabe5/doc.lang/editing.txt | 1553 ++++ Aufgabe5/doc.lang/eval.txt | 7386 +++++++++++++++++++ Aufgabe5/doc.lang/farsi.txt | 269 + Aufgabe5/doc.lang/filetype.txt | 561 ++ Aufgabe5/doc.lang/fold.txt | 583 ++ Aufgabe5/doc.lang/getscript.txt | 303 + Aufgabe5/doc.lang/gui.txt | 993 +++ Aufgabe5/doc.lang/gui_w16.txt | 186 + Aufgabe5/doc.lang/gui_w32.txt | 474 ++ Aufgabe5/doc.lang/gui_x11.txt | 590 ++ Aufgabe5/doc.lang/hangulin.txt | 101 + Aufgabe5/doc.lang/hebrew.txt | 145 + Aufgabe5/doc.lang/help.txt | 213 + Aufgabe5/doc.lang/howto.txt | 96 + Aufgabe5/doc.lang/if_cscop.txt | 483 ++ Aufgabe5/doc.lang/if_mzsch.txt | 269 + Aufgabe5/doc.lang/if_ole.txt | 199 + Aufgabe5/doc.lang/if_perl.txt | 283 + Aufgabe5/doc.lang/if_pyth.txt | 331 + Aufgabe5/doc.lang/if_ruby.txt | 205 + Aufgabe5/doc.lang/if_sniff.txt | 95 + Aufgabe5/doc.lang/if_tcl.txt | 531 ++ Aufgabe5/doc.lang/indent.txt | 558 ++ Aufgabe5/doc.lang/index.txt | 1560 ++++ Aufgabe5/doc.lang/insert.txt | 1862 +++++ Aufgabe5/doc.lang/intro.txt | 881 +++ Aufgabe5/doc.lang/map.txt | 1362 ++++ Aufgabe5/doc.lang/mbyte.txt | 1407 ++++ Aufgabe5/doc.lang/message.txt | 831 +++ Aufgabe5/doc.lang/mlang.txt | 205 + Aufgabe5/doc.lang/motion.txt | 1303 ++++ Aufgabe5/doc.lang/netbeans.txt | 822 +++ Aufgabe5/doc.lang/options.txt | 7697 ++++++++++++++++++++ Aufgabe5/doc.lang/os_390.txt | 340 + Aufgabe5/doc.lang/os_amiga.txt | 145 + Aufgabe5/doc.lang/os_beos.txt | 348 + Aufgabe5/doc.lang/os_dos.txt | 296 + Aufgabe5/doc.lang/os_mac.txt | 118 + Aufgabe5/doc.lang/os_mint.txt | 39 + Aufgabe5/doc.lang/os_msdos.txt | 276 + Aufgabe5/doc.lang/os_os2.txt | 220 + Aufgabe5/doc.lang/os_qnx.txt | 138 + Aufgabe5/doc.lang/os_risc.txt | 323 + Aufgabe5/doc.lang/os_unix.txt | 60 + Aufgabe5/doc.lang/os_vms.txt | 816 +++ Aufgabe5/doc.lang/os_win32.txt | 336 + Aufgabe5/doc.lang/pattern.txt | 1255 ++++ Aufgabe5/doc.lang/pi_gzip.txt | 39 + Aufgabe5/doc.lang/pi_netrw.txt | 1759 +++++ Aufgabe5/doc.lang/pi_paren.txt | 50 + Aufgabe5/doc.lang/pi_spec.txt | 111 + Aufgabe5/doc.lang/pi_tar.txt | 66 + Aufgabe5/doc.lang/pi_vimball.txt | 92 + Aufgabe5/doc.lang/pi_zip.txt | 55 + Aufgabe5/doc.lang/print.txt | 751 ++ Aufgabe5/doc.lang/quickfix.txt | 1357 ++++ Aufgabe5/doc.lang/quickref.txt | 1375 ++++ Aufgabe5/doc.lang/quotes.txt | 274 + Aufgabe5/doc.lang/recover.txt | 191 + Aufgabe5/doc.lang/remote.txt | 201 + Aufgabe5/doc.lang/repeat.txt | 659 ++ Aufgabe5/doc.lang/rileft.txt | 125 + Aufgabe5/doc.lang/russian.txt | 74 + Aufgabe5/doc.lang/scroll.txt | 315 + Aufgabe5/doc.lang/sign.txt | 191 + Aufgabe5/doc.lang/spell.txt | 1571 ++++ Aufgabe5/doc.lang/sponsor.txt | 216 + Aufgabe5/doc.lang/sql.txt | 763 ++ Aufgabe5/doc.lang/starting.txt | 1466 ++++ Aufgabe5/doc.lang/syntax.txt | 4554 ++++++++++++ Aufgabe5/doc.lang/tabpage.txt | 371 + Aufgabe5/doc.lang/tagsrch.txt | 833 +++ Aufgabe5/doc.lang/term.txt | 856 +++ Aufgabe5/doc.lang/tips.txt | 508 ++ Aufgabe5/doc.lang/todo.txt | 3507 +++++++++ Aufgabe5/doc.lang/uganda.txt | 296 + Aufgabe5/doc.lang/undo.txt | 242 + Aufgabe5/doc.lang/usr_01.txt | 182 + Aufgabe5/doc.lang/usr_02.txt | 504 ++ Aufgabe5/doc.lang/usr_03.txt | 654 ++ Aufgabe5/doc.lang/usr_04.txt | 514 ++ Aufgabe5/doc.lang/usr_05.txt | 625 ++ Aufgabe5/doc.lang/usr_06.txt | 276 + Aufgabe5/doc.lang/usr_07.txt | 479 ++ Aufgabe5/doc.lang/usr_08.txt | 601 ++ Aufgabe5/doc.lang/usr_09.txt | 289 + Aufgabe5/doc.lang/usr_10.txt | 823 +++ Aufgabe5/doc.lang/usr_11.txt | 287 + Aufgabe5/doc.lang/usr_12.txt | 358 + Aufgabe5/doc.lang/usr_20.txt | 384 + Aufgabe5/doc.lang/usr_21.txt | 456 ++ Aufgabe5/doc.lang/usr_22.txt | 364 + Aufgabe5/doc.lang/usr_23.txt | 343 + Aufgabe5/doc.lang/usr_24.txt | 599 ++ Aufgabe5/doc.lang/usr_25.txt | 578 ++ Aufgabe5/doc.lang/usr_26.txt | 221 + Aufgabe5/doc.lang/usr_27.txt | 563 ++ Aufgabe5/doc.lang/usr_28.txt | 426 ++ Aufgabe5/doc.lang/usr_29.txt | 613 ++ Aufgabe5/doc.lang/usr_30.txt | 643 ++ Aufgabe5/doc.lang/usr_31.txt | 272 + Aufgabe5/doc.lang/usr_32.txt | 151 + Aufgabe5/doc.lang/usr_40.txt | 656 ++ Aufgabe5/doc.lang/usr_41.txt | 2374 ++++++ Aufgabe5/doc.lang/usr_42.txt | 365 + Aufgabe5/doc.lang/usr_43.txt | 172 + Aufgabe5/doc.lang/usr_44.txt | 719 ++ Aufgabe5/doc.lang/usr_45.txt | 419 ++ Aufgabe5/doc.lang/usr_90.txt | 498 ++ Aufgabe5/doc.lang/usr_toc.txt | 353 + Aufgabe5/doc.lang/various.txt | 838 +++ Aufgabe5/doc.lang/version4.txt | 355 + Aufgabe5/doc.lang/version5.txt | 7813 ++++++++++++++++++++ Aufgabe5/doc.lang/version6.txt | 14530 +++++++++++++++++++++++++++++++++++++ Aufgabe5/doc.lang/version7.txt | 2972 ++++++++ Aufgabe5/doc.lang/vi_diff.txt | 1006 +++ Aufgabe5/doc.lang/visual.txt | 499 ++ Aufgabe5/doc.lang/windows.txt | 1175 +++ Aufgabe5/doc.lang/workshop.txt | 98 + Aufgabe5/stoplist.engl.txt | 583 ++ 133 files changed, 114303 insertions(+) create mode 100644 Aufgabe5/doc.einfach/doc1.txt create mode 100644 Aufgabe5/doc.einfach/doc2.txt create mode 100644 Aufgabe5/doc.einfach/doc3.txt create mode 100644 Aufgabe5/doc.einfach/doc4.txt create mode 100644 Aufgabe5/doc.lang/arabic.txt create mode 100644 Aufgabe5/doc.lang/autocmd.txt create mode 100644 Aufgabe5/doc.lang/change.txt create mode 100644 Aufgabe5/doc.lang/cmdline.txt create mode 100644 Aufgabe5/doc.lang/debug.txt create mode 100644 Aufgabe5/doc.lang/debugger.txt create mode 100644 Aufgabe5/doc.lang/develop.txt create mode 100644 Aufgabe5/doc.lang/diff.txt create mode 100644 Aufgabe5/doc.lang/digraph.txt create mode 100644 Aufgabe5/doc.lang/editing.txt create mode 100644 Aufgabe5/doc.lang/eval.txt create mode 100644 Aufgabe5/doc.lang/farsi.txt create mode 100644 Aufgabe5/doc.lang/filetype.txt create mode 100644 Aufgabe5/doc.lang/fold.txt create mode 100644 Aufgabe5/doc.lang/getscript.txt create mode 100644 Aufgabe5/doc.lang/gui.txt create mode 100644 Aufgabe5/doc.lang/gui_w16.txt create mode 100644 Aufgabe5/doc.lang/gui_w32.txt create mode 100644 Aufgabe5/doc.lang/gui_x11.txt create mode 100644 Aufgabe5/doc.lang/hangulin.txt create mode 100644 Aufgabe5/doc.lang/hebrew.txt create mode 100644 Aufgabe5/doc.lang/help.txt create mode 100644 Aufgabe5/doc.lang/howto.txt create mode 100644 Aufgabe5/doc.lang/if_cscop.txt create mode 100644 Aufgabe5/doc.lang/if_mzsch.txt create mode 100644 Aufgabe5/doc.lang/if_ole.txt create mode 100644 Aufgabe5/doc.lang/if_perl.txt create mode 100644 Aufgabe5/doc.lang/if_pyth.txt create mode 100644 Aufgabe5/doc.lang/if_ruby.txt create mode 100644 Aufgabe5/doc.lang/if_sniff.txt create mode 100644 Aufgabe5/doc.lang/if_tcl.txt create mode 100644 Aufgabe5/doc.lang/indent.txt create mode 100644 Aufgabe5/doc.lang/index.txt create mode 100644 Aufgabe5/doc.lang/insert.txt create mode 100644 Aufgabe5/doc.lang/intro.txt create mode 100644 Aufgabe5/doc.lang/map.txt create mode 100644 Aufgabe5/doc.lang/mbyte.txt create mode 100644 Aufgabe5/doc.lang/message.txt create mode 100644 Aufgabe5/doc.lang/mlang.txt create mode 100644 Aufgabe5/doc.lang/motion.txt create mode 100644 Aufgabe5/doc.lang/netbeans.txt create mode 100644 Aufgabe5/doc.lang/options.txt create mode 100644 Aufgabe5/doc.lang/os_390.txt create mode 100644 Aufgabe5/doc.lang/os_amiga.txt create mode 100644 Aufgabe5/doc.lang/os_beos.txt create mode 100644 Aufgabe5/doc.lang/os_dos.txt create mode 100644 Aufgabe5/doc.lang/os_mac.txt create mode 100644 Aufgabe5/doc.lang/os_mint.txt create mode 100644 Aufgabe5/doc.lang/os_msdos.txt create mode 100644 Aufgabe5/doc.lang/os_os2.txt create mode 100644 Aufgabe5/doc.lang/os_qnx.txt create mode 100644 Aufgabe5/doc.lang/os_risc.txt create mode 100644 Aufgabe5/doc.lang/os_unix.txt create mode 100644 Aufgabe5/doc.lang/os_vms.txt create mode 100644 Aufgabe5/doc.lang/os_win32.txt create mode 100644 Aufgabe5/doc.lang/pattern.txt create mode 100644 Aufgabe5/doc.lang/pi_gzip.txt create mode 100644 Aufgabe5/doc.lang/pi_netrw.txt create mode 100644 Aufgabe5/doc.lang/pi_paren.txt create mode 100644 Aufgabe5/doc.lang/pi_spec.txt create mode 100644 Aufgabe5/doc.lang/pi_tar.txt create mode 100644 Aufgabe5/doc.lang/pi_vimball.txt create mode 100644 Aufgabe5/doc.lang/pi_zip.txt create mode 100644 Aufgabe5/doc.lang/print.txt create mode 100644 Aufgabe5/doc.lang/quickfix.txt create mode 100644 Aufgabe5/doc.lang/quickref.txt create mode 100644 Aufgabe5/doc.lang/quotes.txt create mode 100644 Aufgabe5/doc.lang/recover.txt create mode 100644 Aufgabe5/doc.lang/remote.txt create mode 100644 Aufgabe5/doc.lang/repeat.txt create mode 100644 Aufgabe5/doc.lang/rileft.txt create mode 100644 Aufgabe5/doc.lang/russian.txt create mode 100644 Aufgabe5/doc.lang/scroll.txt create mode 100644 Aufgabe5/doc.lang/sign.txt create mode 100644 Aufgabe5/doc.lang/spell.txt create mode 100644 Aufgabe5/doc.lang/sponsor.txt create mode 100644 Aufgabe5/doc.lang/sql.txt create mode 100644 Aufgabe5/doc.lang/starting.txt create mode 100644 Aufgabe5/doc.lang/syntax.txt create mode 100644 Aufgabe5/doc.lang/tabpage.txt create mode 100644 Aufgabe5/doc.lang/tagsrch.txt create mode 100644 Aufgabe5/doc.lang/term.txt create mode 100644 Aufgabe5/doc.lang/tips.txt create mode 100644 Aufgabe5/doc.lang/todo.txt create mode 100644 Aufgabe5/doc.lang/uganda.txt create mode 100644 Aufgabe5/doc.lang/undo.txt create mode 100644 Aufgabe5/doc.lang/usr_01.txt create mode 100644 Aufgabe5/doc.lang/usr_02.txt create mode 100644 Aufgabe5/doc.lang/usr_03.txt create mode 100644 Aufgabe5/doc.lang/usr_04.txt create mode 100644 Aufgabe5/doc.lang/usr_05.txt create mode 100644 Aufgabe5/doc.lang/usr_06.txt create mode 100644 Aufgabe5/doc.lang/usr_07.txt create mode 100644 Aufgabe5/doc.lang/usr_08.txt create mode 100644 Aufgabe5/doc.lang/usr_09.txt create mode 100644 Aufgabe5/doc.lang/usr_10.txt create mode 100644 Aufgabe5/doc.lang/usr_11.txt create mode 100644 Aufgabe5/doc.lang/usr_12.txt create mode 100644 Aufgabe5/doc.lang/usr_20.txt create mode 100644 Aufgabe5/doc.lang/usr_21.txt create mode 100644 Aufgabe5/doc.lang/usr_22.txt create mode 100644 Aufgabe5/doc.lang/usr_23.txt create mode 100644 Aufgabe5/doc.lang/usr_24.txt create mode 100644 Aufgabe5/doc.lang/usr_25.txt create mode 100644 Aufgabe5/doc.lang/usr_26.txt create mode 100644 Aufgabe5/doc.lang/usr_27.txt create mode 100644 Aufgabe5/doc.lang/usr_28.txt create mode 100644 Aufgabe5/doc.lang/usr_29.txt create mode 100644 Aufgabe5/doc.lang/usr_30.txt create mode 100644 Aufgabe5/doc.lang/usr_31.txt create mode 100644 Aufgabe5/doc.lang/usr_32.txt create mode 100644 Aufgabe5/doc.lang/usr_40.txt create mode 100644 Aufgabe5/doc.lang/usr_41.txt create mode 100644 Aufgabe5/doc.lang/usr_42.txt create mode 100644 Aufgabe5/doc.lang/usr_43.txt create mode 100644 Aufgabe5/doc.lang/usr_44.txt create mode 100644 Aufgabe5/doc.lang/usr_45.txt create mode 100644 Aufgabe5/doc.lang/usr_90.txt create mode 100644 Aufgabe5/doc.lang/usr_toc.txt create mode 100644 Aufgabe5/doc.lang/various.txt create mode 100644 Aufgabe5/doc.lang/version4.txt create mode 100644 Aufgabe5/doc.lang/version5.txt create mode 100644 Aufgabe5/doc.lang/version6.txt create mode 100644 Aufgabe5/doc.lang/version7.txt create mode 100644 Aufgabe5/doc.lang/vi_diff.txt create mode 100644 Aufgabe5/doc.lang/visual.txt create mode 100644 Aufgabe5/doc.lang/windows.txt create mode 100644 Aufgabe5/doc.lang/workshop.txt create mode 100644 Aufgabe5/stoplist.engl.txt (limited to 'Aufgabe5') diff --git a/Aufgabe5/doc.einfach/doc1.txt b/Aufgabe5/doc.einfach/doc1.txt new file mode 100644 index 0000000..a4545be --- /dev/null +++ b/Aufgabe5/doc.einfach/doc1.txt @@ -0,0 +1 @@ +der Hund, die Katze, die Maus diff --git a/Aufgabe5/doc.einfach/doc2.txt b/Aufgabe5/doc.einfach/doc2.txt new file mode 100644 index 0000000..d6cbe9d --- /dev/null +++ b/Aufgabe5/doc.einfach/doc2.txt @@ -0,0 +1 @@ +der Hund, die Maus, das Huhn diff --git a/Aufgabe5/doc.einfach/doc3.txt b/Aufgabe5/doc.einfach/doc3.txt new file mode 100644 index 0000000..c08e245 --- /dev/null +++ b/Aufgabe5/doc.einfach/doc3.txt @@ -0,0 +1 @@ +die Maus, die Kuh, das Kalb diff --git a/Aufgabe5/doc.einfach/doc4.txt b/Aufgabe5/doc.einfach/doc4.txt new file mode 100644 index 0000000..1ce3139 --- /dev/null +++ b/Aufgabe5/doc.einfach/doc4.txt @@ -0,0 +1,3 @@ +der Floh, +die Kuh, +das Haus diff --git a/Aufgabe5/doc.lang/arabic.txt b/Aufgabe5/doc.lang/arabic.txt new file mode 100644 index 0000000..2dda3ca --- /dev/null +++ b/Aufgabe5/doc.lang/arabic.txt @@ -0,0 +1,322 @@ +*arabic.txt* For Vim version 7.0. Last change: 2005 Mar 29 + + + VIM REFERENCE MANUAL by Nadim Shaikli + + +Arabic Language support (options & mappings) for Vim *Arabic* + +{Vi does not have any of these commands} + + *E800* +In order to use right-to-left and Arabic mapping support, it is +necessary to compile VIM with the |+arabic| feature. + +These functions have been created by Nadim Shaikli + +It is best to view this file with these settings within VIM's GUI: > + + :set encoding=utf-8 + :set arabicshape + + +Introduction +------------ +Arabic is a rather demanding language in which a number of special +features are required. Characters are right-to-left oriented and +ought to appear as such on the screen (i.e. from right to left). +Arabic also requires shaping of its characters, meaning the same +character has a different visual form based on its relative location +within a word (initial, medial, final or stand-alone). Arabic also +requires two different forms of combining and the ability, in +certain instances, to either superimpose up to two characters on top +of another (composing) or the actual substitution of two characters +into one (combining). Lastly, to display Arabic properly one will +require not only ISO-8859-6 (U+0600-U+06FF) fonts, but will also +require Presentation Form-B (U+FE70-U+FEFF) fonts both of which are +subsets within a so-called ISO-10646-1 font. + +The commands, prompts and help files are not in Arabic, therefore +the user interface remains the standard Vi interface. + + +Highlights +---------- +o Editing left-to-right files as in the original VIM hasn't changed. + +o Viewing and editing files in right-to-left windows. File + orientation is per window, so it is possible to view the same + file in right-to-left and left-to-right modes, simultaneously. + +o No special terminal with right-to-left capabilities is required. + The right-to-left changes are completely hardware independent. + Only Arabic fonts are necessary. + +o Compatible with the original VIM. Almost all features work in + right-to-left mode (there are liable to be bugs). + +o Changing keyboard mapping and reverse insert modes using a single + command. + +o Toggling complete Arabic support via a single command. + +o While in Arabic mode, numbers are entered from left to right. Upon + entering a none number character, that character will be inserted + just into the left of the last number. + +o Arabic keymapping on the command line in reverse insert mode. + +o Proper Bidirectional functionality is possible given VIM is + started within a Bidi capable terminal emulator. + + +Arabic Fonts *arabicfonts* +------------ + +VIM requires monospaced fonts of which there are many out there. +Arabic requires ISO-8859-6 as well as Presentation Form-B fonts +(without Form-B, Arabic will _NOT_ be usable). It is highly +recommended that users search for so-called 'ISO-10646-1' fonts. +Do an Internet search or check www.arabeyes.org for further +info on where to attain the necessary Arabic fonts. + + +Font Installation +----------------- + +o Installation of fonts for X Window systems (Unix/Linux) + + Depending on your system, copy your_ARABIC_FONT file into a + directory of your choice. Change to the directory containing + the Arabic fonts and execute the following commands: + + % mkfontdir + % xset +fp path_name_of_arabic_fonts_directory + + +Usage +----- +Prior to the actual usage of Arabic within VIM, a number of settings +need to be accounted for and invoked. + +o Setting the Arabic fonts + + + For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done + by entering the following command in the VIM window. +> + :set guifont=your_ARABIC_FONT +< + NOTE: the string 'your_ARABIC_FONT' is used to denote a complete + font name akin to that used in Linux/Unix systems. + (e.g. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1) + + You can append the 'guifont' set command to your .vimrc file + in order to get the same above noted results. In other words, + you can include ':set guifont=your_ARABIC_FONT' to your .vimrc + file. + + + Under the X Window environment, you can also start VIM with + '-fn your_ARABIC_FONT' option. + +o Setting the appropriate character Encoding + To enable the correct Arabic encoding the following command needs + to be appended, +> + :set encoding=utf-8 +< + to your .vimrc file (entering the command manually into you VIM + window is highly discouraged). In short, include ':set + encoding=utf-8' to your .vimrc file. + + Attempts to use Arabic without UTF-8 will result the following + warning message, + + *W17* > + Arabic requires UTF-8, do ':set encoding=utf-8' + +o Enable Arabic settings [short-cut] + + In order to simplify and streamline things, you can either invoke + VIM with the command-line option, + + % vim -A my_utf8_arabic_file ... + + or enable 'arabic' via the following command within VIM +> + :set arabic +< + The two above noted possible invocations are the preferred manner + in which users are instructed to proceed. Baring an enabled 'termbidi' + setting, both command options: + + 1. set the appropriate keymap + 2. enable the deletion of a single combined pair character + 3. enable rightleft mode + 4. enable rightleftcmd mode (affecting the command-line) + 5. enable arabicshape mode (do visual character alterations) + + You may also append the command to your .vimrc file and simply + include ':set arabic' to it. + + You are also capable of disabling Arabic support via +> + :set noarabic +< + which resets everything that the command had enabled without touching + the global settings as they could affect other possible open buffers. + In short the 'noarabic' command, + + 1. resets to the alternate keymap + 2. disables the deletion of a single combined pair character + 3. disables rightleft mode + + NOTE: the 'arabic' command takes into consideration 'termbidi' for + possible external bi-directional (bidi) support from the + terminal ("mlterm" for instance offers such support). + 'termbidi', if available, is superior to rightleft support + and its support is preferred due to its level of offerings. + 'arabic' when 'termbidi' is enabled only sets the keymap. + + If, on the other hand, you'd like to be verbose and explicit and + are opting not to use the 'arabic' short-cut command, here's what + is needed (i.e. if you use ':set arabic' you can skip this section) - + + + Arabic Keymapping Activation + + To activate the Arabic keymap (i.e. to remap your English/Latin + keyboard to look-n-feel like a standard Arabic one), set the + 'keymap' command to "arabic". This is done by entering +> + :set keymap=arabic +< + in your VIM window. You can also append the 'keymap' set command to + your .vimrc file. In other words, you can include ':set keymap=arabic' + to your .vimrc file. + + To turn toggle (or switch) your keymapping between Arabic and the + default mapping (English), it is advised that users use the 'CTRL-^' + key press while in insert (or add/replace) mode. The command-line + will display your current mapping by displaying an "Arabic" string + next to your insertion mode (e.g. -- INSERT Arabic --) indicating + your current keymap. + + + Arabic deletion of a combined pair character + + By default VIM has the 'delcombine' option disabled. This option + allows the deletion of ALEF in a LAM_ALEF (LAA) combined character + and still retain the LAM (i.e. it reverts to treating the combined + character as its natural two characters form -- this also pertains + to harakat and their combined forms). You can enable this option + by entering +> + :set delcombine +< + in our VIM window. You can also append the 'delcombine' set command + to your .vimrc file. In other words, you can include ':set delcombine' + to your .vimrc file. + + + Arabic right-to-left Mode + + By default VIM starts in Left-to-right mode. 'rightleft' is the + command that allows one to alter a window's orientation - that can + be accomplished via, + + - Toggling between left-to-right and right-to-left modes is + accomplished through ':set rightleft' and ':set norightleft'. + + - While in Left-to-right mode, enter ':set rl' in the command line + ('rl' is the abbreviation for rightleft). + + - Put the ':set rl' line in your '.vimrc' file to start Vim in + right-to-left mode permanently. + + + Arabic right-to-left command-line Mode + + For certain commands the editing can be done in right-to-left mode. + Currently this is only applicable to search commands. + + This is controlled with the 'rightleftcmd' option. The default is + "search", which means that windows in which 'rightleft' is set will + edit search commands in right-left mode. To disable this behavior, +> + :set rightleftcmd= +< + To enable right-left editing of search commands again, +> + :set rightleftcmd& +< + + Arabic Shaping Mode + + To activate the required visual characters alterations (shaping, + composing, combining) which the Arabic language requires, enable + the 'arabicshape' command. This is done by entering +> + :set arabicshape +< + in our VIM window. You can also append the 'arabicshape' set + command to your .vimrc file. In other words, you can include + ':set arabicshape' to your .vimrc file. + + +Keymap/Keyboard *arabickeymap* +--------------- + +The character/letter encoding used in VIM is the standard UTF-8. +It is widely discouraged that any other encoding be used or even +attempted. + +Note: UTF-8 is an all encompassing encoding and as such is + the only supported (and encouraged) encoding with + regard to Arabic (all other proprietary encodings + should be discouraged and frowned upon). + +o Keyboard + + + CTRL-^ in insert/replace mode toggles between Arabic/Latin mode + + + Keyboard mapping is based on the Microsoft's Arabic keymap (the + defacto standard in the Arab world): + + +---------------------------------------------------------------------+ + |! |@ |# |$ |% |^ |& |* |( |) |_ |+ || |~ ّ | + |1 ١ |2 ٢ |3 ٣ |4 ٤ |5 ٥ |6 ٦ |7 ٧ |8 ٨ |9 ٩ |0 ٠ |- |= |\ |` ذ | + +---------------------------------------------------------------------+ + |Q َ |W ً |E ُ |R ٌ |T لإ |Y إ |U ` |I ÷ |O x |P ؛ |{ < |} > | + |q ض |w ص |e ث |r ق |t ف |y غ |u ع |i ه |o خ |p ح |[ ج |] د | + +-----------------------------------------------------------+ + |A ِ |S ٍ |D [ |F ] |G لأ |H أ |J ـ |K ، |L / |: |" | + |a ش |s س |d ي |f ب |g ل |h ا |j ت |k ن |l م |; ك |' ط | + +------------------------------------------------------+ + |Z ~ |X ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ | + |z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ | + +-------------------------------------------------+ + +Restrictions +------------ + +o VIM in its GUI form does not currently support Bi-directionality + (i.e. the ability to see both Arabic and Latin intermixed within + the same line). + + +Known Bugs +---------- + +There is one known minor bug, + + 1. If you insert a haraka (e.g. Fatha (U+064E)) after a LAM (U+0644) + and then insert an ALEF (U+0627), the appropriate combining will + not happen due to the sandwiched haraka resulting in something + that will NOT be displayed correctly. + + WORK-AROUND: Don't include harakats between LAM and ALEF combos. + In general, don't anticipate to see correct visual + representation with regard to harakats and LAM+ALEF + combined characters (even those entered after both + characters). The problem noted is strictly a visual + one, meaning saving such a file will contain all the + appropriate info/encodings - nothing is lost. + +No other bugs are known to exist. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/autocmd.txt b/Aufgabe5/doc.lang/autocmd.txt new file mode 100644 index 0000000..53acf8a --- /dev/null +++ b/Aufgabe5/doc.lang/autocmd.txt @@ -0,0 +1,1269 @@ +*autocmd.txt* For Vim version 7.0. Last change: 2007 Jan 16 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Automatic commands *autocommand* + +For a basic explanation, see section |40.3| in the user manual. + +1. Introduction |autocmd-intro| +2. Defining autocommands |autocmd-define| +3. Removing autocommands |autocmd-remove| +4. Listing autocommands |autocmd-list| +5. Events |autocmd-events| +6. Patterns |autocmd-patterns| +7. Buffer-local autocommands |autocmd-buflocal| +8. Groups |autocmd-groups| +9. Executing autocommands |autocmd-execute| +10. Using autocommands |autocmd-use| +11. Disabling autocommands |autocmd-disable| + +{Vi does not have any of these commands} +{only when the |+autocmd| feature has not been disabled at compile time} + +============================================================================== +1. Introduction *autocmd-intro* + +You can specify commands to be executed automatically when reading or writing +a file, when entering or leaving a buffer or window, and when exiting Vim. +For example, you can create an autocommand to set the 'cindent' option for +files matching *.c. You can also use autocommands to implement advanced +features, such as editing compressed files (see |gzip-example|). The usual +place to put autocommands is in your .vimrc or .exrc file. + + *E203* *E204* *E143* +WARNING: Using autocommands is very powerful, and may lead to unexpected side +effects. Be careful not to destroy your text. +- It's a good idea to do some testing on an expendable copy of a file first. + For example: If you use autocommands to decompress a file when starting to + edit it, make sure that the autocommands for compressing when writing work + correctly. +- Be prepared for an error halfway through (e.g., disk full). Vim will mostly + be able to undo the changes to the buffer, but you may have to clean up the + changes to other files by hand (e.g., compress a file that has been + decompressed). +- If the BufRead* events allow you to edit a compressed file, the FileRead* + events should do the same (this makes recovery possible in some rare cases). + It's a good idea to use the same autocommands for the File* and Buf* events + when possible. + +============================================================================== +2. Defining autocommands *autocmd-define* + +Note: The ":autocmd" command cannot be followed by another command, since any +'|' is considered part of the command. + + *:au* *:autocmd* +:au[tocmd] [group] {event} {pat} [nested] {cmd} + Add {cmd} to the list of commands that Vim will + execute automatically on {event} for a file matching + {pat}. Vim always adds the {cmd} after existing + autocommands, so that the autocommands execute in the + order in which they were given. See |autocmd-nested| + for [nested]. + +The special pattern or defines a buffer-local autocommand. +See |autocmd-buflocal|. + +Note that special characters (e.g., "%", "") in the ":autocmd" +arguments are not expanded when the autocommand is defined. These will be +expanded when the Event is recognized, and the {cmd} is executed. The only +exception is that "" is expanded when the autocmd is defined. Example: +> + :au BufNewFile,BufRead *.html so :h/html.vim + +Here Vim expands to the name of the file containing this line. + +When your .vimrc file is sourced twice, the autocommands will appear twice. +To avoid this, put this command in your .vimrc file, before defining +autocommands: > + + :autocmd! " Remove ALL autocommands for the current group. + +If you don't want to remove all autocommands, you can instead use a variable +to ensure that Vim includes the autocommands only once: > + + :if !exists("autocommands_loaded") + : let autocommands_loaded = 1 + : au ... + :endif + +When the [group] argument is not given, Vim uses the current group (as defined +with ":augroup"); otherwise, Vim uses the group defined with [group]. Note +that [group] must have been defined before. You cannot define a new group +with ":au group ..."; use ":augroup" for that. + +While testing autocommands, you might find the 'verbose' option to be useful: > + :set verbose=9 +This setting makes Vim echo the autocommands as it executes them. + +When defining an autocommand in a script, it will be able to call functions +local to the script and use mappings local to the script. When the event is +triggered and the command executed, it will run in the context of the script +it was defined in. This matters if || is used in a command. + +When executing the commands, the messages from one command overwrites a +previous message. This is different from when executing the commands +manually. Mostly the screen will not scroll up, thus there is no hit-enter +prompt. When one command outputs two messages this can happen anyway. + +============================================================================== +3. Removing autocommands *autocmd-remove* + +:au[tocmd]! [group] {event} {pat} [nested] {cmd} + Remove all autocommands associated with {event} and + {pat}, and add the command {cmd}. See + |autocmd-nested| for [nested]. + +:au[tocmd]! [group] {event} {pat} + Remove all autocommands associated with {event} and + {pat}. + +:au[tocmd]! [group] * {pat} + Remove all autocommands associated with {pat} for all + events. + +:au[tocmd]! [group] {event} + Remove ALL autocommands for {event}. + +:au[tocmd]! [group] Remove ALL autocommands. + +When the [group] argument is not given, Vim uses the current group (as defined +with ":augroup"); otherwise, Vim uses the group defined with [group]. + +============================================================================== +4. Listing autocommands *autocmd-list* + +:au[tocmd] [group] {event} {pat} + Show the autocommands associated with {event} and + {pat}. + +:au[tocmd] [group] * {pat} + Show the autocommands associated with {pat} for all + events. + +:au[tocmd] [group] {event} + Show all autocommands for {event}. + +:au[tocmd] [group] Show all autocommands. + +If you provide the [group] argument, Vim lists only the autocommands for +[group]; otherwise, Vim lists the autocommands for ALL groups. Note that this +argument behavior differs from that for defining and removing autocommands. + +In order to list buffer-local autocommands, use a pattern in the form +or . See |autocmd-buflocal|. + + *:autocmd-verbose* +When 'verbose' is non-zero, listing an autocommand will also display where it +was last defined. Example: > + + :verbose autocmd BufEnter + FileExplorer BufEnter + * call s:LocalBrowse(expand("")) + Last set from /usr/share/vim/vim-7.0/plugin/NetrwPlugin.vim +< +See |:verbose-cmd| for more information. + +============================================================================== +5. Events *autocmd-events* *E215* *E216* + +You can specify a comma-separated list of event names. No white space can be +used in this list. The command applies to all the events in the list. + +For READING FILES there are four kinds of events possible: + BufNewFile starting to edit a non-existent file + BufReadPre BufReadPost starting to edit an existing file + FilterReadPre FilterReadPost read the temp file with filter output + FileReadPre FileReadPost any other file read +Vim uses only one of these four kinds when reading a file. The "Pre" and +"Post" events are both triggered, before and after reading the file. + +Note that the autocommands for the *ReadPre events and all the Filter events +are not allowed to change the current buffer (you will get an error message if +this happens). This is to prevent the file to be read into the wrong buffer. + +Note that the 'modified' flag is reset AFTER executing the BufReadPost +and BufNewFile autocommands. But when the 'modified' option was set by the +autocommands, this doesn't happen. + +You can use the 'eventignore' option to ignore a number of events or all +events. + *autocommand-events* *{event}* +Vim recognizes the following events. Vim ignores the case of event names +(e.g., you can use "BUFread" or "bufread" instead of "BufRead"). + +First an overview by function with a short explanation. Then the list +alphabetically with full explanations |autocmd-events-abc|. + +Name triggered by ~ + + Reading +|BufNewFile| starting to edit a file that doesn't exist +|BufReadPre| starting to edit a new buffer, before reading the file +|BufRead| starting to edit a new buffer, after reading the file +|BufReadPost| starting to edit a new buffer, after reading the file +|BufReadCmd| before starting to edit a new buffer |Cmd-event| + +|FileReadPre| before reading a file with a ":read" command +|FileReadPost| after reading a file with a ":read" command +|FileReadCmd| before reading a file with a ":read" command |Cmd-event| + +|FilterReadPre| before reading a file from a filter command +|FilterReadPost| after reading a file from a filter command + +|StdinReadPre| before reading from stdin into the buffer +|StdinReadPost| After reading from the stdin into the buffer + + Writing +|BufWrite| starting to write the whole buffer to a file +|BufWritePre| starting to write the whole buffer to a file +|BufWritePost| after writing the whole buffer to a file +|BufWriteCmd| before writing the whole buffer to a file |Cmd-event| + +|FileWritePre| starting to write part of a buffer to a file +|FileWritePost| after writing part of a buffer to a file +|FileWriteCmd| before writing part of a buffer to a file |Cmd-event| + +|FileAppendPre| starting to append to a file +|FileAppendPost| after appending to a file +|FileAppendCmd| before appending to a file |Cmd-event| + +|FilterWritePre| starting to write a file for a filter command or diff +|FilterWritePost| after writing a file for a filter command or diff + + Buffers +|BufAdd| just after adding a buffer to the buffer list +|BufCreate| just after adding a buffer to the buffer list +|BufDelete| before deleting a buffer from the buffer list +|BufWipeout| before completely deleting a buffer + +|BufFilePre| before changing the name of the current buffer +|BufFilePost| after changing the name of the current buffer + +|BufEnter| after entering a buffer +|BufLeave| before leaving to another buffer +|BufWinEnter| after a buffer is displayed in a window +|BufWinLeave| before a buffer is removed from a window + +|BufUnload| before unloading a buffer +|BufHidden| just after a buffer has become hidden +|BufNew| just after creating a new buffer + +|SwapExists| detected an existing swap file + + Options +|FileType| when the 'filetype' option has been set +|Syntax| when the 'syntax' option has been set +|EncodingChanged| after the 'encoding' option has been changed +|TermChanged| after the value of 'term' has changed + + Startup and exit +|VimEnter| after doing all the startup stuff +|GUIEnter| after starting the GUI successfully +|TermResponse| after the termainal response to |t_RV| is received + +|VimLeavePre| before exiting Vim, before writing the viminfo file +|VimLeave| before exiting Vim, after writing the viminfo file + + Various +|FileChangedShell| Vim notices that a file changed since editing started +|FileChangedShellPost| After handling a file changed since editing started +|FileChangedRO| before making the first change to a read-only file + +|ShellCmdPost| after executing a shell command +|ShellFilterPost| after filtering with a shell command + +|FuncUndefined| a user function is used but it isn't defined +|SpellFileMissing| a spell file is used but it can't be found +|SourcePre| before sourcing a Vim script +|SourceCmd| before sourcing a Vim script |Cmd-event| + +|VimResized| after the Vim window size changed +|FocusGained| Vim got input focus +|FocusLost| Vim lost input focus +|CursorHold| the user doesn't press a key for a while +|CursorHoldI| the user doesn't press a key for a while in Insert mode +|CursorMoved| the cursor was moved in Normal mode +|CursorMovedI| the cursor was moved in Insert mode + +|WinEnter| after entering another window +|WinLeave| before leaving a window +|TabEnter| after entering another tab page +|TabLeave| before leaving a tab page +|CmdwinEnter| after entering the command-line window +|CmdwinLeave| before leaving the command-line window + +|InsertEnter| starting Insert mode +|InsertChange| when typing while in Insert or Replace mode +|InsertLeave| when leaving Insert mode + +|ColorScheme| after loading a color scheme + +|RemoteReply| a reply from a server Vim was received + +|QuickFixCmdPre| before a quickfix command is run +|QuickFixCmdPost| after a quickfix command is run + +|SessionLoadPost| after loading a session file + +|MenuPopup| just before showing the popup menu + +|User| to be used in combination with ":doautocmd" + + +The alphabetical list of autocommand events: *autocmd-events-abc* + + *BufCreate* *BufAdd* +BufAdd or BufCreate Just after creating a new buffer which is + added to the buffer list, or adding a buffer + to the buffer list. + Also used just after a buffer in the buffer + list has been renamed. + The BufCreate event is for historic reasons. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being created "". + *BufDelete* +BufDelete Before deleting a buffer from the buffer list. + The BufUnload may be called first (if the + buffer was loaded). + Also used just before a buffer in the buffer + list is renamed. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being deleted "". + *BufEnter* +BufEnter After entering a buffer. Useful for setting + options for a file type. Also executed when + starting to edit a buffer, after the + BufReadPost autocommands. + *BufFilePost* +BufFilePost After changing the name of the current buffer + with the ":file" or ":saveas" command. + *BufFilePre* +BufFilePre Before changing the name of the current buffer + with the ":file" or ":saveas" command. + *BufHidden* +BufHidden Just after a buffer has become hidden. That + is, when there are no longer windows that show + the buffer, but the buffer is not unloaded or + deleted. Not used for ":qa" or ":q" when + exiting Vim. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being unloaded "". + *BufLeave* +BufLeave Before leaving to another buffer. Also when + leaving or closing the current window and the + new current window is not for the same buffer. + Not used for ":qa" or ":q" when exiting Vim. + *BufNew* +BufNew Just after creating a new buffer. Also used + just after a buffer has been renamed. When + the buffer is added to the buffer list BufAdd + will be triggered too. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being created "". + *BufNewFile* +BufNewFile When starting to edit a file that doesn't + exist. Can be used to read in a skeleton + file. + *BufRead* *BufReadPost* +BufRead or BufReadPost When starting to edit a new buffer, after + reading the file into the buffer, before + executing the modelines. See |BufWinEnter| + for when you need to do something after + processing the modelines. + This does NOT work for ":r file". Not used + when the file doesn't exist. Also used after + successfully recovering a file. + *BufReadCmd* +BufReadCmd Before starting to edit a new buffer. Should + read the file into the buffer. |Cmd-event| + *BufReadPre* *E200* *E201* +BufReadPre When starting to edit a new buffer, before + reading the file into the buffer. Not used + if the file doesn't exist. + *BufUnload* +BufUnload Before unloading a buffer. This is when the + text in the buffer is going to be freed. This + may be after a BufWritePost and before a + BufDelete. Also used for all buffers that are + loaded when Vim is going to exit. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being unloaded "". + *BufWinEnter* +BufWinEnter After a buffer is displayed in a window. This + can be when the buffer is loaded (after + processing the modelines), when a hidden + buffer is displayed in a window (and is no + longer hidden) or a buffer already visible in + a window is also displayed in another window. + *BufWinLeave* +BufWinLeave Before a buffer is removed from a window. + Not when it's still visible in another window. + Also triggered when exiting. It's triggered + before BufUnload or BufHidden. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being unloaded "". + *BufWipeout* +BufWipeout Before completely deleting a buffer. The + BufUnload and BufDelete events may be called + first (if the buffer was loaded and was in the + buffer list). Also used just before a buffer + is renamed (also when it's not in the buffer + list). + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer being deleted "". + *BufWrite* *BufWritePre* +BufWrite or BufWritePre Before writing the whole buffer to a file. + *BufWriteCmd* +BufWriteCmd Before writing the whole buffer to a file. + Should do the writing of the file and reset + 'modified' if successful, unless '+' is in + 'cpo' and writing to another file |cpo-+|. + The buffer contents should not be changed. + |Cmd-event| + *BufWritePost* +BufWritePost After writing the whole buffer to a file + (should undo the commands for BufWritePre). + *CmdwinEnter* +CmdwinEnter After entering the command-line window. + Useful for setting options specifically for + this special type of window. This is + triggered _instead_ of BufEnter and WinEnter. + is set to a single character, + indicating the type of command-line. + |cmdwin-char| + *CmdwinLeave* +CmdwinLeave Before leaving the command-line window. + Useful to clean up any global setting done + with CmdwinEnter. This is triggered _instead_ + of BufLeave and WinLeave. + is set to a single character, + indicating the type of command-line. + |cmdwin-char| + *ColorScheme* +ColorScheme After loading a color scheme. |:colorscheme| + + *CursorHold* +CursorHold When the user doesn't press a key for the time + specified with 'updatetime'. Not re-triggered + until the user has pressed a key (i.e. doesn't + fire every 'updatetime' ms if you leave Vim to + make some coffee. :) See |CursorHold-example| + for previewing tags. + This event is only triggered in Normal mode. + While recording the CursorHold event is not + triggered. |q| + Note: Interactive commands cannot be used for + this event. There is no hit-enter prompt, + the screen is updated directly (when needed). + Note: In the future there will probably be + another option to set the time. + Hint: to force an update of the status lines + use: > + :let &ro = &ro +< {only on Amiga, Unix, Win32, MSDOS and all GUI + versions} + *CursorHoldI* +CursorHoldI Just like CursorHold, but in Insert mode. + + *CursorMoved* +CursorMoved After the cursor was moved in Normal mode. + Also when the text of the cursor line has been + changed, e.g., with "x", "rx" or "p". + Not triggered when there is typeahead or when + an operator is pending. + For an example see |match-parens|. + Careful: Don't do anything that the user does + not expect or that is slow. + *CursorMovedI* +CursorMovedI After the cursor was moved in Insert mode. + Otherwise the same as CursorMoved. + *EncodingChanged* +EncodingChanged Fires off after the 'encoding' option has been + changed. Useful to set up fonts, for example. + *FileAppendCmd* +FileAppendCmd Before appending to a file. Should do the + appending to the file. Use the '[ and '] + marks for the range of lines.|Cmd-event| + *FileAppendPost* +FileAppendPost After appending to a file. + *FileAppendPre* +FileAppendPre Before appending to a file. Use the '[ and '] + marks for the range of lines. + *FileChangedRO* +FileChangedRO Before making the first change to a read-only + file. Can be used to check-out the file from + a source control system. Not triggered when + the change was caused by an autocommand. + This event is triggered when making the first + change in a buffer or the first change after + 'readonly' was set, just before the change is + applied to the text. + WARNING: If the autocommand moves the cursor + the effect of the change is undefined. + *E788* + It is not allowed to change to another buffer + here. You can reload the buffer but not edit + another one. + *FileChangedShell* +FileChangedShell When Vim notices that the modification time of + a file has changed since editing started. + Also when the file attributes of the file + change. |timestamp| + Mostly triggered after executing a shell + command, but also with a |:checktime| command + or when Gvim regains input focus. + This autocommand is triggered for each changed + file. It is not used when 'autoread' is set + and the buffer was not changed. If a + FileChangedShell autocommand is present the + warning message and prompt is not given. + This is useful for reloading related buffers + which are affected by a single command. + The |v:fcs_reason| variable is set to indicate + what happened and |v:fcs_choice| can be used + to tell Vim what to do next. + NOTE: When this autocommand is executed, the + current buffer "%" may be different from the + buffer that was changed "". + NOTE: The commands must not change the current + buffer, jump to another buffer or delete a + buffer. *E246* + NOTE: This event never nests, to avoid an + endless loop. This means that while executing + commands for the FileChangedShell event no + other FileChangedShell event will be + triggered. + *FileChangedShellPost* +FileChangedShellPost After handling a file that was changed outside + of Vim. Can be used to update the statusline. + *FileEncoding* +FileEncoding Obsolete. It still works and is equivalent + to |EncodingChanged|. + *FileReadCmd* +FileReadCmd Before reading a file with a ":read" command. + Should do the reading of the file. |Cmd-event| + *FileReadPost* +FileReadPost After reading a file with a ":read" command. + Note that Vim sets the '[ and '] marks to the + first and last line of the read. This can be + used to operate on the lines just read. + *FileReadPre* +FileReadPre Before reading a file with a ":read" command. + *FileType* +FileType When the 'filetype' option has been set. + can be used for the name of the file + where this option was set, and for + the new value of 'filetype'. + See |filetypes|. + *FileWriteCmd* +FileWriteCmd Before writing to a file, when not writing the + whole buffer. Should do the writing to the + file. Should not change the buffer. Use the + '[ and '] marks for the range of lines. + |Cmd-event| + *FileWritePost* +FileWritePost After writing to a file, when not writing the + whole buffer. + *FileWritePre* +FileWritePre Before writing to a file, when not writing the + whole buffer. Use the '[ and '] marks for the + range of lines. + *FilterReadPost* +FilterReadPost After reading a file from a filter command. + Vim checks the pattern against the name of + the current buffer as with FilterReadPre. + Not triggered when 'shelltemp' is off. + *FilterReadPre* *E135* +FilterReadPre Before reading a file from a filter command. + Vim checks the pattern against the name of + the current buffer, not the name of the + temporary file that is the output of the + filter command. + Not triggered when 'shelltemp' is off. + *FilterWritePost* +FilterWritePost After writing a file for a filter command or + making a diff. + Vim checks the pattern against the name of + the current buffer as with FilterWritePre. + Not triggered when 'shelltemp' is off. + *FilterWritePre* +FilterWritePre Before writing a file for a filter command or + making a diff. + Vim checks the pattern against the name of + the current buffer, not the name of the + temporary file that is the output of the + filter command. + Not triggered when 'shelltemp' is off. + *FocusGained* +FocusGained When Vim got input focus. Only for the GUI + version and a few console versions where this + can be detected. + *FocusLost* +FocusLost When Vim lost input focus. Only for the GUI + version and a few console versions where this + can be detected. May also happen when a + dialog pops up. + *FuncUndefined* +FuncUndefined When a user function is used but it isn't + defined. Useful for defining a function only + when it's used. Both and are + set to the name of the function. + See |autoload-functions|. + *GUIEnter* +GUIEnter After starting the GUI successfully, and after + opening the window. It is triggered before + VimEnter when using gvim. Can be used to + position the window from a .gvimrc file: > + :autocmd GUIEnter * winpos 100 50 +< *InsertChange* +InsertChange When typing while in Insert or + Replace mode. The |v:insertmode| variable + indicates the new mode. + Be careful not to move the cursor or do + anything else that the user does not expect. + *InsertEnter* +InsertEnter When starting Insert mode. Also for Replace + mode and Virtual Replace mode. The + |v:insertmode| variable indicates the mode. + Be careful not to move the cursor or do + anything else that the user does not expect. + *InsertLeave* +InsertLeave When leaving Insert mode. Also when using + CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|. + *MenuPopup* +MenuPopup Just before showing the popup menu (under the + right mouse button). Useful for adjusting the + menu for what is under the cursor or mouse + pointer. + The pattern is matched against a single + character representing the mode: + n Normal + v Visual + o Operator-pending + i Insert + c Command line + *QuickFixCmdPre* +QuickFixCmdPre Before a quickfix command is run (|:make|, + |:lmake|, |:grep|, |:lgrep|, |:grepadd|, + |:lgrepadd|, |:vimgrep|, |:lvimgrep|, + |:vimgrepadd|, |:vimgrepadd|). The pattern is + matched against the command being run. When + |:grep| is used but 'grepprg' is set to + "internal" it still matches "grep". + This command cannot be used to set the + 'makeprg' and 'grepprg' variables. + If this command causes an error, the quickfix + command is not executed. + *QuickFixCmdPost* +QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix + command is run, before jumping to the first + location. + *RemoteReply* +RemoteReply When a reply from a Vim that functions as + server was received |server2client()|. + is equal to the {serverid} from which + the reply was sent, and is the actual + reply string. + Note that even if an autocommand is defined, + the reply should be read with |remote_read()| + to consume it. + *SessionLoadPost* +SessionLoadPost After loading the session file created using + the |:mksession| command. + *ShellCmdPost* +ShellCmdPost After executing a shell command with |:!cmd|, + |:shell|, |:make| and |:grep|. Can be used to + check for any changed files. + *ShellFilterPost* +ShellFilterPost After executing a shell command with + ":{range}!cmd", ":w !cmd" or ":r !cmd". + Can be used to check for any changed files. + *SourcePre* +SourcePre Before sourcing a Vim script. |:source| + is the name of the file being sourced. + *SourceCmd* +SourceCmd When sourcing a Vim script. |:source| + is the name of the file being sourced. + The autocommand must source this file. + |Cmd-event| + *SpellFileMissing* +SpellFileMissing When trying to load a spell checking file and + it can't be found. The pattern is matched + against the language. is the + language, 'encoding' also matters. See + |spell-SpellFileMissing|. + *StdinReadPost* +StdinReadPost After reading from the stdin into the buffer, + before executing the modelines. Only used + when the "-" argument was used when Vim was + started |--|. + *StdinReadPre* +StdinReadPre Before reading from stdin into the buffer. + Only used when the "-" argument was used when + Vim was started |--|. + *SwapExists* +SwapExists Detected an existing swap file when starting + to edit a file. Only when it is possible to + select a way to handle the situation, when Vim + would ask the user what to do. + The |v:swapname| variable holds the name of + the swap file found, the file being + edited. |v:swapcommand| may contain a command + to be executed in the opened file. + The commands should set the |v:swapchoice| + variable to a string with one character to + tell Vim what should be done next: + 'o' open read-only + 'e' edit the file anyway + 'r' recover + 'd' delete the swap file + 'q' quit, don't edit the file + 'a' abort, like hitting CTRL-C + When set to an empty string the user will be + asked, as if there was no SwapExists autocmd. + Note: Do not try to change the buffer, the + results are unpredictable. + *Syntax* +Syntax When the 'syntax' option has been set. + can be used for the name of the file + where this option was set, and for + the new value of 'syntax'. + See |:syn-on|. + *TabEnter* +TabEnter Just after entering a tab page. |tab-page| + After triggering the WinEnter and before + triggering the BufEnter event. + *TabLeave* +TabLeave Just before leaving a tab page. |tab-page| + A WinLeave event will have been triggered + first. + *TermChanged* +TermChanged After the value of 'term' has changed. Useful + for re-loading the syntax file to update the + colors, fonts and other terminal-dependent + settings. Executed for all loaded buffers. + *TermResponse* +TermResponse After the response to |t_RV| is received from + the terminal. The value of |v:termresponse| + can be used to do things depending on the + terminal version. + *User* +User Never executed automatically. To be used for + autocommands that are only executed with + ":doautocmd". + *UserGettingBored* +UserGettingBored When the user hits CTRL-C. Just kidding! :-) + *VimEnter* +VimEnter After doing all the startup stuff, including + loading .vimrc files, executing the "-c cmd" + arguments, creating all windows and loading + the buffers in them. + *VimLeave* +VimLeave Before exiting Vim, just after writing the + .viminfo file. Executed only once, like + VimLeavePre. + To detect an abnormal exit use |v:dying|. + *VimLeavePre* +VimLeavePre Before exiting Vim, just before writing the + .viminfo file. This is executed only once, + if there is a match with the name of what + happens to be the current buffer when exiting. + Mostly useful with a "*" pattern. > + :autocmd VimLeavePre * call CleanupStuff() +< To detect an abnormal exit use |v:dying|. + *VimResized* +VimResized After the Vim window was resized, thus 'lines' + and/or 'columns' changed. Not when starting + up though. + *WinEnter* +WinEnter After entering another window. Not done for + the first window, when Vim has just started. + Useful for setting the window height. + If the window is for another buffer, Vim + executes the BufEnter autocommands after the + WinEnter autocommands. + Note: When using ":split fname" the WinEnter + event is triggered after the split but before + the file "fname" is loaded. + *WinLeave* +WinLeave Before leaving a window. If the window to be + entered next is for a different buffer, Vim + executes the BufLeave autocommands before the + WinLeave autocommands (but not for ":new"). + Not used for ":qa" or ":q" when exiting Vim. + +============================================================================== +6. Patterns *autocmd-patterns* *{pat}* + +The file pattern {pat} is tested for a match against the file name in one of +two ways: +1. When there is no '/' in the pattern, Vim checks for a match against only + the tail part of the file name (without its leading directory path). +2. When there is a '/' in the pattern, Vim checks for a match against the + both short file name (as you typed it) and the full file name (after + expanding it to a full path and resolving symbolic links). + +The special pattern or is used for buffer-local +autocommands |autocmd-buflocal|. This pattern is not matched against the name +of a buffer. + +Examples: > + :autocmd BufRead *.txt set et +Set the 'et' option for all text files. > + + :autocmd BufRead /vim/src/*.c set cindent +Set the 'cindent' option for C files in the /vim/src directory. > + + :autocmd BufRead /tmp/*.c set ts=5 +If you have a link from "/tmp/test.c" to "/home/nobody/vim/src/test.c", and +you start editing "/tmp/test.c", this autocommand will match. + +Note: To match part of a path, but not from the root directory, use a '*' as +the first character. Example: > + :autocmd BufRead */doc/*.txt set tw=78 +This autocommand will for example be executed for "/tmp/doc/xx.txt" and +"/usr/home/piet/doc/yy.txt". The number of directories does not matter here. + + +The file name that the pattern is matched against is after expanding +wildcards. Thus is you issue this command: > + :e $ROOTDIR/main.$EXT +The argument is first expanded to: > + /usr/root/main.py +Before it's matched with the pattern of the autocommand. Careful with this +when using events like FileReadCmd, the value of may not be what you +expect. + + +Environment variables can be used in a pattern: > + :autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab +And ~ can be used for the home directory (if $HOME is defined): > + :autocmd BufWritePost ~/.vimrc so ~/.vimrc + :autocmd BufRead ~archive/* set readonly +The environment variable is expanded when the autocommand is defined, not when +the autocommand is executed. This is different from the command! + + *file-pattern* +The pattern is interpreted like mostly used in file names: + * matches any sequence of characters + ? matches any single character + \? matches a '?' + . matches a '.' + ~ matches a '~' + , separates patterns + \, matches a ',' + { } like \( \) in a |pattern| + , inside { }: like \| in a |pattern| + \ special meaning like in a |pattern| + [ch] matches 'c' or 'h' + [^ch] match any character but 'c' and 'h' + +Note that for all systems the '/' character is used for path separator (even +MS-DOS and OS/2). This was done because the backslash is difficult to use +in a pattern and to make the autocommands portable across different systems. + + *autocmd-changes* +Matching with the pattern is done when an event is triggered. Changing the +buffer name in one of the autocommands, or even deleting the buffer, does not +change which autocommands will be executed. Example: > + + au BufEnter *.foo bdel + au BufEnter *.foo set modified + +This will delete the current buffer and then set 'modified' in what has become +the current buffer instead. Vim doesn't take into account that "*.foo" +doesn't match with that buffer name. It matches "*.foo" with the name of the +buffer at the moment the event was triggered. + +However, buffer-local autocommands will not be executed for a buffer that has +been wiped out with |:bwipe|. After deleting the buffer with |:bdel| the +buffer actually still exists (it becomes unlisted), thus the autocommands are +still executed. + +============================================================================== +7. Buffer-local autocommands *autocmd-buflocal* *autocmd-buffer-local* + ** ** *E680* + +Buffer-local autocommands are attached to a specific buffer. They are useful +if the buffer does not have a name and when the name does not match a specific +pattern. But it also means they must be explicitly added to each buffer. + +Instead of a pattern buffer-local autocommands use one of these forms: + current buffer + buffer number 99 + using (only when executing autocommands) + || + +Examples: > + :au CursorHold echo 'hold' + :au CursorHold echo 'hold' + :au CursorHold echo 'hold' + +All the commands for autocommands also work with buffer-local autocommands, +simply use the special string instead of the pattern. Examples: > + :au! * " remove buffer-local autocommands for + " current buffer + :au! * " remove buffer-local autocommands for + " buffer #33 + :dobuf :au! CursorHold " remove autocmd for given event for all + " buffers + :au * " list buffer-local autocommands for + " current buffer + +Note that when an autocommand is defined for the current buffer, it is stored +with the buffer number. Thus it uses the form "", where 12 is the +number of the current buffer. You will see this when listing autocommands, +for example. + +To test for presence of buffer-local autocommands use the |exists()| function +as follows: > + :if exists("#CursorHold#") | ... | endif + :if exists("#CursorHold#") | ... | endif " for current buffer + +When a buffer is wiped out its buffer-local autocommands are also gone, of +course. Note that when deleting a buffer, e.g., with ":bdel", it is only +unlisted, the autocommands are still present. In order to see the removal of +buffer-local autocommands: > + :set verbose=6 + +It is not possible to define buffer-local autocommands for a non-existent +buffer. + +============================================================================== +8. Groups *autocmd-groups* + +Autocommands can be put together in a group. This is useful for removing or +executing a group of autocommands. For example, all the autocommands for +syntax highlighting are put in the "highlight" group, to be able to execute +":doautoall highlight BufRead" when the GUI starts. + +When no specific group is selected, Vim uses the default group. The default +group does not have a name. You cannot execute the autocommands from the +default group separately; you can execute them only by executing autocommands +for all groups. + +Normally, when executing autocommands automatically, Vim uses the autocommands +for all groups. The group only matters when executing autocommands with +":doautocmd" or ":doautoall", or when defining or deleting autocommands. + +The group name can contain any characters except white space. The group name +"end" is reserved (also in uppercase). + +The group name is case sensitive. Note that this is different from the event +name! + + *:aug* *:augroup* +:aug[roup] {name} Define the autocmd group name for the + following ":autocmd" commands. The name "end" + or "END" selects the default group. + + *:augroup-delete* *E367* +:aug[roup]! {name} Delete the autocmd group {name}. Don't use + this if there is still an autocommand using + this group! This is not checked. + +To enter autocommands for a specific group, use this method: +1. Select the group with ":augroup {name}". +2. Delete any old autocommands with ":au!". +3. Define the autocommands. +4. Go back to the default group with "augroup END". + +Example: > + :augroup uncompress + : au! + : au BufEnter *.gz %!gunzip + :augroup END + +This prevents having the autocommands defined twice (e.g., after sourcing the +.vimrc file again). + +============================================================================== +9. Executing autocommands *autocmd-execute* + +Vim can also execute Autocommands non-automatically. This is useful if you +have changed autocommands, or when Vim has executed the wrong autocommands +(e.g., the file pattern match was wrong). + +Note that the 'eventignore' option applies here too. Events listed in this +option will not cause any commands to be executed. + + *:do* *:doau* *:doautocmd* *E217* +:do[autocmd] [group] {event} [fname] + Apply the autocommands matching [fname] (default: + current file name) for {event} to the current buffer. + You can use this when the current file name does not + match the right pattern, after changing settings, or + to execute autocommands for a certain event. + It's possible to use this inside an autocommand too, + so you can base the autocommands for one extension on + another extension. Example: > + :au Bufenter *.cpp so ~/.vimrc_cpp + :au Bufenter *.cpp doau BufEnter x.c +< Be careful to avoid endless loops. See + |autocmd-nested|. + + When the [group] argument is not given, Vim executes + the autocommands for all groups. When the [group] + argument is included, Vim executes only the matching + autocommands for that group. Note: if you use an + undefined group name, Vim gives you an error message. + + After applying the autocommands the modelines are + processed, so that their overrule the settings from + autocommands, like what happens when editing a file. + + *:doautoa* *:doautoall* +:doautoa[ll] [group] {event} [fname] + Like ":doautocmd", but apply the autocommands to each + loaded buffer. Note that {fname} is used to select + the autocommands, not the buffers to which they are + applied. + Careful: Don't use this for autocommands that delete a + buffer, change to another buffer or change the + contents of a buffer; the result is unpredictable. + This command is intended for autocommands that set + options, change highlighting, and things like that. + +============================================================================== +10. Using autocommands *autocmd-use* + +For WRITING FILES there are four possible sets of events. Vim uses only one +of these sets for a write command: + +BufWriteCmd BufWritePre BufWritePost writing the whole buffer + FilterWritePre FilterWritePost writing to filter temp file +FileAppendCmd FileAppendPre FileAppendPost appending to a file +FileWriteCmd FileWritePre FileWritePost any other file write + +When there is a matching "*Cmd" autocommand, it is assumed it will do the +writing. No further writing is done and the other events are not triggered. +|Cmd-event| + +Note that the *WritePost commands should undo any changes to the buffer that +were caused by the *WritePre commands; otherwise, writing the file will have +the side effect of changing the buffer. + +Before executing the autocommands, the buffer from which the lines are to be +written temporarily becomes the current buffer. Unless the autocommands +change the current buffer or delete the previously current buffer, the +previously current buffer is made the current buffer again. + +The *WritePre and *AppendPre autocommands must not delete the buffer from +which the lines are to be written. + +The '[ and '] marks have a special position: +- Before the *ReadPre event the '[ mark is set to the line just above where + the new lines will be inserted. +- Before the *ReadPost event the '[ mark is set to the first line that was + just read, the '] mark to the last line. +- Before executing the *WriteCmd, *WritePre and *AppendPre autocommands the '[ + mark is set to the first line that will be written, the '] mark to the last + line. +Careful: '[ and '] change when using commands that change the buffer. + +In commands which expect a file name, you can use "" for the file name +that is being read |:| (you can also use "%" for the current file +name). "" can be used for the buffer number of the currently effective +buffer. This also works for buffers that doesn't have a name. But it doesn't +work for files without a buffer (e.g., with ":r file"). + + *gzip-example* +Examples for reading and writing compressed files: > + :augroup gzip + : autocmd! + : autocmd BufReadPre,FileReadPre *.gz set bin + : autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip + : autocmd BufReadPost,FileReadPost *.gz set nobin + : autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r") + : autocmd BufWritePost,FileWritePost *.gz !mv :r + : autocmd BufWritePost,FileWritePost *.gz !gzip :r + + : autocmd FileAppendPre *.gz !gunzip + : autocmd FileAppendPre *.gz !mv :r + : autocmd FileAppendPost *.gz !mv :r + : autocmd FileAppendPost *.gz !gzip :r + :augroup END + +The "gzip" group is used to be able to delete any existing autocommands with +":autocmd!", for when the file is sourced twice. + +(":r" is the file name without the extension, see |:_%:|) + +The commands executed for the BufNewFile, BufRead/BufReadPost, BufWritePost, +FileAppendPost and VimLeave events do not set or reset the changed flag of the +buffer. When you decompress the buffer with the BufReadPost autocommands, you +can still exit with ":q". When you use ":undo" in BufWritePost to undo the +changes made by BufWritePre commands, you can still do ":q" (this also makes +"ZZ" work). If you do want the buffer to be marked as modified, set the +'modified' option. + +To execute Normal mode commands from an autocommand, use the ":normal" +command. Use with care! If the Normal mode command is not finished, the user +needs to type characters (e.g., after ":normal m" you need to type a mark +name). + +If you want the buffer to be unmodified after changing it, reset the +'modified' option. This makes it possible to exit the buffer with ":q" +instead of ":q!". + + *autocmd-nested* *E218* +By default, autocommands do not nest. If you use ":e" or ":w" in an +autocommand, Vim does not execute the BufRead and BufWrite autocommands for +those commands. If you do want this, use the "nested" flag for those commands +in which you want nesting. For example: > + :autocmd FileChangedShell *.c nested e! +The nesting is limited to 10 levels to get out of recursive loops. + +It's possible to use the ":au" command in an autocommand. This can be a +self-modifying command! This can be useful for an autocommand that should +execute only once. + +If you want to skip autocommands for one command, use the |:noautocmd| command +modifier or the 'eventignore' option. + +Note: When reading a file (with ":read file" or with a filter command) and the +last line in the file does not have an , Vim remembers this. At the next +write (with ":write file" or with a filter command), if the same line is +written again as the last line in a file AND 'binary' is set, Vim does not +supply an . This makes a filter command on the just read lines write the +same file as was read, and makes a write command on just filtered lines write +the same file as was read from the filter. For example, another way to write +a compressed file: > + + :autocmd FileWritePre *.gz set bin|'[,']!gzip + :autocmd FileWritePost *.gz undo|set nobin +< + *autocommand-pattern* +You can specify multiple patterns, separated by commas. Here are some +examples: > + + :autocmd BufRead * set tw=79 nocin ic infercase fo=2croq + :autocmd BufRead .letter set tw=72 fo=2tcrq + :autocmd BufEnter .letter set dict=/usr/lib/dict/words + :autocmd BufLeave .letter set dict= + :autocmd BufRead,BufNewFile *.c,*.h set tw=0 cin noic + :autocmd BufEnter *.c,*.h abbr FOR for (i = 0; i < 3; ++i){}O + :autocmd BufLeave *.c,*.h unabbr FOR + +For makefiles (makefile, Makefile, imakefile, makefile.unix, etc.): > + + :autocmd BufEnter ?akefile* set include=^s\=include + :autocmd BufLeave ?akefile* set include& + +To always start editing C files at the first function: > + + :autocmd BufRead *.c,*.h 1;/^{ + +Without the "1;" above, the search would start from wherever the file was +entered, rather than from the start of the file. + + *skeleton* *template* +To read a skeleton (template) file when opening a new file: > + + :autocmd BufNewFile *.c 0r ~/vim/skeleton.c + :autocmd BufNewFile *.h 0r ~/vim/skeleton.h + :autocmd BufNewFile *.java 0r ~/vim/skeleton.java + +To insert the current date and time in a *.html file when writing it: > + + :autocmd BufWritePre,FileWritePre *.html ks|call LastMod()|'s + :fun LastMod() + : if line("$") > 20 + : let l = 20 + : else + : let l = line("$") + : endif + : exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " . + : \ strftime("%Y %b %d") + :endfun + +You need to have a line "Last modified: " in the first 20 lines +of the file for this to work. Vim replaces (and anything in the +same line after it) with the current date and time. Explanation: + ks mark current position with mark 's' + call LastMod() call the LastMod() function to do the work + 's return the cursor to the old position +The LastMod() function checks if the file is shorter than 20 lines, and then +uses the ":g" command to find lines that contain "Last modified: ". For those +lines the ":s" command is executed to replace the existing date with the +current one. The ":execute" command is used to be able to use an expression +for the ":g" and ":s" commands. The date is obtained with the strftime() +function. You can change its argument to get another date string. + +When entering :autocmd on the command-line, completion of events and command +names may be done (with , CTRL-D, etc.) where appropriate. + +Vim executes all matching autocommands in the order that you specify them. +It is recommended that your first autocommand be used for all files by using +"*" as the file pattern. This means that you can define defaults you like +here for any settings, and if there is another matching autocommand it will +override these. But if there is no other matching autocommand, then at least +your default settings are recovered (if entering this file from another for +which autocommands did match). Note that "*" will also match files starting +with ".", unlike Unix shells. + + *autocmd-searchpat* +Autocommands do not change the current search patterns. Vim saves the current +search patterns before executing autocommands then restores them after the +autocommands finish. This means that autocommands do not affect the strings +highlighted with the 'hlsearch' option. Within autocommands, you can still +use search patterns normally, e.g., with the "n" command. +If you want an autocommand to set the search pattern, such that it is used +after the autocommand finishes, use the ":let @/ =" command. +The search-highlighting cannot be switched off with ":nohlsearch" in an +autocommand. Use the 'h' flag in the 'viminfo' option to disable search- +highlighting when starting Vim. + + *Cmd-event* +When using one of the "*Cmd" events, the matching autocommands are expected to +do the file reading, writing or sourcing. This can be used when working with +a special kind of file, for example on a remote system. +CAREFUL: If you use these events in a wrong way, it may have the effect of +making it impossible to read or write the matching files! Make sure you test +your autocommands properly. Best is to use a pattern that will never match a +normal file name, for example "ftp://*". + +When defining a BufReadCmd it will be difficult for Vim to recover a crashed +editing session. When recovering from the original file, Vim reads only those +parts of a file that are not found in the swap file. Since that is not +possible with a BufReadCmd, use the |:preserve| command to make sure the +original file isn't needed for recovery. You might want to do this only when +you expect the file to be modified. + +For file read and write commands the |v:cmdarg| variable holds the "++enc=" +and "++ff=" argument that are effective. These should be used for the command +that reads/writes the file. The |v:cmdbang| variable is one when "!" was +used, zero otherwise. + +See the $VIMRUNTIME/plugin/netrw.vim for examples. + +============================================================================== +11. Disabling autocommands *autocmd-disable* + +To disable autocommands for some time use the 'eventignore' option. Note that +this may cause unexpected behavior, make sure you restore 'eventignore' +afterwards, using a |:try| block with |:finally|. + + *:noautocmd* *:noa* +To disable autocommands for just one command use the ":noautocmd" command +modifier. This will set 'eventignore' to "all" for the duration of the +following command. Example: > + + :noautocmd w fname.gz + +This will write the file without triggering the autocommands defined by the +gzip plugin. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/change.txt b/Aufgabe5/doc.lang/change.txt new file mode 100644 index 0000000..01f9a4b --- /dev/null +++ b/Aufgabe5/doc.lang/change.txt @@ -0,0 +1,1579 @@ +*change.txt* For Vim version 7.0. Last change: 2006 May 05 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +This file describes commands that delete or change text. In this context, +changing text means deleting the text and replacing it with other text using +one command. You can undo all of these commands. You can repeat the non-Ex +commands with the "." command. + +1. Deleting text |deleting| +2. Delete and insert |delete-insert| +3. Simple changes |simple-change| *changing* +4. Complex changes |complex-change| + 4.1 Filter commands |filter| + 4.2 Substitute |:substitute| + 4.3 Search and replace |search-replace| + 4.4 Changing tabs |change-tabs| +5. Copying and moving text |copy-move| +6. Formatting text |formatting| +7. Sorting text |sorting| + +For inserting text see |insert.txt|. + +============================================================================== +1. Deleting text *deleting* *E470* + +["x] or ** *x* *dl* +["x]x Delete [count] characters under and after the cursor + [into register x] (not |linewise|). Does the same as + "dl". + The key does not take a [count]. Instead, it + deletes the last character of the count. + See |:fixdel| if the key does not do what you + want. See |'whichwrap'| for deleting a line break + (join lines). {Vi does not support } + + *X* *dh* +["x]X Delete [count] characters before the cursor [into + register x] (not |linewise|). Does the same as "dh". + Also see |'whichwrap'|. + + *d* +["x]d{motion} Delete text that {motion} moves over [into register + x]. See below for exceptions. + + *dd* +["x]dd Delete [count] lines [into register x] |linewise|. + + *D* +["x]D Delete the characters under the cursor until the end + of the line and [count]-1 more lines [into register + x]; synonym for "d$". + (not |linewise|) + When the '#' flag is in 'cpoptions' the count is + ignored. + +{Visual}["x]x or *v_x* *v_d* *v_* +{Visual}["x]d or +{Visual}["x] Delete the highlighted text [into register x] (for + {Visual} see |Visual-mode|). {not in Vi} + +{Visual}["x]CTRL-H or *v_CTRL-H* *v_* +{Visual}["x] When in Select mode: Delete the highlighted text [into + register x]. + +{Visual}["x]X or *v_X* *v_D* *v_b_D* +{Visual}["x]D Delete the highlighted lines [into register x] (for + {Visual} see |Visual-mode|). In Visual block mode, + "D" deletes the highlighted text plus all text until + the end of the line. {not in Vi} + + *:d* *:de* *:del* *:delete* +:[range]d[elete] [x] Delete [range] lines (default: current line) [into + register x]. + +:[range]d[elete] [x] {count} + Delete {count} lines, starting with [range] + (default: current line |cmdline-ranges|) [into + register x]. + +These commands delete text. You can repeat them with the "." command +(except ":d") and undo them. Use Visual mode to delete blocks of text. See +|registers| for an explanation of registers. + +An exception for the d{motion} command: If the motion is not linewise, the +start and end of the motion are not in the same line, and there are only +blanks before the start and after the end of the motion, the delete becomes +linewise. This means that the delete also removes the line of blanks that you +might expect to remain. + +Trying to delete an empty region of text (e.g., "d0" in the first column) +is an error when 'cpoptions' includes the 'E' flag. + + *J* +J Join [count] lines, with a minimum of two lines. + Remove the indent and insert up to two spaces (see + below). + + *v_J* +{Visual}J Join the highlighted lines, with a minimum of two + lines. Remove the indent and insert up to two spaces + (see below). {not in Vi} + + *gJ* +gJ Join [count] lines, with a minimum of two lines. + Don't insert or remove any spaces. {not in Vi} + + *v_gJ* +{Visual}gJ Join the highlighted lines, with a minimum of two + lines. Don't insert or remove any spaces. {not in + Vi} + + *:j* *:join* +:[range]j[oin][!] [flags] + Join [range] lines. Same as "J", except with [!] + the join does not insert or delete any spaces. + If a [range] has equal start and end values, this + command does nothing. The default behavior is to + join the current line with the line below it. + {not in Vi: !} + See |ex-flags| for [flags]. + +:[range]j[oin][!] {count} [flags] + Join {count} lines, starting with [range] (default: + current line |cmdline-ranges|). Same as "J", except + with [!] the join does not insert or delete any + spaces. + {not in Vi: !} + See |ex-flags| for [flags]. + +These commands delete the between lines. This has the effect of joining +multiple lines into one line. You can repeat these commands (except ":j") and +undo them. + +These commands, except "gJ", insert one space in place of the unless +there is trailing white space or the next line starts with a ')'. These +commands, except "gJ", delete any leading white space on the next line. If +the 'joinspaces' option is on, these commands insert two spaces after a '.', +'!' or '?' (but if 'cpoptions' includes the 'j' flag, they insert two spaces +only after a '.'). +The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting +spaces before and after a multi-byte character |fo-table|. + + +============================================================================== +2. Delete and insert *delete-insert* *replacing* + + *R* +R Enter Replace mode: Each character you type replaces + an existing character, starting with the character + under the cursor. Repeat the entered text [count]-1 + times. See |Replace-mode| for more details. + + *gR* +gR Enter Virtual Replace mode: Each character you type + replaces existing characters in screen space. So a + may replace several characters at once. + Repeat the entered text [count]-1 times. See + |Virtual-Replace-mode| for more details. + {not available when compiled without the +vreplace + feature} + + *c* +["x]c{motion} Delete {motion} text [into register x] and start + insert. When 'cpoptions' includes the 'E' flag and + there is no text to delete (e.g., with "cTx" when the + cursor is just after an 'x'), an error occurs and + insert mode does not start (this is Vi compatible). + When 'cpoptions' does not include the 'E' flag, the + "c" command always starts insert mode, even if there + is no text to delete. + + *cc* +["x]cc Delete [count] lines [into register x] and start + insert |linewise|. If 'autoindent' is on, preserve + the indent of the first line. + + *C* +["x]C Delete from the cursor position to the end of the + line and [count]-1 more lines [into register x], and + start insert. Synonym for c$ (not |linewise|). + + *s* +["x]s Delete [count] characters [into register x] and start + insert (s stands for Substitute). Synonym for "cl" + (not |linewise|). + + *S* +["x]S Delete [count] lines [into register x] and start + insert. Synonym for "cc" |linewise|. + +{Visual}["x]c or *v_c* *v_s* +{Visual}["x]s Delete the highlighted text [into register x] and + start insert (for {Visual} see |Visual-mode|). {not + in Vi} + + *v_r* +{Visual}["x]r{char} Replace all selected characters by {char}. + + *v_C* +{Visual}["x]C Delete the highlighted lines [into register x] and + start insert. In Visual block mode it works + differently |v_b_C|. {not in Vi} + *v_S* +{Visual}["x]S Delete the highlighted lines [into register x] and + start insert (for {Visual} see |Visual-mode|). {not + in Vi} + *v_R* +{Visual}["x]R Currently just like {Visual}["x]S. In a next version + it might work differently. {not in Vi} + +Notes: +- You can end Insert and Replace mode with . +- See the section "Insert and Replace mode" |mode-ins-repl| for the other + special characters in these modes. +- The effect of [count] takes place after Vim exits Insert or Replace mode. +- When the 'cpoptions' option contains '$' and the change is within one line, + Vim continues to show the text to be deleted and puts a '$' at the last + deleted character. + +See |registers| for an explanation of registers. + +Replace mode is just like Insert mode, except that every character you enter +deletes one character. If you reach the end of a line, Vim appends any +further characters (just like Insert mode). In Replace mode, the backspace +key restores the original text (if there was any). (See section "Insert and +Replace mode" |mode-ins-repl|). + + *cw* *cW* +Special case: "cw" and "cW" work the same as "ce" and "cE" if the cursor is +on a non-blank. This is because Vim interprets "cw" as change-word, and a +word does not include the following white space. {Vi: "cw" when on a blank +followed by other blanks changes only the first blank; this is probably a +bug, because "dw" deletes all the blanks; use the 'w' flag in 'cpoptions' to +make it work like Vi anyway} + +If you prefer "cw" to include the space after a word, use this mapping: > + :map cw dwi +< + *:c* *:ch* *:change* +:{range}c[hange][!] Replace lines of text with some different text. + Type a line containing only "." to stop replacing. + Without {range}, this command changes only the current + line. + Adding [!] toggles 'autoindent' for the time this + command is executed. + +============================================================================== +3. Simple changes *simple-change* + + *r* +r{char} Replace the character under the cursor with {char}. + If {char} is a or , a line break replaces the + character. To replace with a real , use CTRL-V + . CTRL-V replaces with a . + {Vi: CTRL-V still replaces with a line break, + cannot replace something with a } + If you give a [count], Vim replaces [count] characters + with [count] {char}s. When {char} is a or , + however, Vim inserts only one : "5r" replaces + five characters with a single line break. + When {char} is a or , Vim performs + autoindenting. This works just like deleting the + characters that are replaced and then doing + "i". + {char} can be entered as a digraph |digraph-arg|. + |:lmap| mappings apply to {char}. The CTRL-^ command + in Insert mode can be used to switch this on/off + |i_CTRL-^|. See |utf-8-char-arg| about using + composing characters when 'encoding' is Unicode. + + *gr* +gr{char} Replace the virtual characters under the cursor with + {char}. This replaces in screen space, not file + space. See |gR| and |Virtual-Replace-mode| for more + details. As with |r| a count may be given. + {char} can be entered like with |r|. + {not available when compiled without the +vreplace + feature} + + *digraph-arg* +The argument for Normal mode commands like |r| and |t| is a single character. +When 'cpo' doesn't contain the 'D' flag, this character can also be entered +like |digraphs|. First type CTRL-K and then the two digraph characters. +{not available when compiled without the |+digraphs| feature} + + *case* +The following commands change the case of letters. The currently active +|locale| is used. See |:language|. The LC_CTYPE value matters here. + + *~* +~ 'notildeop' option: Switch case of the character + under the cursor and move the cursor to the right. + If a [count] is given, do that many characters. {Vi: + no count} + +~{motion} 'tildeop' option: switch case of {motion} text. {Vi: + tilde cannot be used as an operator} + + *g~* +g~{motion} Switch case of {motion} text. {not in Vi} + +g~g~ *g~g~* *g~~* +g~~ Switch case of current line. {not in Vi}. + + *v_~* +{Visual}~ Switch case of highlighted text (for {Visual} see + |Visual-mode|). {not in Vi} + + *v_U* +{Visual}U Make highlighted text uppercase (for {Visual} see + |Visual-mode|). {not in Vi} + + *gU* *uppercase* +gU{motion} Make {motion} text uppercase. {not in Vi} + Example: > + :map! gUiw`]a +< This works in Insert mode: press CTRL-F to make the + word before the cursor uppercase. Handy to type + words in lowercase and then make them uppercase. + + +gUgU *gUgU* *gUU* +gUU Make current line uppercase. {not in Vi}. + + *v_u* +{Visual}u Make highlighted text lowercase (for {Visual} see + |Visual-mode|). {not in Vi} + + *gu* *lowercase* +gu{motion} Make {motion} text lowercase. {not in Vi} + +gugu *gugu* *guu* +guu Make current line lowercase. {not in Vi}. + + *g?* *rot13* +g?{motion} Rot13 encode {motion} text. {not in Vi} + + *v_g?* +{Visual}g? Rot13 encode the highlighted text (for {Visual} see + |Visual-mode|). {not in Vi} + +g?g? *g?g?* *g??* +g?? Rot13 encode current line. {not in Vi}. + + +Adding and subtracting ~ + *CTRL-A* +CTRL-A Add [count] to the number or alphabetic character at + or after the cursor. {not in Vi} + + *CTRL-X* +CTRL-X Subtract [count] from the number or alphabetic + character at or after the cursor. {not in Vi} + +The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned +octal and hexadecimal numbers and alphabetic characters. This depends on the +'nrformats' option. +- When 'nrformats' includes "octal", Vim considers numbers starting with a '0' + to be octal, unless the number includes a '8' or '9'. Other numbers are + decimal and may have a preceding minus sign. + If the cursor is on a number, the commands apply to that number; otherwise + Vim uses the number to the right of the cursor. +- When 'nrformats' includes "hex", Vim assumes numbers starting with '0x' or + '0X' are hexadecimal. The case of the rightmost letter in the number + determines the case of the resulting hexadecimal number. If there is no + letter in the current number, Vim uses the previously detected case. +- When 'nrformats' includes "alpha", Vim will change the alphabetic character + under or after the cursor. This is useful to make lists with an alphabetic + index. + +For numbers with leading zeros (including all octal and hexadecimal numbers), +Vim preserves the number of characters in the number when possible. CTRL-A on +"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff". +There is one exception: When a number that starts with a zero is found not to +be octal (it contains a '8' or '9'), but 'nrformats' does include "octal", +leading zeros are removed to avoid that the result may be recognized as an +octal number. + +Note that when 'nrformats' includes "octal", decimal numbers with leading +zeros cause mistakes, because they can be confused with octal numbers. + +The CTRL-A command is very useful in a macro. Example: Use the following +steps to make a numbered list. + +1. Create the first list entry, make sure it starts with a number. +2. qa - start recording into register 'a' +3. Y - yank the entry +4. p - put a copy of the entry below the first one +5. CTRL-A - increment the number +6. q - stop recording +7. @a - repeat the yank, put and increment times + + +SHIFTING LINES LEFT OR RIGHT *shift-left-right* + + *<* +<{motion} Shift {motion} lines one 'shiftwidth' leftwards. + + *<<* +<< Shift [count] lines one 'shiftwidth' leftwards. + + *v_<* +{Visual}[count]< Shift the highlighted lines [count] 'shiftwidth' + leftwards (for {Visual} see |Visual-mode|). {not in + Vi} + + *>* + >{motion} Shift {motion} lines one 'shiftwidth' rightwards. + + *>>* + >> Shift [count] lines one 'shiftwidth' rightwards. + + *v_>* +{Visual}[count]> Shift the highlighted lines [count] 'shiftwidth' + rightwards (for {Visual} see |Visual-mode|). {not in + Vi} + + *:<* +:[range]< Shift [range] lines one 'shiftwidth' left. Repeat '<' + for shifting multiple 'shiftwidth's. + +:[range]< {count} Shift {count} lines one 'shiftwidth' left, starting + with [range] (default current line |cmdline-ranges|). + Repeat '<' for shifting multiple 'shiftwidth's. + +:[range]le[ft] [indent] left align lines in [range]. Sets the indent in the + lines to [indent] (default 0). {not in Vi} + + *:>* +:[range]> [flags] Shift {count} [range] lines one 'shiftwidth' right. + Repeat '>' for shifting multiple 'shiftwidth's. + See |ex-flags| for [flags]. + +:[range]> {count} [flags] + Shift {count} lines one 'shiftwidth' right, starting + with [range] (default current line |cmdline-ranges|). + Repeat '>' for shifting multiple 'shiftwidth's. + See |ex-flags| for [flags]. + +The ">" and "<" commands are handy for changing the indentation within +programs. Use the 'shiftwidth' option to set the size of the white space +which these commands insert or delete. Normally the 'shiftwidth' option is 8, +but you can set it to, say, 3 to make smaller indents. The shift leftwards +stops when there is no indent. The shift right does not affect empty lines. + +If the 'shiftround' option is on, the indent is rounded to a multiple of +'shiftwidth'. + +If the 'smartindent' option is on, or 'cindent' is on and 'cinkeys' contains +'#', shift right does not affect lines starting with '#' (these are supposed +to be C preprocessor lines that must stay in column 1). + +When the 'expandtab' option is off (this is the default) Vim uses s as +much as possible to make the indent. You can use ">><<" to replace an indent +made out of spaces with the same indent made out of s (and a few spaces +if necessary). If the 'expandtab' option is on, Vim uses only spaces. Then +you can use ">><<" to replace s in the indent by spaces (or use +":retab!"). + +To move a line several 'shiftwidth's, use Visual mode or the ":" commands. +For example: > + Vjj4> move three lines 4 indents to the right + :<<< move current line 3 indents to the left + :>> 5 move 5 lines 2 indents to the right + :5>> move line 5 2 indents to the right + +============================================================================== +4. Complex changes *complex-change* + +4.1 Filter commands *filter* + +A filter is a program that accepts text at standard input, changes it in some +way, and sends it to standard output. You can use the commands below to send +some text through a filter, so that it is replace by the filter output. +Examples of filters are "sort", which sorts lines alphabetically, and +"indent", which formats C program files (you need a version of indent that +works like a filter; not all versions do). The 'shell' option specifies the +shell Vim uses to execute the filter command (See also the 'shelltype' +option). You can repeat filter commands with ".". Vim does not recognize a +comment (starting with '"') after the ":!" command. + + *!* +!{motion}{filter} Filter {motion} text lines through the external + program {filter}. + + *!!* +!!{filter} Filter [count] lines through the external program + {filter}. + + *v_!* +{Visual}!{filter} Filter the highlighted lines through the external + program {filter} (for {Visual} see |Visual-mode|). + {not in Vi} + +:{range}![!]{filter} [!][arg] *:range!* + Filter {range} lines through the external program + {filter}. Vim replaces the optional bangs with the + latest given command and appends the optional [arg]. + Vim saves the output of the filter command in a + temporary file and then reads the file into the + buffer. Vim uses the 'shellredir' option to redirect + the filter output to the temporary file. + However, if the 'shelltemp' option is off then pipes + are used when possible (on Unix). + When the 'R' flag is included in 'cpoptions' marks in + the filtered lines are deleted, unless the + |:keepmarks| command is used. Example: > + :keepmarks '<,'>!sort +< When the number of lines after filtering is less than + before, marks in the missing lines are deleted anyway. + + *=* +={motion} Filter {motion} lines through the external program + given with the 'equalprg' option. When the 'equalprg' + option is empty (this is the default), use the + internal formatting function |C-indenting|. But when + 'indentexpr' is not empty, it will be used instead + |indent-expression|. + + *==* +== Filter [count] lines like with ={motion}. + + *v_=* +{Visual}= Filter the highlighted lines like with ={motion}. + {not in Vi} + + +4.2 Substitute *:substitute* + *:s* *:su* +:[range]s[ubstitute]/{pattern}/{string}/[flags] [count] + For each line in [range] replace a match of {pattern} + with {string}. + For the {pattern} see |pattern|. + {string} can be a literal string, or something + special; see |sub-replace-special|. + When [range] and [count] are omitted, replace in the + current line only. + When [count] is given, replace in [count] lines, + starting with the last line in [range]. When [range] + is omitted start in the current line. + Also see |cmdline-ranges|. + See |:s_flags| for [flags]. + +:[range]s[ubstitute] [flags] [count] +:[range]&[&][flags] [count] *:&* + Repeat last :substitute with same search pattern and + substitute string, but without the same flags. You + may add [flags], see |:s_flags|. + Note that after ":substitute" the '&' flag can't be + used, it's recognized as a pattern separator. + The space between ":substitute" and the 'c', 'g' and + 'r' flags isn't required, but in scripts it's a good + idea to keep it to avoid confusion. + +:[range]~[&][flags] [count] *:~* + Repeat last substitute with same substitute string + but with last used search pattern. This is like + ":&r". See |:s_flags| for [flags]. + + *&* +& Synonym for ":s//~/" (repeat last substitute). Note + that the flags are not remembered, thus it might + actually work differently. You can use ":&&" to keep + the flags. + + *g&* +g& Synonym for ":%s//~/&" (repeat last substitute on all + lines with the same flags). + Mnemonic: global substitute. {not in Vi} + + *:snomagic* *:sno* +:[range]sno[magic] ... Same as ":substitute", but always use 'nomagic'. + {not in Vi} + + *:smagic* *:sm* +:[range]sm[agic] ... Same as ":substitute", but always use 'magic'. + {not in Vi} + + *:s_flags* +The flags that you can use for the substitute commands: + +[&] Must be the first one: Keep the flags from the previous substitute + command. Examples: > + :&& + :s/this/that/& +< Note that ":s" and ":&" don't keep the flags. + {not in Vi} + +[c] Confirm each substitution. Vim highlights the matching string (with + |hl-IncSearch|). You can type: *:s_c* + 'y' to substitute this match + 'l' to substitute this match and then quit ("last") + 'n' to skip this match + to quit substituting + 'a' to substitute this and all remaining matches {not in Vi} + 'q' to quit substituting {not in Vi} + CTRL-E to scroll the screen up {not in Vi, not available when + compiled without the +insert_expand feature} + CTRL-Y to scroll the screen down {not in Vi, not available when + compiled without the +insert_expand feature} + If the 'edcompatible' option is on, Vim remembers the [c] flag and + toggles it each time you use it, but resets it when you give a new + search pattern. + {not in Vi: highlighting of the match, other responses than 'y' or 'n'} + +[e] When the search pattern fails, do not issue an error message and, in + particular, continue in maps as if no error occurred. This is most + useful to prevent the "No match" error from breaking a mapping. Vim + does not suppress the following error messages, however: + Regular expressions can't be delimited by letters + \ should be followed by /, ? or & + No previous substitute regular expression + Trailing characters + Interrupted + {not in Vi} + +[g] Replace all occurrences in the line. Without this argument, + replacement occurs only for the first occurrence in each line. If + the 'edcompatible' option is on, Vim remembers this flag and toggles + it each time you use it, but resets it when you give a new search + pattern. If the 'gdefault' option is on, this flag is on by default + and the [g] argument switches it off. + +[i] Ignore case for the pattern. The 'ignorecase' and 'smartcase' options + are not used. + {not in Vi} + +[I] Don't ignore case for the pattern. The 'ignorecase' and 'smartcase' + options are not used. + {not in Vi} + +[n] Report the number of matches, do not actually substitute. The [c] + flag is ignored. The matches are reported as if 'report' is zero. + Useful to |count-items|. + +[p] Print the line containing the last substitute. + +[#] Like [p] and prepend the line number. + +[l] Like [l] but print the text like |:list|. + +[r] Only useful in combination with ":&" or ":s" without arguments. ":&r" + works the same way as ":~": When the search pattern is empty, use the + previously used search pattern instead of the search pattern from the + last substitute or ":global". If the last command that did a search + was a substitute or ":global", there is no effect. If the last + command was a search command such as "/", use the pattern from that + command. + For ":s" with an argument this already happens: > + :s/blue/red/ + /green + :s//red/ or :~ or :&r +< The last commands will replace "green" with "red". > + :s/blue/red/ + /green + :& +< The last command will replace "blue" with "red". + {not in Vi} + +Note that there is no flag to change the "magicness" of the pattern. A +different command is used instead. The reason is that the flags can only be +found by skipping the pattern, and in order to skip the pattern the +"magicness" must be known. Catch 22! + +If the {pattern} for the substitute command is empty, the command uses the +pattern from the last substitute or ":global" command. With the [r] flag, the +command uses the pattern from the last substitute, ":global", or search +command. + +For compatibility with Vi these two exceptions are allowed: +"\/{string}/" and "\?{string}?" do the same as "//{string}/r". +"\&{string}&" does the same as "//{string}/". + *E146* +Instead of the '/' which surrounds the pattern and replacement string, you +can use any other character, but not an alphanumeric character, '\', '"' or +'|'. This is useful if you want to include a '/' in the search pattern or +replacement string. Example: > + :s+/+//+ + +For the definition of a pattern, see |pattern|. + + *sub-replace-special* *:s\=* +When the {string} starts with "\=" it is evaluated as an expression, see +|sub-replace-expression|. You can use that for any special characters. +Otherwise these characters in {string} have a special meaning: + *:s%* +When {string} is equal to "%" and '/' is included with the 'cpoptions' option, +then the {string} of the previous substitute command is used. |cpo-/| + +magic nomagic action ~ + & \& replaced with the whole matched pattern *s/\&* + \& & replaced with & + \0 replaced with the whole matched pattern *\0* *s/\0* + \1 replaced with the matched pattern in the first + pair of () *s/\1* + \2 replaced with the matched pattern in the second + pair of () *s/\2* + .. .. *s/\3* + \9 replaced with the matched pattern in the ninth + pair of () *s/\9* + ~ \~ replaced with the {string} of the previous + substitute *s~* + \~ ~ replaced with ~ *s/\~* + \u next character made uppercase *s/\u* + \U following characters made uppercase, until \E *s/\U* + \l next character made lowercase *s/\l* + \L following characters made lowercase, until \E *s/\L* + \e end of \u, \U, \l and \L (NOTE: not !) *s/\e* + \E end of \u, \U, \l and \L *s/\E* + split line in two at this point + (Type the as CTRL-V ) *s* + \r idem *s/\r* + \ insert a carriage-return (CTRL-M) + (Type the as CTRL-V ) *s/\* + \n insert a ( in the file) + (does NOT break the line) *s/\n* + \b insert a *s/\b* + \t insert a *s/\t* + \\ insert a single backslash *s/\\* + \x where x is any character not mentioned above: + Reserved for future expansion + +Examples: > + :s/a\|b/xxx\0xxx/g modifies "a b" to "xxxaxxx xxxbxxx" + :s/\([abc]\)\([efg]\)/\2\1/g modifies "af fa bg" to "fa fa gb" + :s/abcde/abc^Mde/ modifies "abcde" to "abc", "de" (two lines) + :s/$/\^M/ modifies "abcde" to "abcde^M" + :s/\w\+/\u\0/g modifies "bla bla" to "Bla Bla" + +Note: In previous versions CTRL-V was handled in a special way. Since this is +not Vi compatible, this was removed. Use a backslash instead. + +command text result ~ +:s/aa/a^Ma/ aa aa +:s/aa/a\^Ma/ aa a^Ma +:s/aa/a\\^Ma/ aa a\a + +(you need to type CTRL-V to get a ^M here) + +The numbering of "\1", "\2" etc. is done based on which "\(" comes first in +the pattern (going left to right). When a parentheses group matches several +times, the last one will be used for "\1", "\2", etc. Example: > + :s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x" + +When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\), +either the first or second pattern in parentheses did not match, so either +\1 or \2 is empty. Example: > + :s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x" +< + +Substitute with an expression *sub-replace-expression* + *sub-replace-\=* +When the substitute string starts with "\=" the remainder is interpreted as an +expression. This does not work recursively: a substitute() function inside +the expression cannot use "\=" for the substitute string. + +The special meaning for characters as mentioned at |sub-replace-special| does +not apply except "", "\" and "\\". Thus in the result of the +expression you need to use two backslashes get one, put a backslash before a + you want to insert and use a without a backslash where you want to +break the line. + +For convenience a character is also used as a line break. Prepend a +backslash to get a real character (which will be a NUL in the file). + +When the result is a |List| then the items are joined with separating line +breaks. Thus each item becomes a line, except that they can contain line +breaks themselves. + +The whole matched text can be accessed with "submatch(0)". The text matched +with the first pair of () with "submatch(1)". Likewise for further +sub-matches in (). + +Be careful: The separation character must not appear in the expression! +Consider using a character like "@" or ":". There is no problem if the result +of the expression contains the separation character. + +Examples: > + :s@\n@\="\r" . expand("$HOME") . "\r"@ +This replaces an end-of-line with a new line containing the value of $HOME. > + + s/E/\="\"/g +This replaces 'E' characters with an euro sign. Read more in ||. + + +4.3 Search and replace *search-replace* + + *:pro* *:promptfind* +:promptf[ind] [string] + Put up a Search dialog. When [string] is given, it is + used as the initial search string. + {only for Win32, Motif and GTK GUI} + + *:promptr* *:promptrepl* +:promptr[epl] [string] + Put up a Search/Replace dialog. When [string] is + given, it is used as the initial search string. + {only for Win32, Motif and GTK GUI} + + +4.4 Changing tabs *change-tabs* + *:ret* *:retab* +:[range]ret[ab][!] [new_tabstop] + Replace all sequences of white-space containing a + with new strings of white-space using the new + tabstop value given. If you do not specify a new + tabstop size or it is zero, Vim uses the current value + of 'tabstop'. + The current value of 'tabstop' is always used to + compute the width of existing tabs. + With !, Vim also replaces strings of only normal + spaces with tabs where appropriate. + With 'expandtab' on, Vim replaces all tabs with the + appropriate number of spaces. + This command sets 'tabstop' to the new value given, + and if performed on the whole file, which is default, + should not make any visible change. + Careful: This command modifies any characters + inside of strings in a C program. Use "\t" to avoid + this (that's a good habit anyway). + ":retab!" may also change a sequence of spaces by + characters, which can mess up a printf(). + {not in Vi} + Not available when |+ex_extra| feature was disabled at + compile time. + + *retab-example* +Example for using autocommands and ":retab" to edit a file which is stored +with tabstops at 8 but edited with tabstops set at 4. Warning: white space +inside of strings can change! Also see 'softtabstop' option. > + + :auto BufReadPost *.xx retab! 4 + :auto BufWritePre *.xx retab! 8 + :auto BufWritePost *.xx retab! 4 + :auto BufNewFile *.xx set ts=4 + +============================================================================== +5. Copying and moving text *copy-move* + + *quote* +"{a-zA-Z0-9.%#:-"} Use register {a-zA-Z0-9.%#:-"} for next delete, yank + or put (use uppercase character to append with + delete and yank) ({.%#:} only work with put). + + *:reg* *:registers* +:reg[isters] Display the contents of all numbered and named + registers. {not in Vi} + +:reg[isters] {arg} Display the contents of the numbered and named + registers that are mentioned in {arg}. For example: > + :dis 1a +< to display registers '1' and 'a'. Spaces are allowed + in {arg}. {not in Vi} + + *:di* *:display* +:di[splay] [arg] Same as :registers. {not in Vi} + + *y* *yank* +["x]y{motion} Yank {motion} text [into register x]. When no + characters are to be yanked (e.g., "y0" in column 1), + this is an error when 'cpoptions' includes the 'E' + flag. + + *yy* +["x]yy Yank [count] lines [into register x] |linewise|. + + *Y* +["x]Y yank [count] lines [into register x] (synonym for + yy, |linewise|). If you like "Y" to work from the + cursor to the end of line (which is more logical, + but not Vi-compatible) use ":map Y y$". + + *v_y* +{Visual}["x]y Yank the highlighted text [into register x] (for + {Visual} see |Visual-mode|). {not in Vi} + + *v_Y* +{Visual}["x]Y Yank the highlighted lines [into register x] (for + {Visual} see |Visual-mode|). {not in Vi} + + *:y* *:yank* +:[range]y[ank] [x] Yank [range] lines [into register x]. + +:[range]y[ank] [x] {count} + Yank {count} lines, starting with last line number + in [range] (default: current line |cmdline-ranges|), + [into register x]. + + *p* *put* *E353* +["x]p Put the text [from register x] after the cursor + [count] times. {Vi: no count} + + *P* +["x]P Put the text [from register x] before the cursor + [count] times. {Vi: no count} + + ** +["x] Put the text from a register before the cursor [count] + times. Uses the "* register, unless another is + specified. + Leaves the cursor at the end of the new text. + Using the mouse only works when 'mouse' contains 'n' + or 'a'. + {not in Vi} + If you have a scrollwheel and often accidentally paste + text, you can use these mappings to disable the + pasting with the middle mouse button: > + :map + :imap +< You might want to disable the multi-click versions + too, see |double-click|. + + *gp* +["x]gp Just like "p", but leave the cursor just after the new + text. {not in Vi} + + *gP* +["x]gP Just like "P", but leave the cursor just after the new + text. {not in Vi} + + *:pu* *:put* +:[line]pu[t] [x] Put the text [from register x] after [line] (default + current line). This always works |linewise|, thus + this command can be used to put a yanked block as new + lines. + The cursor is left on the first non-blank in the last + new line. + The register can also be '=' followed by an optional + expression. The expression continues until the end of + the command. You need to escape the '|' and '"' + characters to prevent them from terminating the + command. Example: > + :put ='path' . \",/test\" +< If there is no expression after '=', Vim uses the + previous expression. You can see it with ":dis =". + +:[line]pu[t]! [x] Put the text [from register x] before [line] (default + current line). + +["x]]p or *]p* *]* +["x]] Like "p", but adjust the indent to the current line. + Using the mouse only works when 'mouse' contains 'n' + or 'a'. {not in Vi} + +["x][P or *[P* +["x]]P or *]P* +["x][p or *[p* *[* +["x][ Like "P", but adjust the indent to the current line. + Using the mouse only works when 'mouse' contains 'n' + or 'a'. {not in Vi} + +You can use these commands to copy text from one place to another. Do this +by first getting the text into a register with a yank, delete or change +command, then inserting the register contents with a put command. You can +also use these commands to move text from one file to another, because Vim +preserves all registers when changing buffers (the CTRL-^ command is a quick +way to toggle between two files). + + *linewise-register* *characterwise-register* +You can repeat the put commands with "." (except for :put) and undo them. If +the command that was used to get the text into the register was |linewise|, +Vim inserts the text below ("p") or above ("P") the line where the cursor is. +Otherwise Vim inserts the text after ("p") or before ("P") the cursor. With +the ":put" command, Vim always inserts the text in the next line. You can +exchange two characters with the command sequence "xp". You can exchange two +lines with the command sequence "ddp". You can exchange two words with the +command sequence "deep" (start with the cursor in the blank space before the +first word). You can use the "']" or "`]" command after the put command to +move the cursor to the end of the inserted text, or use "'[" or "`[" to move +the cursor to the start. + + *put-Visual-mode* *v_p* *v_P* +When using a put command like |p| or |P| in Visual mode, Vim will try to +replace the selected text with the contents of the register. Whether this +works well depends on the type of selection and the type of the text in the +register. With blockwise selection it also depends on the size of the block +and whether the corners are on an existing character. (Implementation detail: +it actually works by first putting the register after the selection and then +deleting the selection.) + + *blockwise-register* +If you use a blockwise Visual mode command to get the text into the register, +the block of text will be inserted before ("P") or after ("p") the cursor +column in the current and next lines. Vim makes the whole block of text start +in the same column. Thus the inserted text looks the same as when it was +yanked or deleted. Vim may replace some characters with spaces to make +this happen. However, if the width of the block is not a multiple of a +width and the text after the inserted block contains s, that text may be +misaligned. + +Note that after a characterwise yank command, Vim leaves the cursor on the +first yanked character that is closest to the start of the buffer. This means +that "yl" doesn't move the cursor, but "yh" moves the cursor one character +left. +Rationale: In Vi the "y" command followed by a backwards motion would + sometimes not move the cursor to the first yanked character, + because redisplaying was skipped. In Vim it always moves to + the first character, as specified by Posix. +With a linewise yank command the cursor is put in the first line, but the +column is unmodified, thus it may not be on the first yanked character. + +There are nine types of registers: *registers* *E354* +1. The unnamed register "" +2. 10 numbered registers "0 to "9 +3. The small delete register "- +4. 26 named registers "a to "z or "A to "Z +5. four read-only registers ":, "., "% and "# +6. the expression register "= +7. The selection and drop registers "*, "+ and "~ +8. The black hole register "_ +9. Last search pattern register "/ + +1. Unnamed register "" *quote_quote* *quotequote* +Vim fills this register with text deleted with the "d", "c", "s", "x" commands +or copied with the yank "y" command, regardless of whether or not a specific +register was used (e.g. "xdd). This is like the unnamed register is pointing +to the last used register. An exception is the '_' register: "_dd does not +store the deleted text in any register. +Vim uses the contents of the unnamed register for any put command (p or P) +which does not specify a register. Additionally you can access it with the +name '"'. This means you have to type two double quotes. Writing to the "" +register writes to register "0. +{Vi: register contents are lost when changing files, no '"'} + +2. Numbered registers "0 to "9 *quote_number* *quote0* *quote1* + *quote2* *quote3* *quote4* *quote9* +Vim fills these registers with text from yank and delete commands. + Numbered register 0 contains the text from the most recent yank command, +unless the command specified another register with ["x]. + Numbered register 1 contains the text deleted by the most recent delete or +change command, unless the command specified another register or the text is +less than one line (the small delete register is used then). An exception is +made for the delete operator with these movement commands: |%|, |(|, |)|, |`|, +|/|, |?|, |n|, |N|, |{| and |}|. Register "1 is always used then (this is Vi +compatible). The "- register is used as well if the delete is within a line. + With each successive deletion or change, Vim shifts the previous contents +of register 1 into register 2, 2 into 3, and so forth, losing the previous +contents of register 9. +{Vi: numbered register contents are lost when changing files; register 0 does +not exist} + +3. Small delete register "- *quote_-* *quote-* +This register contains text from commands that delete less than one line, +except when the command specifies a register with ["x]. +{not in Vi} + +4. Named registers "a to "z or "A to "Z *quote_alpha* *quotea* +Vim fills these registers only when you say so. Specify them as lowercase +letters to replace their previous contents or as uppercase letters to append +to their previous contents. When the '>' flag is present in 'cpoptions' then +a line break is inserted before the appended text. + +5. Read-only registers ":, "., "% and "# +These are '%', '#', ':' and '.'. You can use them only with the "p", "P", +and ":put" commands and with CTRL-R. {not in Vi} + *quote_.* *quote.* *E29* + ". Contains the last inserted text (the same as what is inserted + with the insert mode commands CTRL-A and CTRL-@). Note: this + doesn't work with CTRL-R on the command-line. It works a bit + differently, like inserting the text instead of putting it + ('textwidth' and other options affect what is inserted). + *quote_%* *quote%* + "% Contains the name of the current file. + *quote_#* *quote#* + "# Contains the name of the alternate file. + *quote_:* *quote:* *E30* + ": Contains the most recent executed command-line. Example: Use + "@:" to repeat the previous command-line command. + The command-line is only stored in this register when at least + one character of it was typed. Thus it remains unchanged if + the command was completely from a mapping. + {not available when compiled without the |+cmdline_hist| + feature} + +6. Expression register "= *quote_=* *quote=* +This is not really a register that stores text, but is a way to use an +expression in commands which use a register. The expression register is +read-only; you cannot put text into it. After the '=', the cursor moves to +the command-line, where you can enter any expression (see |expression|). All +normal command-line editing commands are available, including a special +history for expressions. When you end the command-line by typing , Vim +computes the result of the expression. If you end it with , Vim abandons +the expression. If you do not enter an expression, Vim uses the previous +expression (like with the "/" command). The expression must evaluate to a +string. If the result is a number it's turned into a string. A List, +Dictionary or FuncRef results in an error message (use string() to convert). +If the "= register is used for the "p" command, the string is split up at +characters. If the string ends in a , it is regarded as a linewise +register. {not in Vi} + +7. Selection and drop registers "*, "+ and "~ +Use these register for storing and retrieving the selected text for the GUI. +See |quotestar| and |quoteplus|. When the clipboard is not available or not +working, the unnamed register is used instead. For Unix systems the clipboard +is only available when the |+xterm_clipboard| feature is present. {not in Vi} + +Note that there is only a distinction between "* and "+ for X11 systems. For +an explanation of the difference, see |x11-selection|. Under MS-Windows, use +of "* and "+ is actually synonymous and refers to the |gui-clipboard|. + + *quote_~* *quote~* ** +The read-only "~ register stores the dropped text from the last drag'n'drop +operation. When something has been dropped onto Vim, the "~ register is +filled in and the pseudo key is sent for notification. You can remap +this key if you want; the default action (for all modes) is to insert the +contents of the "~ register at the cursor position. {not in Vi} +{only available when compiled with the |+dnd| feature, currently only with the +GTK GUI} + +Note: The "~ register is only used when dropping plain text onto Vim. +Drag'n'drop of URI lists is handled internally. + +8. Black hole register "_ *quote_* +When writing to this register, nothing happens. This can be used to delete +text without affecting the normal registers. When reading from this register, +nothing is returned. {not in Vi} + +9. Last search pattern register "/ *quote_/* *quote/* +Contains the most recent search-pattern. This is used for "n" and 'hlsearch'. +It is writable with ":let", you can change it to have 'hlsearch' highlight +other matches without actually searching. You can't yank or delete into this +register. {not in Vi} + + *@/* +You can write to a register with a ":let" command |:let-@|. Example: > + :let @/ = "the" + +If you use a put command without specifying a register, Vim uses the register +that was last filled (this is also the contents of the unnamed register). If +you are confused, use the ":dis" command to find out what Vim will put (this +command displays all named and numbered registers; the unnamed register is +labelled '"'). + +The next three commands always work on whole lines. + +:[range]co[py] {address} *:co* *:copy* + Copy the lines given by [range] to below the line + given by {address}. + + *:t* +:t Synonym for copy. + +:[range]m[ove] {address} *:m* *:mo* *:move* *E134* + Move the lines given by [range] to below the line + given by {address}. + +============================================================================== +6. Formatting text *formatting* + +:[range]ce[nter] [width] *:ce* *:center* + Center lines in [range] between [width] columns + (default 'textwidth' or 80 when 'textwidth' is 0). + {not in Vi} + Not available when |+ex_extra| feature was disabled at + compile time. + +:[range]ri[ght] [width] *:ri* *:right* + Right-align lines in [range] at [width] columns + (default 'textwidth' or 80 when 'textwidth' is 0). + {not in Vi} + Not available when |+ex_extra| feature was disabled at + compile time. + + *:le* *:left* +:[range]le[ft] [indent] + Left-align lines in [range]. Sets the indent in the + lines to [indent] (default 0). {not in Vi} + Not available when |+ex_extra| feature was disabled at + compile time. + + *gq* +gq{motion} Format the lines that {motion} moves over. + Formatting is done with one of three methods: + 1. If 'formatexpr' is not empty the expression is + evaluated. This can differ for each buffer. + 2. If 'formatprg' is not empty an external program + is used. + 3. Otherwise formatting is done internally. + + In the third case the 'textwidth' option controls the + length of each formatted line (see below). + If the 'textwidth' option is 0, the formatted line + length is the screen width (with a maximum width of + 79). + The 'formatoptions' option controls the type of + formatting |fo-table|. + The cursor is left on the first non-blank of the last + formatted line. + NOTE: The "Q" command formerly performed this + function. If you still want to use "Q" for + formatting, use this mapping: > + :nnoremap Q gq + +gqgq *gqgq* *gqq* +gqq Format the current line. {not in Vi} + + *v_gq* +{Visual}gq Format the highlighted text. (for {Visual} see + |Visual-mode|). {not in Vi} + + *gw* +gw{motion} Format the lines that {motion} moves over. Similar to + |gq| but puts the cursor back at the same position in + the text. However, 'formatprg' and 'formatexpr' are + not used. {not in Vi} + +gwgw *gwgw* *gww* +gww Format the current line as with "gw". {not in Vi} + + *v_gw* +{Visual}gw Format the highlighted text as with "gw". (for + {Visual} see |Visual-mode|). {not in Vi} + +Example: To format the current paragraph use: *gqap* > + gqap + +The "gq" command leaves the cursor in the line where the motion command takes +the cursor. This allows you to repeat formatting repeated with ".". This +works well with "gqj" (format current and next line) and "gq}" (format until +end of paragraph). Note: When 'formatprg' is set, "gq" leaves the cursor on +the first formatted line (as with using a filter command). + +If you want to format the current paragraph and continue where you were, use: > + gwap +If you always want to keep paragraphs formatted you may want to add the 'a' +flag to 'formatoptions'. See |auto-format|. + +If the 'autoindent' option is on, Vim uses the indent of the first line for +the following lines. + +Formatting does not change empty lines (but it does change lines with only +white space!). + +The 'joinspaces' option is used when lines are joined together. + +You can set the 'formatexpr' option to an expression or the 'formatprg' option +to the name of an external program for Vim to use for text formatting. The +'textwidth' and other options have no effect on formatting by an external +program. + + *right-justify* +There is no command in Vim to right justify text. You can do it with +an external command, like "par" (e.g.: "!}par" to format until the end of the +paragraph) or set 'formatprg' to "par". + + *format-comments* +Vim can format comments in a special way. Vim recognizes a comment by a +specific string at the start of the line (ignoring white space). Three types +of comments can be used: + +- A comment string that repeats at the start of each line. An example is the + type of comment used in shell scripts, starting with "#". +- A comment string that occurs only in the first line, not in the following + lines. An example is this list with dashes. +- Three-piece comments that have a start string, an end string, and optional + lines in between. The strings for the start, middle and end are different. + An example is the C-style comment: + /* + * this is a C comment + */ + +The 'comments' option is a comma-separated list of parts. Each part defines a +type of comment string. A part consists of: + {flags}:{string} + +{string} is the literal text that must appear. + +{flags}: + n Nested comment. Nesting with mixed parts is allowed. If 'comments' + is "n:),n:>" a line starting with "> ) >" is a comment. + + b Blank (, or ) required after {string}. + + f Only the first line has the comment string. Do not repeat comment on + the next line, but preserve indentation (e.g., a bullet-list). + + s Start of three-piece comment + + m Middle of a three-piece comment + + e End of a three-piece comment + + l Left adjust middle with start or end (default). Only recognized when + used together with 's' or 'e'. + + r Right adjust middle with start or end. Only recognized when used + together with 's' or 'e'. + + O Don't use this one for the "O" command. + + x Allows three-piece comments to be ended by just typing the last + character of the end-comment string as the first character on a new + line, when the middle-comment string has already been inserted + automatically. See below for more details. + + {digits} + When together with 's' or 'e': add extra indent for the middle part. + This can be used to left-align the middle part with the start or end + and then add an offset. + + -{digits} + Like {digits} but reduce the indent. This only works when there is + some indent for the start or end part that can be removed. + +When a string has none of the 'f', 's', 'm' or 'e' flags, Vim assumes the +comment string repeats at the start of each line. The flags field may be +empty. + +Any blank space in the text before and after the {string} is part of the +{string}, so do not include leading or trailing blanks unless the blanks are a +required part of the comment string. + +When one comment leader is part of another, specify the part after the whole. +For example, to include both "-" and "->", use > + :set comments=f:->,f:- + +A three-piece comment must always be given as start,middle,end, with no other +parts in between. An example of a three-piece comment is > + sr:/*,mb:*,ex:*/ +for C-comments. To avoid recognizing "*ptr" as a comment, the middle string +includes the 'b' flag. For three-piece comments, Vim checks the text after +the start and middle strings for the end string. If Vim finds the end string, +the comment does not continue on the next line. Three-piece comments must +have a middle string because otherwise Vim can't recognize the middle lines. + +Notice the use of the "x" flag in the above three-piece comment definition. +When you hit Return in a C-comment, Vim will insert the middle comment leader +for the new line, e.g. " * ". To close this comment you just have to type "/" +before typing anything else on the new line. This will replace the +middle-comment leader with the end-comment leader, leaving just " */". There +is no need to hit BackSpace first. + +Examples: > + "b:*" Includes lines starting with "*", but not if the "*" is + followed by a non-blank. This avoids a pointer dereference + like "*str" to be recognized as a comment. + "n:>" Includes a line starting with ">", ">>", ">>>", etc. + "fb:-" Format a list that starts with "- ". + +By default, "b:#" is included. This means that a line that starts with +"#include" is not recognized as a comment line. But a line that starts with +"# define" is recognized. This is a compromise. + +Often the alignment can be changed from right alignment to a left alignment +with an additional space. For example, for Javadoc comments, this can be +used (insert a backslash before the space when using ":set"): > + s1:/*,mb:*,ex:*/ +Note that an offset is included with start, so that the middle part is left +aligned with the start and then an offset of one character added. This makes +it possible to left align the start and middle for this construction: > + /** + * comment + */ + +{not available when compiled without the |+comments| feature} + + *fo-table* +You can use the 'formatoptions' option to influence how Vim formats text. +'formatoptions' is a string that can contain any of the letters below. The +default setting is "tcq". You can separate the option letters with commas for +readability. + +letter meaning when present in 'formatoptions' ~ + +t Auto-wrap text using textwidth (does not apply to comments) +c Auto-wrap comments using textwidth, inserting the current comment + leader automatically. +r Automatically insert the current comment leader after hitting + in Insert mode. +o Automatically insert the current comment leader after hitting 'o' or + 'O' in Normal mode. +q Allow formatting of comments with "gq". + Note that formatting will not change blank lines or lines containing + only the comment leader. A new paragraph starts after such a line, + or when the comment leader changes. +w Trailing white space indicates a paragraph continues in the next line. + A line that ends in a non-white character ends a paragraph. +a Automatic formatting of paragraphs. Every time text is inserted or + deleted the paragraph will be reformatted. See |auto-format|. + When the 'c' flag is present this only happens for recognized + comments. +n When formatting text, recognize numbered lists. This actually uses + the 'formatlistpat' option, thus any kind of list can be used. The + indent of the text after the number is used for the next line. The + default is to find a number, optionally be followed by '.', ':', ')', + ']' or '}'. Note that 'autoindent' must be set too. Doesn't work + well together with "2". + Example: > + 1. the first item + wraps + 2. the second item +2 When formatting text, use the indent of the second line of a paragraph + for the rest of the paragraph, instead of the indent of the first + line. This supports paragraphs in which the first line has a + different indent than the rest. Note that 'autoindent' must be set + too. Example: > + first line of a paragraph + second line of the same paragraph + third line. +v Vi-compatible auto-wrapping in insert mode: Only break a line at a + blank that you have entered during the current insert command. (Note: + this is not 100% Vi compatible. Vi has some "unexpected features" or + bugs in this area. It uses the screen column instead of the line + column.) +b Like 'v', but only auto-wrap if you enter a blank at or before + the wrap margin. If the line was longer than 'textwidth' when you + started the insert, or you do not enter a blank in the insert before + reaching 'textwidth', Vim does not perform auto-wrapping. +l Long lines are not broken in insert mode: When a line was longer than + 'textwidth' when the insert command started, Vim does not + automatically format it. +m Also break at a multi-byte character above 255. This is useful for + Asian text where every character is a word on its own. +M When joining lines, don't insert a space before or after a multi-byte + character. Overrules the 'B' flag. +B When joining lines, don't insert a space between two multi-byte + characters. Overruled by the 'M' flag. +1 Don't break a line after a one-letter word. It's broken before it + instead (if possible). + + +With 't' and 'c' you can specify when Vim performs auto-wrapping: +value action ~ +"" no automatic formatting (you can use "gq" for manual formatting) +"t" automatic formatting of text, but not comments +"c" automatic formatting for comments, but not text (good for C code) +"tc" automatic formatting for text and comments + +Note that when 'textwidth' is 0, Vim does no automatic formatting anyway (but +does insert comment leaders according to the 'comments' option). An exception +is when the 'a' flag is present. |auto-format| + +Note that when 'paste' is on, Vim does no formatting at all. + +Note that 'textwidth' can be non-zero even if Vim never performs auto-wrapping; +'textwidth' is still useful for formatting with "gq". + +If the 'comments' option includes "/*", "*" and/or "*/", then Vim has some +built in stuff to treat these types of comments a bit more cleverly. +Opening a new line before or after "/*" or "*/" (with 'r' or 'o' present in +'formatoptions') gives the correct start of the line automatically. The same +happens with formatting and auto-wrapping. Opening a line after a line +starting with "/*" or "*" and containing "*/", will cause no comment leader to +be inserted, and the indent of the new line is taken from the line containing +the start of the comment. +E.g.: + /* ~ + * Your typical comment. ~ + */ ~ + The indent on this line is the same as the start of the above + comment. + +All of this should be really cool, especially in conjunction with the new +:autocmd command to prepare different settings for different types of file. + +Some examples: + for C code (only format comments): > + :set fo=croq +< for Mail/news (format all, don't start comment with "o" command): > + :set fo=tcrq +< + +Automatic formatting *auto-format* + +When the 'a' flag is present in 'formatoptions' text is formatted +automatically when inserting text or deleting text. This works nice for +editing text paragraphs. A few hints on how to use this: + +- You need to properly define paragraphs. The simplest is paragraphs that are + separated by a blank line. When there is no separating blank line, consider + using the 'w' flag and adding a space at the end of each line in the + paragraphs except the last one. + +- You can set the 'formatoptions' based on the type of file |filetype| or + specifically for one file with a |modeline|. + +- Set 'formatoptions' to "aw2tq" to make text with indents like this: + + bla bla foobar bla + bla foobar bla foobar bla + bla bla foobar bla + bla foobar bla bla foobar + +- Add the 'c' flag to only auto-format comments. Useful in source code. + +- Set 'textwidth' to the desired width. If it is zero then 79 is used, or the + width of the screen if this is smaller. + +And a few warnings: + +- When part of the text is not properly separated in paragraphs, making + changes in this text will cause it to be formatted anyway. Consider doing > + + :set fo-=a + +- When using the 'w' flag (trailing space means paragraph continues) and + deleting the last line of a paragraph with |dd|, the paragraph will be + joined with the next one. + +- Changed text is saved for undo. Formatting is also a change. Thus each + format action saves text for undo. This may consume quite a lot of memory. + +- Formatting a long paragraph and/or with complicated indenting may be slow. + +============================================================================== +7. Sorting text *sorting* + +Vim has a sorting function and a sorting command. The sorting function can be +found here: |sort()|. + + *:sor* *:sort* +:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/] + Sort lines in [range]. When no range is given all + lines are sorted. + + With [!] the order is reversed. + + With [i] case is ignored. + + With [n] sorting is done on the first decimal number + in the line (after or inside a {pattern} match). + + With [x] sorting is done on the first hexadecimal + number in the line (after or inside a {pattern} + match). A leading "0x" or "0X" is ignored. + + With [o] sorting is done on the first octal number in + the line (after or inside a {pattern} match). + + With [u] only keep the first of a sequence of + identical lines (ignoring case when [i] is used). + Without this flag, a sequence of identical lines + will be kept in their original order. + Note that leading and trailing white space may cause + lines to be different. + + When /{pattern}/ is specified and there is no [r] flag + the text matched with {pattern} is skipped, so that + you sort on what comes after the match. + Instead of the slash any non-letter can be used. + For example, to sort on the second comma-separated + field: > + :sort /[^,]*,/ +< To sort on the text at virtual column 10 (thus + ignoring the difference between tabs and spaces): > + :sort /.*\%10v/ +< To sort on the first number in the line, no matter + what is in front of it: > + :sort /.*\ze\d/ + +< With [r] sorting is done on the matching {pattern} + instead of skipping past it as described above. + For example, to sort on only the first three letters + of each line: > + :sort /\a\a\a/ r + +< If a {pattern} is used, any lines which don't have a + match for {pattern} are kept in their current order, + but separate from the lines which do match {pattern}. + If you sorted in reverse, they will be in reverse + order after the sorted lines, otherwise they will be + in their original order, right before the sorted + lines. + +Note that using ":sort" with ":global" doesn't sort the matching lines, it's +quite useless. + +The details about sorting depend on the library function used. There is no +guarantee that sorting is "stable" or obeys the current locale. You will have +to try it out. + +The sorting can be interrupted, but if you interrupt it too late in the +process you may end up with duplicated lines. This also depends on the system +library function used. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/cmdline.txt b/Aufgabe5/doc.lang/cmdline.txt new file mode 100644 index 0000000..414ef42 --- /dev/null +++ b/Aufgabe5/doc.lang/cmdline.txt @@ -0,0 +1,1048 @@ +*cmdline.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + + *Cmdline-mode* *Command-line-mode* +Command-line mode *Cmdline* *Command-line* *mode-cmdline* *:* + +Command-line mode is used to enter Ex commands (":"), search patterns +("/" and "?"), and filter commands ("!"). + +Basic command line editing is explained in chapter 20 of the user manual +|usr_20.txt|. + +1. Command-line editing |cmdline-editing| +2. Command-line completion |cmdline-completion| +3. Ex command-lines |cmdline-lines| +4. Ex command-line ranges |cmdline-ranges| +5. Ex command-line flags |ex-flags| +6. Ex special characters |cmdline-special| +7. Command-line window |cmdline-window| + +============================================================================== +1. Command-line editing *cmdline-editing* + +Normally characters are inserted in front of the cursor position. You can +move around in the command-line with the left and right cursor keys. With the + key, you can toggle between inserting and overstriking characters. +{Vi: can only alter the last character in the line} + +Note that if your keyboard does not have working cursor keys or any of the +other special keys, you can use ":cnoremap" to define another key for them. +For example, to define tcsh style editing keys: *tcsh-style* > + :cnoremap + :cnoremap + :cnoremap + :cnoremap b + :cnoremap f +(<> notation |<>|; type all this literally) + + *cmdline-too-long* +When the command line is getting longer than what fits on the screen, only the +part that fits will be shown. The cursor can only move in this visible part, +thus you cannot edit beyond that. + + *cmdline-history* *history* +The command-lines that you enter are remembered in a history table. You can +recall them with the up and down cursor keys. There are actually five +history tables: +- one for ':' commands +- one for search strings +- one for expressions +- one for input lines, typed for the |input()| function. +- one for debug mode commands +These are completely separate. Each history can only be accessed when +entering the same type of line. +Use the 'history' option to set the number of lines that are remembered +(default: 20). +Notes: +- When you enter a command-line that is exactly the same as an older one, the + old one is removed (to avoid repeated commands moving older commands out of + the history). +- Only commands that are typed are remembered. Ones that completely come from + mappings are not put in the history +- All searches are put in the search history, including the ones that come + from commands like "*" and "#". But for a mapping, only the last search is + remembered (to avoid that long mappings trash the history). +{Vi: no history} +{not available when compiled without the |+cmdline_hist| feature} + +There is an automatic completion of names on the command-line; see +|cmdline-completion|. + + *c_CTRL-V* +CTRL-V Insert next non-digit literally. Up to three digits form the + decimal value of a single byte. The non-digit and the three + digits are not considered for mapping. This works the same + way as in Insert mode (see above, |i_CTRL-V|). + Note: Under Windows CTRL-V is often mapped to paste text. + Use CTRL-Q instead then. + *c_CTRL-Q* +CTRL-Q Same as CTRL-V. But with some terminals it is used for + control flow, it doesn't work then. + + *c_* + cursor left + *c_* + cursor right + *c_* + or *c_* + cursor one WORD left + *c_* + or *c_* + cursor one WORD right +CTRL-B or *c_CTRL-B* *c_* + cursor to beginning of command-line +CTRL-E or *c_CTRL-E* *c_* + cursor to end of command-line + + *c_* + cursor to position of mouse click. + +CTRL-H *c_* *c_CTRL-H* + delete the character in front of the cursor (see |:fixdel| if + your key does not do what you want). + *c_* + delete the character under the cursor (at end of line: + character before the cursor) (see |:fixdel| if your + key does not do what you want). + *c_CTRL-W* +CTRL-W delete the word before the cursor + *c_CTRL-U* +CTRL-U remove all characters between the cursor position and + the beginning of the line. Previous versions of vim + deleted all characters on the line. If that is the + preferred behavior, add the following to your .vimrc: > + :cnoremap +< + Note: if the command-line becomes empty with one of the + delete commands, Command-line mode is quit. + *c_* + Toggle between insert and overstrike. {not in Vi} + +{char1} {char2} or *c_digraph* +CTRL-K {char1} {char2} *c_CTRL-K* + enter digraph (see |digraphs|). When {char1} is a special + key, the code for that key is inserted in <> form. {not in Vi} + +CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_* + Insert the contents of a numbered or named register. Between + typing CTRL-R and the second character '"' will be displayed + to indicate that you are expected to enter the name of a + register. + The text is inserted as if you typed it, but mappings and + abbreviations are not used. Command-line completion through + 'wildchar' is not triggered though. And characters that end + the command line are inserted literally (, , , + ). A or CTRL-W could still end the command line + though, and remaining characters will then be interpreted in + another mode, which might not be what you intended. + Special registers: + '"' the unnamed register, containing the text of + the last delete or yank + '%' the current file name + '#' the alternate file name + '*' the clipboard contents (X11: primary selection) + '+' the clipboard contents + '/' the last search pattern + ':' the last command-line + '-' the last small (less than a line) delete + '.' the last inserted text + *c_CTRL-R_=* + '=' the expression register: you are prompted to + enter an expression (see |expression|) + (doesn't work at the expression prompt; some + things such as changing the buffer or current + window are not allowed to avoid side effects) + See |registers| about registers. {not in Vi} + Implementation detail: When using the |expression| register + and invoking setcmdpos(), this sets the position before + inserting the resulting string. Use CTRL-R CTRL-R to set the + position afterwards. + +CTRL-R CTRL-F *c_CTRL-R_CTRL-F* *c__* +CTRL-R CTRL-P *c_CTRL-R_CTRL-P* *c__* +CTRL-R CTRL-W *c_CTRL-R_CTRL-W* *c__* +CTRL-R CTRL-A *c_CTRL-R_CTRL-A* *c__* + Insert the object under the cursor: + CTRL-F the Filename under the cursor + CTRL-P the Filename under the cursor, expanded with + 'path' as in |gf| + CTRL-W the Word under the cursor + CTRL-A the WORD under the cursor; see |WORD| + + When 'incsearch' is set the cursor position at the end of the + currently displayed match is used. With CTRL-W the part of + the word that was already typed is not inserted again. + + {not in Vi} + CTRL-F and CTRL-P: {only when +file_in_path feature is + included} + + *c_CTRL-R_CTRL-R* *c__* + *c_CTRL-R_CTRL-O* *c__* +CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A} +CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A} + Insert register or object under the cursor. Works like + |c_CTRL-R| but inserts the text literally. For example, if + register a contains "xy^Hz" (where ^H is a backspace), + "CTRL-R a" will insert "xz" while "CTRL-R CTRL-R a" will + insert "xy^Hz". + +CTRL-\ e {expr} *c_CTRL-\_e* + Evaluate {expr} and replace the whole command line with the + result. You will be prompted for the expression, type + to finish it. It's most useful in mappings though. See + |expression|. + See |c_CTRL-R_=| for inserting the result of an expression. + Useful functions are |getcmdtype()|, |getcmdline()| and + |getcmdpos()|. + The cursor position is unchanged, except when the cursor was + at the end of the line, then it stays at the end. + |setcmdpos()| can be used to set the cursor position. + The |sandbox| is used for evaluating the expression to avoid + nasty side effects. + Example: > + :cmap eAppendSome() + :func AppendSome() + :let cmd = getcmdline() . " Some()" + :" place the cursor on the ) + :call setcmdpos(strlen(cmd)) + :return cmd + :endfunc +< This doesn't work recursively, thus not when already editing + an expression. + + *c_CTRL-Y* +CTRL-Y When there is a modeless selection, copy the selection into + the clipboard. |modeless-selection| + If there is no selection CTRL-Y is inserted as a character. + +CTRL-J *c_CTRL-J* *c_* *c_* + or start entered command + *c_* + When typed and 'x' not present in 'cpoptions', quit + Command-line mode without executing. In macros or when 'x' + present in 'cpoptions', start entered command. + *c_CTRL-C* +CTRL-C quit command-line without executing + + *c_* + recall older command-line from history, whose beginning + matches the current command-line (see below). + {not available when compiled without the |+cmdline_hist| + feature} + *c_* + recall more recent command-line from history, whose beginning + matches the current command-line (see below). + {not available when compiled without the |+cmdline_hist| + feature} + + *c_* *c_* + or + recall older command-line from history + {not available when compiled without the |+cmdline_hist| + feature} + *c_* *c_* + or + recall more recent command-line from history + {not available when compiled without the |+cmdline_hist| + feature} + +CTRL-D command-line completion (see |cmdline-completion|) +'wildchar' option + command-line completion (see |cmdline-completion|) +CTRL-N command-line completion (see |cmdline-completion|) +CTRL-P command-line completion (see |cmdline-completion|) +CTRL-A command-line completion (see |cmdline-completion|) +CTRL-L command-line completion (see |cmdline-completion|) + + *c_CTRL-_* +CTRL-_ a - switch between Hebrew and English keyboard mode, which is + private to the command-line and not related to hkmap. + This is useful when Hebrew text entry is required in the + command-line, searches, abbreviations, etc. Applies only if + Vim is compiled with the |+rightleft| feature and the + 'allowrevins' option is set. + See |rileft.txt|. + + b - switch between Farsi and English keyboard mode, which is + private to the command-line and not related to fkmap. In + Farsi keyboard mode the characters are inserted in reverse + insert manner. This is useful when Farsi text entry is + required in the command-line, searches, abbreviations, etc. + Applies only if Vim is compiled with the |+farsi| feature. + See |farsi.txt|. + + *c_CTRL-^* +CTRL-^ Toggle the use of language |:lmap| mappings and/or Input + Method. + When typing a pattern for a search command and 'imsearch' is + not -1, VAL is the value of 'imsearch', otherwise VAL is the + value of 'iminsert'. + When language mappings are defined: + - If VAL is 1 (langmap mappings used) it becomes 0 (no langmap + mappings used). + - If VAL was not 1 it becomes 1, thus langmap mappings are + enabled. + When no language mappings are defined: + - If VAL is 2 (Input Method is used) it becomes 0 (no input + method used) + - If VAL has another value it becomes 2, thus the Input Method + is enabled. + These language mappings are normally used to type characters + that are different from what the keyboard produces. The + 'keymap' option can be used to install a whole number of them. + When entering a command line, langmap mappings are switched + off, since you are expected to type a command. After + switching it on with CTRL-^, the new state is not used again + for the next command or Search pattern. + {not in Vi} + +For Emacs-style editing on the command-line see |emacs-keys|. + +The and keys take the current command-line as a search string. +The beginning of the next/previous command-lines are compared with this +string. The first line that matches is the new command-line. When typing +these two keys repeatedly, the same string is used again. For example, this +can be used to find the previous substitute command: Type ":s" and then . +The same could be done by typing a number of times until the desired +command-line is shown. (Note: the shifted arrow keys do not work on all +terminals) + + *his* *:history* +:his[tory] Print the history of last entered commands. + {not in Vi} + {not available when compiled without the |+cmdline_hist| + feature} + +:his[tory] [{name}] [{first}][, [{last}]] + List the contents of history {name} which can be: + c[md] or : command-line history + s[earch] or / search string history + e[xpr] or = expression register history + i[nput] or @ input line history + d[ebug] or > debug command history + a[ll] all of the above + {not in Vi} + + If the numbers {first} and/or {last} are given, the respective + range of entries from a history is listed. These numbers can + be specified in the following form: + *:history-indexing* + A positive number represents the absolute index of an entry + as it is given in the first column of a :history listing. + This number remains fixed even if other entries are deleted. + + A negative number means the relative position of an entry, + counted from the newest entry (which has index -1) backwards. + + Examples: + List entries 6 to 12 from the search history: > + :history / 6,12 +< + List the recent five entries from all histories: > + :history all -5, + +============================================================================== +2. Command-line completion *cmdline-completion* + +When editing the command-line, a few commands can be used to complete the +word before the cursor. This is available for: + +- Command names: At the start of the command-line. +- Tags: Only after the ":tag" command. +- File names: Only after a command that accepts a file name or a setting for + an option that can be set to a file name. This is called file name + completion. +- Shell command names: After ":!cmd", ":r !cmd" and ":w !cmd". $PATH is used. +- Options: Only after the ":set" command. +- Mappings: Only after a ":map" or similar command. +- Variable and function names: Only after a ":if", ":call" or similar command. + +When Vim was compiled with the |+cmdline_compl| feature disabled, only file +names, directories and help items can be completed. + +These are the commands that can be used: + + *c_CTRL-D* +CTRL-D List names that match the pattern in front of the cursor. + When showing file names, directories are highlighted (see + 'highlight' option). Names where 'suffixes' matches are moved + to the end. + The 'wildoptions' option can be set to "tagfile" to list the + file of matching tags. + *c_CTRL-I* *c_wildchar* *c_* +'wildchar' option + A match is done on the pattern in front of the cursor. The + match (if there are several, the first match) is inserted + in place of the pattern. (Note: does not work inside a + macro, because or are mostly used as 'wildchar', + and these have a special meaning in some macros.) When typed + again and there were multiple matches, the next + match is inserted. After the last match, the first is used + again (wrap around). + The behavior can be changed with the 'wildmode' option. + *c_CTRL-N* +CTRL-N After using 'wildchar' which got multiple matches, go to next + match. Otherwise recall more recent command-line from history. + *c_CTRL-P* *c_* +CTRL-P After using 'wildchar' which got multiple matches, go to + previous match. Otherwise recall older command-line from + history. only works with the GUI, on the Amiga and + with MS-DOS. + *c_CTRL-A* +CTRL-A All names that match the pattern in front of the cursor are + inserted. + *c_CTRL-L* +CTRL-L A match is done on the pattern in front of the cursor. If + there is one match, it is inserted in place of the pattern. + If there are multiple matches the longest common part is + inserted in place of the pattern. If the result is shorter + than the pattern, no completion is done. + When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-L will add + one character from the end of the current match. + +The 'wildchar' option defaults to (CTRL-E when in Vi compatible mode; in +a previous version was used). In the pattern standard wildcards '*' and +'?' are accepted. '*' matches any string, '?' matches exactly one character. + +If you like tcsh's autolist completion, you can use this mapping: + :cnoremap X +(Where X is the command key to use, is CTRL-L and is CTRL-D) +This will find the longest match and then list all matching files. + +If you like tcsh's autolist completion, you can use the 'wildmode' option to +emulate it. For example, this mimics autolist=ambiguous: + :set wildmode=longest,list +This will find the longest match with the first 'wildchar', then list all +matching files with the next. + + *suffixes* +For file name completion you can use the 'suffixes' option to set a priority +between files with almost the same name. If there are multiple matches, +those files with an extension that is in the 'suffixes' option are ignored. +The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending +in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored. +It is impossible to ignore suffixes with two dots. Examples: + + pattern: files: match: ~ + test* test.c test.h test.o test.c + test* test.h test.o test.h and test.o + test* test.i test.h test.c test.i and test.c + +If there is more than one matching file (after ignoring the ones matching +the 'suffixes' option) the first file name is inserted. You can see that +there is only one match when you type 'wildchar' twice and the completed +match stays the same. You can get to the other matches by entering +'wildchar', CTRL-N or CTRL-P. All files are included, also the ones with +extensions matching the 'suffixes' option. + +To completely ignore files with some extension use 'wildignore'. + +The old value of an option can be obtained by hitting 'wildchar' just after +the '='. For example, typing 'wildchar' after ":set dir=" will insert the +current value of 'dir'. This overrules file name completion for the options +that take a file name. + +If you would like using for CTRL-P in an xterm, put this command in +your .cshrc: > + xmodmap -e "keysym Tab = Tab Find" +And this in your .vimrc: > + :cmap [1~ + +============================================================================== +3. Ex command-lines *cmdline-lines* + +The Ex commands have a few specialties: + + *:quote* +'"' at the start of a line causes the whole line to be ignored. '"' +after a command causes the rest of the line to be ignored. This can be used +to add comments. Example: > + :set ai "set 'autoindent' option +It is not possible to add a comment to a shell command ":!cmd" or to the +":map" command and friends, because they see the '"' as part of their +argument. + + *:bar* *:\bar* +'|' can be used to separate commands, so you can give multiple commands in one +line. If you want to use '|' in an argument, precede it with '\'. + +These commands see the '|' as their argument, and can therefore not be +followed by another command: + :argdo + :autocmd + :bufdo + :command + :cscope + :debug + :folddoopen + :folddoclosed + :function + :global + :help + :helpfind + :lcscope + :make + :normal + :perl + :perldo + :promptfind + :promptrepl + :pyfile + :python + :registers + :read ! + :scscope + :tcl + :tcldo + :tclfile + :vglobal + :windo + :write ! + :[range]! + a user defined command without the "-bar" argument |:command| + +Note that this is confusing (inherited from Vi): With ":g" the '|' is included +in the command, with ":s" it is not. + +To be able to use another command anyway, use the ":execute" command. +Example (append the output of "ls" and jump to the first line): > + :execute 'r !ls' | '[ + +There is one exception: When the 'b' flag is present in 'cpoptions', with the +":map" and ":abbr" commands and friends CTRL-V needs to be used instead of +'\'. You can also use "" instead. See also |map_bar|. + +Examples: > + :!ls | wc view the output of two commands + :r !ls | wc insert the same output in the text + :%g/foo/p|> moves all matching lines one shiftwidth + :%s/foo/bar/|> moves one line one shiftwidth + :map q 10^V| map "q" to "10|" + :map q 10\| map \ l map "q" to "10\" and map "\" to "l" + (when 'b' is present in 'cpoptions') + +You can also use to separate commands in the same way as with '|'. To +insert a use CTRL-V CTRL-J. "^@" will be shown. Using '|' is the +preferred method. But for external commands a must be used, because a +'|' is included in the external command. To avoid the special meaning of +it must be preceded with a backslash. Example: > + :r !date-join +This reads the current date into the file and joins it with the previous line. + +Note that when the command before the '|' generates an error, the following +commands will not be executed. + + +Because of Vi compatibility the following strange commands are supported: > + :| print current line (like ":p") + :3| print line 3 (like ":3p") + :3 goto line 3 + +A colon is allowed between the range and the command name. It is ignored +(this is Vi compatible). For example: > + :1,$:s/pat/string + +When the character '%' or '#' is used where a file name is expected, they are +expanded to the current and alternate file name (see the chapter "editing +files" |:_%| |:_#|). + +Embedded spaces in file names are allowed on the Amiga if one file name is +expected as argument. Trailing spaces will be ignored, unless escaped with a +backslash or CTRL-V. Note that the ":next" command uses spaces to separate +file names. Escape the spaces to include them in a file name. Example: > + :next foo\ bar goes\ to school\ +starts editing the three files "foo bar", "goes to" and "school ". + +When you want to use the special characters '"' or '|' in a command, or want +to use '%' or '#' in a file name, precede them with a backslash. The +backslash is not required in a range and in the ":substitute" command. + + *:_!* +The '!' (bang) character after an Ex command makes the command behave in a +different way. The '!' should be placed immediately after the command, without +any blanks in between. If you insert blanks the '!' will be seen as an +argument for the command, which has a different meaning. For example: + :w! name write the current buffer to file "name", overwriting + any existing file + :w !name send the current buffer as standard input to command + "name" + +============================================================================== +4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* + +Some Ex commands accept a line range in front of them. This is noted as +[range]. It consists of one or more line specifiers, separated with ',' or +';'. + +The basics are explained in section |10.3| of the user manual. + + *:,* *:;* +When separated with ';' the cursor position will be set to that line +before interpreting the next line specifier. This doesn't happen for ','. +Examples: > + 4,/this line/ +< from line 4 till match with "this line" after the cursor line. > + 5;/that line/ +< from line 5 till match with "that line" after line 5. + +The default line specifier for most commands is the cursor position, but the +commands ":write" and ":global" have the whole file (1,$) as default. + +If more line specifiers are given than required for the command, the first +one(s) will be ignored. + +Line numbers may be specified with: *:range* *E14* *{address}* + {number} an absolute line number + . the current line *:.* + $ the last line in the file *:$* + % equal to 1,$ (the entire file) *:%* + 't position of mark t (lowercase) *:'* + 'T position of mark T (uppercase); when the mark is in + another file it cannot be used in a range + /{pattern}[/] the next line where {pattern} matches *:/* + ?{pattern}[?] the previous line where {pattern} matches *:?* + \/ the next line where the previously used search + pattern matches + \? the previous line where the previously used search + pattern matches + \& the next line where the previously used substitute + pattern matches + +Each may be followed (several times) by '+' or '-' and an optional number. +This number is added or subtracted from the preceding line number. If the +number is omitted, 1 is used. + +The "/" and "?" after {pattern} are required to separate the pattern from +anything that follows. + +The "/" and "?" may be preceded with another address. The search starts from +there. The difference from using ';' is that the cursor isn't moved. +Examples: > + /pat1//pat2/ Find line containing "pat2" after line containing + "pat1", without moving the cursor. + 7;/pat2/ Find line containing "pat2", after line 7, leaving + the cursor in line 7. + +The {number} must be between 0 and the number of lines in the file. When +using a 0 (zero) this is interpreted as a 1 by most commands. Commands that +use it as a count do use it as a zero (|:tag|, |:pop|, etc). Some commands +interpret the zero as "before the first line" (|:read|, search pattern, etc). + +Examples: > + .+3 three lines below the cursor + /that/+1 the line below the next line containing "that" + .,$ from current line until end of file + 0;/that the first line containing "that", also matches in the + first line. + 1;/that the first line after line 1 containing "that" + +Some commands allow for a count after the command. This count is used as the +number of lines to be used, starting with the line given in the last line +specifier (the default is the cursor line). The commands that accept a count +are the ones that use a range but do not have a file name argument (because +a file name can also be a number). + +Examples: > + :s/x/X/g 5 substitute 'x' by 'X' in the current line and four + following lines + :23d 4 delete lines 23, 24, 25 and 26 + + +Folds and Range + +When folds are active the line numbers are rounded off to include the whole +closed fold. See |fold-behavior|. + + +Reverse Range *E493* + +A range should have the lower line number first. If this is not the case, Vim +will ask you if it should swap the line numbers. + Backwards range given, OK to swap ~ +This is not done within the global command ":g". + +You can use ":silent" before a command to avoid the question, the range will +always be swapped then. + + +Count and Range *N:* + +When giving a count before entering ":", this is translated into: + :.,.+(count - 1) +In words: The 'count' lines at and after the cursor. Example: To delete +three lines: > + 3:d is translated into: .,.+2d +< + +Visual Mode and Range *v_:* + +{Visual}: Starts a command-line with the Visual selected lines as a + range. The code ":'<,'>" is used for this range, which makes + it possible to select a similar line from the command-line + history for repeating a command on different Visually selected + lines. + +============================================================================== +5. Ex command-line flags *ex-flags* + +These flags are supported by a selection of Ex commands. They print the line +that the cursor ends up after executing the command: + + l output like for |:list| + # add line number + p output like for |:print| + +The flags can be combined, thus "l#" uses both a line number and |:list| style +output. + +============================================================================== +6. Ex special characters *cmdline-special* + +Note: These are special characters in the executed command line. If you want +to insert special things while typing you can use the CTRL-R command. For +example, "%" stands for the current file name, while CTRL-R % inserts the +current file name right away. See |c_CTRL-R|. + + +In Ex commands, at places where a file name can be used, the following +characters have a special meaning. These can also be used in the expression +function expand() |expand()|. + % is replaced with the current file name *:_%* + # is replaced with the alternate file name *:_#* + #n (where n is a number) is replaced with the file name of + buffer n. "#0" is the same as "#" + ## is replaced with all names in the argument list *:_##* + concatenated, separated by spaces. Each space in a name + is preceded with a backslash. +Note that these give the file name as it was typed. If an absolute path is +needed (when using the file name from a different directory), you need to add +":p". See |filename-modifiers|. +Note that backslashes are inserted before spaces, so that the command will +correctly interpret the file name. But this doesn't happen for shell +commands. For those you probably have to use quotes: > + :!ls "%" + :r !spell "%" + +To avoid the special meaning of '%' and '#' insert a backslash before it. +Detail: The special meaning is always escaped when there is a backslash before +it, no matter how many backslashes. + you type: result ~ + # alternate.file + \# # + \\# \# + + *:* *:* *:* ** + *:* ** *:* ** + *:* ** *:* ** + *E495* *E496* *E497* *E498* *E499* *E500* +Note: these are typed literally, they are not special keys! + is replaced with the word under the cursor (like |star|) + is replaced with the WORD under the cursor (see |WORD|) + is replaced with the path name under the cursor (like what + |gf| uses) + when executing autocommands, is replaced with the file name + for a file read or write + when executing autocommands, is replaced with the currently + effective buffer number (for ":r file" and ":so file" it is + the current buffer, the file being read/sourced is not in a + buffer). + when executing autocommands, is replaced with the match for + which this autocommand was executed. It differs from + only when the file name isn't used to match with + (for FileType, Syntax and SpellFileMissing events). + when executing a ":source" command, is replaced with the + file name of the sourced file; + when executing a function, is replaced with + "function {function-name}"; function call nesting is + indicated like this: + "function {function-name1}..{function-name2}". Note that + filename-modifiers are useless when is used inside + a function. + + *filename-modifiers* + *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* +The file name modifiers can be used after "%", "#", "#n", "", "", +"" or "". They are also used with the |fnamemodify()| function. +These are not available when Vim has been compiled without the |+modify_fname| +feature. +These modifiers can be given, in this order: + :p Make file name a full path. Must be the first modifier. Also + changes "~/" (and "~user/" for Unix and VMS) to the path for + the home directory. If the name is a directory a path + separator is added at the end. For a file name that does not + exist and does not have an absolute path the result is + unpredictable. + :8 Converts the path to 8.3 short format (currently only on + win32). Will act on as much of a path that is an existing + path. + :~ Reduce file name to be relative to the home directory, if + possible. File name is unmodified if it is not below the home + directory. + :. Reduce file name to be relative to current directory, if + possible. File name is unmodified if it is not below the + current directory. + For maximum shortness, use ":~:.". + :h Head of the file name (the last component and any separators + removed). Cannot be used with :e, :r or :t. + Can be repeated to remove several components at the end. + When the file name ends in a path separator, only the path + separator is removed. Thus ":p:h" on a directory name results + on the directory name itself (without trailing slash). + When the file name is an absolute path (starts with "/" for + Unix; "x:\" for MS-DOS, WIN32, OS/2; "drive:" for Amiga), that + part is not removed. When there is no head (path is relative + to current directory) the result is empty. + :t Tail of the file name (last component of the name). Must + precede any :r or :e. + :r Root of the file name (the last extension removed). When + there is only an extension (file name that starts with '.', + e.g., ".vimrc"), it is not removed. Can be repeated to remove + several extensions (last one first). + :e Extension of the file name. Only makes sense when used alone. + When there is no extension the result is empty. + When there is only an extension (file name that starts with + '.'), the result is empty. Can be repeated to include more + extensions. If there are not enough extensions (but at least + one) as much as possible are included. + :s?pat?sub? + Substitute the first occurrence of "pat" with "sub". This + works like the |:s| command. "pat" is a regular expression. + Any character can be used for '?', but it must not occur in + "pat" or "sub". + After this, the previous modifiers can be used again. For + example ":p", to make a full path after the substitution. + :gs?pat?sub? + Substitute all occurrences of "path" with "sub". Otherwise + this works like ":s". + +Examples, when the file name is "src/version.c", current dir +"/home/mool/vim": > + :p /home/mool/vim/src/version.c + :p:. src/version.c + :p:~ ~/vim/src/version.c + :h src + :p:h /home/mool/vim/src + :p:h:h /home/mool/vim + :t version.c + :p:t version.c + :r src/version + :p:r /home/mool/vim/src/version + :t:r version + :e c + :s?version?main? src/main.c + :s?version?main?:p /home/mool/vim/src/main.c + :p:gs?/?\\? \home\mool\vim\src\version.c + +Examples, when the file name is "src/version.c.gz": > + :p /home/mool/vim/src/version.c.gz + :e gz + :e:e c.gz + :e:e:e c.gz + :e:e:r c + :r src/version.c + :r:e c + :r:r src/version + :r:r:r src/version +< + *extension-removal* *:_%<* +If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file +name is removed (everything after and including the last '.' in the file +name). This is included for backwards compatibility with version 3.0, the +":r" form is preferred. Examples: > + + % current file name + %< current file name without extension + # alternate file name for current window + #< idem, without extension + #31 alternate file number 31 + #31< idem, without extension + word under the cursor + WORD under the cursor (see |WORD|) + path name under the cursor + < idem, without extension + +Note: Where a file name is expected wildcards expansion is done. On Unix the +shell is used for this, unless it can be done internally (for speed). +Backticks also work, like in > + :n `echo *.c` +(backtick expansion is not possible in |restricted-mode|) +But expansion is only done if there are any wildcards before expanding the +'%', '#', etc.. This avoids expanding wildcards inside a file name. If you +want to expand the result of , add a wildcard character to it. +Examples: (alternate file name is "?readme?") + command expands to ~ + :e # :e ?readme? + :e `ls #` :e {files matching "?readme?"} + :e #.* :e {files matching "?readme?.*"} + :cd :cd {file name under cursor} + :cd * :cd {file name under cursor plus "*" and then expanded} + +When the expanded argument contains a "!" and it is used for a shell command +(":!cmd", ":r !cmd" or ":w !cmd"), it is escaped with a backslash to avoid it +being expanded into a previously used command. When the 'shell' option +contains "sh", this is done twice, to avoid the shell trying to expand the +"!". + + *filename-backslash* +For filesystems that use a backslash as directory separator (MS-DOS, Windows, +OS/2), it's a bit difficult to recognize a backslash that is used to escape +the special meaning of the next character. The general rule is: If the +backslash is followed by a normal file name character, it does not have a +special meaning. Therefore "\file\foo" is a valid file name, you don't have +to type the backslash twice. + +An exception is the '$' sign. It is a valid character in a file name. But +to avoid a file name like "$home" to be interpreted as an environment variable, +it needs to be preceded by a backslash. Therefore you need to use "/\$home" +for the file "$home" in the root directory. A few examples: + + FILE NAME INTERPRETED AS ~ + $home expanded to value of environment var $home + \$home file "$home" in current directory + /\$home file "$home" in root directory + \\$home file "\\", followed by expanded $home + +============================================================================== +6. Command-line window *cmdline-window* *cmdwin* + +In the command-line window the command line can be edited just like editing +text in any window. It is a special kind of window, because you cannot leave +it in a normal way. +{not available when compiled without the |+cmdline_hist| or |+vertsplit| +feature} + + +OPEN + +There are two ways to open the command-line window: +1. From Command-line mode, use the key specified with the 'cedit' option. + The default is CTRL-F when 'compatible' is not set. +2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?* + This starts editing an Ex command-line ("q:") or search string ("q/" or + "q?"). Note that this is not possible while recording is in progress (the + "q" stops recording then). + +When the window opens it is filled with the command-line history. The last +line contains the command as typed so far. The left column will show a +character that indicates the type of command-line being edited, see +|cmdwin-char|. + +Vim will be in Normal mode when the editor is opened, except when 'insertmode' +is set. + +The height of the window is specified with 'cmdwinheight' (or smaller if there +is no room). The window is always full width and is positioned just above the +command-line. + + +EDIT + +You can now use commands to move around and edit the text in the window. Both +in Normal mode and Insert mode. + +It is possible to use ":", "/" and other commands that use the command-line, +but it's not possible to open another command-line window then. There is no +nesting. + *E11* +The command-line window is not a normal window. It is not possible to move to +another window or edit another buffer. All commands that would do this are +disabled in the command-line window. Of course it _is_ possible to execute +any command that you entered in the command-line window. + + +CLOSE *E199* + +There are several ways to leave the command-line window: + + Execute the command-line under the cursor. Works both in + Insert and in Normal mode. +CTRL-C Continue in Command-line mode. The command-line under the + cursor is used as the command-line. Works both in Insert and + in Normal mode. ":close" also works. There is no redraw, + thus the window will remain visible. +:quit Discard the command line and go back to Normal mode. + ":exit", ":xit" and CTRL-\ CTRL-N also work. +:qall Quit Vim, unless there are changes in some buffer. +:qall! Quit Vim, discarding changes to any buffer. + +Once the command-line window is closed the old window sizes are restored. The +executed command applies to the window and buffer where the command-line was +started from. This works as if the command-line window was not there, except +that there will be an extra screen redraw. +The buffer used for the command-line window is deleted. Any changes to lines +other than the one that is executed with are lost. + +If you would like to execute the command under the cursor and then have the +command-line window open again, you may find this mapping useful: > + + :map q: + + +VARIOUS + +The command-line window cannot be used: +- when there already is a command-line window (no nesting) +- for entering a encryption key or when using inputsecret() +- when Vim was not compiled with the +vertsplit feature + +Some options are set when the command-line window is opened: +'filetype' "vim", when editing an Ex command-line; this starts Vim syntax + highlighting if it was enabled +'rightleft' off +'modifiable' on +'buftype' "nofile" +'swapfile' off + +It is allowed to write the buffer contents to a file. This is an easy way to +save the command-line history and read it back later. + +If the 'wildchar' option is set to , and the command-line window is used +for an Ex command, then two mappings will be added to use for completion +in the command-line window, like this: > + :imap + :nmap a +Note that hitting in Normal mode will do completion on the next +character. That way it works at the end of the line. +If you don't want these mappings, disable them with: > + au CmdwinEnter [:>] iunmap + au CmdwinEnter [:>] nunmap +You could put these lines in your vimrc file. + +While in the command-line window you cannot use the mouse to put the cursor in +another window, or drag statuslines of other windows. You can drag the +statusline of the command-line window itself and the statusline above it. +Thus you can resize the command-line window, but not others. + + +AUTOCOMMANDS + +Two autocommand events are used: |CmdwinEnter| and |CmdwinLeave|. Since this +window is of a special type, the WinEnter, WinLeave, BufEnter and BufLeave +events are not triggered. You can use the Cmdwin events to do settings +specifically for the command-line window. Be careful not to cause side +effects! +Example: > + :au CmdwinEnter : let b:cpt_save = &cpt | set cpt=v + :au CmdwinLeave : let &cpt = b:cpt_save +This sets 'complete' to use command-line completion in Insert mode for CTRL-N. +Another example: > + :au CmdwinEnter [/?] startinsert +This will make Vim start in Insert mode in the command-line window. + + *cmdwin-char* +The character used for the pattern indicates the type of command-line: + : normal Ex command + > debug mode command |debug-mode| + / forward search string + ? backward search string + = expression for "= |expr-register| + @ string for |input()| + - text for |:insert| or |:append| + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/debug.txt b/Aufgabe5/doc.lang/debug.txt new file mode 100644 index 0000000..599e181 --- /dev/null +++ b/Aufgabe5/doc.lang/debug.txt @@ -0,0 +1,151 @@ +*debug.txt* For Vim version 7.0. Last change: 2006 May 01 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Debugging Vim *debug-vim* + +This is for debugging Vim itself, when it doesn't work properly. +For debugging Vim scripts, functions, etc. see |debug-scripts| + +1. Location of a crash, using gcc and gdb |debug-gcc| +2. Windows Bug Reporting |debug-win32| + +============================================================================== + +1. Location of a crash, using gcc and gdb *debug-gcc* + +When Vim crashes in one of the test files, and you are using gcc for +compilation, here is what you can do to find out exactly where Vim crashes. +This also applies when using the MingW tools. + +1. Compile Vim with the "-g" option (there is a line in the Makefile for this, + which you can uncomment). + +2. Execute these commands (replace "11" with the test that fails): > + cd testdir + gdb ../vim + run -u unix.vim -U NONE -s dotest.in test11.in + +3. Check where Vim crashes, gdb should give a message for this. + +4. Get a stack trace from gdb with this command: > + where +< You can check out different places in the stack trace with: > + frame 3 +< Replace "3" with one of the numbers in the stack trace. + +============================================================================== + +2. Windows Bug Reporting *debug-win32* + +If the Windows version of Vim crashes in a reproducible manner, you can take +some steps to provide a useful bug report. + + +GENERIC ~ + +You must obtain the debugger symbols (PDB) file for your executable: gvim.pdb +for gvim.exe, or vim.pdb for vim.exe. The PDB should be available from the +same place that you obtained the executable. Be sure to use the PDB that +matches the EXE (same date). + +If you built the executable yourself with the Microsoft Visual C++ compiler, +then the PDB was built with the EXE. + +Alternatively, if you have the source files, you can import Make_ivc.mak into +Visual Studio as a workspace. Then select a debug configuration, build and +you can do all kinds of debugging (set breakpoints, watch variables, etc.). + +If you have Visual Studio, use that instead of the VC Toolkit and WinDbg. + +For other compilers, you should always use the corresponding debugger: TD for +a Vim executable compiled with the Borland compiler; gdb (see above +|debug-gcc|) for the Cygwin and MinGW compilers. + + + *debug-vs2005* +2.2 Debugging Vim crashes with Visual Studio 2005/Visual C++ 2005 Express ~ + +First launch vim.exe or gvim.exe and then launch Visual Studio. (If you don't +have Visual Studio, follow the instructions at |get-ms-debuggers| to obtain a +free copy of Visual C++ 2005 Express Edition.) + +On the Tools menu, click Attach to Process. Choose the Vim process. + +In Vim, reproduce the crash. A dialog will appear in Visual Studio, telling +you about the unhandled exception in the Vim process. Click Break to break +into the process. + +Visual Studio will pop up another dialog, telling you that no symbols are +loaded and that the source code cannot be displayed. Click OK. + +Several windows will open. Right-click in the Call Stack window. Choose Load +Symbols. The Find Symbols dialog will open, looking for (g)vim.pdb. Navigate +to the directory where you have the PDB file and click Open. + +At this point, you should have a full call stack with vim function names and +line numbers. Double-click one of the lines and the Find Source dialog will +appear. Navigate to the directory where the Vim source is (if you have it.) + +If you don't know how to debug this any further, follow the instructions +at ":help bug-reports". Paste the call stack into the bug report. + +If you have a non-free version of Visual Studio, you can save a minidump via +the Debug menu and send it with the bug report. A minidump is a small file +(<100KB), which contains information about the state of your process. +Visual C++ 2005 Express Edition cannot save minidumps and it cannot be +installed as a just-in-time debugger. Use WinDbg, |debug-windbg|, if you +need to save minidumps or you want a just-in-time (postmortem) debugger. + + *debug-windbg* +2.3 Debugging Vim crashes with WinDbg ~ + +See |get-ms-debuggers| to obtain a copy of WinDbg. + +As with the Visual Studio IDE, you can attach WinDbg to a running Vim process. +You can also have your system automatically invoke WinDbg as a postmortem +debugger. To set WinDbg as your postmortem debugger, run "windbg -I". + +To attach WinDbg to a running Vim process, launch WinDbg. On the File menu, +choose Attach to a Process. Select the Vim process and click OK. + +At this point, choose Symbol File Path on the File menu, and add the folder +containing your Vim PDB to the sympath. If you have Vim source available, +use Source File Path on the File menu. You can now open source files in WinDbg +and set breakpoints, if you like. Reproduce your crash. WinDbg should open the +source file at the point of the crash. Using the View menu, you can examine +the call stack, local variables, watch windows, and so on. + +If WinDbg is your postmortem debugger, you do not need to attach WinDbg to +your Vim process. Simply reproduce the crash and WinDbg will launch +automatically. As above, set the Symbol File Path and the Source File Path. + +To save a minidump, type the following at the WinDbg command line: > + .dump vim.dmp +< + *debug-minidump* +2.4 Opening a Minidump ~ + +If you have a minidump file, you can open it in Visual Studio or in WinDbg. + +In Visual Studio 2005: on the File menu, choose Open, then Project/Solution. +Navigate to the .dmp file and open it. Now press F5 to invoke the debugger. +Follow the instructions in |debug-vs2005| to set the Symbol File Path. + +In WinDbg: choose Open Crash Dump on the File menu. Follow the instructions in +|debug-windbg| to set the Symbol File Path. + + *get-ms-debuggers* +2.5 Obtaining Microsoft Debugging Tools ~ + +The Debugging Tools for Windows (including WinDbg) can be downloaded from + http://www.microsoft.com/whdc/devtools/debugging/default.mspx +This includes the WinDbg debugger. + +Visual C++ 2005 Express Edition can be downloaded for free from: + http://msdn.microsoft.com/vstudio/express/visualC/default.aspx + +========================================================================= + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/debugger.txt b/Aufgabe5/doc.lang/debugger.txt new file mode 100644 index 0000000..d726820 --- /dev/null +++ b/Aufgabe5/doc.lang/debugger.txt @@ -0,0 +1,140 @@ +*debugger.txt* For Vim version 7.0. Last change: 2005 Mar 29 + + + VIM REFERENCE MANUAL by Gordon Prieur + + +Debugger Support Features *debugger-support* + +1. Debugger Features |debugger-features| +2. Vim Compile Options |debugger-compilation| +3. Integrated Debuggers |debugger-integration| + +{Vi does not have any of these features} + +============================================================================== +1. Debugger Features *debugger-features* + +The following features are available for an integration with a debugger or +an Integrated Programming Environment (IPE) or Integrated Development +Environment (IDE): + + Alternate Command Input |alt-input| + Debug Signs |debug-signs| + Debug Source Highlight |debug-highlight| + Message Footer |gui-footer| + Balloon Evaluation |balloon-eval| + +These features were added specifically for use in the Motif version of gvim. +However, the |alt-input| and |debug-highlight| were written to be usable in +both vim and gvim. Some of the other features could be used in the non-GUI +vim with slight modifications. However, I did not do this nor did I test the +reliability of building for vim or non Motif GUI versions. + + +1.1 Alternate Command Input *alt-input* + +For Vim to work with a debugger there must be at least an input connection +with a debugger or external tool. In many cases there will also be an output +connection but this isn't absolutely necessary. + +The purpose of the input connection is to let the external debugger send +commands to Vim. The commands sent by the debugger should give the debugger +enough control to display the current debug environment and state. + +The current implementation is based on the X Toolkit dispatch loop and the +XtAddInput() function call. + + +1.2 Debug Signs *debug-signs* + +Many debuggers mark specific lines by placing a small sign or color highlight +on the line. The |:sign| command lets the debugger set this graphic mark. Some +examples where this feature would be used would be a debugger showing an arrow +representing the Program Counter (PC) of the program being debugged. Another +example would be a small stop sign for a line with a breakpoint. These visible +highlights let the user keep track of certain parts of the state of the +debugger. + +This feature can be used with more than debuggers, too. An IPE can use a sign +to highlight build errors, searched text, or other things. The sign feature +can also work together with the |debug-highlight| to ensure the mark is +highly visible. + +Debug signs are defined and placed using the |:sign| command. + + +1.3 Debug Source Highlight *debug-highlight* + +This feature allows a line to have a predominant highlight. The highlight is +intended to make a specific line stand out. The highlight could be made to +work for both vim and gvim, whereas the debug sign is, in most cases, limited +to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm +from Sun has a "sign gutter" for showing signs. + + +1.4 Message Footer *gui-footer* + +The message footer can be used to display messages from a debugger or IPE. It +can also be used to display menu and toolbar tips. The footer area is at the +bottom of the GUI window, below the line used to display colon commands. + +The display of the footer is controlled by the 'guioptions' letter 'F'. + + +1.5 Balloon Evaluation *balloon-eval* + +This feature allows a debugger, or other external tool, to display dynamic +information based on where the mouse is pointing. The purpose of this feature +was to allow Sun's Visual WorkShop debugger to display expression evaluations. +However, the feature was implemented in as general a manner as possible and +could be used for displaying other information as well. + +The Balloon Evaluation has some settable parameters too. For Motif the font +list and colors can be set via X resources (XmNballoonEvalFontList, +XmNballoonEvalBackground, and XmNballoonEvalForeground). +The 'balloondelay' option sets the delay before an attempt is made to show a +balloon. +The 'ballooneval' option needs to be set to switch it on. + +Balloon evaluation is only available when compiled with the |+balloon_eval| +feature. + +The Balloon evaluation functions are also used to show a tooltip for the +toolbar. The 'ballooneval' option does not need to be set for this. But the +other settings apply. + +Another way to use the balloon is with the 'balloonexpr' option. This is +completely user definable. + +============================================================================== +2. Vim Compile Options *debugger-compilation* + +The debugger features were added explicitly for use with Sun's Visual +WorkShop Integrated Programming Environment (ipe). However, they were done +in as generic a manner as possible so that integration with other debuggers +could also use some or all of the tools used with Sun's ipe. + +The following compile time preprocessor variables control the features: + + Alternate Command Input ALT_X_INPUT + Debug Glyphs FEAT_SIGNS + Debug Highlights FEAT_SIGNS + Message Footer FEAT_FOOTER + Balloon Evaluation FEAT_BEVAL + +The first integration with a full IPE/IDE was with Sun Visual WorkShop. To +compile a gvim which interfaces with VWS set the following flag, which sets +all the above flags: + + Sun Visual WorkShop FEAT_SUN_WORKSHOP + +============================================================================== +3. Integrated Debuggers *debugger-integration* + +One fully integrated debugger/IPE/IDE is Sun's Visual WorkShop Integrated +Programming Environment. + +For Sun NetBeans support see |netbeans|. + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/develop.txt b/Aufgabe5/doc.lang/develop.txt new file mode 100644 index 0000000..1d1c6ca --- /dev/null +++ b/Aufgabe5/doc.lang/develop.txt @@ -0,0 +1,490 @@ +*develop.txt* For Vim version 7.0. Last change: 2006 Mar 09 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Development of Vim. *development* + +This text is important for those who want to be involved in further developing +Vim. + +1. Design goals |design-goals| +2. Coding style |coding-style| +3. Design decisions |design-decisions| +4. Assumptions |design-assumptions| + +See the file README.txt in the "src" directory for an overview of the source +code. + +Vim is open source software. Everybody is encouraged to contribute to help +improving Vim. For sending patches a context diff "diff -c" is preferred. +Also see http://www.vim.org/tips/tip.php?tip_id=618. + +============================================================================== +1. Design goals *design-goals* + +Most important things come first (roughly). + +Note that quite a few items are contradicting. This is intentional. A +balance must be found between them. + + +VIM IS... VI COMPATIBLE *design-compatible* + +First of all, it should be possible to use Vim as a drop-in replacement for +Vi. When the user wants to, he can use Vim in compatible mode and hardly +notice any difference with the original Vi. + +Exceptions: +- We don't reproduce obvious Vi bugs in Vim. +- There are different versions of Vi. I am using Version 3.7 (6/7/85) as a + reference. But support for other versions is also included when possible. + The Vi part of POSIX is not considered a definitive source. +- Vim adds new commands, you cannot rely on some command to fail because it + didn't exist in Vi. +- Vim will have a lot of features that Vi doesn't have. Going back from Vim + to Vi will be a problem, this cannot be avoided. +- Some things are hardly ever used (open mode, sending an e-mail when + crashing, etc.). Those will only be included when someone has a good reason + why it should be included and it's not too much work. +- For some items it is debatable whether Vi compatibility should be + maintained. There will be an option flag for these. + + +VIM IS... IMPROVED *design-improved* + +The IMproved bits of Vim should make it a better Vi, without becoming a +completely different editor. Extensions are done with a "Vi spirit". +- Use the keyboard as much as feasible. The mouse requires a third hand, + which we don't have. Many terminals don't have a mouse. +- When the mouse is used anyway, avoid the need to switch back to the + keyboard. Avoid mixing mouse and keyboard handling. +- Add commands and options in a consistent way. Otherwise people will have a + hard time finding and remembering them. Keep in mind that more commands and + options will be added later. +- A feature that people do not know about is a useless feature. Don't add + obscure features, or at least add hints in documentation that they exists. +- Minimize using CTRL and other modifiers, they are more difficult to type. +- There are many first-time and inexperienced Vim users. Make it easy for + them to start using Vim and learn more over time. +- There is no limit to the features that can be added. Selecting new features + is one based on (1) what users ask for, (2) how much effort it takes to + implement and (3) someone actually implementing it. + + +VIM IS... MULTI PLATFORM *design-multi-platform* + +Vim tries to help as many users on as many platforms as possible. +- Support many kinds of terminals. The minimal demands are cursor positioning + and clear-screen. Commands should only use key strokes that most keyboards + have. Support all the keys on the keyboard for mapping. +- Support many platforms. A condition is that there is someone willing to do + Vim development on that platform, and it doesn't mean messing up the code. +- Support many compilers and libraries. Not everybody is able or allowed to + install another compiler or GUI library. +- People switch from one platform to another, and from GUI to terminal + version. Features should be present in all versions, or at least in as many + as possible with a reasonable effort. Try to avoid that users must switch + between platforms to accomplish their work efficiently. +- That a feature is not possible on some platforms, or only possible on one + platform, does not mean it cannot be implemented. [This intentionally + contradicts the previous item, these two must be balanced.] + + +VIM IS... WELL DOCUMENTED *design-documented* + +- A feature that isn't documented is a useless feature. A patch for a new + feature must include the documentation. +- Documentation should be comprehensive and understandable. Using examples is + recommended. +- Don't make the text unnecessarily long. Less documentation means that an + item is easier to find. + + +VIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size* + +Using Vim must not be a big attack on system resources. Keep it small and +fast. +- Computers are becoming faster and bigger each year. Vim can grow too, but + no faster than computers are growing. Keep Vim usable on older systems. +- Many users start Vim from a shell very often. Startup time must be short. +- Commands must work efficiently. The time they consume must be as small as + possible. Useful commands may take longer. +- Don't forget that some people use Vim over a slow connection. Minimize the + communication overhead. +- Items that add considerably to the size and are not used by many people + should be a feature that can be disabled. +- Vim is a component among other components. Don't turn it into a massive + application, but have it work well together with other programs. + + +VIM IS... MAINTAINABLE *design-maintain* + +- The source code should not become a mess. It should be reliable code. +- Use the same layout in all files to make it easy to read |coding-style|. +- Use comments in a useful way! Quoting the function name and argument names + is NOT useful. Do explain what they are for. +- Porting to another platform should be made easy, without having to change + too much platform-independent code. +- Use the object-oriented spirit: Put data and code together. Minimize the + knowledge spread to other parts of the code. + + +VIM IS... FLEXIBLE *design-flexible* + +Vim should make it easy for users to work in their preferred styles rather +than coercing its users into particular patterns of work. This can be for +items with a large impact (e.g., the 'compatible' option) or for details. The +defaults are carefully chosen such that most users will enjoy using Vim as it +is. Commands and options can be used to adjust Vim to the desire of the user +and its environment. + + +VIM IS... NOT *design-not* + +- Vim is not a shell or an Operating System. You will not be able to run a + shell inside Vim or use it to control a debugger. This should work the + other way around: Use Vim as a component from a shell or in an IDE. + A satirical way to say this: "Unlike Emacs, Vim does not attempt to include + everything but the kitchen sink, but some people say that you can clean one + with it. ;-)" + To use Vim with gdb see: http://www.agide.org and http://clewn.sf.net. +- Vim is not a fancy GUI editor that tries to look nice at the cost of + being less consistent over all platforms. But functional GUI features are + welcomed. + +============================================================================== +2. Coding style *coding-style* + +These are the rules to use when making changes to the Vim source code. Please +stick to these rules, to keep the sources readable and maintainable. + +This list is not complete. Look in the source code for more examples. + + +MAKING CHANGES *style-changes* + +The basic steps to make changes to the code: +1. Adjust the documentation. Doing this first gives you an impression of how + your changes affect the user. +2. Make the source code changes. +3. Check ../doc/todo.txt if the change affects any listed item. +4. Make a patch with "diff -c" against the unmodified code and docs. +5. Make a note about what changed and include it with the patch. + + +USE OF COMMON FUNCTIONS *style-functions* + +Some functions that are common to use, have a special Vim version. Always +consider using the Vim version, because they were introduced with a reason. + +NORMAL NAME VIM NAME DIFFERENCE OF VIM VERSION +free() vim_free() Checks for freeing NULL +malloc() alloc() Checks for out of memory situation +malloc() lalloc() Like alloc(), but has long argument +strcpy() STRCPY() Includes cast to (char *), for char_u * args +strchr() vim_strchr() Accepts special characters +strrchr() vim_strrchr() Accepts special characters +isspace() vim_isspace() Can handle characters > 128 +iswhite() vim_iswhite() Only TRUE for Tab and space +memcpy() mch_memmove() Handles overlapped copies +bcopy() mch_memmove() Handles overlapped copies +memset() vim_memset() Uniform for all systems + + +NAMES *style-names* + +Function names can not be more than 31 characters long (because of VMS). + +Don't use "delete" as a variable name, C++ doesn't like it. + +Because of the requirement that Vim runs on as many systems as possible, we +need to avoid using names that are already defined by the system. This is a +list of names that are known to cause trouble. The name is given as a regexp +pattern. + +is.*() POSIX, ctype.h +to.*() POSIX, ctype.h + +d_.* POSIX, dirent.h +l_.* POSIX, fcntl.h +gr_.* POSIX, grp.h +pw_.* POSIX, pwd.h +sa_.* POSIX, signal.h +mem.* POSIX, string.h +str.* POSIX, string.h +wcs.* POSIX, string.h +st_.* POSIX, stat.h +tms_.* POSIX, times.h +tm_.* POSIX, time.h +c_.* POSIX, termios.h +MAX.* POSIX, limits.h +__.* POSIX, system +_[A-Z].* POSIX, system +E[A-Z0-9]* POSIX, errno.h + +*_t POSIX, for typedefs. Use *_T instead. + +wait don't use as argument to a function, conflicts with types.h +index shadows global declaration +time shadows global declaration +new C++ reserved keyword +try Borland C++ doesn't like it to be used as a variable. + +basename() GNU string function +dirname() GNU string function +get_env_value() Linux system function + + +VARIOUS *style-various* + +Typedef'ed names should end in "_T": > + typedef int some_T; +Define'ed names should be uppercase: > + #define SOME_THING +Features always start with "FEAT_": > + #define FEAT_FOO + +Don't use '\"', some compilers can't handle it. '"' works fine. + +Don't use: + #if HAVE_SOME +Some compilers can't handle that and complain that "HAVE_SOME" is not defined. +Use + #ifdef HAVE_SOME +or + #if defined(HAVE_SOME) + + +STYLE *style-examples* + +General rule: One statement per line. + +Wrong: if (cond) a = 1; + +OK: if (cond) + a = 1; + +Wrong: while (cond); + +OK: while (cond) + ; + +Wrong: do a = 1; while (cond); + +OK: do + a = 1; + while (cond); + + +Functions start with: + +Wrong: int function_name(int arg1, int arg2) + +OK: /* + * Explanation of what this function is used for. + * + * Return value explanation. + */ + int + function_name(arg1, arg2) + int arg1; /* short comment about arg1 */ + int arg2; /* short comment about arg2 */ + { + int local; /* comment about local */ + + local = arg1 * arg2; + +NOTE: Don't use ANSI style function declarations. A few people still have to +use a compiler that doesn't support it. + + +SPACES AND PUNCTUATION *style-spaces* + +No space between a function name and the bracket: + +Wrong: func (arg); +OK: func(arg); + +Do use a space after if, while, switch, etc. + +Wrong: if(arg) for(;;) +OK: if (arg) for (;;) + +Use a space after a comma and semicolon: + +Wrong: func(arg1,arg2); for (i = 0;i < 2;++i) +OK: func(arg1, arg2); for (i = 0; i < 2; ++i) + +Use a space before and after '=', '+', '/', etc. + +Wrong: var=a*5; +OK: var = a * 5; + +In general: Use empty lines to group lines of code together. Put a comment +just above the group of lines. This makes it more easy to quickly see what is +being done. + +OK: /* Prepare for building the table. */ + get_first_item(); + table_idx = 0; + + /* Build the table */ + while (has_item()) + table[table_idx++] = next_item(); + + /* Finish up. */ + cleanup_items(); + generate_hash(table); + +============================================================================== +3. Design decisions *design-decisions* + +Folding + +Several forms of folding should be possible for the same buffer. For example, +have one window that shows the text with function bodies folded, another +window that shows a function body. + +Folding is a way to display the text. It should not change the text itself. +Therefore the folding has been implemented as a filter between the text stored +in a buffer (buffer lines) and the text displayed in a window (logical lines). + + +Naming the window + +The word "window" is commonly used for several things: A window on the screen, +the xterm window, a window inside Vim to view a buffer. +To avoid confusion, other items that are sometimes called window have been +given another name. Here is an overview of the related items: + +screen The whole display. For the GUI it's something like 1024x768 + pixels. The Vim shell can use the whole screen or part of it. +shell The Vim application. This can cover the whole screen (e.g., + when running in a console) or part of it (xterm or GUI). +window View on a buffer. There can be several windows in Vim, + together with the command line, menubar, toolbar, etc. they + fit in the shell. + + +Spell checking *develop-spell* + +When spell checking was going to be added to Vim a survey was done over the +available spell checking libraries and programs. Unfortunately, the result +was that none of them provided sufficient capabilities to be used as the spell +checking engine in Vim, for various reasons: + +- Missing support for multi-byte encodings. At least UTF-8 must be supported, + so that more than one language can be used in the same file. + Doing on-the-fly conversion is not always possible (would require iconv + support). +- For the programs and libraries: Using them as-is would require installing + them separately from Vim. That's mostly not impossible, but a drawback. +- Performance: A few tests showed that it's possible to check spelling on the + fly (while redrawing), just like syntax highlighting. But the mechanisms + used by other code are much slower. Myspell uses a hashtable, for example. + The affix compression that most spell checkers use makes it slower too. +- For using an external program like aspell a communication mechanism would + have to be setup. That's complicated to do in a portable way (Unix-only + would be relatively simple, but that's not good enough). And performance + will become a problem (lots of process switching involved). +- Missing support for words with non-word characters, such as "Etten-Leur" and + "et al.", would require marking the pieces of them OK, lowering the + reliability. +- Missing support for regions or dialects. Makes it difficult to accept + all English words and highlight non-Canadian words differently. +- Missing support for rare words. Many words are correct but hardly ever used + and could be a misspelled often-used word. +- For making suggestions the speed is less important and requiring to install + another program or library would be acceptable. But the word lists probably + differ, the suggestions may be wrong words. + + +Spelling suggestions *develop-spell-suggestions* + +For making suggestions there are two basic mechanisms: +1. Try changing the bad word a little bit and check for a match with a good + word. Or go through the list of good words, change them a little bit and + check for a match with the bad word. The changes are deleting a character, + inserting a character, swapping two characters, etc. +2. Perform soundfolding on both the bad word and the good words and then find + matches, possibly with a few changes like with the first mechanism. + +The first is good for finding typing mistakes. After experimenting with +hashtables and looking at solutions from other spell checkers the conclusion +was that a trie (a kind of tree structure) is ideal for this. Both for +reducing memory use and being able to try sensible changes. For example, when +inserting a character only characters that lead to good words need to be +tried. Other mechanisms (with hashtables) need to try all possible letters at +every position in the word. Also, a hashtable has the requirement that word +boundaries are identified separately, while a trie does not require this. +That makes the mechanism a lot simpler. + +Soundfolding is useful when someone knows how the words sounds but doesn't +know how it is spelled. For example, the word "dictionary" might be written +as "daktonerie". The number of changes that the first method would need to +try is very big, it's hard to find the good word that way. After soundfolding +the words become "tktnr" and "tkxnry", these differ by only two letters. + +To find words by their soundfolded equivalent (soundalike word) we need a list +of all soundfolded words. A few experiments have been done to find out what +the best method is. Alternatives: +1. Do the sound folding on the fly when looking for suggestions. This means + walking through the trie of good words, soundfolding each word and + checking how different it is from the bad word. This is very efficient for + memory use, but takes a long time. On a fast PC it takes a couple of + seconds for English, which can be acceptable for interactive use. But for + some languages it takes more than ten seconds (e.g., German, Catalan), + which is unacceptable slow. For batch processing (automatic corrections) + it's to slow for all languages. +2. Use a trie for the soundfolded words, so that searching can be done just + like how it works without soundfolding. This requires remembering a list + of good words for each soundfolded word. This makes finding matches very + fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte. + For some languages more than the original word list. +3. Like the second alternative, but reduce the amount of memory by using affix + compression and store only the soundfolded basic word. This is what Aspell + does. Disadvantage is that affixes need to be stripped from the bad word + before soundfolding it, which means that mistakes at the start and/or end + of the word will cause the mechanism to fail. Also, this becomes slow when + the bad word is quite different from the good word. + +The choice made is to use the second mechanism and use a separate file. This +way a user with sufficient memory can get very good suggestions while a user +who is short of memory or just wants the spell checking and no suggestions +doesn't use so much memory. + + +Word frequency + +For sorting suggestions it helps to know which words are common. In theory we +could store a word frequency with the word in the dictionary. However, this +requires storing a count per word. That degrades word tree compression a lot. +And maintaining the word frequency for all languages will be a heavy task. +Also, it would be nice to prefer words that are already in the text. This way +the words that appear in the specific text are preferred for suggestions. + +What has been implemented is to count words that have been seen during +displaying. A hashtable is used to quickly find the word count. The count is +initialized from words listed in COMMON items in the affix file, so that it +also works when starting a new file. + +This isn't ideal, because the longer Vim is running the higher the counts +become. But in practice it is a noticable improvement over not using the word +count. + +============================================================================== +4. Assumptions *design-assumptions* + +Size of variables: +char 8 bit signed +char_u 8 bit unsigned +int 32 or 64 bit signed (16 might be possible with limited features) +unsigned 32 or 64 bit unsigned (16 as with ints) +long 32 or 64 bit signed, can hold a pointer + +Note that some compilers cannot handle long lines or strings. The C89 +standard specifies a limit of 509 characters. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/diff.txt b/Aufgabe5/doc.lang/diff.txt new file mode 100644 index 0000000..a0e8053 --- /dev/null +++ b/Aufgabe5/doc.lang/diff.txt @@ -0,0 +1,404 @@ +*diff.txt* For Vim version 7.0. Last change: 2006 Apr 14 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + + *diff* *vimdiff* *gvimdiff* *diff-mode* +This file describes the +diff feature: Showing differences between two or +three versions of the same file. + +The basics are explained in section |08.7| of the user manual. + +1. Starting diff mode |vimdiff| +2. Viewing diffs |view-diffs| +3. Jumping to diffs |jumpto-diffs| +4. Copying diffs |copy-diffs| +5. Diff options |diff-options| + +{not in Vi} + +============================================================================== +1. Starting diff mode + +The easiest way to start editing in diff mode is with the "vimdiff" command. +This starts Vim as usual, and additionally sets up for viewing the differences +between the arguments. > + + vimdiff file1 file2 [file3 [file4]] + +This is equivalent to: > + + vim -d file1 file2 [file3 [file4]] + +You may also use "gvimdiff" or "vim -d -g". The GUI is started then. +You may also use "viewdiff" or "gviewdiff". Vim starts in readonly mode then. +"r" may be prepended for restricted mode (see |-Z|). + +The second and following arguments may also be a directory name. Vim will +then append the file name of the first argument to the directory name to find +the file. + +This only works when a standard "diff" command is available. See 'diffexpr'. + +Diffs are local to the current tab page |tab-page|. You can't see diffs with +a window in another tab page. This does make it possible to have several +diffs at the same time, each in their own tab page. + +What happens is that Vim opens a window for each of the files. This is like +using the |-O| argument. This uses vertical splits. If you prefer horizontal +splits add the |-o| argument: > + + vimdiff -o file1 file2 [file3] + +If you always prefer horizontal splits include "horizontal" in 'diffopt'. + +In each of the edited files these options are set: + + 'diff' on + 'scrollbind' on + 'scrollopt' includes "hor" + 'wrap' off + 'foldmethod' "diff" + 'foldcolumn' value from 'diffopt', default is 2 + +These options are set local to the window. When editing another file they are +reset to the global value. + +The differences shown are actually the differences in the buffer. Thus if you +make changes after loading a file, these will be included in the displayed +diffs. You might have to do ":diffupdate" now and then, not all changes are +immediately taken into account. + +In your .vimrc file you could do something special when Vim was started in +diff mode. You could use a construct like this: > + + if &diff + setup for diff mode + else + setup for non-diff mode + endif + +While already in Vim you can start diff mode in three ways. + + *E98* +:diffsplit {filename} *:diffs* *:diffsplit* + Open a new window on the file {filename}. The options are set + as for "vimdiff" for the current and the newly opened window. + Also see 'diffexpr'. + + *:difft* *:diffthis* +:diffthis Make the current window part of the diff windows. This sets + the options like for "vimdiff". + +:diffpatch {patchfile} *:diffp* *:diffpatch* + Use the current buffer, patch it with the diff found in + {patchfile} and open a buffer on the result. The options are + set as for "vimdiff". + {patchfile} can be in any format that the "patch" program + understands or 'patchexpr' can handle. + Note that {patchfile} should only contain a diff for one file, + the current file. If {patchfile} contains diffs for other + files as well, the results are unpredictable. Vim changes + directory to /tmp to avoid files in the current directory + accidentally being patched. But it may still result in + various ".rej" files to be created. And when absolute path + names are present these files may get patched anyway. + +To make these commands use a vertical split, prepend |:vertical|. Examples: > + + :vert diffsplit main.c~ + :vert diffpatch /tmp/diff + +If you always prefer a vertical split include "vertical" in 'diffopt'. + + *E96* +There can be up to four buffers with 'diff' set. + +Since the option values are remembered with the buffer, you can edit another +file for a moment and come back to the same file and be in diff mode again. + + *:diffo* *:diffoff* +:diffoff Switch off diff mode for the current window. + +:diffoff! Switch off diff mode for all windows in the current tab page. + +The ":diffoff" command resets the relevant options to their default value. +This may be different from what the values were before diff mode was started, +the old values are not remembered. + + 'diff' off + 'scrollbind' off + 'scrollopt' without "hor" + 'wrap' on + 'foldmethod' "manual" + 'foldcolumn' 0 + +============================================================================== +2. Viewing diffs *view-diffs* + +The effect is that the diff windows show the same text, with the differences +highlighted. When scrolling the text, the 'scrollbind' option will make the +text in other windows to be scrolled as well. With vertical splits the text +should be aligned properly. + +The alignment of text will go wrong when: +- 'wrap' is on, some lines will be wrapped and occupy two or more screen + lines +- folds are open in one window but not another +- 'scrollbind' is off +- changes have been made to the text +- "filler" is not present in 'diffopt', deleted/inserted lines makes the + alignment go wrong + +All the buffers edited in a window where the 'diff' option is set will join in +the diff. This is also possible for hidden buffers. They must have been +edited in a window first for this to be possible. + +Since 'diff' is a window-local option, it's possible to view the same buffer +in diff mode in one window and "normal" in another window. It is also +possible to view the changes you have made to a buffer, but since Vim doesn't +allow having two buffers for the same file, you need to make a copy of the +original file and diff with that. For example: > + :!cp % tempfile + :diffsplit tempfile + +A buffer that is unloaded cannot be used for the diff. But it does work for +hidden buffers. You can use ":hide" to close a window without unloading the +buffer. If you don't want a buffer to remain used for the diff do ":set +nodiff" before hiding it. + + *:diffu* *:diffupdate* +:diffu[pdate] Update the diff highlighting and folds. + +Vim attempts to keep the differences updated when you make changes to the +text. This mostly takes care of inserted and deleted lines. Changes within a +line and more complicated changes do not cause the differences to be updated. +To force the differences to be updated use: > + + :diffupdate + + +Vim will show filler lines for lines that are missing in one window but are +present in another. These lines were inserted in another file or deleted in +this file. Removing "filler" from the 'diffopt' option will make Vim not +display these filler lines. + + +Folds are used to hide the text that wasn't changed. See |folding| for all +the commands that can be used with folds. + +The context of lines above a difference that are not included in the fold can +be set with the 'diffopt' option. For example, to set the context to three +lines: > + + :set diffopt=filler,context:3 + + +The diffs are highlighted with these groups: + +|hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in + this buffer but not in another. +|hl-DiffChange| DiffChange Changed lines. +|hl-DiffText| DiffText Changed text inside a Changed line. Vim + finds the first character that is different, + and the last character that is different + (searching from the end of the line). The + text in between is highlighted. This means + that parts in the middle that are still the + same are highlighted anyway. Only "iwhite" of + 'diffopt' is used here. +|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines, + because they don't really exist in this + buffer. + +============================================================================== +3. Jumping to diffs *jumpto-diffs* + +Two commands can be used to jump to diffs: + *[c* + [c Jump backwards to the previous start of a change. + When a count is used, do it that many times. + *]c* + ]c Jump forwards to the next start of a change. + When a count is used, do it that many times. + +It is an error if there is no change for the cursor to move to. + +============================================================================== +4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103* + *merge* +There are two commands to copy text from one buffer to another. The result is +that the buffers will be equal within the specified range. + + *:diffg* *:diffget* +:[range]diffg[et] [bufspec] + Modify the current buffer to undo difference with another + buffer. If [bufspec] is given, that buffer is used. + Otherwise this only works if there is one other buffer in diff + mode. + See below for [range]. + + *:diffpu* *:diffput* +:[range]diffpu[t] [bufspec] + Modify another buffer to undo difference with the current + buffer. Just like ":diffget" but the other buffer is modified + instead of the current one. + When [bufspec] is omitted and there is more than one other + buffer in diff mode where 'modifiable' is set this fails. + See below for [range]. + + *do* +do Same as ":diffget" without argument or range. The "o" stands + for "obtain" ("dg" can't be used, it could be the start of + "dgg"!). + + *dp* +dp Same as ":diffput" without argument or range. + +When no [range] is given, the diff at the cursor position or just above it is +affected. When [range] is used, Vim tries to only put or get the specified +lines. When there are deleted lines, this may not always be possible. + +There can be deleted lines below the last line of the buffer. When the cursor +is on the last line in the buffer and there is no diff above this line, the +":diffget" and "do" commands will obtain lines from the other buffer. + +To be able to get those lines from another buffer in a [range] it's allowed to +use the last line number plus one. This command gets all diffs from the other +buffer: > + + :1,$+1diffget + +Note that deleted lines are displayed, but not counted as text lines. You +can't move the cursor into them. To fill the deleted lines with the lines +from another buffer use ":diffget" on the line below them. + *E787* +When the buffer that is about to be modified is read-only and the autocommand +that is triggered by |FileChangedRO| changes buffers the command will fail. +The autocommand must not change buffers. + +The [bufspec] argument above can be a buffer number, a pattern for a buffer +name or a part of a buffer name. Examples: + + :diffget Use the other buffer which is in diff mode + :diffget 3 Use buffer 3 + :diffget v2 Use the buffer which matches "v2" and is in + diff mode (e.g., "file.c.v2") + +============================================================================== +5. Diff options *diff-options* + +Also see |'diffopt'| and the "diff" item of |'fillchars'|. + + +FINDING THE DIFFERENCES *diff-diffexpr* + +The 'diffexpr' option can be set to use something else than the standard +"diff" program to compare two files and find the differences. + +When 'diffexpr' is empty, Vim uses this command to find the differences +between file1 and file2: > + + diff file1 file2 > outfile + +The ">" is replaced with the value of 'shellredir'. + +The output of "diff" must be a normal "ed" style diff. Do NOT use a context +diff. This example explains the format that Vim expects: > + + 1a2 + > bbb + 4d4 + < 111 + 7c7 + < GGG + --- + > ggg + +The "1a2" item appends the line "bbb". +The "4d4" item deletes the line "111". +The '7c7" item replaces the line "GGG" with "ggg". + +When 'diffexpr' is not empty, Vim evaluates to obtain a diff file in the +format mentioned. These variables are set to the file names used: + + v:fname_in original file + v:fname_new new version of the same file + v:fname_out resulting diff file + +Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the +'diffopt' option. 'diffexpr' cannot change the value of 'lines' and +'columns'. + +Example (this does almost the same as 'diffexpr' being empty): > + + set diffexpr=MyDiff() + function MyDiff() + let opt = "" + if &diffopt =~ "icase" + let opt = opt . "-i " + endif + if &diffopt =~ "iwhite" + let opt = opt . "-b " + endif + silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new . + \ " > " . v:fname_out + endfunction + +The "-a" argument is used to force comparing the files as text, comparing as +binaries isn't useful. The "--binary" argument makes the files read in binary +mode, so that a CTRL-Z doesn't end the text on DOS. + + *E97* +Vim will do a test if the diff output looks alright. If it doesn't, you will +get an error message. Possible causes: +- The "diff" program cannot be executed. +- The "diff" program doesn't produce normal "ed" style diffs (see above). +- The 'shell' and associated options are not set correctly. Try if filtering + works with a command like ":!sort". +- You are using 'diffexpr' and it doesn't work. +If it's not clear what the problem is set the 'verbose' option to one or more +to see more messages. + +The self-installing Vim includes a diff program. If you don't have it you +might want to download a diff.exe. For example from +http://jlb.twu.net/code/unixkit.php. + + +USING PATCHES *diff-patchexpr* + +The 'patchexpr' option can be set to use something else than the standard +"patch" program. + +When 'patchexpr' is empty, Vim will call the "patch" program like this: > + + patch -o outfile origfile < patchfile + +This should work fine with most versions of the "patch" program. Note that a +CR in the middle of a line may cause problems, it is seen as a line break. + +If the default doesn't work for you, set the 'patchexpr' to an expression that +will have the same effect. These variables are set to the file names used: + + v:fname_in original file + v:fname_diff patch file + v:fname_out resulting patched file + +Example (this does the same as 'patchexpr' being empty): > + + set patchexpr=MyPatch() + function MyPatch() + :call system("patch -o " . v:fname_out . " " . v:fname_in . + \ " < " . v:fname_diff) + endfunction + +Make sure that using the "patch" program doesn't have unwanted side effects. +For example, watch out for additionally generated files, which should be +deleted. It should just patch the file and nothing else. + Vim will change directory to "/tmp" or another temp directory before +evaluating 'patchexpr'. This hopefully avoids that files in the current +directory are accidentally patched. Vim will also delete files starting with +v:fname_in and ending in ".rej" and ".orig". + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/digraph.txt b/Aufgabe5/doc.lang/digraph.txt new file mode 100644 index 0000000..ec5aec5 --- /dev/null +++ b/Aufgabe5/doc.lang/digraph.txt @@ -0,0 +1,349 @@ +*digraph.txt* For Vim version 7.0. Last change: 2006 Apr 25 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Digraphs *digraphs* *Digraphs* + +Digraphs are used to enter characters that normally cannot be entered by +an ordinary keyboard. These are mostly accented characters which have the +eighth bit set. The digraphs are easier to remember than the decimal number +that can be entered with CTRL-V (see |i_CTRL-V|). + +There is a brief introduction on digraphs in the user manual: |24.9| +An alternative is using the 'keymap' option. + +1. Defining digraphs |digraphs-define| +2. Using digraphs |digraphs-use| +3. Default digraphs |digraphs-default| + +{Vi does not have any of these commands} + +============================================================================== +1. Defining digraphs *digraphs-define* + + *:dig* *:digraphs* +:dig[raphs] show currently defined digraphs. + *E104* *E39* +:dig[raphs] {char1}{char2} {number} ... + Add digraph {char1}{char2} to the list. {number} is + the decimal representation of the character. Normally + it is the Unicode character, see |digraph-encoding|. + Example: > + :digr e: 235 a: 228 +< Avoid defining a digraph with '_' (underscore) as the + first character, it has a special meaning in the + future. + +Vim is normally compiled with the |+digraphs| feature. If the feature is +disabled, the ":digraph" command will display an error message. + +Example of the output of ":digraphs": > + TH 222 ss 223 a! 224 a' 225 a> 226 a? 227 a: 228 + +The first two characters in each column are the characters you have to type to +enter the digraph. + +In the middle of each column is the resulting character. This may be mangled +if you look at it on a system that does not support digraphs or if you print +this file. + + *digraph-encoding* +The decimal number normally is the Unicode number of the character. Note that +the meaning doesn't change when 'encoding' changes. The character will be +converted from Unicode to 'encoding' when needed. This does require the +conversion to be available, it might fail. + +When Vim was compiled without the +multi_byte feature, you need to specify the +character in the encoding given with 'encoding'. You might want to use +something like this: > + + if has("multi_byte") + digraph oe 339 + elseif &encoding == "iso-8859-15" + digraph oe 189 + endif + +This defines the "oe" digraph for a character that is number 339 in Unicode +and 189 in latin9 (iso-8859-15). + +============================================================================== +2. Using digraphs *digraphs-use* + +There are two methods to enter digraphs: *i_digraph* + CTRL-K {char1} {char2} or + {char1} {char2} +The first is always available; the second only when the 'digraph' option is +set. + +If a digraph with {char1}{char2} does not exist, Vim searches for a digraph +{char2}{char1}. This helps when you don't remember which character comes +first. + +Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim +enters the code for that special key. This is not a digraph. + +Once you have entered the digraph, Vim treats the character like a normal +character that occupies only one character in the file and on the screen. +Example: > + 'B' 'B' will enter the broken '|' character (166) + 'a' '>' will enter an 'a' with a circumflex (226) + CTRL-K '-' '-' will enter a soft hyphen (173) + +The current digraphs are listed with the ":digraphs" command. Some of the +default ones are listed below |digraph-table|. + +For CTRL-K, there is one general digraph: CTRL-K {char} will enter +{char} with the highest bit set. You can use this to enter meta-characters. + +The character cannot be part of a digraph. When hitting , Vim +stops digraph entry and ends Insert mode or Command-line mode, just like +hitting an out of digraph context. Use CTRL-V 155 to enter meta-ESC +(CSI). + +If you accidentally typed an 'a' that should be an 'e', you will type 'a' +'e'. But that is a digraph, so you will not get what you want. To correct +this, you will have to type e again. To avoid this don't set the +'digraph' option and use CTRL-K to enter digraphs. + +You may have problems using Vim with characters which have an ASCII value +above 128. For example: You insert ue (u-umlaut) and the editor echoes \334 +in Insert mode. After leaving the Insert mode everything is fine. Note that +fmt removes all characters with ASCII codes above 128 from the text being +formatted. On some Unix systems this means you have to define the +environment-variable LC_CTYPE. If you are using csh, then put the following +line in your .cshrc: > + setenv LC_CTYPE iso_8859_1 + +============================================================================== +3. Default digraphs *digraphs-default* + +Vim comes with a set of default digraphs. Check the output of ":digraphs" to +see them. + +On most systems Vim uses the same digraphs. They work for the Unicode and +ISO-8859-1 character sets. These default digraphs are taken from the RFC1345 +mnemonics. To make it easy to remember the mnemonic, the second character has +a standard meaning: + + char name char meaning ~ + Exclamation mark ! Grave + Apostrophe ' Acute accent + Greater-Than sign > Circumflex accent + Question Mark ? tilde + Hyphen-Minus - Macron + Left parenthesis ( Breve + Full Stop . Dot Above + Colon : Diaeresis + Comma , Cedilla + Underline _ Underline + Solidus / Stroke + Quotation mark " Double acute accent + Semicolon ; Ogonek + Less-Than sign < Caron + Zero 0 Ring above + Two 2 Hook + Nine 9 Horn + + Equals = Cyrillic + Asterisk * Greek + Percent sign % Greek/Cyrillic special + Plus + smalls: Arabic, capitals: Hebrew + Three 3 some Latin/Greek/Cyrillic letters + Four 4 Bopomofo + Five 5 Hiragana + Six 6 Katakana + +Example: a: is and o: is + +These are the RFC1345 digraphs for the one-byte characters. See the output of +":digraphs" for the others. The characters above 255 are only available when +Vim was compiled with the |+multi_byte| feature. + +EURO + +Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was +added for this. Note the difference between latin1, where the digraph Cu is +used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is +used for the euro sign, while both of them are the character 164, 0xa4. For +compatibility with zsh Eu can also be used for the euro sign. + + *digraph-table* +char digraph hex dec official name ~ +^@ NU 0x00 0 NULL (NUL) +^A SH 0x01 1 START OF HEADING (SOH) +^B SX 0x02 2 START OF TEXT (STX) +^C EX 0x03 3 END OF TEXT (ETX) +^D ET 0x04 4 END OF TRANSMISSION (EOT) +^E EQ 0x05 5 ENQUIRY (ENQ) +^F AK 0x06 6 ACKNOWLEDGE (ACK) +^G BL 0x07 7 BELL (BEL) +^H BS 0x08 8 BACKSPACE (BS) +^I HT 0x09 9 CHARACTER TABULATION (HT) +^@ LF 0x0a 10 LINE FEED (LF) +^K VT 0x0b 11 LINE TABULATION (VT) +^L FF 0x0c 12 FORM FEED (FF) +^M CR 0x0d 13 CARRIAGE RETURN (CR) +^N SO 0x0e 14 SHIFT OUT (SO) +^O SI 0x0f 15 SHIFT IN (SI) +^P DL 0x10 16 DATALINK ESCAPE (DLE) +^Q D1 0x11 17 DEVICE CONTROL ONE (DC1) +^R D2 0x12 18 DEVICE CONTROL TWO (DC2) +^S D3 0x13 19 DEVICE CONTROL THREE (DC3) +^T D4 0x14 20 DEVICE CONTROL FOUR (DC4) +^U NK 0x15 21 NEGATIVE ACKNOWLEDGE (NAK) +^V SY 0x16 22 SYNCHRONOUS IDLE (SYN) +^W EB 0x17 23 END OF TRANSMISSION BLOCK (ETB) +^X CN 0x18 24 CANCEL (CAN) +^Y EM 0x19 25 END OF MEDIUM (EM) +^Z SB 0x1a 26 SUBSTITUTE (SUB) +^[ EC 0x1b 27 ESCAPE (ESC) +^\ FS 0x1c 28 FILE SEPARATOR (IS4) +^] GS 0x1d 29 GROUP SEPARATOR (IS3) +^^ RS 0x1e 30 RECORD SEPARATOR (IS2) +^_ US 0x1f 31 UNIT SEPARATOR (IS1) + SP 0x20 32 SPACE +# Nb 0x23 35 NUMBER SIGN +$ DO 0x24 36 DOLLAR SIGN +@ At 0x40 64 COMMERCIAL AT +[ <( 0x5b 91 LEFT SQUARE BRACKET +\ // 0x5c 92 REVERSE SOLIDUS +] )> 0x5d 93 RIGHT SQUARE BRACKET +^ '> 0x5e 94 CIRCUMFLEX ACCENT +` '! 0x60 96 GRAVE ACCENT +{ (! 0x7b 123 LEFT CURLY BRACKET +| !! 0x7c 124 VERTICAL LINE +} !) 0x7d 125 RIGHT CURLY BRACKET +~ '? 0x7e 126 TILDE +^? DT 0x7f 127 DELETE (DEL) +~@ PA 0x80 128 PADDING CHARACTER (PAD) +~A HO 0x81 129 HIGH OCTET PRESET (HOP) +~B BH 0x82 130 BREAK PERMITTED HERE (BPH) +~C NH 0x83 131 NO BREAK HERE (NBH) +~D IN 0x84 132 INDEX (IND) +~E NL 0x85 133 NEXT LINE (NEL) +~F SA 0x86 134 START OF SELECTED AREA (SSA) +~G ES 0x87 135 END OF SELECTED AREA (ESA) +~H HS 0x88 136 CHARACTER TABULATION SET (HTS) +~I HJ 0x89 137 CHARACTER TABULATION WITH JUSTIFICATION (HTJ) +~J VS 0x8a 138 LINE TABULATION SET (VTS) +~K PD 0x8b 139 PARTIAL LINE FORWARD (PLD) +~L PU 0x8c 140 PARTIAL LINE BACKWARD (PLU) +~M RI 0x8d 141 REVERSE LINE FEED (RI) +~N S2 0x8e 142 SINGLE-SHIFT TWO (SS2) +~O S3 0x8f 143 SINGLE-SHIFT THREE (SS3) +~P DC 0x90 144 DEVICE CONTROL STRING (DCS) +~Q P1 0x91 145 PRIVATE USE ONE (PU1) +~R P2 0x92 146 PRIVATE USE TWO (PU2) +~S TS 0x93 147 SET TRANSMIT STATE (STS) +~T CC 0x94 148 CANCEL CHARACTER (CCH) +~U MW 0x95 149 MESSAGE WAITING (MW) +~V SG 0x96 150 START OF GUARDED AREA (SPA) +~W EG 0x97 151 END OF GUARDED AREA (EPA) +~X SS 0x98 152 START OF STRING (SOS) +~Y GC 0x99 153 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI) +~Z SC 0x9a 154 SINGLE CHARACTER INTRODUCER (SCI) +~[ CI 0x9b 155 CONTROL SEQUENCE INTRODUCER (CSI) +~\ ST 0x9c 156 STRING TERMINATOR (ST) +~] OC 0x9d 157 OPERATING SYSTEM COMMAND (OSC) +~^ PM 0x9e 158 PRIVACY MESSAGE (PM) +~_ AC 0x9f 159 APPLICATION PROGRAM COMMAND (APC) +| NS 0xa0 160 NO-BREAK SPACE + !I 0xa1 161 INVERTED EXCLAMATION MARK + Ct 0xa2 162 CENT SIGN + Pd 0xa3 163 POUND SIGN + Cu 0xa4 164 CURRENCY SIGN + Ye 0xa5 165 YEN SIGN + BB 0xa6 166 BROKEN BAR + SE 0xa7 167 SECTION SIGN + ': 0xa8 168 DIAERESIS + Co 0xa9 169 COPYRIGHT SIGN + -a 0xaa 170 FEMININE ORDINAL INDICATOR + << 0xab 171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + NO 0xac 172 NOT SIGN + -- 0xad 173 SOFT HYPHEN + Rg 0xae 174 REGISTERED SIGN + 'm 0xaf 175 MACRON + DG 0xb0 176 DEGREE SIGN + +- 0xb1 177 PLUS-MINUS SIGN + 2S 0xb2 178 SUPERSCRIPT TWO + 3S 0xb3 179 SUPERSCRIPT THREE + '' 0xb4 180 ACUTE ACCENT + My 0xb5 181 MICRO SIGN + PI 0xb6 182 PILCROW SIGN + .M 0xb7 183 MIDDLE DOT + ', 0xb8 184 CEDILLA + 1S 0xb9 185 SUPERSCRIPT ONE + -o 0xba 186 MASCULINE ORDINAL INDICATOR + >> 0xbb 187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 14 0xbc 188 VULGAR FRACTION ONE QUARTER + 12 0xbd 189 VULGAR FRACTION ONE HALF + 34 0xbe 190 VULGAR FRACTION THREE QUARTERS + ?I 0xbf 191 INVERTED QUESTION MARK + A! 0xc0 192 LATIN CAPITAL LETTER A WITH GRAVE + A' 0xc1 193 LATIN CAPITAL LETTER A WITH ACUTE + A> 0xc2 194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX + A? 0xc3 195 LATIN CAPITAL LETTER A WITH TILDE + A: 0xc4 196 LATIN CAPITAL LETTER A WITH DIAERESIS + AA 0xc5 197 LATIN CAPITAL LETTER A WITH RING ABOVE + AE 0xc6 198 LATIN CAPITAL LETTER AE + C, 0xc7 199 LATIN CAPITAL LETTER C WITH CEDILLA + E! 0xc8 200 LATIN CAPITAL LETTER E WITH GRAVE + E' 0xc9 201 LATIN CAPITAL LETTER E WITH ACUTE + E> 0xca 202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX + E: 0xcb 203 LATIN CAPITAL LETTER E WITH DIAERESIS + I! 0xcc 204 LATIN CAPITAL LETTER I WITH GRAVE + I' 0xcd 205 LATIN CAPITAL LETTER I WITH ACUTE + I> 0xce 206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX + I: 0xcf 207 LATIN CAPITAL LETTER I WITH DIAERESIS + D- 0xd0 208 LATIN CAPITAL LETTER ETH (Icelandic) + N? 0xd1 209 LATIN CAPITAL LETTER N WITH TILDE + O! 0xd2 210 LATIN CAPITAL LETTER O WITH GRAVE + O' 0xd3 211 LATIN CAPITAL LETTER O WITH ACUTE + O> 0xd4 212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX + O? 0xd5 213 LATIN CAPITAL LETTER O WITH TILDE + O: 0xd6 214 LATIN CAPITAL LETTER O WITH DIAERESIS + *X 0xd7 215 MULTIPLICATION SIGN + O/ 0xd8 216 LATIN CAPITAL LETTER O WITH STROKE + U! 0xd9 217 LATIN CAPITAL LETTER U WITH GRAVE + U' 0xda 218 LATIN CAPITAL LETTER U WITH ACUTE + U> 0xdb 219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX + U: 0xdc 220 LATIN CAPITAL LETTER U WITH DIAERESIS + Y' 0xdd 221 LATIN CAPITAL LETTER Y WITH ACUTE + TH 0xde 222 LATIN CAPITAL LETTER THORN (Icelandic) + ss 0xdf 223 LATIN SMALL LETTER SHARP S (German) + a! 0xe0 224 LATIN SMALL LETTER A WITH GRAVE + a' 0xe1 225 LATIN SMALL LETTER A WITH ACUTE + a> 0xe2 226 LATIN SMALL LETTER A WITH CIRCUMFLEX + a? 0xe3 227 LATIN SMALL LETTER A WITH TILDE + a: 0xe4 228 LATIN SMALL LETTER A WITH DIAERESIS + aa 0xe5 229 LATIN SMALL LETTER A WITH RING ABOVE + ae 0xe6 230 LATIN SMALL LETTER AE + c, 0xe7 231 LATIN SMALL LETTER C WITH CEDILLA + e! 0xe8 232 LATIN SMALL LETTER E WITH GRAVE + e' 0xe9 233 LATIN SMALL LETTER E WITH ACUTE + e> 0xea 234 LATIN SMALL LETTER E WITH CIRCUMFLEX + e: 0xeb 235 LATIN SMALL LETTER E WITH DIAERESIS + i! 0xec 236 LATIN SMALL LETTER I WITH GRAVE + i' 0xed 237 LATIN SMALL LETTER I WITH ACUTE + i> 0xee 238 LATIN SMALL LETTER I WITH CIRCUMFLEX + i: 0xef 239 LATIN SMALL LETTER I WITH DIAERESIS + d- 0xf0 240 LATIN SMALL LETTER ETH (Icelandic) + n? 0xf1 241 LATIN SMALL LETTER N WITH TILDE + o! 0xf2 242 LATIN SMALL LETTER O WITH GRAVE + o' 0xf3 243 LATIN SMALL LETTER O WITH ACUTE + o> 0xf4 244 LATIN SMALL LETTER O WITH CIRCUMFLEX + o? 0xf5 245 LATIN SMALL LETTER O WITH TILDE + o: 0xf6 246 LATIN SMALL LETTER O WITH DIAERESIS + -: 0xf7 247 DIVISION SIGN + o/ 0xf8 248 LATIN SMALL LETTER O WITH STROKE + u! 0xf9 249 LATIN SMALL LETTER U WITH GRAVE + u' 0xfa 250 LATIN SMALL LETTER U WITH ACUTE + u> 0xfb 251 LATIN SMALL LETTER U WITH CIRCUMFLEX + u: 0xfc 252 LATIN SMALL LETTER U WITH DIAERESIS + y' 0xfd 253 LATIN SMALL LETTER Y WITH ACUTE + th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic) + y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/editing.txt b/Aufgabe5/doc.lang/editing.txt new file mode 100644 index 0000000..4c982c5 --- /dev/null +++ b/Aufgabe5/doc.lang/editing.txt @@ -0,0 +1,1553 @@ +*editing.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Editing files *edit-files* + +1. Introduction |edit-intro| +2. Editing a file |edit-a-file| +3. The argument list |argument-list| +4. Writing |writing| +5. Writing and quitting |write-quit| +6. Dialogs |edit-dialogs| +7. The current directory |current-directory| +8. Editing binary files |edit-binary| +9. Encryption |encryption| +10. Timestamps |timestamps| +11. File Searching |file-searching| + +============================================================================== +1. Introduction *edit-intro* + +Editing a file with Vim means: + +1. reading the file into a buffer +2. changing the buffer with editor commands +3. writing the buffer into a file + + *current-file* +As long as you don't write the buffer, the original file remains unchanged. +If you start editing a file (read a file into the buffer), the file name is +remembered as the "current file name". This is also known as the name of the +current buffer. It can be used with "%" on the command line |:_%|. + + *alternate-file* +If there already was a current file name, then that one becomes the alternate +file name. It can be used with "#" on the command line |:_#| and you can use +the |CTRL-^| command to toggle between the current and the alternate file. +However, the alternate file name is not changed when |:keepalt| is used. + + *:keepalt* *:keepa* +:keepalt {cmd} Execute {cmd} while keeping the current alternate file + name. Note that commands invoked indirectly (e.g., + with a function) may still set the alternate file + name. {not in Vi} + +All file names are remembered in the buffer list. When you enter a file name, +for editing (e.g., with ":e filename") or writing (e.g., with ":w filename"), +the file name is added to the list. You can use the buffer list to remember +which files you edited and to quickly switch from one file to another (e.g., +to copy text) with the |CTRL-^| command. First type the number of the file +and then hit CTRL-^. {Vi: only one alternate file name is remembered} + + +CTRL-G or *CTRL-G* *:f* *:fi* *:file* +:f[ile] Prints the current file name (as typed, unless ":cd" + was used), the cursor position (unless the 'ruler' + option is set), and the file status (readonly, + modified, read errors, new file). See the 'shortmess' + option about how to make this message shorter. + {Vi does not include column number} + +:f[ile]! like |:file|, but don't truncate the name even when + 'shortmess' indicates this. + +{count}CTRL-G Like CTRL-G, but prints the current file name with + full path. If the count is higher than 1 the current + buffer number is also given. {not in Vi} + + *g_CTRL-G* *word-count* *byte-count* +g CTRL-G Prints the current position of the cursor in five + ways: Column, Line, Word, Character and Byte. If the + number of Characters and Bytes is the same then the + Character position is omitted. + If there are characters in the line that take more + than one position on the screen ( or special + character), both the "real" column and the screen + column are shown, separated with a dash. + See also 'ruler' option. {not in Vi} + + *v_g_CTRL-G* +{Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and + Byte counts for the visually selected region are + displayed. + In Blockwise mode, Column count is also shown. (For + {Visual} see |Visual-mode|.) + {not in VI} + + *:file_f* +:f[ile][!] {name} Sets the current file name to {name}. The optional ! + avoids truncating the message, as with |:file|. + If the buffer did have a name, that name becomes the + |alternate-file| name. An unlisted buffer is created + to hold the old name. + *:0file* +:0f[ile][!] Remove the name of the current buffer. The optional ! + avoids truncating the message, as with |:file|. {not + in Vi} + +:buffers +:files +:ls List all the currently known file names. See + 'windows.txt' |:files| |:buffers| |:ls|. {not in + Vi} + +Vim will remember the full path name of a file name that you enter. In most +cases when the file name is displayed only the name you typed is shown, but +the full path name is being used if you used the ":cd" command |:cd|. + + *home-replace* +If the environment variable $HOME is set, and the file name starts with that +string, it is often displayed with HOME replaced with "~". This was done to +keep file names short. When reading or writing files the full name is still +used, the "~" is only used when displaying file names. When replacing the +file name would result in just "~", "~/" is used instead (to avoid confusion +between options set to $HOME with 'backupext' set to "~"). + +When writing the buffer, the default is to use the current file name. Thus +when you give the "ZZ" or ":wq" command, the original file will be +overwritten. If you do not want this, the buffer can be written into another +file by giving a file name argument to the ":write" command. For example: > + + vim testfile + [change the buffer with editor commands] + :w newfile + :q + +This will create a file "newfile", that is a modified copy of "testfile". +The file "testfile" will remain unchanged. Anyway, if the 'backup' option is +set, Vim renames or copies the original file before it will be overwritten. +You can use this file if you discover that you need the original file. See +also the 'patchmode' option. The name of the backup file is normally the same +as the original file with 'backupext' appended. The default "~" is a bit +strange to avoid accidentally overwriting existing files. If you prefer ".bak" +change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS +machines, when Vim has detected that an MS-DOS-like filesystem is being used +(e.g., messydos or crossdos) or when the 'shortname' option is on. The +backup file can be placed in another directory by setting 'backupdir'. + + *auto-shortname* +Technical: On the Amiga you can use 30 characters for a file name. But on an + MS-DOS-compatible filesystem only 8 plus 3 characters are + available. Vim tries to detect the type of filesystem when it is + creating the .swp file. If an MS-DOS-like filesystem is suspected, + a flag is set that has the same effect as setting the 'shortname' + option. This flag will be reset as soon as you start editing a + new file. The flag will be used when making the file name for the + ".swp" and ".~" files for the current file. But when you are + editing a file in a normal filesystem and write to an MS-DOS-like + filesystem the flag will not have been set. In that case the + creation of the ".~" file may fail and you will get an error + message. Use the 'shortname' option in this case. + +When you started editing without giving a file name, "No File" is displayed in +messages. If the ":write" command is used with a file name argument, the file +name for the current file is set to that file name. This only happens when +the 'F' flag is included in 'cpoptions' (by default it is included) |cpo-F|. +This is useful when entering text in an empty buffer and then writing it to a +file. If 'cpoptions' contains the 'f' flag (by default it is NOT included) +|cpo-f| the file name is set for the ":read file" command. This is useful +when starting Vim without an argument and then doing ":read file" to start +editing a file. +When the file name was set and 'filetype' is empty the filetype detection +autocommands will be triggered. + *not-edited* +Because the file name was set without really starting to edit that file, you +are protected from overwriting that file. This is done by setting the +"notedited" flag. You can see if this flag is set with the CTRL-G or ":file" +command. It will include "[Not edited]" when the "notedited" flag is set. +When writing the buffer to the current file name (with ":w!"), the "notedited" +flag is reset. + + *abandon* +Vim remembers whether you have changed the buffer. You are protected from +losing the changes you made. If you try to quit without writing, or want to +start editing another file, Vim will refuse this. In order to overrule this +protection, add a '!' to the command. The changes will then be lost. For +example: ":q" will not work if the buffer was changed, but ":q!" will. To see +whether the buffer was changed use the "CTRL-G" command. The message includes +the string "[Modified]" if the buffer has been changed. + +If you want to automatically save the changes without asking, switch on the +'autowriteall' option. 'autowrite' is the associated Vi-compatible option +that does not work for all commands. + +If you want to keep the changed buffer without saving it, switch on the +'hidden' option. See |hidden-buffer|. + +============================================================================== +2. Editing a file *edit-a-file* + + *:e* *:edit* +:e[dit] [++opt] [+cmd] Edit the current file. This is useful to re-edit the + current file, when it has been changed outside of Vim. + This fails when changes have been made to the current + buffer and 'autowriteall' isn't set or the file can't + be written. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + + *:edit!* +:e[dit]! [++opt] [+cmd] + Edit the current file always. Discard any changes to + the current buffer. This is useful if you want to + start all over again. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + + *:edit_f* +:e[dit] [++opt] [+cmd] {file} + Edit {file}. + This fails when changes have been made to the current + buffer, unless 'hidden' is set or 'autowriteall' is + set and the file can be written. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + + *:edit!_f* +:e[dit]! [++opt] [+cmd] {file} + Edit {file} always. Discard any changes to the + current buffer. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + +:e[dit] [++opt] [+cmd] #[count] + Edit the [count]th buffer (as shown by |:files|). + This command does the same as [count] CTRL-^. But ":e + #" doesn't work if the alternate buffer doesn't have a + file name, while CTRL-^ still works then. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + + *:ene* *:enew* +:ene[w] Edit a new, unnamed buffer. This fails when changes + have been made to the current buffer, unless 'hidden' + is set or 'autowriteall' is set and the file can be + written. + If 'fileformats' is not empty, the first format given + will be used for the new buffer. If 'fileformats' is + empty, the 'fileformat' of the current buffer is used. + {not in Vi} + + *:ene!* *:enew!* +:ene[w]! Edit a new, unnamed buffer. Discard any changes to + the current buffer. + Set 'fileformat' like |:enew|. + {not in Vi} + + *:fin* *:find* +:fin[d][!] [++opt] [+cmd] {file} + Find {file} in 'path' and then |:edit| it. + {not in Vi} {not available when the |+file_in_path| + feature was disabled at compile time} + +:{count}fin[d][!] [++opt] [+cmd] {file} + Just like ":find", but use the {count} match in + 'path'. Thus ":2find file" will find the second + "file" found in 'path'. When there are fewer matches + for the file in 'path' than asked for, you get an + error message. + + *:ex* +:ex [++opt] [+cmd] [file] + Same as |:edit|. + + *:vi* *:visual* +:vi[sual][!] [++opt] [+cmd] [file] + When used in Ex mode: Leave |Ex-mode|, go back to + Normal mode. Otherwise same as |:edit|. + + *:vie* *:view* +:vie[w] [++opt] [+cmd] file + When used in Ex mode: Leave |Ex mode|, go back to + Normal mode. Otherwise same as |:edit|, but set + 'readonly' option for this buffer. {not in Vi} + + *CTRL-^* *CTRL-6* +CTRL-^ Edit the alternate file (equivalent to ":e #"). + Mostly the alternate file is the previously edited + file. This is a quick way to toggle between two + files. + If the 'autowrite' or 'autowriteall' option is on and + the buffer was changed, write it. + Mostly the ^ character is positioned on the 6 key, + pressing CTRL and 6 then gets you what we call CTRL-^. + But on some non-US keyboards CTRL-^ is produced in + another way. + +{count}CTRL-^ Edit [count]th file in the buffer list (equivalent to + ":e #[count]"). This is a quick way to switch between + files. + See |CTRL-^| above for further details. + {not in Vi} + +[count]]f *]f* *[f* +[count][f Same as "gf". Deprecated. + + *gf* *E446* *E447* +[count]gf Edit the file whose name is under or after the cursor. + Mnemonic: "goto file". + Uses the 'isfname' option to find out which characters + are supposed to be in a file name. Trailing + punctuation characters ".,:;!" are ignored. + Uses the 'path' option as a list of directory names + to look for the file. Also looks for the file + relative to the current file. + Uses the 'suffixesadd' option to check for file names + with a suffix added. + If the file can't be found, 'includeexpr' is used to + modify the name and another attempt is done. + If a [count] is given, the count'th file that is found + in the 'path' is edited. + This command fails if Vim refuses to |abandon| the + current file. + If you want to edit the file in a new window use + |CTRL-W_CTRL-F|. + If you do want to edit a new file, use: > + :e +< To make gf always work like that: > + :map gf :e +< If the name is a hypertext link, that looks like + "type://machine/path", you need the |netrw| plugin. + For Unix the '~' character is expanded, like in + "~user/file". Environment variables are expanded too + |expand-env|. + {not in Vi} + {not available when the |+file_in_path| feature was + disabled at compile time} + + *v_gf* +{Visual}[count]gf Same as "gf", but the highlighted text is used as the + name of the file to edit. 'isfname' is ignored. + Leading blanks are skipped, otherwise all blanks and + special characters are included in the file name. + (For {Visual} see |Visual-mode|.) + {not in VI} + + *gF* +[count]gF Same as "gf", except if a number follows the file + name, then the cursor is positioned on that line in + the file. The file name and the number must be + separated by a non-filename (see 'isfname') and + non-numeric character. White space between the + filename, the separator and the number are ignored. + Examples: + eval.c:10 ~ + eval.c @ 20 ~ + eval.c (30) ~ + eval.c 40 ~ + + *v_gF* +{Visual}[count]gF Same as "v_gf". + +These commands are used to start editing a single file. This means that the +file is read into the buffer and the current file name is set. The file that +is opened depends on the current directory, see |:cd|. + +See |read-messages| for an explanation of the message that is given after the +file has been read. + +You can use the ":e!" command if you messed up the buffer and want to start +all over again. The ":e" command is only useful if you have changed the +current file name. + + *:filename* *{file}* +Note for systems other than Unix and MS-DOS: When using a command that +accepts a single file name (like ":edit file") spaces in the file name are +allowed, but trailing spaces are ignored. This is useful on systems that +allow file names with embedded spaces (like MS-Windows and the Amiga). +Example: The command ":e Long File Name " will edit the file "Long File +Name". When using a command that accepts more than one file name (like ":next +file1 file2") embedded spaces must be escaped with a backslash. + + *wildcard* +Wildcards in {file} are expanded. Which wildcards are supported depends on +the system. These are the common ones: + ? matches one character + * matches anything, including nothing + ** matches anything, including nothing, recurses into directories + [abc] match 'a', 'b' or 'c' + +To avoid the special meaning of the wildcards prepend a backslash. However, +on MS-Windows the backslash is a path separator and "path\[abc]" is still seen +as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this +is to use "path\[[]abc]". Then the file "path[abc]" literally. + + *starstar-wildcard* +Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems. +This allows searching a directory tree. This goes up to 100 directories deep. +Example: > + :n **/*.txt +Finds files: + ttt.txt + subdir/ttt.txt + a/b/c/d/ttt.txt +When non-wildcard characters are used these are only matched in the first +directory. Example: > + :n /usr/inc**/*.h +Finds files: + /usr/include/types.h + /usr/include/sys/types.h + /usr/inc_old/types.h + *backtick-expansion* *`-expansion* +On Unix and a few other systems you can also use backticks in the file name, +for example: > + :e `find . -name ver\\*.c -print` +The backslashes before the star are required to prevent "ver*.c" to be +expanded by the shell before executing the find program. +This also works for most other systems, with the restriction that the +backticks must be around the whole item. It is not possible to have text +directly before the first or just after the last backtick. + + *`=* +You can have the backticks expanded as a Vim expression, instead of an +external command, by using the syntax `={expr}` e.g.: > + :e `=tempname()` +The expression can contain just about anything, thus this can also be used to +avoid the special meaning of '"', '|', '%' and '#'. Names are to be separated +with line breaks. When the result is a |List| then each item is used as a +name. Line breaks also separate names. + + *++opt* *[++opt]* +The [++opt] argument can be used to force the value of 'fileformat', +'fileencoding' or 'binary' to a value for one command, and to specify the +behavior for bad characters. The form is: > + ++{optname} +Or: > + ++{optname}={value} + +Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* *++edit* + ff or fileformat overrides 'fileformat' + enc or encoding overrides 'fileencoding' + bin or binary sets 'binary' + nobin or nobinary resets 'binary' + bad specifies behavior for bad characters + edit for |:read| only: keep option values as if editing + a file + +{value} cannot contain white space. It can be any valid value for these +options. Examples: > + :e ++ff=unix +This edits the same file again with 'fileformat' set to "unix". > + + :w ++enc=latin1 newfile +This writes the current buffer to "newfile" in latin1 format. + +There may be several ++opt arguments, separated by white space. They must all +appear before any |+cmd| argument. + + *++bad* +The argument of "++bad=" specifies what happens with characters that can't be +converted and illegal bytes. It can be one of three things: + ++bad=X A single-byte character that replaces each bad character. + ++bad=keep Keep bad characters without conversion. Note that this may + result in illegal bytes in your text! + ++bad=drop Remove the bad characters. + +The default is like "++bad=?": Replace each bad character with a question +mark. + +Note that when reading, the 'fileformat' and 'fileencoding' options will be +set to the used format. When writing this doesn't happen, thus a next write +will use the old value of the option. Same for the 'binary' option. + + + *+cmd* *[+cmd]* +The [+cmd] argument can be used to position the cursor in the newly opened +file, or execute any other command: + + Start at the last line. + +{num} Start at line {num}. + +/{pat} Start at first line containing {pat}. + +{command} Execute {command} after opening the new file. + {command} is any Ex command. +To include a white space in the {pat} or {command}, precede it with a +backslash. Double the number of backslashes. > + :edit +/The\ book file + :edit +/dir\ dirname\\ file + :edit +set\ dir=c:\\\\temp file +Note that in the last example the number of backslashes is halved twice: Once +for the "+cmd" argument and once for the ":set" command. + + *file-formats* +The 'fileformat' option sets the style for a file: +'fileformat' characters name ~ + "dos" or DOS format *DOS-format* + "unix" Unix format *Unix-format* + "mac" Mac format *Mac-format* +Previously 'textmode' was used. It is obsolete now. + +When reading a file, the mentioned characters are interpreted as the . +In DOS format (default for MS-DOS, OS/2 and Win32), and are both +interpreted as the . Note that when writing the file in DOS format, + characters will be added for each single . Also see |file-read|. + +When writing a file, the mentioned characters are used for . For DOS +format is used. Also see |DOS-format-write|. + +You can read a file in DOS format and write it in Unix format. This will +replace all pairs by (assuming 'fileformats' includes "dos"): > + :e file + :set fileformat=unix + :w +If you read a file in Unix format and write with DOS format, all +characters will be replaced with (assuming 'fileformats' includes +"unix"): > + :e file + :set fileformat=dos + :w + +If you start editing a new file and the 'fileformats' option is not empty +(which is the default), Vim will try to detect whether the lines in the file +are separated by the specified formats. When set to "unix,dos", Vim will +check for lines with a single (as used on Unix and Amiga) or by a + pair (MS-DOS). Only when ALL lines end in , 'fileformat' is set +to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac", +and no characters are found in the file, 'fileformat' is set to "mac". + +If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message +"[dos format]" is shown to remind you that something unusual is happening. On +MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to +"unix". On all systems but the Macintosh you get the message "[mac format]" +if 'fileformat' is set to "mac". + +If the 'fileformats' option is empty and DOS format is used, but while reading +a file some lines did not end in , "[CR missing]" will be included in +the file message. +If the 'fileformats' option is empty and Mac format is used, but while reading +a file a was found, "[NL missing]" will be included in the file message. + +If the new file does not exist, the 'fileformat' of the current buffer is used +when 'fileformats' is empty. Otherwise the first format from 'fileformats' is +used for the new file. + +Before editing binary, executable or Vim script files you should set the +'binary' option. A simple way to do this is by starting Vim with the "-b" +option. This will avoid the use of 'fileformat'. Without this you risk that +single characters are unexpectedly replaced with . + +You can encrypt files that are written by setting the 'key' option. This +provides some security against others reading your files. |encryption| + + +============================================================================== +3. The argument list *argument-list* *arglist* + +If you give more than one file name when starting Vim, this list is remembered +as the argument list. You can jump to each file in this list. + +Do not confuse this with the buffer list, which you can see with the +|:buffers| command. The argument list was already present in Vi, the buffer +list is new in Vim. Every file name in the argument list will also be present +in the buffer list (unless it was deleted with |:bdel| or |:bwipe|). But it's +common that names in the buffer list are not in the argument list. + +This subject is introduced in section |07.2| of the user manual. + +There is one global argument list, which is used for all windows by default. +It is possible to create a new argument list local to a window, see +|:arglocal|. + +You can use the argument list with the following commands, and with the +expression functions |argc()| and |argv()|. These all work on the argument +list of the current window. + + *:ar* *:args* +:ar[gs] Print the argument list, with the current file in + square brackets. + +:ar[gs] [++opt] [+cmd] {arglist} *:args_f* + Define {arglist} as the new argument list and edit + the first one. This fails when changes have been made + and Vim does not want to |abandon| the current buffer. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + +:ar[gs]! [++opt] [+cmd] {arglist} *:args_f!* + Define {arglist} as the new argument list and edit + the first one. Discard any changes to the current + buffer. + Also see |++opt| and |+cmd|. + {Vi: no ++opt} + +:[count]arge[dit][!] [++opt] [+cmd] {name} *:arge* *:argedit* + Add {name} to the argument list and edit it. + When {name} already exists in the argument list, this + entry is edited. + This is like using |:argadd| and then |:edit|. + Note that only one file name is allowed, and spaces + inside the file name are allowed, like with |:edit|. + [count] is used like with |:argadd|. + [!] is required if the current file cannot be + |abandon|ed. + Also see |++opt| and |+cmd|. + {not in Vi} + +:[count]arga[dd] {name} .. *:arga* *:argadd* *E479* + Add the {name}s to the argument list. + If [count] is omitted, the {name}s are added just + after the current entry in the argument list. + Otherwise they are added after the [count]'th file. + If the argument list is "a b c", and "b" is the + current argument, then these commands result in: + command new argument list ~ + :argadd x a b x c + :0argadd x x a b c + :1argadd x a x b c + :99argadd x a b c x + There is no check for duplicates, it is possible to + add a file to the argument list twice. + The currently edited file is not changed. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Note: you can also use this method: > + :args ## x +< This will add the "x" item and sort the new list. + +:argd[elete] {pattern} .. *:argd* *:argdelete* *E480* + Delete files from the argument list that match the + {pattern}s. {pattern} is used like a file pattern, + see |file-pattern|. "%" can be used to delete the + current entry. + This command keeps the currently edited file, also + when it's deleted from the argument list. + Example: > + :argdel *.obj +< {not in Vi} {not available when compiled without the + |+listcmds| feature} + +:{range}argd[elete] Delete the {range} files from the argument list. + When the last number in the range is too high, up to + the last argument is deleted. Example: > + :10,1000argdel +< Deletes arguments 10 and further, keeping 1-9. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + + *:argu* *:argument* +:[count]argu[ment] [count] [++opt] [+cmd] + Edit file [count] in the argument list. When [count] + is omitted the current entry is used. This fails + when changes have been made and Vim does not want to + |abandon| the current buffer. + Also see |++opt| and |+cmd|. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + +:[count]argu[ment]! [count] [++opt] [+cmd] + Edit file [count] in the argument list, discard any + changes to the current buffer. When [count] is + omitted the current entry is used. + Also see |++opt| and |+cmd|. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + +:[count]n[ext] [++opt] [+cmd] *:n* *:ne* *:next* *E165* *E163* + Edit [count] next file. This fails when changes have + been made and Vim does not want to |abandon| the + current buffer. Also see |++opt| and |+cmd|. {Vi: no + count or ++opt}. + +:[count]n[ext]! [++opt] [+cmd] + Edit [count] next file, discard any changes to the + buffer. Also see |++opt| and |+cmd|. {Vi: no count + or ++opt}. + +:n[ext] [++opt] [+cmd] {arglist} *:next_f* + Same as |:args_f|. + +:n[ext]! [++opt] [+cmd] {arglist} + Same as |:args_f!|. + +:[count]N[ext] [count] [++opt] [+cmd] *:Next* *:N* *E164* + Edit [count] previous file in argument list. This + fails when changes have been made and Vim does not + want to |abandon| the current buffer. + Also see |++opt| and |+cmd|. {Vi: no count or ++opt}. + +:[count]N[ext]! [count] [++opt] [+cmd] + Edit [count] previous file in argument list. Discard + any changes to the buffer. Also see |++opt| and + |+cmd|. {Vi: no count or ++opt}. + +:[count]prev[ious] [count] [++opt] [+cmd] *:prev* *:previous* + Same as :Next. Also see |++opt| and |+cmd|. {Vi: + only in some versions} + + *:rew* *:rewind* +:rew[ind] [++opt] [+cmd] + Start editing the first file in the argument list. + This fails when changes have been made and Vim does + not want to |abandon| the current buffer. + Also see |++opt| and |+cmd|. {Vi: no ++opt} + +:rew[ind]! [++opt] [+cmd] + Start editing the first file in the argument list. + Discard any changes to the buffer. Also see |++opt| + and |+cmd|. {Vi: no ++opt} + + *:fir* *:first* +:fir[st][!] [++opt] [+cmd] + Other name for ":rewind". {not in Vi} + + *:la* *:last* +:la[st] [++opt] [+cmd] + Start editing the last file in the argument list. + This fails when changes have been made and Vim does + not want to |abandon| the current buffer. + Also see |++opt| and |+cmd|. {not in Vi} + +:la[st]! [++opt] [+cmd] + Start editing the last file in the argument list. + Discard any changes to the buffer. Also see |++opt| + and |+cmd|. {not in Vi} + + *:wn* *:wnext* +:[count]wn[ext] [++opt] [+cmd] + Write current file and start editing the [count] + next file. Also see |++opt| and |+cmd|. {not in Vi} + +:[count]wn[ext] [++opt] [+cmd] {file} + Write current file to {file} and start editing the + [count] next file, unless {file} already exists and + the 'writeany' option is off. Also see |++opt| and + |+cmd|. {not in Vi} + +:[count]wn[ext]! [++opt] [+cmd] {file} + Write current file to {file} and start editing the + [count] next file. Also see |++opt| and |+cmd|. {not + in Vi} + +:[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext* +:[count]wp[revious][!] [++opt] [+cmd] [file] *:wp* *:wprevious* + Same as :wnext, but go to previous file instead of + next. {not in Vi} + +The [count] in the commands above defaults to one. For some commands it is +possible to use two counts. The last one (rightmost one) is used. + +If no [+cmd] argument is present, the cursor is positioned at the last known +cursor position for the file. If 'startofline' is set, the cursor will be +positioned at the first non-blank in the line, otherwise the last know column +is used. If there is no last known cursor position the cursor will be in the +first line (the last line in Ex mode). + + *{arglist}* +The wildcards in the argument list are expanded and the file names are sorted. +Thus you can use the command "vim *.c" to edit all the C files. From within +Vim the command ":n *.c" does the same. + +White space is used to separate file names. Put a backslash before a space or +Tab to include it in a file name. E.g., to edit the single file "foo bar": > + :next foo\ bar + +On Unix and a few other systems you can also use backticks, for example: > + :next `find . -name \\*.c -print` +The backslashes before the star are required to prevent "*.c" to be expanded +by the shell before executing the find program. + + *arglist-position* +When there is an argument list you can see which file you are editing in the +title of the window (if there is one and 'title' is on) and with the file +message you get with the "CTRL-G" command. You will see something like + (file 4 of 11) +If 'shortmess' contains 'f' it will be + (4 of 11) +If you are not really editing the file at the current position in the argument +list it will be + (file (4) of 11) +This means that you are position 4 in the argument list, but not editing the +fourth file in the argument list. This happens when you do ":e file". + + +LOCAL ARGUMENT LIST + +{not in Vi} +{not available when compiled without the |+windows| or |+listcmds| feature} + + *:arglocal* +:argl[ocal] Make a local copy of the global argument list. + Doesn't start editing another file. + +:argl[ocal][!] [++opt] [+cmd] {arglist} + Define a new argument list, which is local to the + current window. Works like |:args_f| otherwise. + + *:argglobal* +:argg[lobal] Use the global argument list for the current window. + Doesn't start editing another file. + +:argg[lobal][!] [++opt] [+cmd] {arglist} + Use the global argument list for the current window. + Define a new global argument list like |:args_f|. + All windows using the global argument list will see + this new list. + +There can be several argument lists. They can be shared between windows. +When they are shared, changing the argument list in one window will also +change it in the other window. + +When a window is split the new window inherits the argument list from the +current window. The two windows then share this list, until one of them uses +|:arglocal| or |:argglobal| to use another argument list. + + +USING THE ARGUMENT LIST + + *:argdo* +:argdo[!] {cmd} Execute {cmd} for each file in the argument list. + It works like doing this: > + :rewind + :{cmd} + :next + :{cmd} + etc. +< When the current file can't be |abandon|ed and the [!] + is not present, the command fails. + When an error is detected on one file, further files + in the argument list will not be visited. + The last file in the argument list (or where an error + occurred) becomes the current file. + {cmd} can contain '|' to concatenate several commands. + {cmd} must not change the argument list. + Note: While this command is executing, the Syntax + autocommand event is disabled by adding it to + 'eventignore'. This considerably speeds up editing + each file. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Also see |:windo|, |:tabdo| and |:bufdo|. + +Example: > + :args *.c + :argdo set ff=unix | update +This sets the 'fileformat' option to "unix" and writes the file if is now +changed. This is done for all *.c files. + +Example: > + :args *.[ch] + :argdo %s/\/My_Foo/ge | update +This changes the word "my_foo" to "My_Foo" in all *.c and *.h files. The "e" +flag is used for the ":substitute" command to avoid an error for files where +"my_foo" isn't used. ":update" writes the file only if changes were made. + +============================================================================== +4. Writing *writing* *save-file* + +Note: When the 'write' option is off, you are not able to write any file. + + *:w* *:write* + *E502* *E503* *E504* *E505* + *E512* *E514* *E667* +:w[rite] Write the whole buffer to the current file. This is + the normal way to save changes to a file. It fails + when the 'readonly' option is set or when there is + another reason why the file can't be written. + +:w[rite]! Like ":write", but forcefully write when 'readonly' is + set or there is another reason why writing was + refused. + Note: This may change the permission and ownership of + the file and break (symbolic) links. Add the 'W' flag + to 'cpoptions' to avoid this. + +:[range]w[rite][!] Write the specified lines to the current file. This + is unusual, because the file will not contain all + lines in the buffer. + + *:w_f* *:write_f* +:[range]w[rite] {file} Write the specified lines to {file}, unless it + already exists and the 'writeany' option is off. + + *:w!* +:[range]w[rite]! {file} Write the specified lines to {file}. Overwrite an + existing file. + + *:w_a* *:write_a* *E494* +:[range]w[rite][!] >> Append the specified lines to the current file. + +:[range]w[rite][!] >> {file} + Append the specified lines to {file}. '!' forces the + write even if file does not exist. + + *:w_c* *:write_c* +:[range]w[rite] !{cmd} Execute {cmd} with [range] lines as standard input + (note the space in front of the '!'). {cmd} is + executed like with ":!{cmd}", any '!' is replaced with + the previous command |:!|. + +The default [range] for the ":w" command is the whole buffer (1,$). If you +write the whole buffer, it is no longer considered changed. Also when you +write it to a different file with ":w somefile"! + +If a file name is given with ":w" it becomes the alternate file. This can be +used, for example, when the write fails and you want to try again later with +":w #". This can be switched off by removing the 'A' flag from the +'cpoptions' option. + + *:sav* *:saveas* +:sav[eas][!] {file} Save the current buffer under the name {file} and set + the filename of the current buffer to {file}. The + previous name is used for the alternate file name. + The [!] is needed to overwrite an existing file. + When 'filetype' is empty filetype detection is done + with the new name, before the file is written. + When the write was successful 'readonly' is reset. + {not in Vi} + + *:up* *:update* +:[range]up[date][!] [>>] [file] + Like ":write", but only write when the buffer has been + modified. {not in Vi} + + +WRITING WITH MULTIPLE BUFFERS *buffer-write* + + *:wa* *:wall* +:wa[ll] Write all changed buffers. Buffers without a file + name or which are readonly are not written. {not in + Vi} + +:wa[ll]! Write all changed buffers, even the ones that are + readonly. Buffers without a file name are not + written. {not in Vi} + + +Vim will warn you if you try to overwrite a file that has been changed +elsewhere. See |timestamp|. + + *backup* *E207* *E506* *E507* *E508* *E509* *E510* +If you write to an existing file (but do not append) while the 'backup', +'writebackup' or 'patchmode' option is on, a backup of the original file is +made. The file is either copied or renamed (see 'backupcopy'). After the +file has been successfully written and when the 'writebackup' option is on and +the 'backup' option is off, the backup file is deleted. When the 'patchmode' +option is on the backup file may be renamed. + + *backup-table* +'backup' 'writebackup' action ~ + off off no backup made + off on backup current file, deleted afterwards (default) + on off delete old backup, backup current file + on on delete old backup, backup current file + +When the 'backupskip' pattern matches with the name of the file which is +written, no backup file is made. The values of 'backup' and 'writebackup' are +ignored then. + +When the 'backup' option is on, an old backup file (with the same name as the +new backup file) will be deleted. If 'backup' is not set, but 'writebackup' +is set, an existing backup file will not be deleted. The backup file that is +made while the file is being written will have a different name. + +On some filesystems it's possible that in a crash you lose both the backup and +the newly written file (it might be there but contain bogus data). In that +case try recovery, because the swap file is synced to disk and might still be +there. |:recover| + +The directories given with the 'backupdir' option is used to put the backup +file in. (default: same directory as the written file). + +Whether the backup is a new file, which is a copy of the original file, or the +original file renamed depends on the 'backupcopy' option. See there for an +explanation of when the copy is made and when the file is renamed. + +If the creation of a backup file fails, the write is not done. If you want +to write anyway add a '!' to the command. + + *write-readonly* +When the 'cpoptions' option contains 'W', Vim will refuse to overwrite a +readonly file. When 'W' is not present, ":w!" will overwrite a readonly file, +if the system allows it (the directory must be writable). + + *write-fail* +If the writing of the new file fails, you have to be careful not to lose +your changes AND the original file. If there is no backup file and writing +the new file failed, you have already lost the original file! DON'T EXIT VIM +UNTIL YOU WRITE OUT THE FILE! If a backup was made, it is put back in place +of the original file (if possible). If you exit Vim, and lose the changes +you made, the original file will mostly still be there. If putting back the +original file fails, there will be an error message telling you that you +lost the original file. + + *DOS-format-write* +If the 'fileformat' is "dos", is used for . This is default +for MS-DOS, Win32 and OS/2. On other systems the message "[dos format]" is +shown to remind you that an unusual was used. + *Unix-format-write* +If the 'fileformat' is "unix", is used for . On MS-DOS, Win32 and +OS/2 the message "[unix format]" is shown. + *Mac-format-write* +If the 'fileformat' is "mac", is used for . On non-Mac systems the +message "[mac format]" is shown. + +See also |file-formats| and the 'fileformat' and 'fileformats' options. + + *ACL* +ACL stands for Access Control List. It is an advanced way to control access +rights for a file. It is used on new MS-Windows and Unix systems, but only +when the filesystem supports it. + Vim attempts to preserve the ACL info when writing a file. The backup file +will get the ACL info of the original file. + The ACL info is also used to check if a file is read-only (when opening the +file). + + *read-only-share* +When MS-Windows shares a drive on the network it can be marked as read-only. +This means that even if the file read-only attribute is absent, and the ACL +settings on NT network shared drives allow writing to the file, you can still +not write to the file. Vim on Win32 platforms will detect read-only network +drives and will mark the file as read-only. You will not be able to override +it with |:write|. + + *write-device* +When the file name is actually a device name, Vim will not make a backup (that +would be impossible). You need to use "!", since the device already exists. +Example for Unix: > + :w! /dev/lpt0 +and for MS-DOS or MS-Windows: > + :w! lpt0 +For Unix a device is detected when the name doesn't refer to a normal file or +a directory. A fifo or named pipe also looks like a device to Vim. +For MS-DOS and MS-Windows the device is detected by its name: + AUX + CON + CLOCK$ + NUL + PRN + COMn n=1,2,3... etc + LPTn n=1,2,3... etc +The names can be in upper- or lowercase. + +============================================================================== +5. Writing and quitting *write-quit* + + *:q* *:quit* +:q[uit] Quit the current window. Quit Vim if this is the last + window. This fails when changes have been made and + Vim refuses to |abandon| the current buffer, and when + the last file in the argument list has not been + edited. + If there are other tab pages and quitting the last + window in the current tab page the current tab page is + closed |tab-page|. + +:conf[irm] q[uit] Quit, but give prompt when changes have been made, or + the last file in the argument list has not been + edited. See |:confirm| and 'confirm'. {not in Vi} + +:q[uit]! Quit without writing, also when visible buffers have + changes. Does not exit when there are changed hidden + buffers. Use ":qall!" to exit always. + +:cq[uit] Quit always, without writing, and return an error + code. See |:cq|. Used for Manx's QuickFix mode (see + |quickfix|). {not in Vi} + + *:wq* +:wq Write the current file and quit. Writing fails when + the file is read-only or the buffer does not have a + name. Quitting fails when the last file in the + argument list has not been edited. + +:wq! Write the current file and quit. Writing fails when + the current buffer does not have a name. + +:wq {file} Write to {file} and quit. Quitting fails when the + last file in the argument list has not been edited. + +:wq! {file} Write to {file} and quit. + +:[range]wq[!] [file] Same as above, but only write the lines in [range]. + + *:x* *:xit* +:[range]x[it][!] [file] + Like ":wq", but write only when changes have been + made. + When 'hidden' is set and there are more windows, the + current buffer becomes hidden, after writing the file. + + *:exi* *:exit* +:[range]exi[t][!] [file] + Same as :xit. + + *ZZ* +ZZ Write current file, if modified, and quit (same as + ":x"). (Note: If there are several windows for the + current file, the file is written if it was modified + and the window is closed). + + *ZQ* +ZQ Quit without checking for changes (same as ":q!"). + {not in Vi} + +MULTIPLE WINDOWS AND BUFFERS *window-exit* + + *:qa* *:qall* +:qa[ll] Exit Vim, unless there are some buffers which have been + changed. (Use ":bmod" to go to the next modified buffer). + When 'autowriteall' is set all changed buffers will be + written, like |:wqall|. {not in Vi} + +:conf[irm] qa[ll] + Exit Vim. Bring up a prompt when some buffers have been + changed. See |:confirm|. {not in Vi} + +:qa[ll]! Exit Vim. Any changes to buffers are lost. {not in Vi} + + *:quita* *:quitall* +:quita[ll][!] Same as ":qall". {not in Vi} + +:wqa[ll] *:wqa* *:wqall* *:xa* *:xall* +:xa[ll] Write all changed buffers and exit Vim. If there are buffers + without a file name, which are readonly or which cannot be + written for another reason, Vim will not quit. {not in Vi} + +:conf[irm] wqa[ll] +:conf[irm] xa[ll] + Write all changed buffers and exit Vim. Bring up a prompt + when some buffers are readonly or cannot be written for + another reason. See |:confirm|. {not in Vi} + +:wqa[ll]! +:xa[ll]! Write all changed buffers, even the ones that are readonly, + and exit Vim. If there are buffers without a file name or + which cannot be written for another reason, Vim will not quit. + {not in Vi} + +============================================================================== +6. Dialogs *edit-dialogs* + + *:confirm* *:conf* +:conf[irm] {command} Execute {command}, and use a dialog when an + operation has to be confirmed. Can be used on the + ":q", ":qa" and ":w" commands (the latter to over-ride + a read-only setting). + +Examples: > + :confirm w foo +< Will ask for confirmation when "foo" already exists. > + :confirm q +< Will ask for confirmation when there are changes. > + :confirm qa +< If any modified, unsaved buffers exist, you will be prompted to save + or abandon each one. There are also choices to "save all" or "abandon + all". + +If you want to always use ":confirm", set the 'confirm' option. + + *:browse* *:bro* *E338* *E614* *E615* *E616* *E578* +:bro[wse] {command} Open a file selection dialog for an argument to + {command}. At present this works for |:e|, |:w|, + |:r|, |:saveas|, |:sp|, |:mkexrc|, |:mkvimrc| and + |:mksession|. + {only in Win32, Athena, Motif, GTK and Mac GUI} + When ":browse" is not possible you get an error + message. If the |+browse| feature is missing or the + {command} doesn't support browsing, the {command} is + executed without a dialog. + ":browse set" works like |:options|. + +The syntax is best shown via some examples: > + :browse e $vim/foo +< Open the browser in the $vim/foo directory, and edit the + file chosen. > + :browse e +< Open the browser in the directory specified with 'browsedir', + and edit the file chosen. > + :browse w +< Open the browser in the directory of the current buffer, + with the current buffer filename as default, and save the + buffer under the filename chosen. > + :browse w C:/bar +< Open the browser in the C:/bar directory, with the current + buffer filename as default, and save the buffer under the + filename chosen. +Also see the |'browsedir'| option. +For versions of Vim where browsing is not supported, the command is executed +unmodified. + + *browsefilter* +For MS Windows, you can modify the filters that are used in the browse dialog. +By setting the g:browsefilter or b:browsefilter variables, you can change the +filters globally or locally to the buffer. The variable is set to a string in +the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the +text that appears in the "Files of Type" comboBox, and {pattern} is the +pattern which filters the filenames. Several patterns can be given, separated +by ';'. + +For Motif the same format is used, but only the very first pattern is actually +used (Motif only offers one pattern, but you can edit it). + +For example, to have only Vim files in the dialog, you could use the following +command: > + + let g:browsefilter="Vim Scripts\t*.vim\nVim Startup Files\t*vimrc\n" + +You can override the filter setting on a per-buffer basis by setting the +b:browsefilter variable. You would most likely set b:browsefilter in a +filetype plugin, so that the browse dialog would contain entries related to +the type of file you are currently editing. Disadvantage: This makes it +difficult to start editing a file of a different type. To overcome this, you +may want to add "All Files\t*.*\n" as the final filter, so that the user can +still access any desired file. + +============================================================================== +7. The current directory *current-directory* + +You may use the |:cd| and |:lcd| commands to change to another directory, so +you will not have to type that directory name in front of the file names. It +also makes a difference for executing external commands, e.g. ":!ls". + +Changing directory fails when the current buffer is modified, the '.' flag is +present in 'cpoptions' and "!" is not used in the command. + + *:cd* *E747* *E472* +:cd[!] On non-Unix systems: Print the current directory + name. On Unix systems: Change the current directory + to the home directory. Use |:pwd| to print the + current directory on all systems. + +:cd[!] {path} Change the current directory to {path}. + If {path} is relative, it is searched for in the + directories listed in |'cdpath'|. + Does not change the meaning of an already opened file, + because its full path name is remembered. Files from + the |arglist| may change though! + On MS-DOS this also changes the active drive. + To change to the directory of the current file: > + :cd %:h +< + *:cd-* *E186* +:cd[!] - Change to the previous current directory (before the + previous ":cd {path}" command). {not in Vi} + + *:chd* *:chdir* +:chd[ir][!] [path] Same as |:cd|. + + *:lc* *:lcd* +:lc[d][!] {path} Like |:cd|, but only set the current directory for the + current window. The current directory for other + windows is not changed. {not in Vi} + + *:lch* *:lchdir* +:lch[dir][!] Same as |:lcd|. {not in Vi} + + *:pw* *:pwd* *E187* +:pw[d] Print the current directory name. {Vi: no pwd} + Also see |getcwd()|. + +So long as no |:lcd| command has been used, all windows share the same current +directory. Using a command to jump to another window doesn't change anything +for the current directory. +When a |:lcd| command has been used for a window, the specified directory +becomes the current directory for that window. Windows where the |:lcd| +command has not been used stick to the global current directory. When jumping +to another window the current directory will become the last specified local +current directory. If none was specified, the global current directory is +used. +When a |:cd| command is used, the current window will lose his local current +directory and will use the global current directory from now on. + +After using |:cd| the full path name will be used for reading and writing +files. On some networked file systems this may cause problems. The result of +using the full path name is that the file names currently in use will remain +referring to the same file. Example: If you have a file a:test and a +directory a:vim the commands ":e test" ":cd vim" ":w" will overwrite the file +a:test and not write a:vim/test. But if you do ":w test" the file a:vim/test +will be written, because you gave a new file name and did not refer to a +filename before the ":cd". + +============================================================================== +8. Editing binary files *edit-binary* + +Although Vim was made to edit text files, it is possible to edit binary +files. The |-b| Vim argument (b for binary) makes Vim do file I/O in binary +mode, and sets some options for editing binary files ('binary' on, 'textwidth' +to 0, 'modeline' off, 'expandtab' off). Setting the 'binary' option has the +same effect. Don't forget to do this before reading the file. + +There are a few things to remember when editing binary files: +- When editing executable files the number of characters must not change. + Use only the "R" or "r" command to change text. Do not delete characters + with "x" or by backspacing. +- Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be + split in two. +- When there are not many s, the lines will become very long. If you + want to edit a line that does not fit on the screen reset the 'wrap' option. + Horizontal scrolling is used then. If a line becomes too long (more than + about 32767 characters on the Amiga, much more on 32-bit systems, see + |limits|) you cannot edit that line. The line will be split when reading + the file. It is also possible that you get an "out of memory" error when + reading the file. +- Make sure the 'binary' option is set BEFORE loading the + file. Otherwise both and are considered to end a line + and when the file is written the will be replaced with . +- characters are shown on the screen as ^@. You can enter them with + "CTRL-V CTRL-@" or "CTRL-V 000" {Vi cannot handle characters in the + file} +- To insert a character in the file split up a line. When writing the + buffer to a file a will be written for the . +- Vim normally appends an at the end of the file if there is none. + Setting the 'binary' option prevents this. If you want to add the final + , set the 'endofline' option. You can also read the value of this + option to see if there was an for the last line (you cannot see this + in the text). + +============================================================================== +9. Encryption *encryption* + +Vim is able to write files encrypted, and read them back. The encrypted text +cannot be read without the right key. + +Note: The swapfile and text in memory is not encrypted. A system +administrator will be able to see your text while you are editing it. +When filtering text with ":!filter" or using ":w !command" the text is not +encrypted, this may reveal it to others. + +WARNING: If you make a typo when entering the key and then write the file and +exit, the text will be lost! + +The normal way to work with encryption, is to use the ":X" command, which will +ask you to enter a key. A following write command will use that key to +encrypt the file. If you later edit the same file, Vim will ask you to enter +a key. If you type the same key as that was used for writing, the text will +be readable again. If you use a wrong key, it will be a mess. + + *:X* +:X Prompt for an encryption key. The typing is done without showing the + actual text, so that someone looking at the display won't see it. + The typed key is stored in the 'key' option, which is used to encrypt + the file when it is written. The file will remain unchanged until you + write it. See also |-x|. + +The value of the 'key' options is used when text is written. When the option +is not empty, the written file will be encrypted, using the value as the +encryption key. A magic number is prepended, so that Vim can recognize that +the file is encrypted. + +To disable the encryption, reset the 'key' option to an empty value: > + :set key= + +When reading a file that has been encrypted and this option is not empty, it +will be used for decryption. If the value is empty, you will be prompted to +enter the key. If you don't enter a key, the file is edited without being +decrypted. + +If want to start reading a file that uses a different key, set the 'key' +option to an empty string, so that Vim will prompt for a new one. Don't use +the ":set" command to enter the value, other people can read the command over +your shoulder. + +Since the value of the 'key' option is supposed to be a secret, its value can +never be viewed. You should not set this option in a vimrc file. + +An encrypted file can be recognized by the "file" command, if you add this +line to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the +"magic" file: > + 0 string VimCrypt~ Vim encrypted file + +Notes: +- Encryption is not possible when doing conversion with 'charconvert'. +- Text you copy or delete goes to the numbered registers. The registers can + be saved in the .viminfo file, where they could be read. Change your + 'viminfo' option to be safe. +- Someone can type commands in Vim when you walk away for a moment, he should + not be able to get the key. +- If you make a typing mistake when entering the key, you might not be able to + get your text back! +- If you type the key with a ":set key=value" command, it can be kept in the + history, showing the 'key' value in a viminfo file. +- There is never 100% safety. The encryption in Vim has not been tested for + robustness. +- The algorithm used is breakable. A 4 character key in about one hour, a 6 + character key in one day (on a Pentium 133 PC). This requires that you know + some text that must appear in the file. An expert can break it for any key. + When the text has been decrypted, this also means that the key can be + revealed, and other files encrypted with the same key can be decrypted. +- Pkzip uses the same encryption, and US Govt has no objection to its export. + Pkzip's public file APPNOTE.TXT describes this algorithm in detail. +- Vim originates from the Netherlands. That is where the sources come from. + Thus the encryption code is not exported from the USA. + +============================================================================== +10. Timestamps *timestamp* *timestamps* + +Vim remembers the modification timestamp of a file when you begin editing it. +This is used to avoid that you have two different versions of the same file +(without you knowing this). + +After a shell command is run (|:!cmd| |suspend| |:read!| |K|) timestamps are +compared for all buffers in a window. Vim will run any associated +|FileChangedShell| autocommands or display a warning for any files that have +changed. In the GUI this happens when Vim regains input focus. + + *E321* *E462* +If you want to automatically reload a file when it has been changed outside of +Vim, set the 'autoread' option. This doesn't work at the moment you write the +file though, only when the file wasn't changed inside of Vim. + +Note that if a FileChangedShell autocommand is defined you will not get a +warning message or prompt. The autocommand is expected to handle this. + +There is no warning for a directory (e.g., with |netrw-browse|). But you do +get warned if you started editing a new file and it was created as a directory +later. + +When Vim notices the timestamp of a file has changed, and the file is being +edited in a buffer but has not changed, Vim checks if the contents of the file +is equal. This is done by reading the file again (into a hidden buffer, which +is immediately deleted again) and comparing the text. If the text is equal, +you will get no warning. + +If you don't get warned often enough you can use the following command. + + *:checkt* *:checktime* +:checkt[ime] Check if any buffers were changed outside of Vim. + This checks and warns you if you would end up with two + versions of a file. + If this is called from an autocommand, a ":global" + command or is not typed the actual check is postponed + until a moment the side effects (reloading the file) + would be harmless. + Each loaded buffer is checked for its associated file + being changed. If the file was changed Vim will take + action. If there are no changes in the buffer and + 'autoread' is set, the buffer is reloaded. Otherwise, + you are offered the choice of reloading the file. If + the file was deleted you get an error message. + If the file previously didn't exist you get a warning + if it exists now. + Once a file has been checked the timestamp is reset, + you will not be warned again. + +:[N]checkt[ime] {filename} +:[N]checkt[ime] [N] + Check the timestamp of a specific buffer. The buffer + may be specified by name, number or with a pattern. + + +Before writing a file the timestamp is checked. If it has changed, Vim will +ask if you really want to overwrite the file: + + WARNING: The file has been changed since reading it!!! + Do you really want to write to it (y/n)? + +If you hit 'y' Vim will continue writing the file. If you hit 'n' the write is +aborted. If you used ":wq" or "ZZ" Vim will not exit, you will get another +chance to write the file. + +The message would normally mean that somebody has written to the file after +the edit session started. This could be another person, in which case you +probably want to check if your changes to the file and the changes from the +other person should be merged. Write the file under another name and check for +differences (the "diff" program can be used for this). + +It is also possible that you modified the file yourself, from another edit +session or with another command (e.g., a filter command). Then you will know +which version of the file you want to keep. + +There is one situation where you get the message while there is nothing wrong: +On a Win32 system on the day daylight saving time starts. There is something +in the Win32 libraries that confuses Vim about the hour time difference. The +problem goes away the next day. + +============================================================================== +11. File Searching *file-searching* + +{not available when compiled without the |+path_extra| feature} + +The file searching is currently used for the 'path', 'cdpath' and 'tags' +options. There are three different types of searching: + +1) Downward search: *starstar* + Downward search uses the wildcards '*', '**' and possibly others + supported by your operating system. '*' and '**' are handled inside Vim, so + they work on all operating systems. + + The usage of '*' is quite simple: It matches 0 or more characters. + + '**' is more sophisticated: + - It ONLY matches directories. + - It matches up to 30 directories deep, so you can use it to search an + entire directory tree + - The maximum number of levels matched can be given by appending a number + to '**'. + Thus '/usr/**2' can match: > + /usr + /usr/include + /usr/include/sys + /usr/include/g++ + /usr/lib + /usr/lib/X11 + .... +< It does NOT match '/usr/include/g++/std' as this would be three + levels. + The allowed number range is 0 ('**0' is removed) to 255. + If the given number is smaller than 0 it defaults to 30, if it's + bigger than 255 it defaults to 255. + - '**' can only be at the end of the path or be followed by a path + separator or by a number and a path separator. + + You can combine '*' and '**' in any order: > + /usr/**/sys/* + /usr/*/sys/** + /usr/**2/sys/* + +2) Upward search: + Here you can give a directory and then search the directory tree upward for + a file. You could give stop-directories to limit the upward search. The + stop-directories are appended to the path (for the 'path' option) or to + the filename (for the 'tags' option) with a ';'. If you want several + stop-directories separate them with ';'. If you want no stop-directory + ("search upward till the root directory) just use ';'. > + /usr/include/sys;/usr +< will search in: > + /usr/include/sys + /usr/include + /usr +< + If you use a relative path the upward search is started in Vim's current + directory or in the directory of the current file (if the relative path + starts with './' and 'd' is not included in 'cpoptions'). + + If Vim's current path is /u/user_x/work/release and you do > + :set path=include;/u/user_x +< and then search for a file with |gf| the file is searched in: > + /u/user_x/work/release/include + /u/user_x/work/include + /u/user_x/include + +3) Combined up/downward search: + If Vim's current path is /u/user_x/work/release and you do > + set path=**;/u/user_x +< and then search for a file with |gf| the file is searched in: > + /u/user_x/work/release/** + /u/user_x/work/** + /u/user_x/** +< + BE CAREFUL! This might consume a lot of time, as the search of + '/u/user_x/**' includes '/u/user_x/work/**' and + '/u/user_x/work/release/**'. So '/u/user_x/work/release/**' is searched + three times and '/u/user_x/work/**' is searched twice. + + In the above example you might want to set path to: > + :set path=**,/u/user_x/** +< This searches: > + /u/user_x/work/release/** + /u/user_x/** +< This searches the same directories, but in a different order. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/eval.txt b/Aufgabe5/doc.lang/eval.txt new file mode 100644 index 0000000..22421bb --- /dev/null +++ b/Aufgabe5/doc.lang/eval.txt @@ -0,0 +1,7386 @@ +*eval.txt* For Vim version 7.0. Last change: 2006 Nov 01 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Expression evaluation *expression* *expr* *E15* *eval* + +Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|. + +Note: Expression evaluation can be disabled at compile time. If this has been +done, the features in this document are not available. See |+eval| and +|no-eval-feature|. + +1. Variables |variables| + 1.1 Variable types + 1.2 Function references |Funcref| + 1.3 Lists |Lists| + 1.4 Dictionaries |Dictionaries| + 1.5 More about variables |more-variables| +2. Expression syntax |expression-syntax| +3. Internal variable |internal-variables| +4. Builtin Functions |functions| +5. Defining functions |user-functions| +6. Curly braces names |curly-braces-names| +7. Commands |expression-commands| +8. Exception handling |exception-handling| +9. Examples |eval-examples| +10. No +eval feature |no-eval-feature| +11. The sandbox |eval-sandbox| +12. Textlock |textlock| + +{Vi does not have any of these commands} + +============================================================================== +1. Variables *variables* + +1.1 Variable types ~ + *E712* +There are five types of variables: + +Number A 32 bit signed number. + Examples: -123 0x10 0177 + +String A NUL terminated string of 8-bit unsigned characters (bytes). + Examples: "ab\txx\"--" 'x-z''a,c' + +Funcref A reference to a function |Funcref|. + Example: function("strlen") + +List An ordered sequence of items |List|. + Example: [1, 2, ['a', 'b']] + +Dictionary An associative, unordered array: Each entry has a key and a + value. |Dictionary| + Example: {'blue': "#0000ff", 'red': "#ff0000"} + +The Number and String types are converted automatically, depending on how they +are used. + +Conversion from a Number to a String is by making the ASCII representation of +the Number. Examples: > + Number 123 --> String "123" + Number 0 --> String "0" + Number -1 --> String "-1" + +Conversion from a String to a Number is done by converting the first digits +to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If +the String doesn't start with digits, the result is zero. Examples: > + String "456" --> Number 456 + String "6bar" --> Number 6 + String "foo" --> Number 0 + String "0xf1" --> Number 241 + String "0100" --> Number 64 + String "-8" --> Number -8 + String "+8" --> Number 0 + +To force conversion from String to Number, add zero to it: > + :echo "0100" + 0 +< 64 ~ + +To avoid a leading zero to cause octal conversion, or for using a different +base, use |str2nr()|. + +For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE. + +Note that in the command > + :if "foo" +"foo" is converted to 0, which means FALSE. To test for a non-empty string, +use strlen(): > + :if strlen("foo") +< *E745* *E728* *E703* *E729* *E730* *E731* +List, Dictionary and Funcref types are not automatically converted. + + *E706* +You will get an error if you try to change the type of a variable. You need +to |:unlet| it first to avoid this error. String and Number are considered +equivalent though. Consider this sequence of commands: > + :let l = "string" + :let l = 44 " changes type from String to Number + :let l = [1, 2, 3] " error! + + +1.2 Function references ~ + *Funcref* *E695* *E718* +A Funcref variable is obtained with the |function()| function. It can be used +in an expression in the place of a function name, before the parenthesis +around the arguments, to invoke the function it refers to. Example: > + + :let Fn = function("MyFunc") + :echo Fn() +< *E704* *E705* *E707* +A Funcref variable must start with a capital, "s:", "w:", "t:" or "b:". You +cannot have both a Funcref variable and a function with the same name. + +A special case is defining a function and directly assigning its Funcref to a +Dictionary entry. Example: > + :function dict.init() dict + : let self.val = 0 + :endfunction + +The key of the Dictionary can start with a lower case letter. The actual +function name is not used here. Also see |numbered-function|. + +A Funcref can also be used with the |:call| command: > + :call Fn() + :call dict.init() + +The name of the referenced function can be obtained with |string()|. > + :let func = string(Fn) + +You can use |call()| to invoke a Funcref and use a list variable for the +arguments: > + :let r = call(Fn, mylist) + + +1.3 Lists ~ + *List* *Lists* *E686* +A List is an ordered sequence of items. An item can be of any type. Items +can be accessed by their index number. Items can be added and removed at any +position in the sequence. + + +List creation ~ + *E696* *E697* +A List is created with a comma separated list of items in square brackets. +Examples: > + :let mylist = [1, two, 3, "four"] + :let emptylist = [] + +An item can be any expression. Using a List for an item creates a +List of Lists: > + :let nestlist = [[11, 12], [21, 22], [31, 32]] + +An extra comma after the last item is ignored. + + +List index ~ + *list-index* *E684* +An item in the List can be accessed by putting the index in square brackets +after the List. Indexes are zero-based, thus the first item has index zero. > + :let item = mylist[0] " get the first item: 1 + :let item = mylist[2] " get the third item: 3 + +When the resulting item is a list this can be repeated: > + :let item = nestlist[0][1] " get the first list, second item: 12 +< +A negative index is counted from the end. Index -1 refers to the last item in +the List, -2 to the last but one item, etc. > + :let last = mylist[-1] " get the last item: "four" + +To avoid an error for an invalid index use the |get()| function. When an item +is not available it returns zero or the default value you specify: > + :echo get(mylist, idx) + :echo get(mylist, idx, "NONE") + + +List concatenation ~ + +Two lists can be concatenated with the "+" operator: > + :let longlist = mylist + [5, 6] + :let mylist += [7, 8] + +To prepend or append an item turn the item into a list by putting [] around +it. To change a list in-place see |list-modification| below. + + +Sublist ~ + +A part of the List can be obtained by specifying the first and last index, +separated by a colon in square brackets: > + :let shortlist = mylist[2:-1] " get List [3, "four"] + +Omitting the first index is similar to zero. Omitting the last index is +similar to -1. + :let endlist = mylist[2:] " from item 2 to the end: [3, "four"] + :let shortlist = mylist[2:2] " List with one item: [3] + :let otherlist = mylist[:] " make a copy of the List + +If the first index is beyond the last item of the List or the second item is +before the first item, the result is an empty list. There is no error +message. + +If the second index is equal to or greater than the length of the list the +length minus one is used: > + :let mylist = [0, 1, 2, 3] + :echo mylist[2:8] " result: [2, 3] + +NOTE: mylist[s:e] means using the variable "s:e" as index. Watch out for +using a single letter variable before the ":". Insert a space when needed: +mylist[s : e]. + + +List identity ~ + *list-identity* +When variable "aa" is a list and you assign it to another variable "bb", both +variables refer to the same list. Thus changing the list "aa" will also +change "bb": > + :let aa = [1, 2, 3] + :let bb = aa + :call add(aa, 4) + :echo bb +< [1, 2, 3, 4] + +Making a copy of a list is done with the |copy()| function. Using [:] also +works, as explained above. This creates a shallow copy of the list: Changing +a list item in the list will also change the item in the copied list: > + :let aa = [[1, 'a'], 2, 3] + :let bb = copy(aa) + :call add(aa, 4) + :let aa[0][1] = 'aaa' + :echo aa +< [[1, aaa], 2, 3, 4] > + :echo bb +< [[1, aaa], 2, 3] + +To make a completely independent list use |deepcopy()|. This also makes a +copy of the values in the list, recursively. Up to a hundred levels deep. + +The operator "is" can be used to check if two variables refer to the same +List. "isnot" does the opposite. In contrast "==" compares if two lists have +the same value. > + :let alist = [1, 2, 3] + :let blist = [1, 2, 3] + :echo alist is blist +< 0 > + :echo alist == blist +< 1 + +Note about comparing lists: Two lists are considered equal if they have the +same length and all items compare equal, as with using "==". There is one +exception: When comparing a number with a string they are considered +different. There is no automatic type conversion, as with using "==" on +variables. Example: > + echo 4 == "4" +< 1 > + echo [4] == ["4"] +< 0 + +Thus comparing Lists is more strict than comparing numbers and strings. You +can compare simple values this way too by putting them in a string: > + + :let a = 5 + :let b = "5" + echo a == b +< 1 > + echo [a] == [b] +< 0 + + +List unpack ~ + +To unpack the items in a list to individual variables, put the variables in +square brackets, like list items: > + :let [var1, var2] = mylist + +When the number of variables does not match the number of items in the list +this produces an error. To handle any extra items from the list append ";" +and a variable name: > + :let [var1, var2; rest] = mylist + +This works like: > + :let var1 = mylist[0] + :let var2 = mylist[1] + :let rest = mylist[2:] + +Except that there is no error if there are only two items. "rest" will be an +empty list then. + + +List modification ~ + *list-modification* +To change a specific item of a list use |:let| this way: > + :let list[4] = "four" + :let listlist[0][3] = item + +To change part of a list you can specify the first and last item to be +modified. The value must at least have the number of items in the range: > + :let list[3:5] = [3, 4, 5] + +Adding and removing items from a list is done with functions. Here are a few +examples: > + :call insert(list, 'a') " prepend item 'a' + :call insert(list, 'a', 3) " insert item 'a' before list[3] + :call add(list, "new") " append String item + :call add(list, [1, 2]) " append a List as one new item + :call extend(list, [1, 2]) " extend the list with two more items + :let i = remove(list, 3) " remove item 3 + :unlet list[3] " idem + :let l = remove(list, 3, -1) " remove items 3 to last item + :unlet list[3 : ] " idem + :call filter(list, 'v:val !~ "x"') " remove items with an 'x' + +Changing the order of items in a list: > + :call sort(list) " sort a list alphabetically + :call reverse(list) " reverse the order of items + + +For loop ~ + +The |:for| loop executes commands for each item in a list. A variable is set +to each item in the list in sequence. Example: > + :for item in mylist + : call Doit(item) + :endfor + +This works like: > + :let index = 0 + :while index < len(mylist) + : let item = mylist[index] + : :call Doit(item) + : let index = index + 1 + :endwhile + +Note that all items in the list should be of the same type, otherwise this +results in error |E706|. To avoid this |:unlet| the variable at the end of +the loop. + +If all you want to do is modify each item in the list then the |map()| +function will be a simpler method than a for loop. + +Just like the |:let| command, |:for| also accepts a list of variables. This +requires the argument to be a list of lists. > + :for [lnum, col] in [[1, 3], [2, 8], [3, 0]] + : call Doit(lnum, col) + :endfor + +This works like a |:let| command is done for each list item. Again, the types +must remain the same to avoid an error. + +It is also possible to put remaining items in a List variable: > + :for [i, j; rest] in listlist + : call Doit(i, j) + : if !empty(rest) + : echo "remainder: " . string(rest) + : endif + :endfor + + +List functions ~ + *E714* +Functions that are useful with a List: > + :let r = call(funcname, list) " call a function with an argument list + :if empty(list) " check if list is empty + :let l = len(list) " number of items in list + :let big = max(list) " maximum value in list + :let small = min(list) " minimum value in list + :let xs = count(list, 'x') " count nr of times 'x' appears in list + :let i = index(list, 'x') " index of first 'x' in list + :let lines = getline(1, 10) " get ten text lines from buffer + :call append('$', lines) " append text lines in buffer + :let list = split("a b c") " create list from items in a string + :let string = join(list, ', ') " create string from list items + :let s = string(list) " String representation of list + :call map(list, '">> " . v:val') " prepend ">> " to each item + +Don't forget that a combination of features can make things simple. For +example, to add up all the numbers in a list: > + :exe 'let sum = ' . join(nrlist, '+') + + +1.4 Dictionaries ~ + *Dictionaries* *Dictionary* +A Dictionary is an associative array: Each entry has a key and a value. The +entry can be located with the key. The entries are stored without a specific +ordering. + + +Dictionary creation ~ + *E720* *E721* *E722* *E723* +A Dictionary is created with a comma separated list of entries in curly +braces. Each entry has a key and a value, separated by a colon. Each key can +only appear once. Examples: > + :let mydict = {1: 'one', 2: 'two', 3: 'three'} + :let emptydict = {} +< *E713* *E716* *E717* +A key is always a String. You can use a Number, it will be converted to a +String automatically. Thus the String '4' and the number 4 will find the same +entry. Note that the String '04' and the Number 04 are different, since the +Number will be converted to the String '4'. + +A value can be any expression. Using a Dictionary for a value creates a +nested Dictionary: > + :let nestdict = {1: {11: 'a', 12: 'b'}, 2: {21: 'c'}} + +An extra comma after the last entry is ignored. + + +Accessing entries ~ + +The normal way to access an entry is by putting the key in square brackets: > + :let val = mydict["one"] + :let mydict["four"] = 4 + +You can add new entries to an existing Dictionary this way, unlike Lists. + +For keys that consist entirely of letters, digits and underscore the following +form can be used |expr-entry|: > + :let val = mydict.one + :let mydict.four = 4 + +Since an entry can be any type, also a List and a Dictionary, the indexing and +key lookup can be repeated: > + :echo dict.key[idx].key + + +Dictionary to List conversion ~ + +You may want to loop over the entries in a dictionary. For this you need to +turn the Dictionary into a List and pass it to |:for|. + +Most often you want to loop over the keys, using the |keys()| function: > + :for key in keys(mydict) + : echo key . ': ' . mydict[key] + :endfor + +The List of keys is unsorted. You may want to sort them first: > + :for key in sort(keys(mydict)) + +To loop over the values use the |values()| function: > + :for v in values(mydict) + : echo "value: " . v + :endfor + +If you want both the key and the value use the |items()| function. It returns +a List in which each item is a List with two items, the key and the value: > + :for entry in items(mydict) + : echo entry[0] . ': ' . entry[1] + :endfor + + +Dictionary identity ~ + *dict-identity* +Just like Lists you need to use |copy()| and |deepcopy()| to make a copy of a +Dictionary. Otherwise, assignment results in referring to the same +Dictionary: > + :let onedict = {'a': 1, 'b': 2} + :let adict = onedict + :let adict['a'] = 11 + :echo onedict['a'] + 11 + +Two Dictionaries compare equal if all the key-value pairs compare equal. For +more info see |list-identity|. + + +Dictionary modification ~ + *dict-modification* +To change an already existing entry of a Dictionary, or to add a new entry, +use |:let| this way: > + :let dict[4] = "four" + :let dict['one'] = item + +Removing an entry from a Dictionary is done with |remove()| or |:unlet|. +Three ways to remove the entry with key "aaa" from dict: > + :let i = remove(dict, 'aaa') + :unlet dict.aaa + :unlet dict['aaa'] + +Merging a Dictionary with another is done with |extend()|: > + :call extend(adict, bdict) +This extends adict with all entries from bdict. Duplicate keys cause entries +in adict to be overwritten. An optional third argument can change this. +Note that the order of entries in a Dictionary is irrelevant, thus don't +expect ":echo adict" to show the items from bdict after the older entries in +adict. + +Weeding out entries from a Dictionary can be done with |filter()|: > + :call filter(dict 'v:val =~ "x"') +This removes all entries from "dict" with a value not matching 'x'. + + +Dictionary function ~ + *Dictionary-function* *self* *E725* +When a function is defined with the "dict" attribute it can be used in a +special way with a dictionary. Example: > + :function Mylen() dict + : return len(self.data) + :endfunction + :let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")} + :echo mydict.len() + +This is like a method in object oriented programming. The entry in the +Dictionary is a |Funcref|. The local variable "self" refers to the dictionary +the function was invoked from. + +It is also possible to add a function without the "dict" attribute as a +Funcref to a Dictionary, but the "self" variable is not available then. + + *numbered-function* *anonymous-function* +To avoid the extra name for the function it can be defined and directly +assigned to a Dictionary in this way: > + :let mydict = {'data': [0, 1, 2, 3]} + :function mydict.len() dict + : return len(self.data) + :endfunction + :echo mydict.len() + +The function will then get a number and the value of dict.len is a |Funcref| +that references this function. The function can only be used through a +|Funcref|. It will automatically be deleted when there is no |Funcref| +remaining that refers to it. + +It is not necessary to use the "dict" attribute for a numbered function. + + +Functions for Dictionaries ~ + *E715* +Functions that can be used with a Dictionary: > + :if has_key(dict, 'foo') " TRUE if dict has entry with key "foo" + :if empty(dict) " TRUE if dict is empty + :let l = len(dict) " number of items in dict + :let big = max(dict) " maximum value in dict + :let small = min(dict) " minimum value in dict + :let xs = count(dict, 'x') " count nr of times 'x' appears in dict + :let s = string(dict) " String representation of dict + :call map(dict, '">> " . v:val') " prepend ">> " to each item + + +1.5 More about variables ~ + *more-variables* +If you need to know the type of a variable or expression, use the |type()| +function. + +When the '!' flag is included in the 'viminfo' option, global variables that +start with an uppercase letter, and don't contain a lowercase letter, are +stored in the viminfo file |viminfo-file|. + +When the 'sessionoptions' option contains "global", global variables that +start with an uppercase letter and contain at least one lowercase letter are +stored in the session file |session-file|. + +variable name can be stored where ~ +my_var_6 not +My_Var_6 session file +MY_VAR_6 viminfo file + + +It's possible to form a variable name with curly braces, see +|curly-braces-names|. + +============================================================================== +2. Expression syntax *expression-syntax* + +Expression syntax summary, from least to most significant: + +|expr1| expr2 ? expr1 : expr1 if-then-else + +|expr2| expr3 || expr3 .. logical OR + +|expr3| expr4 && expr4 .. logical AND + +|expr4| expr5 == expr5 equal + expr5 != expr5 not equal + expr5 > expr5 greater than + expr5 >= expr5 greater than or equal + expr5 < expr5 smaller than + expr5 <= expr5 smaller than or equal + expr5 =~ expr5 regexp matches + expr5 !~ expr5 regexp doesn't match + + expr5 ==? expr5 equal, ignoring case + expr5 ==# expr5 equal, match case + etc. As above, append ? for ignoring case, # for + matching case + + expr5 is expr5 same |List| instance + expr5 isnot expr5 different |List| instance + +|expr5| expr6 + expr6 .. number addition or list concatenation + expr6 - expr6 .. number subtraction + expr6 . expr6 .. string concatenation + +|expr6| expr7 * expr7 .. number multiplication + expr7 / expr7 .. number division + expr7 % expr7 .. number modulo + +|expr7| ! expr7 logical NOT + - expr7 unary minus + + expr7 unary plus + + +|expr8| expr8[expr1] byte of a String or item of a |List| + expr8[expr1 : expr1] substring of a String or sublist of a |List| + expr8.name entry in a |Dictionary| + expr8(expr1, ...) function call with |Funcref| variable + +|expr9| number number constant + "string" string constant, backslash is special + 'string' string constant, ' is doubled + [expr1, ...] |List| + {expr1: expr1, ...} |Dictionary| + &option option value + (expr1) nested expression + variable internal variable + va{ria}ble internal variable with curly braces + $VAR environment variable + @r contents of register 'r' + function(expr1, ...) function call + func{ti}on(expr1, ...) function call with curly braces + + +".." indicates that the operations in this level can be concatenated. +Example: > + &nu || &list && &shell == "csh" + +All expressions within one level are parsed from left to right. + + +expr1 *expr1* *E109* +----- + +expr2 ? expr1 : expr1 + +The expression before the '?' is evaluated to a number. If it evaluates to +non-zero, the result is the value of the expression between the '?' and ':', +otherwise the result is the value of the expression after the ':'. +Example: > + :echo lnum == 1 ? "top" : lnum + +Since the first expression is an "expr2", it cannot contain another ?:. The +other two expressions can, thus allow for recursive use of ?:. +Example: > + :echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum + +To keep this readable, using |line-continuation| is suggested: > + :echo lnum == 1 + :\ ? "top" + :\ : lnum == 1000 + :\ ? "last" + :\ : lnum + + +expr2 and expr3 *expr2* *expr3* +--------------- + + *expr-barbar* *expr-&&* +The "||" and "&&" operators take one argument on each side. The arguments +are (converted to) Numbers. The result is: + + input output ~ +n1 n2 n1 || n2 n1 && n2 ~ +zero zero zero zero +zero non-zero non-zero zero +non-zero zero non-zero zero +non-zero non-zero non-zero non-zero + +The operators can be concatenated, for example: > + + &nu || &list && &shell == "csh" + +Note that "&&" takes precedence over "||", so this has the meaning of: > + + &nu || (&list && &shell == "csh") + +Once the result is known, the expression "short-circuits", that is, further +arguments are not evaluated. This is like what happens in C. For example: > + + let a = 1 + echo a || b + +This is valid even if there is no variable called "b" because "a" is non-zero, +so the result must be non-zero. Similarly below: > + + echo exists("b") && b == "yes" + +This is valid whether "b" has been defined or not. The second clause will +only be evaluated if "b" has been defined. + + +expr4 *expr4* +----- + +expr5 {cmp} expr5 + +Compare two expr5 expressions, resulting in a 0 if it evaluates to false, or 1 +if it evaluates to true. + + *expr-==* *expr-!=* *expr->* *expr->=* + *expr-<* *expr-<=* *expr-=~* *expr-!~* + *expr-==#* *expr-!=#* *expr->#* *expr->=#* + *expr-<#* *expr-<=#* *expr-=~#* *expr-!~#* + *expr-==?* *expr-!=?* *expr->?* *expr->=?* + *expr- ># >? +greater than or equal >= >=# >=? +smaller than < <# + :let c = getline(".")[col(".") - 1] + +If the length of the String is less than the index, the result is an empty +String. A negative index always results in an empty string (reason: backwards +compatibility). Use [-1:] to get the last byte. + +If expr8 is a |List| then it results the item at index expr1. See |list-index| +for possible index values. If the index is out of range this results in an +error. Example: > + :let item = mylist[-1] " get last item + +Generally, if a |List| index is equal to or higher than the length of the +|List|, or more negative than the length of the |List|, this results in an +error. + + +expr8[expr1a : expr1b] substring or sublist *expr-[:]* + +If expr8 is a Number or String this results in the substring with the bytes +from expr1a to and including expr1b. expr8 is used as a String, expr1a and +expr1b are used as a Number. Note that this doesn't recognize multi-byte +encodings. + +If expr1a is omitted zero is used. If expr1b is omitted the length of the +string minus one is used. + +A negative number can be used to measure from the end of the string. -1 is +the last character, -2 the last but one, etc. + +If an index goes out of range for the string characters are omitted. If +expr1b is smaller than expr1a the result is an empty string. + +Examples: > + :let c = name[-1:] " last byte of a string + :let c = name[-2:-2] " last but one byte of a string + :let s = line(".")[4:] " from the fifth byte to the end + :let s = s[:-3] " remove last two bytes + +If expr8 is a |List| this results in a new |List| with the items indicated by +the indexes expr1a and expr1b. This works like with a String, as explained +just above, except that indexes out of range cause an error. Examples: > + :let l = mylist[:3] " first four items + :let l = mylist[4:4] " List with one item + :let l = mylist[:] " shallow copy of a List + +Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an +error. + + +expr8.name entry in a |Dictionary| *expr-entry* + +If expr8 is a |Dictionary| and it is followed by a dot, then the following +name will be used as a key in the |Dictionary|. This is just like: +expr8[name]. + +The name must consist of alphanumeric characters, just like a variable name, +but it may start with a number. Curly braces cannot be used. + +There must not be white space before or after the dot. + +Examples: > + :let dict = {"one": 1, 2: "two"} + :echo dict.one + :echo dict .2 + +Note that the dot is also used for String concatenation. To avoid confusion +always put spaces around the dot for String concatenation. + + +expr8(expr1, ...) |Funcref| function call + +When expr8 is a |Funcref| type variable, invoke the function it refers to. + + + + *expr9* +number +------ +number number constant *expr-number* + +Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). + + +string *expr-string* *E114* +------ +"string" string constant *expr-quote* + +Note that double quotes are used. + +A string constant accepts these special characters: +\... three-digit octal number (e.g., "\316") +\.. two-digit octal number (must be followed by non-digit) +\. one-digit octal number (must be followed by non-digit) +\x.. byte specified with two hex numbers (e.g., "\x1f") +\x. byte specified with one hex number (must be followed by non-hex char) +\X.. same as \x.. +\X. same as \x. +\u.... character specified with up to 4 hex numbers, stored according to the + current value of 'encoding' (e.g., "\u02a4") +\U.... same as \u.... +\b backspace +\e escape +\f formfeed +\n newline +\r return +\t tab +\\ backslash +\" double quote +\ Special key named "xxx". e.g. "\" for CTRL-W. + +Note that "\000" and "\x00" force the end of the string. + + +literal-string *literal-string* *E115* +--------------- +'string' string constant *expr-'* + +Note that single quotes are used. + +This string is taken as it is. No backslashes are removed or have a special +meaning. The only exception is that two quotes stand for one quote. + +Single quoted strings are useful for patterns, so that backslashes do not need +to be doubled. These two commands are equivalent: > + if a =~ "\\s*" + if a =~ '\s*' + + +option *expr-option* *E112* *E113* +------ +&option option value, local value if possible +&g:option global option value +&l:option local option value + +Examples: > + echo "tabstop is " . &tabstop + if &insertmode + +Any option name can be used here. See |options|. When using the local value +and there is no buffer-local or window-local value, the global value is used +anyway. + + +register *expr-register* +-------- +@r contents of register 'r' + +The result is the contents of the named register, as a single string. +Newlines are inserted where required. To get the contents of the unnamed +register use @" or @@. See |registers| for an explanation of the available +registers. + +When using the '=' register you get the expression itself, not what it +evaluates to. Use |eval()| to evaluate it. + + +nesting *expr-nesting* *E110* +------- +(expr1) nested expression + + +environment variable *expr-env* +-------------------- +$VAR environment variable + +The String value of any environment variable. When it is not defined, the +result is an empty string. + *expr-env-expand* +Note that there is a difference between using $VAR directly and using +expand("$VAR"). Using it directly will only expand environment variables that +are known inside the current Vim session. Using expand() will first try using +the environment variables known inside the current Vim session. If that +fails, a shell will be used to expand the variable. This can be slow, but it +does expand all variables that the shell knows about. Example: > + :echo $version + :echo expand("$version") +The first one probably doesn't echo anything, the second echoes the $version +variable (if your shell supports it). + + +internal variable *expr-variable* +----------------- +variable internal variable +See below |internal-variables|. + + +function call *expr-function* *E116* *E118* *E119* *E120* +------------- +function(expr1, ...) function call +See below |functions|. + + +============================================================================== +3. Internal variable *internal-variables* *E121* + *E461* +An internal variable name can be made up of letters, digits and '_'. But it +cannot start with a digit. It's also possible to use curly braces, see +|curly-braces-names|. + +An internal variable is created with the ":let" command |:let|. +An internal variable is explicitly destroyed with the ":unlet" command +|:unlet|. +Using a name that is not an internal variable or refers to a variable that has +been destroyed results in an error. + +There are several name spaces for variables. Which one is to be used is +specified by what is prepended: + + (nothing) In a function: local to a function; otherwise: global +|buffer-variable| b: Local to the current buffer. +|window-variable| w: Local to the current window. +|tabpage-variable| t: Local to the current tab page. +|global-variable| g: Global. +|local-variable| l: Local to a function. +|script-variable| s: Local to a |:source|'ed Vim script. +|function-argument| a: Function argument (only inside a function). +|vim-variable| v: Global, predefined by Vim. + +The scope name by itself can be used as a |Dictionary|. For example, to +delete all script-local variables: > + :for k in keys(s:) + : unlet s:[k] + :endfor +< + *buffer-variable* *b:var* +A variable name that is preceded with "b:" is local to the current buffer. +Thus you can have several "b:foo" variables, one for each buffer. +This kind of variable is deleted when the buffer is wiped out or deleted with +|:bdelete|. + +One local buffer variable is predefined: + *b:changedtick-variable* *changetick* +b:changedtick The total number of changes to the current buffer. It is + incremented for each change. An undo command is also a change + in this case. This can be used to perform an action only when + the buffer has changed. Example: > + :if my_changedtick != b:changedtick + : let my_changedtick = b:changedtick + : call My_Update() + :endif +< + *window-variable* *w:var* +A variable name that is preceded with "w:" is local to the current window. It +is deleted when the window is closed. + + *tabpage-variable* *t:var* +A variable name that is preceded with "t:" is local to the current tab page, +It is deleted when the tab page is closed. {not available when compiled +without the +windows feature} + + *global-variable* *g:var* +Inside functions global variables are accessed with "g:". Omitting this will +access a variable local to a function. But "g:" can also be used in any other +place if you like. + + *local-variable* *l:var* +Inside functions local variables are accessed without prepending anything. +But you can also prepend "l:" if you like. + + *script-variable* *s:var* +In a Vim script variables starting with "s:" can be used. They cannot be +accessed from outside of the scripts, thus are local to the script. + +They can be used in: +- commands executed while the script is sourced +- functions defined in the script +- autocommands defined in the script +- functions and autocommands defined in functions and autocommands which were + defined in the script (recursively) +- user defined commands defined in the script +Thus not in: +- other scripts sourced from this one +- mappings +- etc. + +script variables can be used to avoid conflicts with global variable names. +Take this example: + + let s:counter = 0 + function MyCounter() + let s:counter = s:counter + 1 + echo s:counter + endfunction + command Tick call MyCounter() + +You can now invoke "Tick" from any script, and the "s:counter" variable in +that script will not be changed, only the "s:counter" in the script where +"Tick" was defined is used. + +Another example that does the same: > + + let s:counter = 0 + command Tick let s:counter = s:counter + 1 | echo s:counter + +When calling a function and invoking a user-defined command, the context for +script variables is set to the script where the function or command was +defined. + +The script variables are also available when a function is defined inside a +function that is defined in a script. Example: > + + let s:counter = 0 + function StartCounting(incr) + if a:incr + function MyCounter() + let s:counter = s:counter + 1 + endfunction + else + function MyCounter() + let s:counter = s:counter - 1 + endfunction + endif + endfunction + +This defines the MyCounter() function either for counting up or counting down +when calling StartCounting(). It doesn't matter from where StartCounting() is +called, the s:counter variable will be accessible in MyCounter(). + +When the same script is sourced again it will use the same script variables. +They will remain valid as long as Vim is running. This can be used to +maintain a counter: > + + if !exists("s:counter") + let s:counter = 1 + echo "script executed for the first time" + else + let s:counter = s:counter + 1 + echo "script executed " . s:counter . " times now" + endif + +Note that this means that filetype plugins don't get a different set of script +variables for each buffer. Use local buffer variables instead |b:var|. + + +Predefined Vim variables: *vim-variable* *v:var* + + *v:beval_col* *beval_col-variable* +v:beval_col The number of the column, over which the mouse pointer is. + This is the byte index in the |v:beval_lnum| line. + Only valid while evaluating the 'balloonexpr' option. + + *v:beval_bufnr* *beval_bufnr-variable* +v:beval_bufnr The number of the buffer, over which the mouse pointer is. Only + valid while evaluating the 'balloonexpr' option. + + *v:beval_lnum* *beval_lnum-variable* +v:beval_lnum The number of the line, over which the mouse pointer is. Only + valid while evaluating the 'balloonexpr' option. + + *v:beval_text* *beval_text-variable* +v:beval_text The text under or after the mouse pointer. Usually a word as + it is useful for debugging a C program. 'iskeyword' applies, + but a dot and "->" before the position is included. When on a + ']' the text before it is used, including the matching '[' and + word before it. When on a Visual area within one line the + highlighted text is used. + Only valid while evaluating the 'balloonexpr' option. + + *v:beval_winnr* *beval_winnr-variable* +v:beval_winnr The number of the window, over which the mouse pointer is. Only + valid while evaluating the 'balloonexpr' option. + + *v:char* *char-variable* +v:char Argument for evaluating 'formatexpr'. + + *v:charconvert_from* *charconvert_from-variable* +v:charconvert_from + The name of the character encoding of a file to be converted. + Only valid while evaluating the 'charconvert' option. + + *v:charconvert_to* *charconvert_to-variable* +v:charconvert_to + The name of the character encoding of a file after conversion. + Only valid while evaluating the 'charconvert' option. + + *v:cmdarg* *cmdarg-variable* +v:cmdarg This variable is used for two purposes: + 1. The extra arguments given to a file read/write command. + Currently these are "++enc=" and "++ff=". This variable is + set before an autocommand event for a file read/write + command is triggered. There is a leading space to make it + possible to append this variable directly after the + read/write command. Note: The "+cmd" argument isn't + included here, because it will be executed anyway. + 2. When printing a PostScript file with ":hardcopy" this is + the argument for the ":hardcopy" command. This can be used + in 'printexpr'. + + *v:cmdbang* *cmdbang-variable* +v:cmdbang Set like v:cmdarg for a file read/write command. When a "!" + was used the value is 1, otherwise it is 0. Note that this + can only be used in autocommands. For user commands || + can be used. + + *v:count* *count-variable* +v:count The count given for the last Normal mode command. Can be used + to get the count before a mapping. Read-only. Example: > + :map _x :echo "the count is " . v:count +< Note: The is required to remove the line range that you + get when typing ':' after a count. + Also used for evaluating the 'formatexpr' option. + "count" also works, for backwards compatibility. + + *v:count1* *count1-variable* +v:count1 Just like "v:count", but defaults to one when no count is + used. + + *v:ctype* *ctype-variable* +v:ctype The current locale setting for characters of the runtime + environment. This allows Vim scripts to be aware of the + current locale encoding. Technical: it's the value of + LC_CTYPE. When not using a locale the value is "C". + This variable can not be set directly, use the |:language| + command. + See |multi-lang|. + + *v:dying* *dying-variable* +v:dying Normally zero. When a deadly signal is caught it's set to + one. When multiple signals are caught the number increases. + Can be used in an autocommand to check if Vim didn't + terminate normally. {only works on Unix} + Example: > + :au VimLeave * if v:dying | echo "\nAAAAaaaarrrggghhhh!!!\n" | endif +< + *v:errmsg* *errmsg-variable* +v:errmsg Last given error message. It's allowed to set this variable. + Example: > + :let v:errmsg = "" + :silent! next + :if v:errmsg != "" + : ... handle error +< "errmsg" also works, for backwards compatibility. + + *v:exception* *exception-variable* +v:exception The value of the exception most recently caught and not + finished. See also |v:throwpoint| and |throw-variables|. + Example: > + :try + : throw "oops" + :catch /.*/ + : echo "caught" v:exception + :endtry +< Output: "caught oops". + + *v:fcs_reason* *fcs_reason-variable* +v:fcs_reason The reason why the |FileChangedShell| event was triggered. + Can be used in an autocommand to decide what to do and/or what + to set v:fcs_choice to. Possible values: + deleted file no longer exists + conflict file contents, mode or timestamp was + changed and buffer is modified + changed file contents has changed + mode mode of file changed + time only file timestamp changed + + *v:fcs_choice* *fcs_choice-variable* +v:fcs_choice What should happen after a |FileChangedShell| event was + triggered. Can be used in an autocommand to tell Vim what to + do with the affected buffer: + reload Reload the buffer (does not work if + the file was deleted). + ask Ask the user what to do, as if there + was no autocommand. Except that when + only the timestamp changed nothing + will happen. + Nothing, the autocommand should do + everything that needs to be done. + The default is empty. If another (invalid) value is used then + Vim behaves like it is empty, there is no warning message. + + *v:fname_in* *fname_in-variable* +v:fname_in The name of the input file. Valid while evaluating: + option used for ~ + 'charconvert' file to be converted + 'diffexpr' original file + 'patchexpr' original file + 'printexpr' file to be printed + And set to the swap file name for |SwapExists|. + + *v:fname_out* *fname_out-variable* +v:fname_out The name of the output file. Only valid while + evaluating: + option used for ~ + 'charconvert' resulting converted file (*) + 'diffexpr' output of diff + 'patchexpr' resulting patched file + (*) When doing conversion for a write command (e.g., ":w + file") it will be equal to v:fname_in. When doing conversion + for a read command (e.g., ":e file") it will be a temporary + file and different from v:fname_in. + + *v:fname_new* *fname_new-variable* +v:fname_new The name of the new version of the file. Only valid while + evaluating 'diffexpr'. + + *v:fname_diff* *fname_diff-variable* +v:fname_diff The name of the diff (patch) file. Only valid while + evaluating 'patchexpr'. + + *v:folddashes* *folddashes-variable* +v:folddashes Used for 'foldtext': dashes representing foldlevel of a closed + fold. + Read-only in the |sandbox|. |fold-foldtext| + + *v:foldlevel* *foldlevel-variable* +v:foldlevel Used for 'foldtext': foldlevel of closed fold. + Read-only in the |sandbox|. |fold-foldtext| + + *v:foldend* *foldend-variable* +v:foldend Used for 'foldtext': last line of closed fold. + Read-only in the |sandbox|. |fold-foldtext| + + *v:foldstart* *foldstart-variable* +v:foldstart Used for 'foldtext': first line of closed fold. + Read-only in the |sandbox|. |fold-foldtext| + + *v:insertmode* *insertmode-variable* +v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand + events. Values: + i Insert mode + r Replace mode + v Virtual Replace mode + + *v:key* *key-variable* +v:key Key of the current item of a |Dictionary|. Only valid while + evaluating the expression used with |map()| and |filter()|. + Read-only. + + *v:lang* *lang-variable* +v:lang The current locale setting for messages of the runtime + environment. This allows Vim scripts to be aware of the + current language. Technical: it's the value of LC_MESSAGES. + The value is system dependent. + This variable can not be set directly, use the |:language| + command. + It can be different from |v:ctype| when messages are desired + in a different language than what is used for character + encoding. See |multi-lang|. + + *v:lc_time* *lc_time-variable* +v:lc_time The current locale setting for time messages of the runtime + environment. This allows Vim scripts to be aware of the + current language. Technical: it's the value of LC_TIME. + This variable can not be set directly, use the |:language| + command. See |multi-lang|. + + *v:lnum* *lnum-variable* +v:lnum Line number for the 'foldexpr' |fold-expr| and 'indentexpr' + expressions, tab page number for 'guitablabel' and + 'guitabtooltip'. Only valid while one of these expressions is + being evaluated. Read-only when in the |sandbox|. + + *v:mouse_win* *mouse_win-variable* +v:mouse_win Window number for a mouse click obtained with |getchar()|. + First window has number 1, like with |winnr()|. The value is + zero when there was no mouse button click. + + *v:mouse_lnum* *mouse_lnum-variable* +v:mouse_lnum Line number for a mouse click obtained with |getchar()|. + This is the text line number, not the screen line number. The + value is zero when there was no mouse button click. + + *v:mouse_col* *mouse_col-variable* +v:mouse_col Column number for a mouse click obtained with |getchar()|. + This is the screen column number, like with |virtcol()|. The + value is zero when there was no mouse button click. + + *v:prevcount* *prevcount-variable* +v:prevcount The count given for the last but one Normal mode command. + This is the v:count value of the previous command. Useful if + you want to cancel Visual mode and then use the count. > + :vmap % :call MyFilter(v:prevcount) +< Read-only. + + *v:profiling* *profiling-variable* +v:profiling Normally zero. Set to one after using ":profile start". + See |profiling|. + + *v:progname* *progname-variable* +v:progname Contains the name (with path removed) with which Vim was + invoked. Allows you to do special initialisations for "view", + "evim" etc., or any other name you might symlink to Vim. + Read-only. + + *v:register* *register-variable* +v:register The name of the register supplied to the last normal mode + command. Empty if none were supplied. |getreg()| |setreg()| + + *v:scrollstart* *scrollstart-variable* +v:scrollstart String describing the script or function that caused the + screen to scroll up. It's only set when it is empty, thus the + first reason is remembered. It is set to "Unknown" for a + typed command. + This can be used to find out why your script causes the + hit-enter prompt. + + *v:servername* *servername-variable* +v:servername The resulting registered |x11-clientserver| name if any. + Read-only. + + *v:shell_error* *shell_error-variable* +v:shell_error Result of the last shell command. When non-zero, the last + shell command had an error. When zero, there was no problem. + This only works when the shell returns the error code to Vim. + The value -1 is often used when the command could not be + executed. Read-only. + Example: > + :!mv foo bar + :if v:shell_error + : echo 'could not rename "foo" to "bar"!' + :endif +< "shell_error" also works, for backwards compatibility. + + *v:statusmsg* *statusmsg-variable* +v:statusmsg Last given status message. It's allowed to set this variable. + + *v:swapname* *swapname-variable* +v:swapname Only valid when executing |SwapExists| autocommands: Name of + the swap file found. Read-only. + + *v:swapchoice* *swapchoice-variable* +v:swapchoice |SwapExists| autocommands can set this to the selected choice + for handling an existing swap file: + 'o' Open read-only + 'e' Edit anyway + 'r' Recover + 'd' Delete swapfile + 'q' Quit + 'a' Abort + The value should be a single-character string. An empty value + results in the user being asked, as would happen when there is + no SwapExists autocommand. The default is empty. + + *v:swapcommand* *swapcommand-variable* +v:swapcommand Normal mode command to be executed after a file has been + opened. Can be used for a |SwapExists| autocommand to have + another Vim open the file and jump to the right place. For + example, when jumping to a tag the value is ":tag tagname\r". + For ":edit +cmd file" the value is ":cmd\r". + + *v:termresponse* *termresponse-variable* +v:termresponse The escape sequence returned by the terminal for the |t_RV| + termcap entry. It is set when Vim receives an escape sequence + that starts with ESC [ or CSI and ends in a 'c', with only + digits, ';' and '.' in between. + When this option is set, the TermResponse autocommand event is + fired, so that you can react to the response from the + terminal. + The response from a new xterm is: "[ Pp ; Pv ; Pc c". Pp + is the terminal type: 0 for vt100 and 1 for vt220. Pv is the + patch level (since this was introduced in patch 95, it's + always 95 or bigger). Pc is always zero. + {only when compiled with |+termresponse| feature} + + *v:this_session* *this_session-variable* +v:this_session Full filename of the last loaded or saved session file. See + |:mksession|. It is allowed to set this variable. When no + session file has been saved, this variable is empty. + "this_session" also works, for backwards compatibility. + + *v:throwpoint* *throwpoint-variable* +v:throwpoint The point where the exception most recently caught and not + finished was thrown. Not set when commands are typed. See + also |v:exception| and |throw-variables|. + Example: > + :try + : throw "oops" + :catch /.*/ + : echo "Exception from" v:throwpoint + :endtry +< Output: "Exception from test.vim, line 2" + + *v:val* *val-variable* +v:val Value of the current item of a |List| or |Dictionary|. Only + valid while evaluating the expression used with |map()| and + |filter()|. Read-only. + + *v:version* *version-variable* +v:version Version number of Vim: Major version number times 100 plus + minor version number. Version 5.0 is 500. Version 5.1 (5.01) + is 501. Read-only. "version" also works, for backwards + compatibility. + Use |has()| to check if a certain patch was included, e.g.: > + if has("patch123") +< Note that patch numbers are specific to the version, thus both + version 5.0 and 5.1 may have a patch 123, but these are + completely different. + + *v:warningmsg* *warningmsg-variable* +v:warningmsg Last given warning message. It's allowed to set this variable. + +============================================================================== +4. Builtin Functions *functions* + +See |function-list| for a list grouped by what the function is used for. + +(Use CTRL-] on the function name to jump to the full explanation.) + +USAGE RESULT DESCRIPTION ~ + +add( {list}, {item}) List append {item} to |List| {list} +append( {lnum}, {string}) Number append {string} below line {lnum} +append( {lnum}, {list}) Number append lines {list} below line {lnum} +argc() Number number of files in the argument list +argidx() Number current index in the argument list +argv( {nr}) String {nr} entry of the argument list +argv( ) List the argument list +browse( {save}, {title}, {initdir}, {default}) + String put up a file requester +browsedir( {title}, {initdir}) String put up a directory requester +bufexists( {expr}) Number TRUE if buffer {expr} exists +buflisted( {expr}) Number TRUE if buffer {expr} is listed +bufloaded( {expr}) Number TRUE if buffer {expr} is loaded +bufname( {expr}) String Name of the buffer {expr} +bufnr( {expr}) Number Number of the buffer {expr} +bufwinnr( {expr}) Number window number of buffer {expr} +byte2line( {byte}) Number line number at byte count {byte} +byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr} +call( {func}, {arglist} [, {dict}]) + any call {func} with arguments {arglist} +changenr() Number current change number +char2nr( {expr}) Number ASCII value of first char in {expr} +cindent( {lnum}) Number C indent for line {lnum} +col( {expr}) Number column nr of cursor or mark +complete({startcol}, {matches}) String set Insert mode completion +complete_add( {expr}) Number add completion match +complete_check() Number check for key typed during completion +confirm( {msg} [, {choices} [, {default} [, {type}]]]) + Number number of choice picked by user +copy( {expr}) any make a shallow copy of {expr} +count( {list}, {expr} [, {start} [, {ic}]]) + Number count how many {expr} are in {list} +cscope_connection( [{num} , {dbpath} [, {prepend}]]) + Number checks existence of cscope connection +cursor( {lnum}, {col} [, {coladd}]) + Number move cursor to {lnum}, {col}, {coladd} +cursor( {list}) Number move cursor to position in {list} +deepcopy( {expr}) any make a full copy of {expr} +delete( {fname}) Number delete file {fname} +did_filetype() Number TRUE if FileType autocommand event used +diff_filler( {lnum}) Number diff filler lines about {lnum} +diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} +empty( {expr}) Number TRUE if {expr} is empty +escape( {string}, {chars}) String escape {chars} in {string} with '\' +eval( {string}) any evaluate {string} into its value +eventhandler( ) Number TRUE if inside an event handler +executable( {expr}) Number 1 if executable {expr} exists +exists( {expr}) Number TRUE if {expr} exists +extend({expr1}, {expr2} [, {expr3}]) + List/Dict insert items of {expr2} into {expr1} +expand( {expr}) String expand special keywords in {expr} +feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer +filereadable( {file}) Number TRUE if {file} is a readable file +filewritable( {file}) Number TRUE if {file} is a writable file +filter( {expr}, {string}) List/Dict remove items from {expr} where + {string} is 0 +finddir( {name}[, {path}[, {count}]]) + String find directory {name} in {path} +findfile( {name}[, {path}[, {count}]]) + String find file {name} in {path} +fnamemodify( {fname}, {mods}) String modify file name +foldclosed( {lnum}) Number first line of fold at {lnum} if closed +foldclosedend( {lnum}) Number last line of fold at {lnum} if closed +foldlevel( {lnum}) Number fold level at {lnum} +foldtext( ) String line displayed for closed fold +foldtextresult( {lnum}) String text for closed fold at {lnum} +foreground( ) Number bring the Vim window to the foreground +function( {name}) Funcref reference to function {name} +garbagecollect() none free memory, breaking cyclic references +get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def} +get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def} +getbufline( {expr}, {lnum} [, {end}]) + List lines {lnum} to {end} of buffer {expr} +getbufvar( {expr}, {varname}) any variable {varname} in buffer {expr} +getchar( [expr]) Number get one character from the user +getcharmod( ) Number modifiers for the last typed character +getcmdline() String return the current command-line +getcmdpos() Number return cursor position in command-line +getcmdtype() String return the current command-line type +getcwd() String the current working directory +getfperm( {fname}) String file permissions of file {fname} +getfsize( {fname}) Number size in bytes of file {fname} +getfontname( [{name}]) String name of font being used +getftime( {fname}) Number last modification time of file +getftype( {fname}) String description of type of file {fname} +getline( {lnum}) String line {lnum} of current buffer +getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer +getloclist({nr}) List list of location list items +getpos( {expr}) List position of cursor, mark, etc. +getqflist() List list of quickfix items +getreg( [{regname} [, 1]]) String contents of register +getregtype( [{regname}]) String type of register +gettabwinvar( {tabnr}, {winnr}, {name}) + any {name} in {winnr} in tab page {tabnr} +getwinposx() Number X coord in pixels of GUI Vim window +getwinposy() Number Y coord in pixels of GUI Vim window +getwinvar( {nr}, {varname}) any variable {varname} in window {nr} +glob( {expr}) String expand file wildcards in {expr} +globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path} +has( {feature}) Number TRUE if feature {feature} supported +has_key( {dict}, {key}) Number TRUE if {dict} has entry {key} +hasmapto( {what} [, {mode} [, {abbr}]]) + Number TRUE if mapping to {what} exists +histadd( {history},{item}) String add an item to a history +histdel( {history} [, {item}]) String remove an item from a history +histget( {history} [, {index}]) String get the item {index} from a history +histnr( {history}) Number highest index of a history +hlexists( {name}) Number TRUE if highlight group {name} exists +hlID( {name}) Number syntax ID of highlight group {name} +hostname() String name of the machine Vim is running on +iconv( {expr}, {from}, {to}) String convert encoding of {expr} +indent( {lnum}) Number indent of line {lnum} +index( {list}, {expr} [, {start} [, {ic}]]) + Number index in {list} where {expr} appears +input( {prompt} [, {text} [, {completion}]]) + String get input from the user +inputdialog( {p} [, {t} [, {c}]]) String like input() but in a GUI dialog +inputlist( {textlist}) Number let the user pick from a choice list +inputrestore() Number restore typeahead +inputsave() Number save and clear typeahead +inputsecret( {prompt} [, {text}]) String like input() but hiding the text +insert( {list}, {item} [, {idx}]) List insert {item} in {list} [before {idx}] +isdirectory( {directory}) Number TRUE if {directory} is a directory +islocked( {expr}) Number TRUE if {expr} is locked +items( {dict}) List key-value pairs in {dict} +join( {list} [, {sep}]) String join {list} items into one String +keys( {dict}) List keys in {dict} +len( {expr}) Number the length of {expr} +libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg} +libcallnr( {lib}, {func}, {arg}) Number idem, but return a Number +line( {expr}) Number line nr of cursor, last line or mark +line2byte( {lnum}) Number byte count of line {lnum} +lispindent( {lnum}) Number Lisp indent for line {lnum} +localtime() Number current time +map( {expr}, {string}) List/Dict change each item in {expr} to {expr} +maparg( {name}[, {mode} [, {abbr}]]) + String rhs of mapping {name} in mode {mode} +mapcheck( {name}[, {mode} [, {abbr}]]) + String check for mappings matching {name} +match( {expr}, {pat}[, {start}[, {count}]]) + Number position where {pat} matches in {expr} +matcharg( {nr}) List arguments of |:match| +matchend( {expr}, {pat}[, {start}[, {count}]]) + Number position where {pat} ends in {expr} +matchlist( {expr}, {pat}[, {start}[, {count}]]) + List match and submatches of {pat} in {expr} +matchstr( {expr}, {pat}[, {start}[, {count}]]) + String {count}'th match of {pat} in {expr} +max({list}) Number maximum value of items in {list} +min({list}) Number minumum value of items in {list} +mkdir({name} [, {path} [, {prot}]]) + Number create directory {name} +mode() String current editing mode +nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} +nr2char( {expr}) String single char with ASCII value {expr} +pathshorten( {expr}) String shorten directory names in a path +prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} +printf( {fmt}, {expr1}...) String format text +pumvisible() Number whether popup menu is visible +range( {expr} [, {max} [, {stride}]]) + List items from {expr} to {max} +readfile({fname} [, {binary} [, {max}]]) + List get list of lines from file {fname} +reltime( [{start} [, {end}]]) List get time value +reltimestr( {time}) String turn time value into a String +remote_expr( {server}, {string} [, {idvar}]) + String send expression +remote_foreground( {server}) Number bring Vim server to the foreground +remote_peek( {serverid} [, {retvar}]) + Number check for reply string +remote_read( {serverid}) String read reply string +remote_send( {server}, {string} [, {idvar}]) + String send key sequence +remove( {list}, {idx} [, {end}]) any remove items {idx}-{end} from {list} +remove( {dict}, {key}) any remove entry {key} from {dict} +rename( {from}, {to}) Number rename (move) file from {from} to {to} +repeat( {expr}, {count}) String repeat {expr} {count} times +resolve( {filename}) String get filename a shortcut points to +reverse( {list}) List reverse {list} in-place +search( {pattern} [, {flags}]) Number search for {pattern} +searchdecl({name} [, {global} [, {thisblock}]]) + Number search for variable declaration +searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) + Number search for other end of start/end pair +searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) + List search for other end of start/end pair +searchpos( {pattern} [, {flags} [, {stopline}]]) + List search for {pattern} +server2client( {clientid}, {string}) + Number send reply string +serverlist() String get a list of available servers +setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} +setcmdpos( {pos}) Number set cursor position in command-line +setline( {lnum}, {line}) Number set line {lnum} to {line} +setloclist( {nr}, {list}[, {action}]) + Number modify location list using {list} +setpos( {expr}, {list}) none set the {expr} position to {list} +setqflist( {list}[, {action}]) Number modify quickfix list using {list} +setreg( {n}, {v}[, {opt}]) Number set register to value and type +settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window + {winnr} in tab page {tabnr} to {val} +setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val} +shellescape( {string}) String escape {string} for use as shell + command argument +simplify( {filename}) String simplify filename as much as possible +sort( {list} [, {func}]) List sort {list}, using {func} to compare +soundfold( {word}) String sound-fold {word} +spellbadword() String badly spelled word at cursor +spellsuggest( {word} [, {max} [, {capital}]]) + List spelling suggestions +split( {expr} [, {pat} [, {keepempty}]]) + List make |List| from {pat} separated {expr} +str2nr( {expr} [, {base}]) Number convert string to number +strftime( {format}[, {time}]) String time in specified format +stridx( {haystack}, {needle}[, {start}]) + Number index of {needle} in {haystack} +string( {expr}) String String representation of {expr} value +strlen( {expr}) Number length of the String {expr} +strpart( {src}, {start}[, {len}]) + String {len} characters of {src} at {start} +strridx( {haystack}, {needle} [, {start}]) + Number last index of {needle} in {haystack} +strtrans( {expr}) String translate string to make it printable +submatch( {nr}) String specific match in ":substitute" +substitute( {expr}, {pat}, {sub}, {flags}) + String all {pat} in {expr} replaced with {sub} +synID( {lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col} +synIDattr( {synID}, {what} [, {mode}]) + String attribute {what} of syntax ID {synID} +synIDtrans( {synID}) Number translated syntax ID of {synID} +system( {expr} [, {input}]) String output of shell command/filter {expr} +tabpagebuflist( [{arg}]) List list of buffer numbers in tab page +tabpagenr( [{arg}]) Number number of current or last tab page +tabpagewinnr( {tabarg}[, {arg}]) + Number number of current window in tab page +taglist( {expr}) List list of tags matching {expr} +tagfiles() List tags files used +tempname() String name for a temporary file +tolower( {expr}) String the String {expr} switched to lowercase +toupper( {expr}) String the String {expr} switched to uppercase +tr( {src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} + to chars in {tostr} +type( {name}) Number type of variable {name} +values( {dict}) List values in {dict} +virtcol( {expr}) Number screen column of cursor or mark +visualmode( [expr]) String last visual mode used +winbufnr( {nr}) Number buffer number of window {nr} +wincol() Number window column of the cursor +winheight( {nr}) Number height of window {nr} +winline() Number window line of the cursor +winnr( [{expr}]) Number number of current window +winrestcmd() String returns command to restore window sizes +winrestview({dict}) None restore view of current window +winsaveview() Dict save view of current window +winwidth( {nr}) Number width of window {nr} +writefile({list}, {fname} [, {binary}]) + Number write list of lines to file {fname} + +add({list}, {expr}) *add()* + Append the item {expr} to |List| {list}. Returns the + resulting |List|. Examples: > + :let alist = add([1, 2, 3], item) + :call add(mylist, "woodstock") +< Note that when {expr} is a |List| it is appended as a single + item. Use |extend()| to concatenate |Lists|. + Use |insert()| to add an item at another position. + + +append({lnum}, {expr}) *append()* + When {expr} is a |List|: Append each item of the |List| as a + text line below line {lnum} in the current buffer. + Otherwise append {expr} as one text line below line {lnum} in + the current buffer. + {lnum} can be zero to insert a line before the first one. + Returns 1 for failure ({lnum} out of range or out of memory), + 0 for success. Example: > + :let failed = append(line('$'), "# THE END") + :let failed = append(0, ["Chapter 1", "the beginning"]) +< + *argc()* +argc() The result is the number of files in the argument list of the + current window. See |arglist|. + + *argidx()* +argidx() The result is the current index in the argument list. 0 is + the first file. argc() - 1 is the last one. See |arglist|. + + *argv()* +argv([{nr}]) The result is the {nr}th file in the argument list of the + current window. See |arglist|. "argv(0)" is the first one. + Example: > + :let i = 0 + :while i < argc() + : let f = escape(argv(i), '. ') + : exe 'amenu Arg.' . f . ' :e ' . f . '' + : let i = i + 1 + :endwhile +< Without the {nr} argument a |List| with the whole |arglist| is + returned. + + *browse()* +browse({save}, {title}, {initdir}, {default}) + Put up a file requester. This only works when "has("browse")" + returns non-zero (only in some GUI versions). + The input fields are: + {save} when non-zero, select file to write + {title} title for the requester + {initdir} directory to start browsing in + {default} default file name + When the "Cancel" button is hit, something went wrong, or + browsing is not possible, an empty string is returned. + + *browsedir()* +browsedir({title}, {initdir}) + Put up a directory requester. This only works when + "has("browse")" returns non-zero (only in some GUI versions). + On systems where a directory browser is not supported a file + browser is used. In that case: select a file in the directory + to be used. + The input fields are: + {title} title for the requester + {initdir} directory to start browsing in + When the "Cancel" button is hit, something went wrong, or + browsing is not possible, an empty string is returned. + +bufexists({expr}) *bufexists()* + The result is a Number, which is non-zero if a buffer called + {expr} exists. + If the {expr} argument is a number, buffer numbers are used. + If the {expr} argument is a string it must match a buffer name + exactly. The name can be: + - Relative to the current directory. + - A full path. + - The name of a buffer with 'filetype' set to "nofile". + - A URL name. + Unlisted buffers will be found. + Note that help files are listed by their short name in the + output of |:buffers|, but bufexists() requires using their + long name to be able to find them. + Use "bufexists(0)" to test for the existence of an alternate + file name. + *buffer_exists()* + Obsolete name: buffer_exists(). + +buflisted({expr}) *buflisted()* + The result is a Number, which is non-zero if a buffer called + {expr} exists and is listed (has the 'buflisted' option set). + The {expr} argument is used like with |bufexists()|. + +bufloaded({expr}) *bufloaded()* + The result is a Number, which is non-zero if a buffer called + {expr} exists and is loaded (shown in a window or hidden). + The {expr} argument is used like with |bufexists()|. + +bufname({expr}) *bufname()* + The result is the name of a buffer, as it is displayed by the + ":ls" command. + If {expr} is a Number, that buffer number's name is given. + Number zero is the alternate buffer for the current window. + If {expr} is a String, it is used as a |file-pattern| to match + with the buffer names. This is always done like 'magic' is + set and 'cpoptions' is empty. When there is more than one + match an empty string is returned. + "" or "%" can be used for the current buffer, "#" for the + alternate buffer. + A full match is preferred, otherwise a match at the start, end + or middle of the buffer name is accepted. + Listed buffers are found first. If there is a single match + with a listed buffer, that one is returned. Next unlisted + buffers are searched for. + If the {expr} is a String, but you want to use it as a buffer + number, force it to be a Number by adding zero to it: > + :echo bufname("3" + 0) +< If the buffer doesn't exist, or doesn't have a name, an empty + string is returned. > + bufname("#") alternate buffer name + bufname(3) name of buffer 3 + bufname("%") name of current buffer + bufname("file2") name of buffer where "file2" matches. +< *buffer_name()* + Obsolete name: buffer_name(). + + *bufnr()* +bufnr({expr} [, {create}]) + The result is the number of a buffer, as it is displayed by + the ":ls" command. For the use of {expr}, see |bufname()| + above. + If the buffer doesn't exist, -1 is returned. Or, if the + {create} argument is present and not zero, a new, unlisted, + buffer is created and its number is returned. + bufnr("$") is the last buffer: > + :let last_buffer = bufnr("$") +< The result is a Number, which is the highest buffer number + of existing buffers. Note that not all buffers with a smaller + number necessarily exist, because ":bwipeout" may have removed + them. Use bufexists() to test for the existence of a buffer. + *buffer_number()* + Obsolete name: buffer_number(). + *last_buffer_nr()* + Obsolete name for bufnr("$"): last_buffer_nr(). + +bufwinnr({expr}) *bufwinnr()* + The result is a Number, which is the number of the first + window associated with buffer {expr}. For the use of {expr}, + see |bufname()| above. If buffer {expr} doesn't exist or + there is no such window, -1 is returned. Example: > + + echo "A window containing buffer 1 is " . (bufwinnr(1)) + +< The number can be used with |CTRL-W_w| and ":wincmd w" + |:wincmd|. + + +byte2line({byte}) *byte2line()* + Return the line number that contains the character at byte + count {byte} in the current buffer. This includes the + end-of-line character, depending on the 'fileformat' option + for the current buffer. The first character has byte count + one. + Also see |line2byte()|, |go| and |:goto|. + {not available when compiled without the |+byte_offset| + feature} + +byteidx({expr}, {nr}) *byteidx()* + Return byte index of the {nr}'th character in the string + {expr}. Use zero for the first character, it returns zero. + This function is only useful when there are multibyte + characters, otherwise the returned value is equal to {nr}. + Composing characters are counted as a separate character. + Example : > + echo matchstr(str, ".", byteidx(str, 3)) +< will display the fourth character. Another way to do the + same: > + let s = strpart(str, byteidx(str, 3)) + echo strpart(s, 0, byteidx(s, 1)) +< If there are less than {nr} characters -1 is returned. + If there are exactly {nr} characters the length of the string + is returned. + +call({func}, {arglist} [, {dict}]) *call()* *E699* + Call function {func} with the items in |List| {arglist} as + arguments. + {func} can either be a |Funcref| or the name of a function. + a:firstline and a:lastline are set to the cursor line. + Returns the return value of the called function. + {dict} is for functions with the "dict" attribute. It will be + used to set the local variable "self". |Dictionary-function| + +changenr() *changenr()* + Return the number of the most recent change. This is the same + number as what is displayed with |:undolist| and can be used + with the |:undo| command. + When a change was made it is the number of that change. After + redo it is the number of the redone change. After undo it is + one less than the number of the undone change. + +char2nr({expr}) *char2nr()* + Return number value of the first char in {expr}. Examples: > + char2nr(" ") returns 32 + char2nr("ABC") returns 65 +< The current 'encoding' is used. Example for "utf-8": > + char2nr("?") returns 225 + char2nr("?"[0]) returns 195 +< nr2char() does the opposite. + +cindent({lnum}) *cindent()* + Get the amount of indent for line {lnum} according the C + indenting rules, as with 'cindent'. + The indent is counted in spaces, the value of 'tabstop' is + relevant. {lnum} is used just like in |getline()|. + When {lnum} is invalid or Vim was not compiled the |+cindent| + feature, -1 is returned. + See |C-indenting|. + + *col()* +col({expr}) The result is a Number, which is the byte index of the column + position given with {expr}. The accepted positions are: + . the cursor position + $ the end of the cursor line (the result is the + number of characters in the cursor line plus one) + 'x position of mark x (if the mark is not set, 0 is + returned) + To get the line number use |col()|. To get both use + |getpos()|. + For the screen column position use |virtcol()|. + Note that only marks in the current file can be used. + Examples: > + col(".") column of cursor + col("$") length of cursor line plus one + col("'t") column of mark t + col("'" . markname) column of mark markname +< The first column is 1. 0 is returned for an error. + For the cursor position, when 'virtualedit' is active, the + column is one higher if the cursor is after the end of the + line. This can be used to obtain the column in Insert mode: > + :imap :let save_ve = &ve + \:set ve=all + \:echo col(".") . "\n" + \let &ve = save_ve +< + +complete({startcol}, {matches}) *complete()* *E785* + Set the matches for Insert mode completion. + Can only be used in Insert mode. You need to use a mapping + with an expression argument |:map-| or CTRL-R = + |i_CTRL-R|. It does not work after CTRL-O. + {startcol} is the byte offset in the line where the completed + text start. The text up to the cursor is the original text + that will be replaced by the matches. Use col('.') for an + empty string. "col('.') - 1" will replace one character by a + match. + {matches} must be a |List|. Each |List| item is one match. + See |complete-items| for the kind of items that are possible. + Note that the after calling this function you need to avoid + inserting anything that would completion to stop. + The match can be selected with CTRL-N and CTRL-P as usual with + Insert mode completion. The popup menu will appear if + specified, see |ins-completion-menu|. + Example: > + inoremap ListMonths() + + func! ListMonths() + call complete(col('.'), ['January', 'February', 'March', + \ 'April', 'May', 'June', 'July', 'August', 'September', + \ 'October', 'November', 'December']) + return '' + endfunc +< This isn't very useful, but it shows how it works. Note that + an empty string is returned to avoid a zero being inserted. + +complete_add({expr}) *complete_add()* + Add {expr} to the list of matches. Only to be used by the + function specified with the 'completefunc' option. + Returns 0 for failure (empty string or out of memory), + 1 when the match was added, 2 when the match was already in + the list. + See |complete-functions| for an explanation of {expr}. It is + the same as one item in the list that 'omnifunc' would return. + +complete_check() *complete_check()* + Check for a key typed while looking for completion matches. + This is to be used when looking for matches takes some time. + Returns non-zero when searching for matches is to be aborted, + zero otherwise. + Only to be used by the function specified with the + 'completefunc' option. + + *confirm()* +confirm({msg} [, {choices} [, {default} [, {type}]]]) + Confirm() offers the user a dialog, from which a choice can be + made. It returns the number of the choice. For the first + choice this is 1. + Note: confirm() is only supported when compiled with dialog + support, see |+dialog_con| and |+dialog_gui|. + {msg} is displayed in a |dialog| with {choices} as the + alternatives. When {choices} is missing or empty, "&OK" is + used (and translated). + {msg} is a String, use '\n' to include a newline. Only on + some systems the string is wrapped when it doesn't fit. + {choices} is a String, with the individual choices separated + by '\n', e.g. > + confirm("Save changes?", "&Yes\n&No\n&Cancel") +< The letter after the '&' is the shortcut key for that choice. + Thus you can type 'c' to select "Cancel". The shortcut does + not need to be the first letter: > + confirm("file has been modified", "&Save\nSave &All") +< For the console, the first letter of each choice is used as + the default shortcut key. + The optional {default} argument is the number of the choice + that is made if the user hits . Use 1 to make the first + choice the default one. Use 0 to not set a default. If + {default} is omitted, 1 is used. + The optional {type} argument gives the type of dialog. This + is only used for the icon of the Win32 GUI. It can be one of + these values: "Error", "Question", "Info", "Warning" or + "Generic". Only the first character is relevant. When {type} + is omitted, "Generic" is used. + If the user aborts the dialog by pressing , CTRL-C, + or another valid interrupt key, confirm() returns 0. + + An example: > + :let choice = confirm("What do you want?", "&Apples\n&Oranges\n&Bananas", 2) + :if choice == 0 + : echo "make up your mind!" + :elseif choice == 3 + : echo "tasteful" + :else + : echo "I prefer bananas myself." + :endif +< In a GUI dialog, buttons are used. The layout of the buttons + depends on the 'v' flag in 'guioptions'. If it is included, + the buttons are always put vertically. Otherwise, confirm() + tries to put the buttons in one horizontal line. If they + don't fit, a vertical layout is used anyway. For some systems + the horizontal layout is always used. + + *copy()* +copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't + different from using {expr} directly. + When {expr} is a |List| a shallow copy is created. This means + that the original |List| can be changed without changing the + copy, and vise versa. But the items are identical, thus + changing an item changes the contents of both |Lists|. Also + see |deepcopy()|. + +count({comp}, {expr} [, {ic} [, {start}]]) *count()* + Return the number of times an item with value {expr} appears + in |List| or |Dictionary| {comp}. + If {start} is given then start with the item with this index. + {start} can only be used with a |List|. + When {ic} is given and it's non-zero then case is ignored. + + + *cscope_connection()* +cscope_connection([{num} , {dbpath} [, {prepend}]]) + Checks for the existence of a |cscope| connection. If no + parameters are specified, then the function returns: + 0, if cscope was not available (not compiled in), or + if there are no cscope connections; + 1, if there is at least one cscope connection. + + If parameters are specified, then the value of {num} + determines how existence of a cscope connection is checked: + + {num} Description of existence check + ----- ------------------------------ + 0 Same as no parameters (e.g., "cscope_connection()"). + 1 Ignore {prepend}, and use partial string matches for + {dbpath}. + 2 Ignore {prepend}, and use exact string matches for + {dbpath}. + 3 Use {prepend}, use partial string matches for both + {dbpath} and {prepend}. + 4 Use {prepend}, use exact string matches for both + {dbpath} and {prepend}. + + Note: All string comparisons are case sensitive! + + Examples. Suppose we had the following (from ":cs show"): > + + # pid database name prepend path + 0 27664 cscope.out /usr/local +< + Invocation Return Val ~ + ---------- ---------- > + cscope_connection() 1 + cscope_connection(1, "out") 1 + cscope_connection(2, "out") 0 + cscope_connection(3, "out") 0 + cscope_connection(3, "out", "local") 1 + cscope_connection(4, "out") 0 + cscope_connection(4, "out", "local") 0 + cscope_connection(4, "cscope.out", "/usr/local") 1 +< +cursor({lnum}, {col} [, {off}]) *cursor()* +cursor({list}) + Positions the cursor at the column {col} in the line {lnum}. + The first column is one. + When there is one argument {list} this is used as a |List| + with two or three items {lnum}, {col} and {off}. This is like + the return value of |getpos()|, but without the first item. + Does not change the jumplist. + If {lnum} is greater than the number of lines in the buffer, + the cursor will be positioned at the last line in the buffer. + If {lnum} is zero, the cursor will stay in the current line. + If {col} is greater than the number of bytes in the line, + the cursor will be positioned at the last character in the + line. + If {col} is zero, the cursor will stay in the current column. + When 'virtualedit' is used {off} specifies the offset in + screen columns from the start of the character. E.g., a + position within a Tab or after the last character. + + +deepcopy({expr}[, {noref}]) *deepcopy()* *E698* + Make a copy of {expr}. For Numbers and Strings this isn't + different from using {expr} directly. + When {expr} is a |List| a full copy is created. This means + that the original |List| can be changed without changing the + copy, and vise versa. When an item is a |List|, a copy for it + is made, recursively. Thus changing an item in the copy does + not change the contents of the original |List|. + When {noref} is omitted or zero a contained |List| or + |Dictionary| is only copied once. All references point to + this single copy. With {noref} set to 1 every occurrence of a + |List| or |Dictionary| results in a new copy. This also means + that a cyclic reference causes deepcopy() to fail. + *E724* + Nesting is possible up to 100 levels. When there is an item + that refers back to a higher level making a deep copy with + {noref} set to 1 will fail. + Also see |copy()|. + +delete({fname}) *delete()* + Deletes the file by the name {fname}. The result is a Number, + which is 0 if the file was deleted successfully, and non-zero + when the deletion failed. + Use |remove()| to delete an item from a |List|. + + *did_filetype()* +did_filetype() Returns non-zero when autocommands are being executed and the + FileType event has been triggered at least once. Can be used + to avoid triggering the FileType event again in the scripts + that detect the file type. |FileType| + When editing another file, the counter is reset, thus this + really checks if the FileType event has been triggered for the + current buffer. This allows an autocommand that starts + editing another buffer to set 'filetype' and load a syntax + file. + +diff_filler({lnum}) *diff_filler()* + Returns the number of filler lines above line {lnum}. + These are the lines that were inserted at this point in + another diff'ed window. These filler lines are shown in the + display but don't exist in the buffer. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. + Returns 0 if the current window is not in diff mode. + +diff_hlID({lnum}, {col}) *diff_hlID()* + Returns the highlight ID for diff mode at line {lnum} column + {col} (byte index). When the current line does not have a + diff change zero is returned. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. + {col} is 1 for the leftmost column, {lnum} is 1 for the first + line. + The highlight ID can be used with |synIDattr()| to obtain + syntax information about the highlighting. + +empty({expr}) *empty()* + Return the Number 1 if {expr} is empty, zero otherwise. + A |List| or |Dictionary| is empty when it does not have any + items. A Number is empty when its value is zero. + For a long |List| this is much faster then comparing the + length with zero. + +escape({string}, {chars}) *escape()* + Escape the characters in {chars} that occur in {string} with a + backslash. Example: > + :echo escape('c:\program files\vim', ' \') +< results in: > + c:\\program\ files\\vim + +< *eval()* +eval({string}) Evaluate {string} and return the result. Especially useful to + turn the result of |string()| back into the original value. + This works for Numbers, Strings and composites of them. + Also works for |Funcref|s that refer to existing functions. + +eventhandler() *eventhandler()* + Returns 1 when inside an event handler. That is that Vim got + interrupted while waiting for the user to type a character, + e.g., when dropping a file on Vim. This means interactive + commands cannot be used. Otherwise zero is returned. + +executable({expr}) *executable()* + This function checks if an executable with the name {expr} + exists. {expr} must be the name of the program without any + arguments. + executable() uses the value of $PATH and/or the normal + searchpath for programs. *PATHEXT* + On MS-DOS and MS-Windows the ".exe", ".bat", etc. can + optionally be included. Then the extensions in $PATHEXT are + tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be + found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is + used. A dot by itself can be used in $PATHEXT to try using + the name without an extension. When 'shell' looks like a + Unix shell, then the name is also tried without adding an + extension. + On MS-DOS and MS-Windows it only checks if the file exists and + is not a directory, not if it's really executable. + On MS-Windows an executable in the same directory as Vim is + always found. Since this directory is added to $PATH it + should also work to execute it |win32-PATH|. + The result is a Number: + 1 exists + 0 does not exist + -1 not implemented on this system + + *exists()* +exists({expr}) The result is a Number, which is non-zero if {expr} is + defined, zero otherwise. The {expr} argument is a string, + which contains one of these: + &option-name Vim option (only checks if it exists, + not if it really works) + +option-name Vim option that works. + $ENVNAME environment variable (could also be + done by comparing with an empty + string) + *funcname built-in function (see |functions|) + or user defined function (see + |user-functions|). + varname internal variable (see + |internal-variables|). Also works + for |curly-braces-names|, |Dictionary| + entries, |List| items, etc. Beware + that this may cause functions to be + invoked cause an error message for an + invalid expression. + :cmdname Ex command: built-in command, user + command or command modifier |:command|. + Returns: + 1 for match with start of a command + 2 full match with a command + 3 matches several user commands + To check for a supported command + always check the return value to be 2. + :2match The |:2match| command. + :3match The |:3match| command. + #event autocommand defined for this event + #event#pattern autocommand defined for this event and + pattern (the pattern is taken + literally and compared to the + autocommand patterns character by + character) + #group autocommand group exists + #group#event autocommand defined for this group and + event. + #group#event#pattern + autocommand defined for this group, + event and pattern. + ##event autocommand for this event is + supported. + For checking for a supported feature use |has()|. + + Examples: > + exists("&shortname") + exists("$HOSTNAME") + exists("*strftime") + exists("*s:MyFunc") + exists("bufcount") + exists(":Make") + exists("#CursorHold") + exists("#BufReadPre#*.gz") + exists("#filetypeindent") + exists("#filetypeindent#FileType") + exists("#filetypeindent#FileType#*") + exists("##ColorScheme") +< There must be no space between the symbol (&/$/*/#) and the + name. + There must be no extra characters after the name, although in + a few cases this is ignored. That may become more strict in + the future, thus don't count on it! + Working example: > + exists(":make") +< NOT working example: > + exists(":make install") + +< Note that the argument must be a string, not the name of the + variable itself. For example: > + exists(bufcount) +< This doesn't check for existence of the "bufcount" variable, + but gets the value of "bufcount", and checks if that exists. + +expand({expr} [, {flag}]) *expand()* + Expand wildcards and the following special keywords in {expr}. + The result is a String. + + When there are several matches, they are separated by + characters. [Note: in version 5.0 a space was used, which + caused problems when a file name contains a space] + + If the expansion fails, the result is an empty string. A name + for a non-existing file is not included. + + When {expr} starts with '%', '#' or '<', the expansion is done + like for the |cmdline-special| variables with their associated + modifiers. Here is a short overview: + + % current file name + # alternate file name + #n alternate file name n + file name under the cursor + autocmd file name + autocmd buffer number (as a String!) + autocmd matched name + sourced script file name + word under the cursor + WORD under the cursor + the {clientid} of the last received + message |server2client()| + Modifiers: + :p expand to full path + :h head (last path component removed) + :t tail (last path component only) + :r root (one extension removed) + :e extension only + + Example: > + :let &tags = expand("%:p:h") . "/tags" +< Note that when expanding a string that starts with '%', '#' or + '<', any following text is ignored. This does NOT work: > + :let doesntwork = expand("%:h.bak") +< Use this: > + :let doeswork = expand("%:h") . ".bak" +< Also note that expanding "" and others only returns the + referenced file name without further expansion. If "" + is "~/.cshrc", you need to do another expand() to have the + "~/" expanded into the path of the home directory: > + :echo expand(expand("")) +< + There cannot be white space between the variables and the + following modifier. The |fnamemodify()| function can be used + to modify normal file names. + + When using '%' or '#', and the current or alternate file name + is not defined, an empty string is used. Using "%:p" in a + buffer with no name, results in the current directory, with a + '/' added. + + When {expr} does not start with '%', '#' or '<', it is + expanded like a file name is expanded on the command line. + 'suffixes' and 'wildignore' are used, unless the optional + {flag} argument is given and it is non-zero. Names for + non-existing files are included. The "**" item can be used to + search in a directory tree. For example, to find all "README" + files in the current directory and below: > + :echo expand("**/README") +< + Expand() can also be used to expand variables and environment + variables that are only known in a shell. But this can be + slow, because a shell must be started. See |expr-env-expand|. + The expanded variable is still handled like a list of file + names. When an environment variable cannot be expanded, it is + left unchanged. Thus ":echo expand('$FOOBAR')" results in + "$FOOBAR". + + See |glob()| for finding existing files. See |system()| for + getting the raw output of an external command. + +extend({expr1}, {expr2} [, {expr3}]) *extend()* + {expr1} and {expr2} must be both |Lists| or both + |Dictionaries|. + + If they are |Lists|: Append {expr2} to {expr1}. + If {expr3} is given insert the items of {expr2} before item + {expr3} in {expr1}. When {expr3} is zero insert before the + first item. When {expr3} is equal to len({expr1}) then + {expr2} is appended. + Examples: > + :echo sort(extend(mylist, [7, 5])) + :call extend(mylist, [2, 3], 1) +< Use |add()| to concatenate one item to a list. To concatenate + two lists into a new list use the + operator: > + :let newlist = [1, 2, 3] + [4, 5] +< + If they are |Dictionaries|: + Add all entries from {expr2} to {expr1}. + If a key exists in both {expr1} and {expr2} then {expr3} is + used to decide what to do: + {expr3} = "keep": keep the value of {expr1} + {expr3} = "force": use the value of {expr2} + {expr3} = "error": give an error message *E737* + When {expr3} is omitted then "force" is assumed. + + {expr1} is changed when {expr2} is not empty. If necessary + make a copy of {expr1} first. + {expr2} remains unchanged. + Returns {expr1}. + + +feedkeys({string} [, {mode}]) *feedkeys()* + Characters in {string} are queued for processing as if they + come from a mapping or were typed by user. They are added to + the end of the typeahead buffer, thus if a mapping is still + being executed these characters come after them. + The function does not wait for processing of keys contained in + {string}. + To include special keys into {string}, use double-quotes + and "\..." notation |expr-quote|. For example, + feedkeys("\") simulates pressing of the Enter key. But + feedkeys('\') pushes 5 characters. + If {mode} is absent, keys are remapped. + {mode} is a String, which can contain these character flags: + 'm' Remap keys. This is default. + 'n' Do not remap keys. + 't' Handle keys as if typed; otherwise they are handled as + if coming from a mapping. This matters for undo, + opening folds, etc. + Return value is always 0. + +filereadable({file}) *filereadable()* + The result is a Number, which is TRUE when a file with the + name {file} exists, and can be read. If {file} doesn't exist, + or is a directory, the result is FALSE. {file} is any + expression, which is used as a String. + *file_readable()* + Obsolete name: file_readable(). + + +filter({expr}, {string}) *filter()* + {expr} must be a |List| or a |Dictionary|. + For each item in {expr} evaluate {string} and when the result + is zero remove the item from the |List| or |Dictionary|. + Inside {string} |v:val| has the value of the current item. + For a |Dictionary| |v:key| has the key of the current item. + Examples: > + :call filter(mylist, 'v:val !~ "OLD"') +< Removes the items where "OLD" appears. > + :call filter(mydict, 'v:key >= 8') +< Removes the items with a key below 8. > + :call filter(var, 0) +< Removes all the items, thus clears the |List| or |Dictionary|. + + Note that {string} is the result of expression and is then + used as an expression again. Often it is good to use a + |literal-string| to avoid having to double backslashes. + + The operation is done in-place. If you want a |List| or + |Dictionary| to remain unmodified make a copy first: > + :let l = filter(copy(mylist), 'v:val =~ "KEEP"') + +< Returns {expr}, the |List| or |Dictionary| that was filtered. + When an error is encountered while evaluating {string} no + further items in {expr} are processed. + + +finddir({name}[, {path}[, {count}]]) *finddir()* + Find directory {name} in {path}. Returns the path of the + first found match. When the found directory is below the + current directory a relative path is returned. Otherwise a + full path is returned. + If {path} is omitted or empty then 'path' is used. + If the optional {count} is given, find {count}'s occurrence of + {name} in {path} instead of the first one. + When {count} is negative return all the matches in a |List|. + This is quite similar to the ex-command |:find|. + {only available when compiled with the +file_in_path feature} + +findfile({name}[, {path}[, {count}]]) *findfile()* + Just like |finddir()|, but find a file instead of a directory. + Uses 'suffixesadd'. + Example: > + :echo findfile("tags.vim", ".;") +< Searches from the current directory upwards until it finds + the file "tags.vim". + +filewritable({file}) *filewritable()* + The result is a Number, which is 1 when a file with the + name {file} exists, and can be written. If {file} doesn't + exist, or is not writable, the result is 0. If (file) is a + directory, and we can write to it, the result is 2. + +fnamemodify({fname}, {mods}) *fnamemodify()* + Modify file name {fname} according to {mods}. {mods} is a + string of characters like it is used for file names on the + command line. See |filename-modifiers|. + Example: > + :echo fnamemodify("main.c", ":p:h") +< results in: > + /home/mool/vim/vim/src +< Note: Environment variables and "~" don't work in {fname}, use + |expand()| first then. + +foldclosed({lnum}) *foldclosed()* + The result is a Number. If the line {lnum} is in a closed + fold, the result is the number of the first line in that fold. + If the line {lnum} is not in a closed fold, -1 is returned. + +foldclosedend({lnum}) *foldclosedend()* + The result is a Number. If the line {lnum} is in a closed + fold, the result is the number of the last line in that fold. + If the line {lnum} is not in a closed fold, -1 is returned. + +foldlevel({lnum}) *foldlevel()* + The result is a Number, which is the foldlevel of line {lnum} + in the current buffer. For nested folds the deepest level is + returned. If there is no fold at line {lnum}, zero is + returned. It doesn't matter if the folds are open or closed. + When used while updating folds (from 'foldexpr') -1 is + returned for lines where folds are still to be updated and the + foldlevel is unknown. As a special case the level of the + previous line is usually available. + + *foldtext()* +foldtext() Returns a String, to be displayed for a closed fold. This is + the default function used for the 'foldtext' option and should + only be called from evaluating 'foldtext'. It uses the + |v:foldstart|, |v:foldend| and |v:folddashes| variables. + The returned string looks like this: > + +-- 45 lines: abcdef +< The number of dashes depends on the foldlevel. The "45" is + the number of lines in the fold. "abcdef" is the text in the + first non-blank line of the fold. Leading white space, "//" + or "/*" and the text from the 'foldmarker' and 'commentstring' + options is removed. + {not available when compiled without the |+folding| feature} + +foldtextresult({lnum}) *foldtextresult()* + Returns the text that is displayed for the closed fold at line + {lnum}. Evaluates 'foldtext' in the appropriate context. + When there is no closed fold at {lnum} an empty string is + returned. + {lnum} is used like with |getline()|. Thus "." is the current + line, "'m" mark m, etc. + Useful when exporting folded text, e.g., to HTML. + {not available when compiled without the |+folding| feature} + + *foreground()* +foreground() Move the Vim window to the foreground. Useful when sent from + a client to a Vim server. |remote_send()| + On Win32 systems this might not work, the OS does not always + allow a window to bring itself to the foreground. Use + |remote_foreground()| instead. + {only in the Win32, Athena, Motif and GTK GUI versions and the + Win32 console version} + + +function({name}) *function()* *E700* + Return a |Funcref| variable that refers to function {name}. + {name} can be a user defined function or an internal function. + + +garbagecollect() *garbagecollect()* + Cleanup unused |Lists| and |Dictionaries| that have circular + references. There is hardly ever a need to invoke this + function, as it is automatically done when Vim runs out of + memory or is waiting for the user to press a key after + 'updatetime'. Items without circular references are always + freed when they become unused. + This is useful if you have deleted a very big |List| and/or + |Dictionary| with circular references in a script that runs + for a long time. + +get({list}, {idx} [, {default}]) *get()* + Get item {idx} from |List| {list}. When this item is not + available return {default}. Return zero when {default} is + omitted. +get({dict}, {key} [, {default}]) + Get item with key {key} from |Dictionary| {dict}. When this + item is not available return {default}. Return zero when + {default} is omitted. + + *getbufline()* +getbufline({expr}, {lnum} [, {end}]) + Return a |List| with the lines starting from {lnum} to {end} + (inclusive) in the buffer {expr}. If {end} is omitted, a + |List| with only the line {lnum} is returned. + + For the use of {expr}, see |bufname()| above. + + For {lnum} and {end} "$" can be used for the last line of the + buffer. Otherwise a number must be used. + + When {lnum} is smaller than 1 or bigger than the number of + lines in the buffer, an empty |List| is returned. + + When {end} is greater than the number of lines in the buffer, + it is treated as {end} is set to the number of lines in the + buffer. When {end} is before {lnum} an empty |List| is + returned. + + This function works only for loaded buffers. For unloaded and + non-existing buffers, an empty |List| is returned. + + Example: > + :let lines = getbufline(bufnr("myfile"), 1, "$") + +getbufvar({expr}, {varname}) *getbufvar()* + The result is the value of option or local buffer variable + {varname} in buffer {expr}. Note that the name without "b:" + must be used. + This also works for a global or buffer-local option, but it + doesn't work for a global variable, window-local variable or + window-local option. + For the use of {expr}, see |bufname()| above. + When the buffer or variable doesn't exist an empty string is + returned, there is no error message. + Examples: > + :let bufmodified = getbufvar(1, "&mod") + :echo "todo myvar = " . getbufvar("todo", "myvar") +< +getchar([expr]) *getchar()* + Get a single character from the user or input stream. + If [expr] is omitted, wait until a character is available. + If [expr] is 0, only get a character when one is available. + Return zero otherwise. + If [expr] is 1, only check if a character is available, it is + not consumed. Return zero if no character available. + + Without {expr} and when {expr} is 0 a whole character or + special key is returned. If it is an 8-bit character, the + result is a number. Use nr2char() to convert it to a String. + Otherwise a String is returned with the encoded character. + For a special key it's a sequence of bytes starting with 0x80 + (decimal: 128). This is the same value as the string + "\", e.g., "\". The returned value is also a + String when a modifier (shift, control, alt) was used that is + not included in the character. + + When {expr} is 1 only the first byte is returned. For a + one-byte character it is the character itself as a number. + Use nr2char() to convert it to a String. + + When the user clicks a mouse button, the mouse event will be + returned. The position can then be found in |v:mouse_col|, + |v:mouse_lnum| and |v:mouse_win|. This example positions the + mouse as it would normally happen: > + let c = getchar() + if c == "\" && v:mouse_win > 0 + exe v:mouse_win . "wincmd w" + exe v:mouse_lnum + exe "normal " . v:mouse_col . "|" + endif +< + There is no prompt, you will somehow have to make clear to the + user that a character has to be typed. + There is no mapping for the character. + Key codes are replaced, thus when the user presses the + key you get the code for the key, not the raw character + sequence. Examples: > + getchar() == "\" + getchar() == "\" +< This example redefines "f" to ignore case: > + :nmap f :call FindChar() + :function FindChar() + : let c = nr2char(getchar()) + : while col('.') < col('$') - 1 + : normal l + : if getline('.')[col('.') - 1] ==? c + : break + : endif + : endwhile + :endfunction + +getcharmod() *getcharmod()* + The result is a Number which is the state of the modifiers for + the last obtained character with getchar() or in another way. + These values are added together: + 2 shift + 4 control + 8 alt (meta) + 16 mouse double click + 32 mouse triple click + 64 mouse quadruple click + 128 Macintosh only: command + Only the modifiers that have not been included in the + character itself are obtained. Thus Shift-a results in "A" + with no modifier. + +getcmdline() *getcmdline()* + Return the current command-line. Only works when the command + line is being edited, thus requires use of |c_CTRL-\_e| or + |c_CTRL-R_=|. + Example: > + :cmap eescape(getcmdline(), ' \') +< Also see |getcmdtype()|, |getcmdpos()| and |setcmdpos()|. + +getcmdpos() *getcmdpos()* + Return the position of the cursor in the command line as a + byte count. The first column is 1. + Only works when editing the command line, thus requires use of + |c_CTRL-\_e| or |c_CTRL-R_=|. Returns 0 otherwise. + Also see |getcmdtype()|, |setcmdpos()| and |getcmdline()|. + +getcmdtype() *getcmdtype()* + Return the current command-line type. Possible return values + are: + : normal Ex command + > debug mode command |debug-mode| + / forward search command + ? backward search command + @ |input()| command + - |:insert| or |:append| command + Only works when editing the command line, thus requires use of + |c_CTRL-\_e| or |c_CTRL-R_=|. Returns an empty string + otherwise. + Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|. + + *getcwd()* +getcwd() The result is a String, which is the name of the current + working directory. + +getfsize({fname}) *getfsize()* + The result is a Number, which is the size in bytes of the + given file {fname}. + If {fname} is a directory, 0 is returned. + If the file {fname} can't be found, -1 is returned. + +getfontname([{name}]) *getfontname()* + Without an argument returns the name of the normal font being + used. Like what is used for the Normal highlight group + |hl-Normal|. + With an argument a check is done whether {name} is a valid + font name. If not then an empty string is returned. + Otherwise the actual font name is returned, or {name} if the + GUI does not support obtaining the real name. + Only works when the GUI is running, thus not in your vimrc or + gvimrc file. Use the |GUIEnter| autocommand to use this + function just after the GUI has started. + Note that the GTK 2 GUI accepts any font name, thus checking + for a valid name does not work. + +getfperm({fname}) *getfperm()* + The result is a String, which is the read, write, and execute + permissions of the given file {fname}. + If {fname} does not exist or its directory cannot be read, an + empty string is returned. + The result is of the form "rwxrwxrwx", where each group of + "rwx" flags represent, in turn, the permissions of the owner + of the file, the group the file belongs to, and other users. + If a user does not have a given permission the flag for this + is replaced with the string "-". Example: > + :echo getfperm("/etc/passwd") +< This will hopefully (from a security point of view) display + the string "rw-r--r--" or even "rw-------". + +getftime({fname}) *getftime()* + The result is a Number, which is the last modification time of + the given file {fname}. The value is measured as seconds + since 1st Jan 1970, and may be passed to strftime(). See also + |localtime()| and |strftime()|. + If the file {fname} can't be found -1 is returned. + +getftype({fname}) *getftype()* + The result is a String, which is a description of the kind of + file of the given file {fname}. + If {fname} does not exist an empty string is returned. + Here is a table over different kinds of files and their + results: + Normal file "file" + Directory "dir" + Symbolic link "link" + Block device "bdev" + Character device "cdev" + Socket "socket" + FIFO "fifo" + All other "other" + Example: > + getftype("/home") +< Note that a type such as "link" will only be returned on + systems that support it. On some systems only "dir" and + "file" are returned. + + *getline()* +getline({lnum} [, {end}]) + Without {end} the result is a String, which is line {lnum} + from the current buffer. Example: > + getline(1) +< When {lnum} is a String that doesn't start with a + digit, line() is called to translate the String into a Number. + To get the line under the cursor: > + getline(".") +< When {lnum} is smaller than 1 or bigger than the number of + lines in the buffer, an empty string is returned. + + When {end} is given the result is a |List| where each item is + a line from the current buffer in the range {lnum} to {end}, + including line {end}. + {end} is used in the same way as {lnum}. + Non-existing lines are silently omitted. + When {end} is before {lnum} an empty |List| is returned. + Example: > + :let start = line('.') + :let end = search("^$") - 1 + :let lines = getline(start, end) + +getloclist({nr}) *getloclist()* + Returns a list with all the entries in the location list for + window {nr}. When {nr} is zero the current window is used. + For a location list window, the displayed location list is + returned. For an invalid window number {nr}, an empty list is + returned. Otherwise, same as getqflist(). + +getqflist() *getqflist()* + Returns a list with all the current quickfix errors. Each + list item is a dictionary with these entries: + bufnr number of buffer that has the file name, use + bufname() to get the name + lnum line number in the buffer (first line is 1) + col column number (first column is 1) + vcol non-zero: "col" is visual column + zero: "col" is byte index + nr error number + pattern search pattern used to locate the error + text description of the error + type type of the error, 'E', '1', etc. + valid non-zero: recognized error message + + When there is no error list or it's empty an empty list is + returned. Quickfix list entries with non-existing buffer + number are returned with "bufnr" set to zero. + + Useful application: Find pattern matches in multiple files and + do something with them: > + :vimgrep /theword/jg *.c + :for d in getqflist() + : echo bufname(d.bufnr) ':' d.lnum '=' d.text + :endfor + + +getreg([{regname} [, 1]]) *getreg()* + The result is a String, which is the contents of register + {regname}. Example: > + :let cliptext = getreg('*') +< getreg('=') returns the last evaluated value of the expression + register. (For use in maps.) + getreg('=', 1) returns the expression itself, so that it can + be restored with |setreg()|. For other registers the extra + argument is ignored, thus you can always give it. + If {regname} is not specified, |v:register| is used. + + +getregtype([{regname}]) *getregtype()* + The result is a String, which is type of register {regname}. + The value will be one of: + "v" for |characterwise| text + "V" for |linewise| text + "{width}" for |blockwise-visual| text + 0 for an empty or unknown register + is one character with value 0x16. + If {regname} is not specified, |v:register| is used. + +gettabwinvar({tabnr}, {winnr}, {varname}) *gettabwinvar()* + Get the value of an option or local window variable {varname} + in window {winnr} in tab page {tabnr}. + Tabs are numbered starting with one. For the current tabpage + use |getwinvar()|. + When {winnr} is zero the current window is used. + This also works for a global option, buffer-local option and + window-local option, but it doesn't work for a global variable + or buffer-local variable. + Note that the name without "w:" must be used. + Examples: > + :let list_is_on = gettabwinvar(1, 2, '&list') + :echo "myvar = " . gettabwinvar(3, 1, 'myvar') + + *getwinposx()* +getwinposx() The result is a Number, which is the X coordinate in pixels of + the left hand side of the GUI Vim window. The result will be + -1 if the information is not available. + + *getwinposy()* +getwinposy() The result is a Number, which is the Y coordinate in pixels of + the top of the GUI Vim window. The result will be -1 if the + information is not available. + +getwinvar({winnr}, {varname}) *getwinvar()* + Like |gettabwinvar()| for the current tabpage. + Examples: > + :let list_is_on = getwinvar(2, '&list') + :echo "myvar = " . getwinvar(1, 'myvar') +< + *glob()* +glob({expr}) Expand the file wildcards in {expr}. The result is a String. + When there are several matches, they are separated by + characters. + If the expansion fails, the result is an empty string. + A name for a non-existing file is not included. + + For most systems backticks can be used to get files names from + any external command. Example: > + :let tagfiles = glob("`find . -name tags -print`") + :let &tags = substitute(tagfiles, "\n", ",", "g") +< The result of the program inside the backticks should be one + item per line. Spaces inside an item are allowed. + + See |expand()| for expanding special Vim variables. See + |system()| for getting the raw output of an external command. + +globpath({path}, {expr}) *globpath()* + Perform glob() on all directories in {path} and concatenate + the results. Example: > + :echo globpath(&rtp, "syntax/c.vim") +< {path} is a comma-separated list of directory names. Each + directory name is prepended to {expr} and expanded like with + glob(). A path separator is inserted when needed. + To add a comma inside a directory name escape it with a + backslash. Note that on MS-Windows a directory may have a + trailing backslash, remove it if you put a comma after it. + If the expansion fails for one of the directories, there is no + error message. + The 'wildignore' option applies: Names matching one of the + patterns in 'wildignore' will be skipped. + + The "**" item can be used to search in a directory tree. + For example, to find all "README.txt" files in the directories + in 'runtimepath' and below: > + :echo globpath(&rtp, "**/README.txt") +< + *has()* +has({feature}) The result is a Number, which is 1 if the feature {feature} is + supported, zero otherwise. The {feature} argument is a + string. See |feature-list| below. + Also see |exists()|. + + +has_key({dict}, {key}) *has_key()* + The result is a Number, which is 1 if |Dictionary| {dict} has + an entry with key {key}. Zero otherwise. + + +hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* + The result is a Number, which is 1 if there is a mapping that + contains {what} in somewhere in the rhs (what it is mapped to) + and this mapping exists in one of the modes indicated by + {mode}. + When {abbr} is there and it is non-zero use abbreviations + instead of mappings. Don't forget to specify Insert and/or + Command-line mode. + Both the global mappings and the mappings local to the current + buffer are checked for a match. + If no matching mapping is found 0 is returned. + The following characters are recognized in {mode}: + n Normal mode + v Visual mode + o Operator-pending mode + i Insert mode + l Language-Argument ("r", "f", "t", etc.) + c Command-line mode + When {mode} is omitted, "nvo" is used. + + This function is useful to check if a mapping already exists + to a function in a Vim script. Example: > + :if !hasmapto('\ABCdoit') + : map d \ABCdoit + :endif +< This installs the mapping to "\ABCdoit" only if there isn't + already a mapping to "\ABCdoit". + +histadd({history}, {item}) *histadd()* + Add the String {item} to the history {history} which can be + one of: *hist-names* + "cmd" or ":" command line history + "search" or "/" search pattern history + "expr" or "=" typed expression history + "input" or "@" input line history + If {item} does already exist in the history, it will be + shifted to become the newest entry. + The result is a Number: 1 if the operation was successful, + otherwise 0 is returned. + + Example: > + :call histadd("input", strftime("%Y %b %d")) + :let date=input("Enter date: ") +< This function is not available in the |sandbox|. + +histdel({history} [, {item}]) *histdel()* + Clear {history}, i.e. delete all its entries. See |hist-names| + for the possible values of {history}. + + If the parameter {item} is given as String, this is seen + as regular expression. All entries matching that expression + will be removed from the history (if there are any). + Upper/lowercase must match, unless "\c" is used |/\c|. + If {item} is a Number, it will be interpreted as index, see + |:history-indexing|. The respective entry will be removed + if it exists. + + The result is a Number: 1 for a successful operation, + otherwise 0 is returned. + + Examples: + Clear expression register history: > + :call histdel("expr") +< + Remove all entries starting with "*" from the search history: > + :call histdel("/", '^\*') +< + The following three are equivalent: > + :call histdel("search", histnr("search")) + :call histdel("search", -1) + :call histdel("search", '^'.histget("search", -1).'$') +< + To delete the last search pattern and use the last-but-one for + the "n" command and 'hlsearch': > + :call histdel("search", -1) + :let @/ = histget("search", -1) + +histget({history} [, {index}]) *histget()* + The result is a String, the entry with Number {index} from + {history}. See |hist-names| for the possible values of + {history}, and |:history-indexing| for {index}. If there is + no such entry, an empty String is returned. When {index} is + omitted, the most recent item from the history is used. + + Examples: + Redo the second last search from history. > + :execute '/' . histget("search", -2) + +< Define an Ex command ":H {num}" that supports re-execution of + the {num}th entry from the output of |:history|. > + :command -nargs=1 H execute histget("cmd", 0+) +< +histnr({history}) *histnr()* + The result is the Number of the current entry in {history}. + See |hist-names| for the possible values of {history}. + If an error occurred, -1 is returned. + + Example: > + :let inp_index = histnr("expr") +< +hlexists({name}) *hlexists()* + The result is a Number, which is non-zero if a highlight group + called {name} exists. This is when the group has been + defined in some way. Not necessarily when highlighting has + been defined for it, it may also have been used for a syntax + item. + *highlight_exists()* + Obsolete name: highlight_exists(). + + *hlID()* +hlID({name}) The result is a Number, which is the ID of the highlight group + with name {name}. When the highlight group doesn't exist, + zero is returned. + This can be used to retrieve information about the highlight + group. For example, to get the background color of the + "Comment" group: > + :echo synIDattr(synIDtrans(hlID("Comment")), "bg") +< *highlightID()* + Obsolete name: highlightID(). + +hostname() *hostname()* + The result is a String, which is the name of the machine on + which Vim is currently running. Machine names greater than + 256 characters long are truncated. + +iconv({expr}, {from}, {to}) *iconv()* + The result is a String, which is the text {expr} converted + from encoding {from} to encoding {to}. + When the conversion fails an empty string is returned. + The encoding names are whatever the iconv() library function + can accept, see ":!man 3 iconv". + Most conversions require Vim to be compiled with the |+iconv| + feature. Otherwise only UTF-8 to latin1 conversion and back + can be done. + This can be used to display messages with special characters, + no matter what 'encoding' is set to. Write the message in + UTF-8 and use: > + echo iconv(utf8_str, "utf-8", &enc) +< Note that Vim uses UTF-8 for all Unicode encodings, conversion + from/to UCS-2 is automatically changed to use UTF-8. You + cannot use UCS-2 in a string anyway, because of the NUL bytes. + {only available when compiled with the +multi_byte feature} + + *indent()* +indent({lnum}) The result is a Number, which is indent of line {lnum} in the + current buffer. The indent is counted in spaces, the value + of 'tabstop' is relevant. {lnum} is used just like in + |getline()|. + When {lnum} is invalid -1 is returned. + + +index({list}, {expr} [, {start} [, {ic}]]) *index()* + Return the lowest index in |List| {list} where the item has a + value equal to {expr}. + If {start} is given then start looking at the item with index + {start} (may be negative for an item relative to the end). + When {ic} is given and it is non-zero, ignore case. Otherwise + case must match. + -1 is returned when {expr} is not found in {list}. + Example: > + :let idx = index(words, "the") + :if index(numbers, 123) >= 0 + + +input({prompt} [, {text} [, {completion}]]) *input()* + The result is a String, which is whatever the user typed on + the command-line. The parameter is either a prompt string, or + a blank string (for no prompt). A '\n' can be used in the + prompt to start a new line. + The highlighting set with |:echohl| is used for the prompt. + The input is entered just like a command-line, with the same + editing commands and mappings. There is a separate history + for lines typed for input(). + Example: > + :if input("Coffee or beer? ") == "beer" + : echo "Cheers!" + :endif +< + If the optional {text} is present and not empty, this is used + for the default reply, as if the user typed this. Example: > + :let color = input("Color? ", "white") + +< The optional {completion} argument specifies the type of + completion supported for the input. Without it completion is + not performed. The supported completion types are the same as + that can be supplied to a user-defined command using the + "-complete=" argument. Refer to |:command-completion| for + more information. Example: > + let fname = input("File: ", "", "file") +< + NOTE: This function must not be used in a startup file, for + the versions that only run in GUI mode (e.g., the Win32 GUI). + Note: When input() is called from within a mapping it will + consume remaining characters from that mapping, because a + mapping is handled like the characters were typed. + Use |inputsave()| before input() and |inputrestore()| + after input() to avoid that. Another solution is to avoid + that further characters follow in the mapping, e.g., by using + |:execute| or |:normal|. + + Example with a mapping: > + :nmap \x :call GetFoo():exe "/" . Foo + :function GetFoo() + : call inputsave() + : let g:Foo = input("enter search pattern: ") + : call inputrestore() + :endfunction + +inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* + Like input(), but when the GUI is running and text dialogs are + supported, a dialog window pops up to input the text. + Example: > + :let n = inputdialog("value for shiftwidth", &sw) + :if n != "" + : let &sw = n + :endif +< When the dialog is cancelled {cancelreturn} is returned. When + omitted an empty string is returned. + Hitting works like pressing the OK button. Hitting + works like pressing the Cancel button. + NOTE: Command-line completion is not supported. + +inputlist({textlist}) *inputlist()* + {textlist} must be a |List| of strings. This |List| is + displayed, one string per line. The user will be prompted to + enter a number, which is returned. + The user can also select an item by clicking on it with the + mouse. For the first string 0 is returned. When clicking + above the first item a negative number is returned. When + clicking on the prompt one more than the length of {textlist} + is returned. + Make sure {textlist} has less then 'lines' entries, otherwise + it won't work. It's a good idea to put the entry number at + the start of the string. Example: > + let color = inputlist(['Select color:', '1. red', + \ '2. green', '3. blue']) + +inputrestore() *inputrestore()* + Restore typeahead that was saved with a previous inputsave(). + Should be called the same number of times inputsave() is + called. Calling it more often is harmless though. + Returns 1 when there is nothing to restore, 0 otherwise. + +inputsave() *inputsave()* + Preserve typeahead (also from mappings) and clear it, so that + a following prompt gets input from the user. Should be + followed by a matching inputrestore() after the prompt. Can + be used several times, in which case there must be just as + many inputrestore() calls. + Returns 1 when out of memory, 0 otherwise. + +inputsecret({prompt} [, {text}]) *inputsecret()* + This function acts much like the |input()| function with but + two exceptions: + a) the user's response will be displayed as a sequence of + asterisks ("*") thereby keeping the entry secret, and + b) the user's response will not be recorded on the input + |history| stack. + The result is a String, which is whatever the user actually + typed on the command-line in response to the issued prompt. + NOTE: Command-line completion is not supported. + +insert({list}, {item} [, {idx}]) *insert()* + Insert {item} at the start of |List| {list}. + If {idx} is specified insert {item} before the item with index + {idx}. If {idx} is zero it goes before the first item, just + like omitting {idx}. A negative {idx} is also possible, see + |list-index|. -1 inserts just before the last item. + Returns the resulting |List|. Examples: > + :let mylist = insert([2, 3, 5], 1) + :call insert(mylist, 4, -1) + :call insert(mylist, 6, len(mylist)) +< The last example can be done simpler with |add()|. + Note that when {item} is a |List| it is inserted as a single + item. Use |extend()| to concatenate |Lists|. + +isdirectory({directory}) *isdirectory()* + The result is a Number, which is non-zero when a directory + with the name {directory} exists. If {directory} doesn't + exist, or isn't a directory, the result is FALSE. {directory} + is any expression, which is used as a String. + +islocked({expr}) *islocked()* *E786* + The result is a Number, which is non-zero when {expr} is the + name of a locked variable. + {expr} must be the name of a variable, |List| item or + |Dictionary| entry, not the variable itself! Example: > + :let alist = [0, ['a', 'b'], 2, 3] + :lockvar 1 alist + :echo islocked('alist') " 1 + :echo islocked('alist[1]') " 0 + +< When {expr} is a variable that does not exist you get an error + message. Use |exists()| to check for existence. + +items({dict}) *items()* + Return a |List| with all the key-value pairs of {dict}. Each + |List| item is a list with two items: the key of a {dict} + entry and the value of this entry. The |List| is in arbitrary + order. + + +join({list} [, {sep}]) *join()* + Join the items in {list} together into one String. + When {sep} is specified it is put in between the items. If + {sep} is omitted a single space is used. + Note that {sep} is not added at the end. You might want to + add it there too: > + let lines = join(mylist, "\n") . "\n" +< String items are used as-is. |Lists| and |Dictionaries| are + converted into a string like with |string()|. + The opposite function is |split()|. + +keys({dict}) *keys()* + Return a |List| with all the keys of {dict}. The |List| is in + arbitrary order. + + *len()* *E701* +len({expr}) The result is a Number, which is the length of the argument. + When {expr} is a String or a Number the length in bytes is + used, as with |strlen()|. + When {expr} is a |List| the number of items in the |List| is + returned. + When {expr} is a |Dictionary| the number of entries in the + |Dictionary| is returned. + Otherwise an error is given. + + *libcall()* *E364* *E368* +libcall({libname}, {funcname}, {argument}) + Call function {funcname} in the run-time library {libname} + with single argument {argument}. + This is useful to call functions in a library that you + especially made to be used with Vim. Since only one argument + is possible, calling standard library functions is rather + limited. + The result is the String returned by the function. If the + function returns NULL, this will appear as an empty string "" + to Vim. + If the function returns a number, use libcallnr()! + If {argument} is a number, it is passed to the function as an + int; if {argument} is a string, it is passed as a + null-terminated string. + This function will fail in |restricted-mode|. + + libcall() allows you to write your own 'plug-in' extensions to + Vim without having to recompile the program. It is NOT a + means to call system functions! If you try to do so Vim will + very probably crash. + + For Win32, the functions you write must be placed in a DLL + and use the normal C calling convention (NOT Pascal which is + used in Windows System DLLs). The function must take exactly + one parameter, either a character pointer or a long integer, + and must return a character pointer or NULL. The character + pointer returned must point to memory that will remain valid + after the function has returned (e.g. in static data in the + DLL). If it points to allocated memory, that memory will + leak away. Using a static buffer in the function should work, + it's then freed when the DLL is unloaded. + + WARNING: If the function returns a non-valid pointer, Vim may + crash! This also happens if the function returns a number, + because Vim thinks it's a pointer. + For Win32 systems, {libname} should be the filename of the DLL + without the ".DLL" suffix. A full path is only required if + the DLL is not in the usual places. + For Unix: When compiling your own plugins, remember that the + object code must be compiled as position-independent ('PIC'). + {only in Win32 on some Unix versions, when the |+libcall| + feature is present} + Examples: > + :echo libcall("libc.so", "getenv", "HOME") + :echo libcallnr("/usr/lib/libc.so", "getpid", "") +< + *libcallnr()* +libcallnr({libname}, {funcname}, {argument}) + Just like libcall(), but used for a function that returns an + int instead of a string. + {only in Win32 on some Unix versions, when the |+libcall| + feature is present} + Example (not very useful...): > + :call libcallnr("libc.so", "printf", "Hello World!\n") + :call libcallnr("libc.so", "sleep", 10) +< + *line()* +line({expr}) The result is a Number, which is the line number of the file + position given with {expr}. The accepted positions are: + . the cursor position + $ the last line in the current buffer + 'x position of mark x (if the mark is not set, 0 is + returned) + w0 first line visible in current window + w$ last line visible in current window + Note that a mark in another file can be used. + To get the column number use |col()|. To get both use + |getpos()|. + Examples: > + line(".") line number of the cursor + line("'t") line number of mark t + line("'" . marker) line number of mark marker +< *last-position-jump* + This autocommand jumps to the last known position in a file + just after opening it, if the '" mark is set: > + :au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif + +line2byte({lnum}) *line2byte()* + Return the byte count from the start of the buffer for line + {lnum}. This includes the end-of-line character, depending on + the 'fileformat' option for the current buffer. The first + line returns 1. + This can also be used to get the byte count for the line just + below the last line: > + line2byte(line("$") + 1) +< This is the file size plus one. + When {lnum} is invalid, or the |+byte_offset| feature has been + disabled at compile time, -1 is returned. + Also see |byte2line()|, |go| and |:goto|. + +lispindent({lnum}) *lispindent()* + Get the amount of indent for line {lnum} according the lisp + indenting rules, as with 'lisp'. + The indent is counted in spaces, the value of 'tabstop' is + relevant. {lnum} is used just like in |getline()|. + When {lnum} is invalid or Vim was not compiled the + |+lispindent| feature, -1 is returned. + +localtime() *localtime()* + Return the current time, measured as seconds since 1st Jan + 1970. See also |strftime()| and |getftime()|. + + +map({expr}, {string}) *map()* + {expr} must be a |List| or a |Dictionary|. + Replace each item in {expr} with the result of evaluating + {string}. + Inside {string} |v:val| has the value of the current item. + For a |Dictionary| |v:key| has the key of the current item. + Example: > + :call map(mylist, '"> " . v:val . " <"') +< This puts "> " before and " <" after each item in "mylist". + + Note that {string} is the result of an expression and is then + used as an expression again. Often it is good to use a + |literal-string| to avoid having to double backslashes. You + still have to double ' quotes + + The operation is done in-place. If you want a |List| or + |Dictionary| to remain unmodified make a copy first: > + :let tlist = map(copy(mylist), ' & . "\t"') + +< Returns {expr}, the |List| or |Dictionary| that was filtered. + When an error is encountered while evaluating {string} no + further items in {expr} are processed. + + +maparg({name}[, {mode} [, {abbr}]]) *maparg()* + Return the rhs of mapping {name} in mode {mode}. When there + is no mapping for {name}, an empty String is returned. + {mode} can be one of these strings: + "n" Normal + "v" Visual + "o" Operator-pending + "i" Insert + "c" Cmd-line + "l" langmap |language-mapping| + "" Normal, Visual and Operator-pending + When {mode} is omitted, the modes for "" are used. + When {abbr} is there and it is non-zero use abbreviations + instead of mappings. + The {name} can have special key names, like in the ":map" + command. The returned String has special characters + translated like in the output of the ":map" command listing. + The mappings local to the current buffer are checked first, + then the global mappings. + This function can be used to map a key even when it's already + mapped, and have it do the original mapping too. Sketch: > + exe 'nnoremap ==' . maparg('', 'n') + + +mapcheck({name}[, {mode} [, {abbr}]]) *mapcheck()* + Check if there is a mapping that matches with {name} in mode + {mode}. See |maparg()| for {mode} and special names in + {name}. + When {abbr} is there and it is non-zero use abbreviations + instead of mappings. + A match happens with a mapping that starts with {name} and + with a mapping which is equal to the start of {name}. + + matches mapping "a" "ab" "abc" ~ + mapcheck("a") yes yes yes + mapcheck("abc") yes yes yes + mapcheck("ax") yes no no + mapcheck("b") no no no + + The difference with maparg() is that mapcheck() finds a + mapping that matches with {name}, while maparg() only finds a + mapping for {name} exactly. + When there is no mapping that starts with {name}, an empty + String is returned. If there is one, the rhs of that mapping + is returned. If there are several mappings that start with + {name}, the rhs of one of them is returned. + The mappings local to the current buffer are checked first, + then the global mappings. + This function can be used to check if a mapping can be added + without being ambiguous. Example: > + :if mapcheck("_vv") == "" + : map _vv :set guifont=7x13 + :endif +< This avoids adding the "_vv" mapping when there already is a + mapping for "_v" or for "_vvv". + +match({expr}, {pat}[, {start}[, {count}]]) *match()* + When {expr} is a |List| then this returns the index of the + first item where {pat} matches. Each item is used as a + String, |Lists| and |Dictionaries| are used as echoed. + Otherwise, {expr} is used as a String. The result is a + Number, which gives the index (byte offset) in {expr} where + {pat} matches. + A match at the first character or |List| item returns zero. + If there is no match -1 is returned. + Example: > + :echo match("testing", "ing") " results in 4 + :echo match([1, 'x'], '\a') " results in 1 +< See |string-match| for how {pat} is used. + *strpbrk()* + Vim doesn't have a strpbrk() function. But you can do: > + :let sepidx = match(line, '[.,;: \t]') +< *strcasestr()* + Vim doesn't have a strcasestr() function. But you can add + "\c" to the pattern to ignore case: > + :let idx = match(haystack, '\cneedle') +< + If {start} is given, the search starts from byte index + {start} in a String or item {start} in a |List|. + The result, however, is still the index counted from the + first character/item. Example: > + :echo match("testing", "ing", 2) +< result is again "4". > + :echo match("testing", "ing", 4) +< result is again "4". > + :echo match("testing", "t", 2) +< result is "3". + For a String, if {start} > 0 then it is like the string starts + {start} bytes later, thus "^" will match at {start}. Except + when {count} is given, then it's like matches before the + {start} byte are ignored (this is a bit complicated to keep it + backwards compatible). + For a String, if {start} < 0, it will be set to 0. For a list + the index is counted from the end. + If {start} is out of range ({start} > strlen({expr}) for a + String or {start} > len({expr}) for a |List|) -1 is returned. + + When {count} is given use the {count}'th match. When a match + is found in a String the search for the next one starts one + character further. Thus this example results in 1: > + echo match("testing", "..", 0, 2) +< In a |List| the search continues in the next item. + Note that when {count} is added the way {start} works changes, + see above. + + See |pattern| for the patterns that are accepted. + The 'ignorecase' option is used to set the ignore-caseness of + the pattern. 'smartcase' is NOT used. The matching is always + done like 'magic' is set and 'cpoptions' is empty. + + +matcharg({nr}) *matcharg()* + Selects the {nr} match item, as set with a |:match|, + |:2match| or |:3match| command. + Return a |List| with two elements: + The name of the highlight group used + The pattern used. + When {nr} is not 1, 2 or 3 returns an empty |List|. + When there is no match item set returns ['', '']. + This is usef to save and restore a |:match|. + + +matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()* + Same as match(), but return the index of first character after + the match. Example: > + :echo matchend("testing", "ing") +< results in "7". + *strspn()* *strcspn()* + Vim doesn't have a strspn() or strcspn() function, but you can + do it with matchend(): > + :let span = matchend(line, '[a-zA-Z]') + :let span = matchend(line, '[^a-zA-Z]') +< Except that -1 is returned when there are no matches. + + The {start}, if given, has the same meaning as for match(). > + :echo matchend("testing", "ing", 2) +< results in "7". > + :echo matchend("testing", "ing", 5) +< result is "-1". + When {expr} is a |List| the result is equal to match(). + +matchlist({expr}, {pat}[, {start}[, {count}]]) *matchlist()* + Same as match(), but return a |List|. The first item in the + list is the matched string, same as what matchstr() would + return. Following items are submatches, like "\1", "\2", etc. + in |:substitute|. When an optional submatch didn't match an + empty string is used. Example: > + echo matchlist('acd', '\(a\)\?\(b\)\?\(c\)\?\(.*\)') +< Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', ''] + When there is no match an empty list is returned. + +matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()* + Same as match(), but return the matched string. Example: > + :echo matchstr("testing", "ing") +< results in "ing". + When there is no match "" is returned. + The {start}, if given, has the same meaning as for match(). > + :echo matchstr("testing", "ing", 2) +< results in "ing". > + :echo matchstr("testing", "ing", 5) +< result is "". + When {expr} is a |List| then the matching item is returned. + The type isn't changed, it's not necessarily a String. + + *max()* +max({list}) Return the maximum value of all items in {list}. + If {list} is not a list or one of the items in {list} cannot + be used as a Number this results in an error. + An empty |List| results in zero. + + *min()* +min({list}) Return the minumum value of all items in {list}. + If {list} is not a list or one of the items in {list} cannot + be used as a Number this results in an error. + An empty |List| results in zero. + + *mkdir()* *E739* +mkdir({name} [, {path} [, {prot}]]) + Create directory {name}. + If {path} is "p" then intermediate directories are created as + necessary. Otherwise it must be "". + If {prot} is given it is used to set the protection bits of + the new directory. The default is 0755 (rwxr-xr-x: r/w for + the user readable for others). Use 0700 to make it unreadable + for others. + This function is not available in the |sandbox|. + Not available on all systems. To check use: > + :if exists("*mkdir") +< + *mode()* +mode() Return a string that indicates the current mode: + n Normal + v Visual by character + V Visual by line + CTRL-V Visual blockwise + s Select by character + S Select by line + CTRL-S Select blockwise + i Insert + R Replace + c Command-line + r Hit-enter prompt + This is useful in the 'statusline' option. In most other + places it always returns "c" or "n". + +nextnonblank({lnum}) *nextnonblank()* + Return the line number of the first line at or below {lnum} + that is not blank. Example: > + if getline(nextnonblank(1)) =~ "Java" +< When {lnum} is invalid or there is no non-blank line at or + below it, zero is returned. + See also |prevnonblank()|. + +nr2char({expr}) *nr2char()* + Return a string with a single character, which has the number + value {expr}. Examples: > + nr2char(64) returns "@" + nr2char(32) returns " " +< The current 'encoding' is used. Example for "utf-8": > + nr2char(300) returns I with bow character +< Note that a NUL character in the file is specified with + nr2char(10), because NULs are represented with newline + characters. nr2char(0) is a real NUL and terminates the + string, thus results in an empty string. + + *getpos()* +getpos({expr}) Get the position for {expr}. For possible values of {expr} + see |line()|. + The result is a |List| with four numbers: + [bufnum, lnum, col, off] + "bufnum" is zero, unless a mark like '0 or 'A is used, then it + is the buffer number of the mark. + "lnum" and "col" are the position in the buffer. The first + column is 1. + The "off" number is zero, unless 'virtualedit' is used. Then + it is the offset in screen columns from the start of the + character. E.g., a position within a Tab or after the last + character. + This can be used to save and restore the cursor position: > + let save_cursor = getpos(".") + MoveTheCursorAround + call setpos('.', save_cursor) +< Also see |setpos()|. + +pathshorten({expr}) *pathshorten()* + Shorten directory names in the path {expr} and return the + result. The tail, the file name, is kept as-is. The other + components in the path are reduced to single letters. Leading + '~' and '.' characters are kept. Example: > + :echo pathshorten('~/.vim/autoload/myfile.vim') +< ~/.v/a/myfile.vim ~ + It doesn't matter if the path exists or not. + +prevnonblank({lnum}) *prevnonblank()* + Return the line number of the first line at or above {lnum} + that is not blank. Example: > + let ind = indent(prevnonblank(v:lnum - 1)) +< When {lnum} is invalid or there is no non-blank line at or + above it, zero is returned. + Also see |nextnonblank()|. + + +printf({fmt}, {expr1} ...) *printf()* + Return a String with {fmt}, where "%" items are replaced by + the formatted form of their respective arguments. Example: > + printf("%4d: E%d %.30s", lnum, errno, msg) +< May result in: + " 99: E42 asdfasdfasdfasdfasdfasdfasdfas" ~ + + Often used items are: + %s string + %6s string right-aligned in 6 bytes + %.9s string truncated to 9 bytes + %c single byte + %d decimal number + %5d decimal number padded with spaces to 5 characters + %x hex number + %04x hex number padded with zeros to at least 4 characters + %X hex number using upper case letters + %o octal number + %% the % character itself + + Conversion specifications start with '%' and end with the + conversion type. All other characters are copied unchanged to + the result. + + The "%" starts a conversion specification. The following + arguments appear in sequence: + + % [flags] [field-width] [.precision] type + + flags + Zero or more of the following flags: + + # The value should be converted to an "alternate + form". For c, d, and s conversions, this option + has no effect. For o conversions, the precision + of the number is increased to force the first + character of the output string to a zero (except + if a zero value is printed with an explicit + precision of zero). + For x and X conversions, a non-zero result has + the string "0x" (or "0X" for X conversions) + prepended to it. + + 0 (zero) Zero padding. For all conversions the converted + value is padded on the left with zeros rather + than blanks. If a precision is given with a + numeric conversion (d, o, x, and X), the 0 flag + is ignored. + + - A negative field width flag; the converted value + is to be left adjusted on the field boundary. + The converted value is padded on the right with + blanks, rather than on the left with blanks or + zeros. A - overrides a 0 if both are given. + + ' ' (space) A blank should be left before a positive + number produced by a signed conversion (d). + + + A sign must always be placed before a number + produced by a signed conversion. A + overrides + a space if both are used. + + field-width + An optional decimal digit string specifying a minimum + field width. If the converted value has fewer bytes + than the field width, it will be padded with spaces on + the left (or right, if the left-adjustment flag has + been given) to fill out the field width. + + .precision + An optional precision, in the form of a period '.' + followed by an optional digit string. If the digit + string is omitted, the precision is taken as zero. + This gives the minimum number of digits to appear for + d, o, x, and X conversions, or the maximum number of + bytes to be printed from a string for s conversions. + + type + A character that specifies the type of conversion to + be applied, see below. + + A field width or precision, or both, may be indicated by an + asterisk '*' instead of a digit string. In this case, a + Number argument supplies the field width or precision. A + negative field width is treated as a left adjustment flag + followed by a positive field width; a negative precision is + treated as though it were missing. Example: > + :echo printf("%d: %.*s", nr, width, line) +< This limits the length of the text used from "line" to + "width" bytes. + + The conversion specifiers and their meanings are: + + doxX The Number argument is converted to signed decimal + (d), unsigned octal (o), or unsigned hexadecimal (x + and X) notation. The letters "abcdef" are used for + x conversions; the letters "ABCDEF" are used for X + conversions. + The precision, if any, gives the minimum number of + digits that must appear; if the converted value + requires fewer digits, it is padded on the left with + zeros. + In no case does a non-existent or small field width + cause truncation of a numeric field; if the result of + a conversion is wider than the field width, the field + is expanded to contain the conversion result. + + c The Number argument is converted to a byte, and the + resulting character is written. + + s The text of the String argument is used. If a + precision is specified, no more bytes than the number + specified are used. + + % A '%' is written. No argument is converted. The + complete conversion specification is "%%". + + Each argument can be Number or String and is converted + automatically to fit the conversion specifier. Any other + argument type results in an error message. + + *E766* *E767* + The number of {exprN} arguments must exactly match the number + of "%" items. If there are not sufficient or too many + arguments an error is given. Up to 18 arguments can be used. + + +pumvisible() *pumvisible()* + Returns non-zero when the popup menu is visible, zero + otherwise. See |ins-completion-menu|. + This can be used to avoid some things that would remove the + popup menu. + + *E726* *E727* +range({expr} [, {max} [, {stride}]]) *range()* + Returns a |List| with Numbers: + - If only {expr} is specified: [0, 1, ..., {expr} - 1] + - If {max} is specified: [{expr}, {expr} + 1, ..., {max}] + - If {stride} is specified: [{expr}, {expr} + {stride}, ..., + {max}] (increasing {expr} with {stride} each time, not + producing a value past {max}). + When the maximum is one before the start the result is an + empty list. When the maximum is more than one before the + start this is an error. + Examples: > + range(4) " [0, 1, 2, 3] + range(2, 4) " [2, 3, 4] + range(2, 9, 3) " [2, 5, 8] + range(2, -2, -1) " [2, 1, 0, -1, -2] + range(0) " [] + range(2, 0) " error! +< + *readfile()* +readfile({fname} [, {binary} [, {max}]]) + Read file {fname} and return a |List|, each line of the file + as an item. Lines broken at NL characters. Macintosh files + separated with CR will result in a single long line (unless a + NL appears somewhere). + When {binary} is equal to "b" binary mode is used: + - When the last line ends in a NL an extra empty list item is + added. + - No CR characters are removed. + Otherwise: + - CR characters that appear before a NL are removed. + - Whether the last line ends in a NL or not does not matter. + All NUL characters are replaced with a NL character. + When {max} is given this specifies the maximum number of lines + to be read. Useful if you only want to check the first ten + lines of a file: > + :for line in readfile(fname, '', 10) + : if line =~ 'Date' | echo line | endif + :endfor +< When {max} is negative -{max} lines from the end of the file + are returned, or as many as there are. + When {max} is zero the result is an empty list. + Note that without {max} the whole file is read into memory. + Also note that there is no recognition of encoding. Read a + file into a buffer if you need to. + When the file can't be opened an error message is given and + the result is an empty list. + Also see |writefile()|. + +reltime([{start} [, {end}]]) *reltime()* + Return an item that represents a time value. The format of + the item depends on the system. It can be passed to + |reltimestr()| to convert it to a string. + Without an argument it returns the current time. + With one argument is returns the time passed since the time + specified in the argument. + With two arguments it returns the time passed between {start} + and {end}. + The {start} and {end} arguments must be values returned by + reltime(). + {only available when compiled with the +reltime feature} + +reltimestr({time}) *reltimestr()* + Return a String that represents the time value of {time}. + This is the number of seconds, a dot and the number of + microseconds. Example: > + let start = reltime() + call MyFunction() + echo reltimestr(reltime(start)) +< Note that overhead for the commands will be added to the time. + The accuracy depends on the system. + Also see |profiling|. + {only available when compiled with the +reltime feature} + + *remote_expr()* *E449* +remote_expr({server}, {string} [, {idvar}]) + Send the {string} to {server}. The string is sent as an + expression and the result is returned after evaluation. + The result must be a String or a |List|. A |List| is turned + into a String by joining the items with a line break in + between (not at the end), like with join(expr, "\n"). + If {idvar} is present, it is taken as the name of a + variable and a {serverid} for later use with + remote_read() is stored there. + See also |clientserver| |RemoteReply|. + This function is not available in the |sandbox|. + {only available when compiled with the |+clientserver| feature} + Note: Any errors will cause a local error message to be issued + and the result will be the empty string. + Examples: > + :echo remote_expr("gvim", "2+2") + :echo remote_expr("gvim1", "b:current_syntax") +< + +remote_foreground({server}) *remote_foreground()* + Move the Vim server with the name {server} to the foreground. + This works like: > + remote_expr({server}, "foreground()") +< Except that on Win32 systems the client does the work, to work + around the problem that the OS doesn't always allow the server + to bring itself to the foreground. + Note: This does not restore the window if it was minimized, + like foreground() does. + This function is not available in the |sandbox|. + {only in the Win32, Athena, Motif and GTK GUI versions and the + Win32 console version} + + +remote_peek({serverid} [, {retvar}]) *remote_peek()* + Returns a positive number if there are available strings + from {serverid}. Copies any reply string into the variable + {retvar} if specified. {retvar} must be a string with the + name of a variable. + Returns zero if none are available. + Returns -1 if something is wrong. + See also |clientserver|. + This function is not available in the |sandbox|. + {only available when compiled with the |+clientserver| feature} + Examples: > + :let repl = "" + :echo "PEEK: ".remote_peek(id, "repl").": ".repl + +remote_read({serverid}) *remote_read()* + Return the oldest available reply from {serverid} and consume + it. It blocks until a reply is available. + See also |clientserver|. + This function is not available in the |sandbox|. + {only available when compiled with the |+clientserver| feature} + Example: > + :echo remote_read(id) +< + *remote_send()* *E241* +remote_send({server}, {string} [, {idvar}]) + Send the {string} to {server}. The string is sent as input + keys and the function returns immediately. At the Vim server + the keys are not mapped |:map|. + If {idvar} is present, it is taken as the name of a variable + and a {serverid} for later use with remote_read() is stored + there. + See also |clientserver| |RemoteReply|. + This function is not available in the |sandbox|. + {only available when compiled with the |+clientserver| feature} + Note: Any errors will be reported in the server and may mess + up the display. + Examples: > + :echo remote_send("gvim", ":DropAndReply ".file, "serverid"). + \ remote_read(serverid) + + :autocmd NONE RemoteReply * + \ echo remote_read(expand("")) + :echo remote_send("gvim", ":sleep 10 | echo ". + \ 'server2client(expand(""), "HELLO")') +< +remove({list}, {idx} [, {end}]) *remove()* + Without {end}: Remove the item at {idx} from |List| {list} and + return it. + With {end}: Remove items from {idx} to {end} (inclusive) and + return a list with these items. When {idx} points to the same + item as {end} a list with one item is returned. When {end} + points to an item before {idx} this is an error. + See |list-index| for possible values of {idx} and {end}. + Example: > + :echo "last item: " . remove(mylist, -1) + :call remove(mylist, 0, 9) +remove({dict}, {key}) + Remove the entry from {dict} with key {key}. Example: > + :echo "removed " . remove(dict, "one") +< If there is no {key} in {dict} this is an error. + + Use |delete()| to remove a file. + +rename({from}, {to}) *rename()* + Rename the file by the name {from} to the name {to}. This + should also work to move files across file systems. The + result is a Number, which is 0 if the file was renamed + successfully, and non-zero when the renaming failed. + This function is not available in the |sandbox|. + +repeat({expr}, {count}) *repeat()* + Repeat {expr} {count} times and return the concatenated + result. Example: > + :let separator = repeat('-', 80) +< When {count} is zero or negative the result is empty. + When {expr} is a |List| the result is {expr} concatenated + {count} times. Example: > + :let longlist = repeat(['a', 'b'], 3) +< Results in ['a', 'b', 'a', 'b', 'a', 'b']. + + +resolve({filename}) *resolve()* *E655* + On MS-Windows, when {filename} is a shortcut (a .lnk file), + returns the path the shortcut points to in a simplified form. + On Unix, repeat resolving symbolic links in all path + components of {filename} and return the simplified result. + To cope with link cycles, resolving of symbolic links is + stopped after 100 iterations. + On other systems, return the simplified {filename}. + The simplification step is done as by |simplify()|. + resolve() keeps a leading path component specifying the + current directory (provided the result is still a relative + path name) and also keeps a trailing path separator. + + *reverse()* +reverse({list}) Reverse the order of items in {list} in-place. Returns + {list}. + If you want a list to remain unmodified make a copy first: > + :let revlist = reverse(copy(mylist)) + +search({pattern} [, {flags} [, {stopline}]]) *search()* + Search for regexp pattern {pattern}. The search starts at the + cursor position (you can use |cursor()| to set it). + + {flags} is a String, which can contain these character flags: + 'b' search backward instead of forward + 'c' accept a match at the cursor position + 'e' move to the End of the match + 'n' do Not move the cursor + 'p' return number of matching sub-pattern (see below) + 's' set the ' mark at the previous location of the cursor + 'w' wrap around the end of the file + 'W' don't wrap around the end of the file + If neither 'w' or 'W' is given, the 'wrapscan' option applies. + + If the 's' flag is supplied, the ' mark is set, only if the + cursor is moved. The 's' flag cannot be combined with the 'n' + flag. + + When the {stopline} argument is given then the search stops + after searching this line. This is useful to restrict the + search to a range of lines. Examples: > + let match = search('(', 'b', line("w0")) + let end = search('END', '', line("w$")) +< When {stopline} is used and it is not zero this also implies + that the search does not wrap around the end of the file. + + If there is no match a 0 is returned and the cursor doesn't + move. No error message is given. + When a match has been found its line number is returned. + *search()-sub-match* + With the 'p' flag the returned value is one more than the + first sub-match in \(\). One if none of them matched but the + whole pattern did match. + To get the column number too use |searchpos()|. + + The cursor will be positioned at the match, unless the 'n' + flag is used. + + Example (goes over all files in the argument list): > + :let n = 1 + :while n <= argc() " loop over all files in arglist + : exe "argument " . n + : " start at the last char in the file and wrap for the + : " first search to find match at start of file + : normal G$ + : let flags = "w" + : while search("foo", flags) > 0 + : s/foo/bar/g + : let flags = "W" + : endwhile + : update " write the file if modified + : let n = n + 1 + :endwhile +< + Example for using some flags: > + :echo search('\ + if searchdecl('myvar') == 0 + echo getline('.') + endif +< + *searchpair()* +searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) + Search for the match of a nested start-end pair. This can be + used to find the "endif" that matches an "if", while other + if/endif pairs in between are ignored. + The search starts at the cursor. The default is to search + forward, include 'b' in {flags} to search backward. + If a match is found, the cursor is positioned at it and the + line number is returned. If no match is found 0 or -1 is + returned and the cursor doesn't move. No error message is + given. + + {start}, {middle} and {end} are patterns, see |pattern|. They + must not contain \( \) pairs. Use of \%( \) is allowed. When + {middle} is not empty, it is found when searching from either + direction, but only when not in a nested start-end pair. A + typical use is: > + searchpair('\', '\', '\') +< By leaving {middle} empty the "else" is skipped. + + {flags} 'b', 'c', 'n', 's', 'w' and 'W' are used like with + |search()|. Additionally: + 'r' Repeat until no more matches found; will find the + outer pair + 'm' return number of Matches instead of line number with + the match; will be > 1 when 'r' is used. + + When a match for {start}, {middle} or {end} is found, the + {skip} expression is evaluated with the cursor positioned on + the start of the match. It should return non-zero if this + match is to be skipped. E.g., because it is inside a comment + or a string. + When {skip} is omitted or empty, every match is accepted. + When evaluating {skip} causes an error the search is aborted + and -1 returned. + + For {stopline} see |search()|. + + The value of 'ignorecase' is used. 'magic' is ignored, the + patterns are used like it's on. + + The search starts exactly at the cursor. A match with + {start}, {middle} or {end} at the next character, in the + direction of searching, is the first one found. Example: > + if 1 + if 2 + endif 2 + endif 1 +< When starting at the "if 2", with the cursor on the "i", and + searching forwards, the "endif 2" is found. When starting on + the character just before the "if 2", the "endif 1" will be + found. That's because the "if 2" will be found first, and + then this is considered to be a nested if/endif from "if 2" to + "endif 2". + When searching backwards and {end} is more than one character, + it may be useful to put "\zs" at the end of the pattern, so + that when the cursor is inside a match with the end it finds + the matching start. + + Example, to find the "endif" command in a Vim script: > + + :echo searchpair('\', '\', '\', 'W', + \ 'getline(".") =~ "^\\s*\""') + +< The cursor must be at or after the "if" for which a match is + to be found. Note that single-quote strings are used to avoid + having to double the backslashes. The skip expression only + catches comments at the start of a line, not after a command. + Also, a word "en" or "if" halfway a line is considered a + match. + Another example, to search for the matching "{" of a "}": > + + :echo searchpair('{', '', '}', 'bW') + +< This works when the cursor is at or before the "}" for which a + match is to be found. To reject matches that syntax + highlighting recognized as strings: > + + :echo searchpair('{', '', '}', 'bW', + \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"') +< + *searchpairpos()* +searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]]) + Same as searchpair(), but returns a |List| with the line and + column position of the match. The first element of the |List| + is the line number and the second element is the byte index of + the column position of the match. If no match is found, + returns [0, 0]. +> + :let [lnum,col] = searchpairpos('{', '', '}', 'n') +< + See |match-parens| for a bigger and more useful example. + +searchpos({pattern} [, {flags} [, {stopline}]]) *searchpos()* + Same as |search()|, but returns a |List| with the line and + column position of the match. The first element of the |List| + is the line number and the second element is the byte index of + the column position of the match. If no match is found, + returns [0, 0]. + Example: > + :let [lnum, col] = searchpos('mypattern', 'n') + +< When the 'p' flag is given then there is an extra item with + the sub-pattern match number |search()-sub-match|. Example: > + :let [lnum, col, submatch] = searchpos('\(\l\)\|\(\u\)', 'np') +< In this example "submatch" is 2 when a lowercase letter is + found |/\l|, 3 when an uppercase letter is found |/\u|. + +server2client( {clientid}, {string}) *server2client()* + Send a reply string to {clientid}. The most recent {clientid} + that sent a string can be retrieved with expand(""). + {only available when compiled with the |+clientserver| feature} + Note: + This id has to be stored before the next command can be + received. I.e. before returning from the received command and + before calling any commands that waits for input. + See also |clientserver|. + Example: > + :echo server2client(expand(""), "HELLO") +< +serverlist() *serverlist()* + Return a list of available server names, one per line. + When there are no servers or the information is not available + an empty string is returned. See also |clientserver|. + {only available when compiled with the |+clientserver| feature} + Example: > + :echo serverlist() +< +setbufvar({expr}, {varname}, {val}) *setbufvar()* + Set option or local variable {varname} in buffer {expr} to + {val}. + This also works for a global or local window option, but it + doesn't work for a global or local window variable. + For a local window option the global value is unchanged. + For the use of {expr}, see |bufname()| above. + Note that the variable name without "b:" must be used. + Examples: > + :call setbufvar(1, "&mod", 1) + :call setbufvar("todo", "myvar", "foobar") +< This function is not available in the |sandbox|. + +setcmdpos({pos}) *setcmdpos()* + Set the cursor position in the command line to byte position + {pos}. The first position is 1. + Use |getcmdpos()| to obtain the current position. + Only works while editing the command line, thus you must use + |c_CTRL-\_e|, |c_CTRL-R_=| or |c_CTRL-R_CTRL-R| with '='. For + |c_CTRL-\_e| and |c_CTRL-R_CTRL-R| with '=' the position is + set after the command line is set to the expression. For + |c_CTRL-R_=| it is set after evaluating the expression but + before inserting the resulting text. + When the number is too big the cursor is put at the end of the + line. A number smaller than one has undefined results. + Returns 0 when successful, 1 when not editing the command + line. + +setline({lnum}, {line}) *setline()* + Set line {lnum} of the current buffer to {line}. + {lnum} is used like with |getline()|. + When {lnum} is just below the last line the {line} will be + added as a new line. + If this succeeds, 0 is returned. If this fails (most likely + because {lnum} is invalid) 1 is returned. Example: > + :call setline(5, strftime("%c")) +< When {line} is a |List| then line {lnum} and following lines + will be set to the items in the list. Example: > + :call setline(5, ['aaa', 'bbb', 'ccc']) +< This is equivalent to: > + :for [n, l] in [[5, 6, 7], ['aaa', 'bbb', 'ccc']] + : call setline(n, l) + :endfor +< Note: The '[ and '] marks are not set. + +setloclist({nr}, {list} [, {action}]) *setloclist()* + Create or replace or add to the location list for window {nr}. + When {nr} is zero the current window is used. For a location + list window, the displayed location list is modified. For an + invalid window number {nr}, -1 is returned. + Otherwise, same as setqflist(). + + *setpos()* +setpos({expr}, {list}) + Set the position for {expr}. Possible values: + . the cursor + 'x mark x + + {list} must be a |List| with four numbers: + [bufnum, lnum, col, off] + + "bufnum" is the buffer number. Zero can be used for the + current buffer. Setting the cursor is only possible for + the current buffer. To set a mark in another buffer you can + use the |bufnr()| function to turn a file name into a buffer + number. + Does not change the jumplist. + + "lnum" and "col" are the position in the buffer. The first + column is 1. Use a zero "lnum" to delete a mark. + + The "off" number is only used when 'virtualedit' is set. Then + it is the offset in screen columns from the start of the + character. E.g., a position within a Tab or after the last + character. + + Also see |getpos()| + + +setqflist({list} [, {action}]) *setqflist()* + Create or replace or add to the quickfix list using the items + in {list}. Each item in {list} is a dictionary. + Non-dictionary items in {list} are ignored. Each dictionary + item can contain the following entries: + + bufnr buffer number; must be the number of a valid + buffer + filename name of a file; only used when "bufnr" is not + present or it is invalid. + lnum line number in the file + pattern search pattern used to locate the error + col column number + vcol when non-zero: "col" is visual column + when zero: "col" is byte index + nr error number + text description of the error + type single-character error type, 'E', 'W', etc. + + The "col", "vcol", "nr", "type" and "text" entries are + optional. Either "lnum" or "pattern" entry can be used to + locate a matching error line. + If the "filename" and "bufnr" entries are not present or + neither the "lnum" or "pattern" entries are present, then the + item will not be handled as an error line. + If both "pattern" and "lnum" are present then "pattern" will + be used. + Note that the list is not exactly the same as what + |getqflist()| returns. + + If {action} is set to 'a', then the items from {list} are + added to the existing quickfix list. If there is no existing + list, then a new list is created. If {action} is set to 'r', + then the items from the current quickfix list are replaced + with the items from {list}. If {action} is not present or is + set to ' ', then a new list is created. + + Returns zero for success, -1 for failure. + + This function can be used to create a quickfix list + independent of the 'errorformat' setting. Use a command like + ":cc 1" to jump to the first position. + + + *setreg()* +setreg({regname}, {value} [,{options}]) + Set the register {regname} to {value}. + If {options} contains "a" or {regname} is upper case, + then the value is appended. + {options} can also contains a register type specification: + "c" or "v" |characterwise| mode + "l" or "V" |linewise| mode + "b" or "" |blockwise-visual| mode + If a number immediately follows "b" or "" then this is + used as the width of the selection - if it is not specified + then the width of the block is set to the number of characters + in the longest line (counting a as 1 character). + + If {options} contains no register settings, then the default + is to use character mode unless {value} ends in a . + Setting the '=' register is not possible. + Returns zero for success, non-zero for failure. + + Examples: > + :call setreg(v:register, @*) + :call setreg('*', @%, 'ac') + :call setreg('a', "1\n2\n3", 'b5') + +< This example shows using the functions to save and restore a + register. > + :let var_a = getreg('a', 1) + :let var_amode = getregtype('a') + .... + :call setreg('a', var_a, var_amode) + +< You can also change the type of a register by appending + nothing: > + :call setreg('a', '', 'al') + +settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* + Set option or local variable {varname} in window {winnr} to + {val}. + Tabs are numbered starting with one. For the current tabpage + use |setwinvar()|. + When {winnr} is zero the current window is used. + This also works for a global or local buffer option, but it + doesn't work for a global or local buffer variable. + For a local buffer option the global value is unchanged. + Note that the variable name without "w:" must be used. + Vim briefly goes to the tab page {tabnr}, this may trigger + TabLeave and TabEnter autocommands. + Examples: > + :call settabwinvar(1, 1, "&list", 0) + :call settabwinvar(3, 2, "myvar", "foobar") +< This function is not available in the |sandbox|. + +setwinvar({nr}, {varname}, {val}) *setwinvar()* + Like |settabwinvar()| for the current tab page. + Examples: > + :call setwinvar(1, "&list", 0) + :call setwinvar(2, "myvar", "foobar") + +shellescape({string}) *shellescape()* + Escape {string} for use as shell command argument. + On MS-Windows and MS-DOS, when 'shellslash' is not set, it + will enclose {string} double quotes and double all double + quotes within {string}. + For other systems, it will enclose {string} in single quotes + and replace all "'" with "'\''". + Example: > + :echo shellescape('c:\program files\vim') +< results in: + "c:\program files\vim" ~ + Example usage: > + :call system("chmod +x -- " . shellescape(expand("%"))) + + +simplify({filename}) *simplify()* + Simplify the file name as much as possible without changing + the meaning. Shortcuts (on MS-Windows) or symbolic links (on + Unix) are not resolved. If the first path component in + {filename} designates the current directory, this will be + valid for the result as well. A trailing path separator is + not removed either. + Example: > + simplify("./dir/.././/file/") == "./file/" +< Note: The combination "dir/.." is only removed if "dir" is + a searchable directory or does not exist. On Unix, it is also + removed when "dir" is a symbolic link within the same + directory. In order to resolve all the involved symbolic + links before simplifying the path name, use |resolve()|. + + +sort({list} [, {func}]) *sort()* *E702* + Sort the items in {list} in-place. Returns {list}. If you + want a list to remain unmodified make a copy first: > + :let sortedlist = sort(copy(mylist)) +< Uses the string representation of each item to sort on. + Numbers sort after Strings, |Lists| after Numbers. + For sorting text in the current buffer use |:sort|. + When {func} is given and it is one then case is ignored. + When {func} is a |Funcref| or a function name, this function + is called to compare items. The function is invoked with two + items as argument and must return zero if they are equal, 1 if + the first one sorts after the second one, -1 if the first one + sorts before the second one. Example: > + func MyCompare(i1, i2) + return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1 + endfunc + let sortedlist = sort(mylist, "MyCompare") +< + + *soundfold()* +soundfold({word}) + Return the sound-folded equivalent of {word}. Uses the first + language in 'spellang' for the current window that supports + soundfolding. 'spell' must be set. When no sound folding is + possible the {word} is returned unmodified. + This can be used for making spelling suggestions. Note that + the method can be quite slow. + + *spellbadword()* +spellbadword([{sentence}]) + Without argument: The result is the badly spelled word under + or after the cursor. The cursor is moved to the start of the + bad word. When no bad word is found in the cursor line the + result is an empty string and the cursor doesn't move. + + With argument: The result is the first word in {sentence} that + is badly spelled. If there are no spelling mistakes the + result is an empty string. + + The return value is a list with two items: + - The badly spelled word or an empty string. + - The type of the spelling error: + "bad" spelling mistake + "rare" rare word + "local" word only valid in another region + "caps" word should start with Capital + Example: > + echo spellbadword("the quik brown fox") +< ['quik', 'bad'] ~ + + The spelling information for the current window is used. The + 'spell' option must be set and the value of 'spelllang' is + used. + + *spellsuggest()* +spellsuggest({word} [, {max} [, {capital}]]) + Return a |List| with spelling suggestions to replace {word}. + When {max} is given up to this number of suggestions are + returned. Otherwise up to 25 suggestions are returned. + + When the {capital} argument is given and it's non-zero only + suggestions with a leading capital will be given. Use this + after a match with 'spellcapcheck'. + + {word} can be a badly spelled word followed by other text. + This allows for joining two words that were split. The + suggestions also include the following text, thus you can + replace a line. + + {word} may also be a good word. Similar words will then be + returned. {word} itself is not included in the suggestions, + although it may appear capitalized. + + The spelling information for the current window is used. The + 'spell' option must be set and the values of 'spelllang' and + 'spellsuggest' are used. + + +split({expr} [, {pattern} [, {keepempty}]]) *split()* + Make a |List| out of {expr}. When {pattern} is omitted or + empty each white-separated sequence of characters becomes an + item. + Otherwise the string is split where {pattern} matches, + removing the matched characters. + When the first or last item is empty it is omitted, unless the + {keepempty} argument is given and it's non-zero. + Other empty items are kept when {pattern} matches at least one + character or when {keepempty} is non-zero. + Example: > + :let words = split(getline('.'), '\W\+') +< To split a string in individual characters: > + :for c in split(mystring, '\zs') +< If you want to keep the separator you can also use '\zs': > + :echo split('abc:def:ghi', ':\zs') +< ['abc:', 'def:', 'ghi'] ~ + Splitting a table where the first element can be empty: > + :let items = split(line, ':', 1) +< The opposite function is |join()|. + + +str2nr( {expr} [, {base}]) *str2nr()* + Convert string {expr} to a number. + {base} is the conversion base, it can be 8, 10 or 16. + When {base} is omitted base 10 is used. This also means that + a leading zero doesn't cause octal conversion to be used, as + with the default String to Number conversion. + When {base} is 16 a leading "0x" or "0X" is ignored. With a + different base the result will be zero. + Text after the number is silently ignored. + + +strftime({format} [, {time}]) *strftime()* + The result is a String, which is a formatted date and time, as + specified by the {format} string. The given {time} is used, + or the current time if no time is given. The accepted + {format} depends on your system, thus this is not portable! + See the manual page of the C function strftime() for the + format. The maximum length of the result is 80 characters. + See also |localtime()| and |getftime()|. + The language can be changed with the |:language| command. + Examples: > + :echo strftime("%c") Sun Apr 27 11:49:23 1997 + :echo strftime("%Y %b %d %X") 1997 Apr 27 11:53:25 + :echo strftime("%y%m%d %T") 970427 11:53:55 + :echo strftime("%H:%M") 11:55 + :echo strftime("%c", getftime("file.c")) + Show mod time of file.c. +< Not available on all systems. To check use: > + :if exists("*strftime") + +stridx({haystack}, {needle} [, {start}]) *stridx()* + The result is a Number, which gives the byte index in + {haystack} of the first occurrence of the String {needle}. + If {start} is specified, the search starts at index {start}. + This can be used to find a second match: > + :let comma1 = stridx(line, ",") + :let comma2 = stridx(line, ",", comma1 + 1) +< The search is done case-sensitive. + For pattern searches use |match()|. + -1 is returned if the {needle} does not occur in {haystack}. + See also |strridx()|. + Examples: > + :echo stridx("An Example", "Example") 3 + :echo stridx("Starting point", "Start") 0 + :echo stridx("Starting point", "start") -1 +< *strstr()* *strchr()* + stridx() works similar to the C function strstr(). When used + with a single character it works similar to strchr(). + + *string()* +string({expr}) Return {expr} converted to a String. If {expr} is a Number, + String or a composition of them, then the result can be parsed + back with |eval()|. + {expr} type result ~ + String 'string' + Number 123 + Funcref function('name') + List [item, item] + Dictionary {key: value, key: value} + Note that in String values the ' character is doubled. + + *strlen()* +strlen({expr}) The result is a Number, which is the length of the String + {expr} in bytes. + If you want to count the number of multi-byte characters (not + counting composing characters) use something like this: > + + :let len = strlen(substitute(str, ".", "x", "g")) +< + If the argument is a Number it is first converted to a String. + For other types an error is given. + Also see |len()|. + +strpart({src}, {start}[, {len}]) *strpart()* + The result is a String, which is part of {src}, starting from + byte {start}, with the byte length {len}. + When non-existing bytes are included, this doesn't result in + an error, the bytes are simply omitted. + If {len} is missing, the copy continues from {start} till the + end of the {src}. > + strpart("abcdefg", 3, 2) == "de" + strpart("abcdefg", -2, 4) == "ab" + strpart("abcdefg", 5, 4) == "fg" + strpart("abcdefg", 3) == "defg" +< Note: To get the first character, {start} must be 0. For + example, to get three bytes under and after the cursor: > + strpart(getline("."), col(".") - 1, 3) +< +strridx({haystack}, {needle} [, {start}]) *strridx()* + The result is a Number, which gives the byte index in + {haystack} of the last occurrence of the String {needle}. + When {start} is specified, matches beyond this index are + ignored. This can be used to find a match before a previous + match: > + :let lastcomma = strridx(line, ",") + :let comma2 = strridx(line, ",", lastcomma - 1) +< The search is done case-sensitive. + For pattern searches use |match()|. + -1 is returned if the {needle} does not occur in {haystack}. + If the {needle} is empty the length of {haystack} is returned. + See also |stridx()|. Examples: > + :echo strridx("an angry armadillo", "an") 3 +< *strrchr()* + When used with a single character it works similar to the C + function strrchr(). + +strtrans({expr}) *strtrans()* + The result is a String, which is {expr} with all unprintable + characters translated into printable characters |'isprint'|. + Like they are shown in a window. Example: > + echo strtrans(@a) +< This displays a newline in register a as "^@" instead of + starting a new line. + +submatch({nr}) *submatch()* + Only for an expression in a |:substitute| command. Returns + the {nr}'th submatch of the matched text. When {nr} is 0 + the whole matched text is returned. + Example: > + :s/\d\+/\=submatch(0) + 1/ +< This finds the first number in the line and adds one to it. + A line break is included as a newline character. + +substitute({expr}, {pat}, {sub}, {flags}) *substitute()* + The result is a String, which is a copy of {expr}, in which + the first match of {pat} is replaced with {sub}. This works + like the ":substitute" command (without any flags). But the + matching with {pat} is always done like the 'magic' option is + set and 'cpoptions' is empty (to make scripts portable). + 'ignorecase' is still relevant. + See |string-match| for how {pat} is used. + And a "~" in {sub} is not replaced with the previous {sub}. + Note that some codes in {sub} have a special meaning + |sub-replace-special|. For example, to replace something with + "\n" (two characters), use "\\\\n" or '\\n'. + When {pat} does not match in {expr}, {expr} is returned + unmodified. + When {flags} is "g", all matches of {pat} in {expr} are + replaced. Otherwise {flags} should be "". + Example: > + :let &path = substitute(&path, ",\\=[^,]*$", "", "") +< This removes the last component of the 'path' option. > + :echo substitute("testing", ".*", "\\U\\0", "") +< results in "TESTING". + +synID({lnum}, {col}, {trans}) *synID()* + The result is a Number, which is the syntax ID at the position + {lnum} and {col} in the current window. + The syntax ID can be used with |synIDattr()| and + |synIDtrans()| to obtain syntax information about text. + + {col} is 1 for the leftmost column, {lnum} is 1 for the first + line. 'synmaxcol' applies, in a longer line zero is returned. + + When {trans} is non-zero, transparent items are reduced to the + item that they reveal. This is useful when wanting to know + the effective color. When {trans} is zero, the transparent + item is returned. This is useful when wanting to know which + syntax item is effective (e.g. inside parens). + Warning: This function can be very slow. Best speed is + obtained by going through the file in forward direction. + + Example (echoes the name of the syntax item under the cursor): > + :echo synIDattr(synID(line("."), col("."), 1), "name") +< +synIDattr({synID}, {what} [, {mode}]) *synIDattr()* + The result is a String, which is the {what} attribute of + syntax ID {synID}. This can be used to obtain information + about a syntax item. + {mode} can be "gui", "cterm" or "term", to get the attributes + for that mode. When {mode} is omitted, or an invalid value is + used, the attributes for the currently active highlighting are + used (GUI, cterm or term). + Use synIDtrans() to follow linked highlight groups. + {what} result + "name" the name of the syntax item + "fg" foreground color (GUI: color name used to set + the color, cterm: color number as a string, + term: empty string) + "bg" background color (like "fg") + "fg#" like "fg", but for the GUI and the GUI is + running the name in "#RRGGBB" form + "bg#" like "fg#" for "bg" + "bold" "1" if bold + "italic" "1" if italic + "reverse" "1" if reverse + "inverse" "1" if inverse (= reverse) + "underline" "1" if underlined + "undercurl" "1" if undercurled + + Example (echoes the color of the syntax item under the + cursor): > + :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg") +< +synIDtrans({synID}) *synIDtrans()* + The result is a Number, which is the translated syntax ID of + {synID}. This is the syntax group ID of what is being used to + highlight the character. Highlight links given with + ":highlight link" are followed. + +system({expr} [, {input}]) *system()* *E677* + Get the output of the shell command {expr}. + When {input} is given, this string is written to a file and + passed as stdin to the command. The string is written as-is, + you need to take care of using the correct line separators + yourself. Pipes are not used. + Note: newlines in {expr} may cause the command to fail. The + characters in 'shellquote' and 'shellxquote' may also cause + trouble. + This is not to be used for interactive commands. + The result is a String. Example: > + + :let files = system("ls") + +< To make the result more system-independent, the shell output + is filtered to replace with for Macintosh, and + with for DOS-like systems. + The command executed is constructed using several options: + 'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote' + ({tmp} is an automatically generated file name). + For Unix and OS/2 braces are put around {expr} to allow for + concatenated commands. + + The command will be executed in "cooked" mode, so that a + CTRL-C will interrupt the command (on Unix at least). + + The resulting error code can be found in |v:shell_error|. + This function will fail in |restricted-mode|. + + Note that any wrong value in the options mentioned above may + make the function fail. It has also been reported to fail + when using a security agent application. + Unlike ":!cmd" there is no automatic check for changed files. + Use |:checktime| to force a check. + + +tabpagebuflist([{arg}]) *tabpagebuflist()* + The result is a |List|, where each item is the number of the + buffer associated with each window in the current tab page. + {arg} specifies the number of tab page to be used. When + omitted the current tab page is used. + When {arg} is invalid the number zero is returned. + To get a list of all buffers in all tabs use this: > + tablist = [] + for i in range(tabpagenr('$')) + call extend(tablist, tabpagebuflist(i + 1)) + endfor +< Note that a buffer may appear in more than one window. + + +tabpagenr([{arg}]) *tabpagenr()* + The result is a Number, which is the number of the current + tab page. The first tab page has number 1. + When the optional argument is "$", the number of the last tab + page is returned (the tab page count). + The number can be used with the |:tab| command. + + +tabpagewinnr({tabarg}, [{arg}]) *tabpagewinnr()* + Like |winnr()| but for tab page {arg}. + {tabarg} specifies the number of tab page to be used. + {arg} is used like with |winnr()|: + - When omitted the current window number is returned. This is + the window which will be used when going to this tab page. + - When "$" the number of windows is returned. + - When "#" the previous window nr is returned. + Useful examples: > + tabpagewinnr(1) " current window of tab page 1 + tabpagewinnr(4, '$') " number of windows in tab page 4 +< When {tabarg} is invalid zero is returned. + + *tagfiles()* +tagfiles() Returns a |List| with the file names used to search for tags + for the current buffer. This is the 'tags' option expanded. + + +taglist({expr}) *taglist()* + Returns a list of tags matching the regular expression {expr}. + Each list item is a dictionary with at least the following + entries: + name Name of the tag. + filename Name of the file where the tag is + defined. + cmd Ex command used to locate the tag in + the file. + kind Type of the tag. The value for this + entry depends on the language specific + kind values generated by the ctags + tool. + static A file specific tag. Refer to + |static-tag| for more information. + The "kind" entry is only available when using Exuberant ctags + generated tags file. More entries may be present, depending + on the content of the tags file: access, implementation, + inherits and signature. Refer to the ctags documentation for + information about these fields. For C code the fields + "struct", "class" and "enum" may appear, they give the name of + the entity the tag is contained in. + + The ex-command 'cmd' can be either an ex search pattern, a + line number or a line number followed by a byte number. + + If there are no matching tags, then an empty list is returned. + + To get an exact tag match, the anchors '^' and '$' should be + used in {expr}. Refer to |tag-regexp| for more information + about the tag search regular expression pattern. + + Refer to |'tags'| for information about how the tags file is + located by Vim. Refer to |tags-file-format| for the format of + the tags file generated by the different ctags tools. + +tempname() *tempname()* *temp-file-name* + The result is a String, which is the name of a file that + doesn't exist. It can be used for a temporary file. The name + is different for at least 26 consecutive calls. Example: > + :let tmpfile = tempname() + :exe "redir > " . tmpfile +< For Unix, the file will be in a private directory (only + accessible by the current user) to avoid security problems + (e.g., a symlink attack or other people reading your file). + When Vim exits the directory and all files in it are deleted. + For MS-Windows forward slashes are used when the 'shellslash' + option is set or when 'shellcmdflag' starts with '-'. + +tolower({expr}) *tolower()* + The result is a copy of the String given, with all uppercase + characters turned into lowercase (just like applying |gu| to + the string). + +toupper({expr}) *toupper()* + The result is a copy of the String given, with all lowercase + characters turned into uppercase (just like applying |gU| to + the string). + +tr({src}, {fromstr}, {tostr}) *tr()* + The result is a copy of the {src} string with all characters + which appear in {fromstr} replaced by the character in that + position in the {tostr} string. Thus the first character in + {fromstr} is translated into the first character in {tostr} + and so on. Exactly like the unix "tr" command. + This code also deals with multibyte characters properly. + + Examples: > + echo tr("hello there", "ht", "HT") +< returns "Hello THere" > + echo tr("", "<>", "{}") +< returns "{blob}" + + *type()* +type({expr}) The result is a Number, depending on the type of {expr}: + Number: 0 + String: 1 + Funcref: 2 + List: 3 + Dictionary: 4 + To avoid the magic numbers it should be used this way: > + :if type(myvar) == type(0) + :if type(myvar) == type("") + :if type(myvar) == type(function("tr")) + :if type(myvar) == type([]) + :if type(myvar) == type({}) + +values({dict}) *values()* + Return a |List| with all the values of {dict}. The |List| is + in arbitrary order. + + +virtcol({expr}) *virtcol()* + The result is a Number, which is the screen column of the file + position given with {expr}. That is, the last screen position + occupied by the character at that position, when the screen + would be of unlimited width. When there is a at the + position, the returned Number will be the column at the end of + the . For example, for a in column 1, with 'ts' + set to 8, it returns 8. + For the use of {expr} see |col()|. Additionally you can use + [lnum, col]: a |List| with the line and column number. When + "lnum" or "col" is out of range then virtcol() returns zero. + When 'virtualedit' is used it can be [lnum, col, off], where + "off" is the offset in screen columns from the start of the + character. E.g., a position within a Tab or after the last + character. + For the byte position use |col()|. + When Virtual editing is active in the current mode, a position + beyond the end of the line can be returned. |'virtualedit'| + The accepted positions are: + . the cursor position + $ the end of the cursor line (the result is the + number of displayed characters in the cursor line + plus one) + 'x position of mark x (if the mark is not set, 0 is + returned) + Note that only marks in the current file can be used. + Examples: > + virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5 + virtcol("$") with text "foo^Lbar", returns 9 + virtcol("'t") with text " there", with 't at 'h', returns 6 +< The first column is 1. 0 is returned for an error. + +visualmode([expr]) *visualmode()* + The result is a String, which describes the last Visual mode + used in the current buffer. Initially it returns an empty + string, but once Visual mode has been used, it returns "v", + "V", or "" (a single CTRL-V character) for + character-wise, line-wise, or block-wise Visual mode + respectively. + Example: > + :exe "normal " . visualmode() +< This enters the same Visual mode as before. It is also useful + in scripts if you wish to act differently depending on the + Visual mode that was used. + + If an expression is supplied that results in a non-zero number + or a non-empty string, then the Visual mode will be cleared + and the old value is returned. Note that " " and "0" are also + non-empty strings, thus cause the mode to be cleared. + + *winbufnr()* +winbufnr({nr}) The result is a Number, which is the number of the buffer + associated with window {nr}. When {nr} is zero, the number of + the buffer in the current window is returned. When window + {nr} doesn't exist, -1 is returned. + Example: > + :echo "The file in the current window is " . bufname(winbufnr(0)) +< + *wincol()* +wincol() The result is a Number, which is the virtual column of the + cursor in the window. This is counting screen cells from the + left side of the window. The leftmost column is one. + +winheight({nr}) *winheight()* + The result is a Number, which is the height of window {nr}. + When {nr} is zero, the height of the current window is + returned. When window {nr} doesn't exist, -1 is returned. + An existing window always has a height of zero or more. + Examples: > + :echo "The current window has " . winheight(0) . " lines." +< + *winline()* +winline() The result is a Number, which is the screen line of the cursor + in the window. This is counting screen lines from the top of + the window. The first line is one. + If the cursor was moved the view on the file will be updated + first, this may cause a scroll. + + *winnr()* +winnr([{arg}]) The result is a Number, which is the number of the current + window. The top window has number 1. + When the optional argument is "$", the number of the + last window is returned (the window count). + When the optional argument is "#", the number of the last + accessed window is returned (where |CTRL-W_p| goes to). + If there is no previous window 0 is returned. + The number can be used with |CTRL-W_w| and ":wincmd w" + |:wincmd|. + + *winrestcmd()* +winrestcmd() Returns a sequence of |:resize| commands that should restore + the current window sizes. Only works properly when no windows + are opened or closed and the current window and tab page is + unchanged. + Example: > + :let cmd = winrestcmd() + :call MessWithWindowSizes() + :exe cmd +< + *winrestview()* +winrestview({dict}) + Uses the |Dictionary| returned by |winsaveview()| to restore + the view of the current window. + If you have changed the values the result is unpredictable. + If the window size changed the result won't be the same. + + *winsaveview()* +winsaveview() Returns a |Dictionary| that contains information to restore + the view of the current window. Use |winrestview()| to + restore the view. + This is useful if you have a mapping that jumps around in the + buffer and you want to go back to the original view. + This does not save fold information. Use the 'foldenable' + option to temporarily switch off folding, so that folds are + not opened when moving around. + The return value includes: + lnum cursor line number + col cursor column + coladd cursor column offset for 'virtualedit' + curswant column for vertical movement + topline first line in the window + topfill filler lines, only in diff mode + leftcol first column displayed + skipcol columns skipped + Note that no option values are saved. + + +winwidth({nr}) *winwidth()* + The result is a Number, which is the width of window {nr}. + When {nr} is zero, the width of the current window is + returned. When window {nr} doesn't exist, -1 is returned. + An existing window always has a width of zero or more. + Examples: > + :echo "The current window has " . winwidth(0) . " columns." + :if winwidth(0) <= 50 + : exe "normal 50\|" + :endif +< + *writefile()* +writefile({list}, {fname} [, {binary}]) + Write |List| {list} to file {fname}. Each list item is + separated with a NL. Each list item must be a String or + Number. + When {binary} is equal to "b" binary mode is used: There will + not be a NL after the last list item. An empty item at the + end does cause the last line in the file to end in a NL. + All NL characters are replaced with a NUL character. + Inserting CR characters needs to be done before passing {list} + to writefile(). + An existing file is overwritten, if possible. + When the write fails -1 is returned, otherwise 0. There is an + error message if the file can't be created or when writing + fails. + Also see |readfile()|. + To copy a file byte for byte: > + :let fl = readfile("foo", "b") + :call writefile(fl, "foocopy", "b") +< + + *feature-list* +There are three types of features: +1. Features that are only supported when they have been enabled when Vim + was compiled |+feature-list|. Example: > + :if has("cindent") +2. Features that are only supported when certain conditions have been met. + Example: > + :if has("gui_running") +< *has-patch* +3. Included patches. First check |v:version| for the version of Vim. + Then the "patch123" feature means that patch 123 has been included for + this version. Example (checking version 6.2.148 or later): > + :if v:version > 602 || v:version == 602 && has("patch148") + +all_builtin_terms Compiled with all builtin terminals enabled. +amiga Amiga version of Vim. +arabic Compiled with Arabic support |Arabic|. +arp Compiled with ARP support (Amiga). +autocmd Compiled with autocommand support. |autocommand| +balloon_eval Compiled with |balloon-eval| support. +balloon_multiline GUI supports multiline balloons. +beos BeOS version of Vim. +browse Compiled with |:browse| support, and browse() will + work. +builtin_terms Compiled with some builtin terminals. +byte_offset Compiled with support for 'o' in 'statusline' +cindent Compiled with 'cindent' support. +clientserver Compiled with remote invocation support |clientserver|. +clipboard Compiled with 'clipboard' support. +cmdline_compl Compiled with |cmdline-completion| support. +cmdline_hist Compiled with |cmdline-history| support. +cmdline_info Compiled with 'showcmd' and 'ruler' support. +comments Compiled with |'comments'| support. +cryptv Compiled with encryption support |encryption|. +cscope Compiled with |cscope| support. +compatible Compiled to be very Vi compatible. +debug Compiled with "DEBUG" defined. +dialog_con Compiled with console dialog support. +dialog_gui Compiled with GUI dialog support. +diff Compiled with |vimdiff| and 'diff' support. +digraphs Compiled with support for digraphs. +dnd Compiled with support for the "~ register |quote_~|. +dos32 32 bits DOS (DJGPP) version of Vim. +dos16 16 bits DOS version of Vim. +ebcdic Compiled on a machine with ebcdic character set. +emacs_tags Compiled with support for Emacs tags. +eval Compiled with expression evaluation support. Always + true, of course! +ex_extra Compiled with extra Ex commands |+ex_extra|. +extra_search Compiled with support for |'incsearch'| and + |'hlsearch'| +farsi Compiled with Farsi support |farsi|. +file_in_path Compiled with support for |gf| and || +filterpipe When 'shelltemp' is off pipes are used for shell + read/write/filter commands +find_in_path Compiled with support for include file searches + |+find_in_path|. +fname_case Case in file names matters (for Amiga, MS-DOS, and + Windows this is not present). +folding Compiled with |folding| support. +footer Compiled with GUI footer support. |gui-footer| +fork Compiled to use fork()/exec() instead of system(). +gettext Compiled with message translation |multi-lang| +gui Compiled with GUI enabled. +gui_athena Compiled with Athena GUI. +gui_gtk Compiled with GTK+ GUI (any version). +gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined). +gui_mac Compiled with Macintosh GUI. +gui_motif Compiled with Motif GUI. +gui_photon Compiled with Photon GUI. +gui_win32 Compiled with MS Windows Win32 GUI. +gui_win32s idem, and Win32s system being used (Windows 3.1) +gui_running Vim is running in the GUI, or it will start soon. +hangul_input Compiled with Hangul input support. |hangul| +iconv Can use iconv() for conversion. +insert_expand Compiled with support for CTRL-X expansion commands in + Insert mode. +jumplist Compiled with |jumplist| support. +keymap Compiled with 'keymap' support. +langmap Compiled with 'langmap' support. +libcall Compiled with |libcall()| support. +linebreak Compiled with 'linebreak', 'breakat' and 'showbreak' + support. +lispindent Compiled with support for lisp indenting. +listcmds Compiled with commands for the buffer list |:files| + and the argument list |arglist|. +localmap Compiled with local mappings and abbr. |:map-local| +mac Macintosh version of Vim. +macunix Macintosh version of Vim, using Unix files (OS-X). +menu Compiled with support for |:menu|. +mksession Compiled with support for |:mksession|. +modify_fname Compiled with file name modifiers. |filename-modifiers| +mouse Compiled with support mouse. +mouseshape Compiled with support for 'mouseshape'. +mouse_dec Compiled with support for Dec terminal mouse. +mouse_gpm Compiled with support for gpm (Linux console mouse) +mouse_netterm Compiled with support for netterm mouse. +mouse_pterm Compiled with support for qnx pterm mouse. +mouse_xterm Compiled with support for xterm mouse. +multi_byte Compiled with support for editing Korean et al. +multi_byte_ime Compiled with support for IME input method. +multi_lang Compiled with support for multiple languages. +mzscheme Compiled with MzScheme interface |mzscheme|. +netbeans_intg Compiled with support for |netbeans|. +netbeans_enabled Compiled with support for |netbeans| and it's used. +ole Compiled with OLE automation support for Win32. +os2 OS/2 version of Vim. +osfiletype Compiled with support for osfiletypes |+osfiletype| +path_extra Compiled with up/downwards search in 'path' and 'tags' +perl Compiled with Perl interface. +postscript Compiled with PostScript file printing. +printer Compiled with |:hardcopy| support. +profile Compiled with |:profile| support. +python Compiled with Python interface. +qnx QNX version of Vim. +quickfix Compiled with |quickfix| support. +reltime Compiled with |reltime()| support. +rightleft Compiled with 'rightleft' support. +ruby Compiled with Ruby interface |ruby|. +scrollbind Compiled with 'scrollbind' support. +showcmd Compiled with 'showcmd' support. +signs Compiled with |:sign| support. +smartindent Compiled with 'smartindent' support. +sniff Compiled with SNiFF interface support. +statusline Compiled with support for 'statusline', 'rulerformat' + and special formats of 'titlestring' and 'iconstring'. +sun_workshop Compiled with support for Sun |workshop|. +spell Compiled with spell checking support |spell|. +syntax Compiled with syntax highlighting support |syntax|. +syntax_items There are active syntax highlighting items for the + current buffer. +system Compiled to use system() instead of fork()/exec(). +tag_binary Compiled with binary searching in tags files + |tag-binary-search|. +tag_old_static Compiled with support for old static tags + |tag-old-static|. +tag_any_white Compiled with support for any white characters in tags + files |tag-any-white|. +tcl Compiled with Tcl interface. +terminfo Compiled with terminfo instead of termcap. +termresponse Compiled with support for |t_RV| and |v:termresponse|. +textobjects Compiled with support for |text-objects|. +tgetent Compiled with tgetent support, able to use a termcap + or terminfo file. +title Compiled with window title support |'title'|. +toolbar Compiled with support for |gui-toolbar|. +unix Unix version of Vim. +user_commands User-defined commands. +viminfo Compiled with viminfo support. +vim_starting True while initial source'ing takes place. +vertsplit Compiled with vertically split windows |:vsplit|. +virtualedit Compiled with 'virtualedit' option. +visual Compiled with Visual mode. +visualextra Compiled with extra Visual mode commands. + |blockwise-operators|. +vms VMS version of Vim. +vreplace Compiled with |gR| and |gr| commands. +wildignore Compiled with 'wildignore' option. +wildmenu Compiled with 'wildmenu' option. +windows Compiled with support for more than one window. +winaltkeys Compiled with 'winaltkeys' option. +win16 Win16 version of Vim (MS-Windows 3.1). +win32 Win32 version of Vim (MS-Windows 95/98/ME/NT/2000/XP). +win64 Win64 version of Vim (MS-Windows 64 bit). +win32unix Win32 version of Vim, using Unix files (Cygwin) +win95 Win32 version for MS-Windows 95/98/ME. +writebackup Compiled with 'writebackup' default on. +xfontset Compiled with X fontset support |xfontset|. +xim Compiled with X input method support |xim|. +xsmp Compiled with X session management support. +xsmp_interact Compiled with interactive X session management support. +xterm_clipboard Compiled with support for xterm clipboard. +xterm_save Compiled with support for saving and restoring the + xterm screen. +x11 Compiled with X11 support. + + *string-match* +Matching a pattern in a String + +A regexp pattern as explained at |pattern| is normally used to find a match in +the buffer lines. When a pattern is used to find a match in a String, almost +everything works in the same way. The difference is that a String is handled +like it is one line. When it contains a "\n" character, this is not seen as a +line break for the pattern. It can be matched with a "\n" in the pattern, or +with ".". Example: > + :let a = "aaaa\nxxxx" + :echo matchstr(a, "..\n..") + aa + xx + :echo matchstr(a, "a.x") + a + x + +Don't forget that "^" will only match at the first character of the String and +"$" at the last character of the string. They don't match after or before a +"\n". + +============================================================================== +5. Defining functions *user-functions* + +New functions can be defined. These can be called just like builtin +functions. The function executes a sequence of Ex commands. Normal mode +commands can be executed with the |:normal| command. + +The function name must start with an uppercase letter, to avoid confusion with +builtin functions. To prevent from using the same name in different scripts +avoid obvious, short names. A good habit is to start the function name with +the name of the script, e.g., "HTMLcolor()". + +It's also possible to use curly braces, see |curly-braces-names|. And the +|autoload| facility is useful to define a function only when it's called. + + *local-function* +A function local to a script must start with "s:". A local script function +can only be called from within the script and from functions, user commands +and autocommands defined in the script. It is also possible to call the +function from a mappings defined in the script, but then || must be used +instead of "s:" when the mapping is expanded outside of the script. + + *:fu* *:function* *E128* *E129* *E123* +:fu[nction] List all functions and their arguments. + +:fu[nction] {name} List function {name}. + {name} can also be a |Dictionary| entry that is a + |Funcref|: > + :function dict.init + +:fu[nction] /{pattern} List functions with a name matching {pattern}. + Example that lists all functions ending with "File": > + :function /File$ +< + *:function-verbose* +When 'verbose' is non-zero, listing a function will also display where it was +last defined. Example: > + + :verbose function SetFileTypeSH + function SetFileTypeSH(name) + Last set from /usr/share/vim/vim-7.0/filetype.vim +< +See |:verbose-cmd| for more information. + + *E124* *E125* +:fu[nction][!] {name}([arguments]) [range] [abort] [dict] + Define a new function by the name {name}. The name + must be made of alphanumeric characters and '_', and + must start with a capital or "s:" (see above). + + {name} can also be a |Dictionary| entry that is a + |Funcref|: > + :function dict.init(arg) +< "dict" must be an existing dictionary. The entry + "init" is added if it didn't exist yet. Otherwise [!] + is required to overwrite an existing function. The + result is a |Funcref| to a numbered function. The + function can only be used with a |Funcref| and will be + deleted if there are no more references to it. + *E127* *E122* + When a function by this name already exists and [!] is + not used an error message is given. When [!] is used, + an existing function is silently replaced. Unless it + is currently being executed, that is an error. + + For the {arguments} see |function-argument|. + + *a:firstline* *a:lastline* + When the [range] argument is added, the function is + expected to take care of a range itself. The range is + passed as "a:firstline" and "a:lastline". If [range] + is excluded, ":{range}call" will call the function for + each line in the range, with the cursor on the start + of each line. See |function-range-example|. + + When the [abort] argument is added, the function will + abort as soon as an error is detected. + + When the [dict] argument is added, the function must + be invoked through an entry in a |Dictionary|. The + local variable "self" will then be set to the + dictionary. See |Dictionary-function|. + + The last used search pattern and the redo command "." + will not be changed by the function. + + *:endf* *:endfunction* *E126* *E193* +:endf[unction] The end of a function definition. Must be on a line + by its own, without other commands. + + *:delf* *:delfunction* *E130* *E131* +:delf[unction] {name} Delete function {name}. + {name} can also be a |Dictionary| entry that is a + |Funcref|: > + :delfunc dict.init +< This will remove the "init" entry from "dict". The + function is deleted if there are no more references to + it. + *:retu* *:return* *E133* +:retu[rn] [expr] Return from a function. When "[expr]" is given, it is + evaluated and returned as the result of the function. + If "[expr]" is not given, the number 0 is returned. + When a function ends without an explicit ":return", + the number 0 is returned. + Note that there is no check for unreachable lines, + thus there is no warning if commands follow ":return". + + If the ":return" is used after a |:try| but before the + matching |:finally| (if present), the commands + following the ":finally" up to the matching |:endtry| + are executed first. This process applies to all + nested ":try"s inside the function. The function + returns at the outermost ":endtry". + + *function-argument* *a:var* +An argument can be defined by giving its name. In the function this can then +be used as "a:name" ("a:" for argument). + *a:0* *a:1* *a:000* *E740* +Up to 20 arguments can be given, separated by commas. After the named +arguments an argument "..." can be specified, which means that more arguments +may optionally be following. In the function the extra arguments can be used +as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which +can be 0). "a:000" is set to a |List| that contains these arguments. Note +that "a:1" is the same as "a:000[0]". + *E742* +The a: scope and the variables in it cannot be changed, they are fixed. +However, if a |List| or |Dictionary| is used, you can changes their contents. +Thus you can pass a |List| to a function and have the function add an item to +it. If you want to make sure the function cannot change a |List| or +|Dictionary| use |:lockvar|. + +When not using "...", the number of arguments in a function call must be equal +to the number of named arguments. When using "...", the number of arguments +may be larger. + +It is also possible to define a function without any arguments. You must +still supply the () then. The body of the function follows in the next lines, +until the matching |:endfunction|. It is allowed to define another function +inside a function body. + + *local-variables* +Inside a function variables can be used. These are local variables, which +will disappear when the function returns. Global variables need to be +accessed with "g:". + +Example: > + :function Table(title, ...) + : echohl Title + : echo a:title + : echohl None + : echo a:0 . " items:" + : for s in a:000 + : echon ' ' . s + : endfor + :endfunction + +This function can then be called with: > + call Table("Table", "line1", "line2") + call Table("Empty Table") + +To return more than one value, pass the name of a global variable: > + :function Compute(n1, n2, divname) + : if a:n2 == 0 + : return "fail" + : endif + : let g:{a:divname} = a:n1 / a:n2 + : return "ok" + :endfunction + +This function can then be called with: > + :let success = Compute(13, 1324, "div") + :if success == "ok" + : echo div + :endif + +An alternative is to return a command that can be executed. This also works +with local variables in a calling function. Example: > + :function Foo() + : execute Bar() + : echo "line " . lnum . " column " . col + :endfunction + + :function Bar() + : return "let lnum = " . line(".") . " | let col = " . col(".") + :endfunction + +The names "lnum" and "col" could also be passed as argument to Bar(), to allow +the caller to set the names. + + *:cal* *:call* *E107* *E117* +:[range]cal[l] {name}([arguments]) + Call a function. The name of the function and its arguments + are as specified with |:function|. Up to 20 arguments can be + used. + Without a range and for functions that accept a range, the + function is called once. When a range is given the cursor is + positioned at the start of the first line before executing the + function. + When a range is given and the function doesn't handle it + itself, the function is executed for each line in the range, + with the cursor in the first column of that line. The cursor + is left at the last line (possibly moved by the last function + call). The arguments are re-evaluated for each line. Thus + this works: + *function-range-example* > + :function Mynumber(arg) + : echo line(".") . " " . a:arg + :endfunction + :1,5call Mynumber(getline(".")) +< + The "a:firstline" and "a:lastline" are defined anyway, they + can be used to do something different at the start or end of + the range. + + Example of a function that handles the range itself: > + + :function Cont() range + : execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ ' + :endfunction + :4,8call Cont() +< + This function inserts the continuation character "\" in front + of all the lines in the range, except the first one. + + *E132* +The recursiveness of user functions is restricted with the |'maxfuncdepth'| +option. + + +AUTOMATICALLY LOADING FUNCTIONS ~ + *autoload-functions* +When using many or large functions, it's possible to automatically define them +only when they are used. There are two methods: with an autocommand and with +the "autoload" directory in 'runtimepath'. + + +Using an autocommand ~ + +This is introduced in the user manual, section |41.14|. + +The autocommand is useful if you have a plugin that is a long Vim script file. +You can define the autocommand and quickly quit the script with |:finish|. +That makes Vim startup faster. The autocommand should then load the same file +again, setting a variable to skip the |:finish| command. + +Use the FuncUndefined autocommand event with a pattern that matches the +function(s) to be defined. Example: > + + :au FuncUndefined BufNet* source ~/vim/bufnetfuncs.vim + +The file "~/vim/bufnetfuncs.vim" should then define functions that start with +"BufNet". Also see |FuncUndefined|. + + +Using an autoload script ~ + *autoload* *E746* +This is introduced in the user manual, section |41.15|. + +Using a script in the "autoload" directory is simpler, but requires using +exactly the right file name. A function that can be autoloaded has a name +like this: > + + :call filename#funcname() + +When such a function is called, and it is not defined yet, Vim will search the +"autoload" directories in 'runtimepath' for a script file called +"filename.vim". For example "~/.vim/autoload/filename.vim". That file should +then define the function like this: > + + function filename#funcname() + echo "Done!" + endfunction + +The file name and the name used before the # in the function must match +exactly, and the defined function must have the name exactly as it will be +called. + +It is possible to use subdirectories. Every # in the function name works like +a path separator. Thus when calling a function: > + + :call foo#bar#func() + +Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'. + +This also works when reading a variable that has not been set yet: > + + :let l = foo#bar#lvar + +However, when the autoload script was already loaded it won't be loaded again +for an unknown variable. + +When assigning a value to such a variable nothing special happens. This can +be used to pass settings to the autoload script before it's loaded: > + + :let foo#bar#toggle = 1 + :call foo#bar#func() + +Note that when you make a mistake and call a function that is supposed to be +defined in an autoload script, but the script doesn't actually define the +function, the script will be sourced every time you try to call the function. +And you will get an error message every time. + +Also note that if you have two script files, and one calls a function in the +other and vise versa, before the used function is defined, it won't work. +Avoid using the autoload functionality at the toplevel. + +Hint: If you distribute a bunch of scripts you can pack them together with the +|vimball| utility. Also read the user manual |distribute-script|. + +============================================================================== +6. Curly braces names *curly-braces-names* + +Wherever you can use a variable, you can use a "curly braces name" variable. +This is a regular variable name with one or more expressions wrapped in braces +{} like this: > + my_{adjective}_variable + +When Vim encounters this, it evaluates the expression inside the braces, puts +that in place of the expression, and re-interprets the whole as a variable +name. So in the above example, if the variable "adjective" was set to +"noisy", then the reference would be to "my_noisy_variable", whereas if +"adjective" was set to "quiet", then it would be to "my_quiet_variable". + +One application for this is to create a set of variables governed by an option +value. For example, the statement > + echo my_{&background}_message + +would output the contents of "my_dark_message" or "my_light_message" depending +on the current value of 'background'. + +You can use multiple brace pairs: > + echo my_{adverb}_{adjective}_message +..or even nest them: > + echo my_{ad{end_of_word}}_message +where "end_of_word" is either "verb" or "jective". + +However, the expression inside the braces must evaluate to a valid single +variable name, e.g. this is invalid: > + :let foo='a + b' + :echo c{foo}d +.. since the result of expansion is "ca + bd", which is not a variable name. + + *curly-braces-function-names* +You can call and define functions by an evaluated name in a similar way. +Example: > + :let func_end='whizz' + :call my_func_{func_end}(parameter) + +This would call the function "my_func_whizz(parameter)". + +============================================================================== +7. Commands *expression-commands* + +:let {var-name} = {expr1} *:let* *E18* + Set internal variable {var-name} to the result of the + expression {expr1}. The variable will get the type + from the {expr}. If {var-name} didn't exist yet, it + is created. + +:let {var-name}[{idx}] = {expr1} *E689* + Set a list item to the result of the expression + {expr1}. {var-name} must refer to a list and {idx} + must be a valid index in that list. For nested list + the index can be repeated. + This cannot be used to add an item to a list. + + *E711* *E719* +:let {var-name}[{idx1}:{idx2}] = {expr1} *E708* *E709* *E710* + Set a sequence of items in a |List| to the result of + the expression {expr1}, which must be a list with the + correct number of items. + {idx1} can be omitted, zero is used instead. + {idx2} can be omitted, meaning the end of the list. + When the selected range of items is partly past the + end of the list, items will be added. + + *:let+=* *:let-=* *:let.=* *E734* +:let {var} += {expr1} Like ":let {var} = {var} + {expr1}". +:let {var} -= {expr1} Like ":let {var} = {var} - {expr1}". +:let {var} .= {expr1} Like ":let {var} = {var} . {expr1}". + These fail if {var} was not set yet and when the type + of {var} and {expr1} don't fit the operator. + + +:let ${env-name} = {expr1} *:let-environment* *:let-$* + Set environment variable {env-name} to the result of + the expression {expr1}. The type is always String. +:let ${env-name} .= {expr1} + Append {expr1} to the environment variable {env-name}. + If the environment variable didn't exist yet this + works like "=". + +:let @{reg-name} = {expr1} *:let-register* *:let-@* + Write the result of the expression {expr1} in register + {reg-name}. {reg-name} must be a single letter, and + must be the name of a writable register (see + |registers|). "@@" can be used for the unnamed + register, "@/" for the search pattern. + If the result of {expr1} ends in a or , the + register will be linewise, otherwise it will be set to + characterwise. + This can be used to clear the last search pattern: > + :let @/ = "" +< This is different from searching for an empty string, + that would match everywhere. + +:let @{reg-name} .= {expr1} + Append {expr1} to register {reg-name}. If the + register was empty it's like setting it to {expr1}. + +:let &{option-name} = {expr1} *:let-option* *:let-star* + Set option {option-name} to the result of the + expression {expr1}. A String or Number value is + always converted to the type of the option. + For an option local to a window or buffer the effect + is just like using the |:set| command: both the local + value and the global value are changed. + Example: > + :let &path = &path . ',/usr/local/include' + +:let &{option-name} .= {expr1} + For a string option: Append {expr1} to the value. + Does not insert a comma like |:set+=|. + +:let &{option-name} += {expr1} +:let &{option-name} -= {expr1} + For a number or boolean option: Add or subtract + {expr1}. + +:let &l:{option-name} = {expr1} +:let &l:{option-name} .= {expr1} +:let &l:{option-name} += {expr1} +:let &l:{option-name} -= {expr1} + Like above, but only set the local value of an option + (if there is one). Works like |:setlocal|. + +:let &g:{option-name} = {expr1} +:let &g:{option-name} .= {expr1} +:let &g:{option-name} += {expr1} +:let &g:{option-name} -= {expr1} + Like above, but only set the global value of an option + (if there is one). Works like |:setglobal|. + +:let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688* + {expr1} must evaluate to a |List|. The first item in + the list is assigned to {name1}, the second item to + {name2}, etc. + The number of names must match the number of items in + the |List|. + Each name can be one of the items of the ":let" + command as mentioned above. + Example: > + :let [s, item] = GetItem(s) +< Detail: {expr1} is evaluated first, then the + assignments are done in sequence. This matters if + {name2} depends on {name1}. Example: > + :let x = [0, 1] + :let i = 0 + :let [i, x[i]] = [1, 2] + :echo x +< The result is [0, 2]. + +:let [{name1}, {name2}, ...] .= {expr1} +:let [{name1}, {name2}, ...] += {expr1} +:let [{name1}, {name2}, ...] -= {expr1} + Like above, but append/add/subtract the value for each + |List| item. + +:let [{name}, ..., ; {lastname}] = {expr1} + Like |:let-unpack| above, but the |List| may have more + items than there are names. A list of the remaining + items is assigned to {lastname}. If there are no + remaining items {lastname} is set to an empty list. + Example: > + :let [a, b; rest] = ["aval", "bval", 3, 4] +< +:let [{name}, ..., ; {lastname}] .= {expr1} +:let [{name}, ..., ; {lastname}] += {expr1} +:let [{name}, ..., ; {lastname}] -= {expr1} + Like above, but append/add/subtract the value for each + |List| item. + *E106* +:let {var-name} .. List the value of variable {var-name}. Multiple + variable names may be given. Special names recognized + here: *E738* + g: global variables + b: local buffer variables + w: local window variables + t: local tab page variables + s: script-local variables + l: local function variables + v: Vim variables. + +:let List the values of all variables. The type of the + variable is indicated before the value: + String + # Number + * Funcref + + +:unl[et][!] {name} ... *:unlet* *:unl* *E108* + Remove the internal variable {name}. Several variable + names can be given, they are all removed. The name + may also be a |List| or |Dictionary| item. + With [!] no error message is given for non-existing + variables. + One or more items from a |List| can be removed: > + :unlet list[3] " remove fourth item + :unlet list[3:] " remove fourth item to last +< One item from a |Dictionary| can be removed at a time: > + :unlet dict['two'] + :unlet dict.two + +:lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv* + Lock the internal variable {name}. Locking means that + it can no longer be changed (until it is unlocked). + A locked variable can be deleted: > + :lockvar v + :let v = 'asdf' " fails! + :unlet v +< *E741* + If you try to change a locked variable you get an + error message: "E741: Value of {name} is locked" + + [depth] is relevant when locking a |List| or + |Dictionary|. It specifies how deep the locking goes: + 1 Lock the |List| or |Dictionary| itself, + cannot add or remove items, but can + still change their values. + 2 Also lock the values, cannot change + the items. If an item is a |List| or + |Dictionary|, cannot add or remove + items, but can still change the + values. + 3 Like 2 but for the |List| / + |Dictionary| in the |List| / + |Dictionary|, one level deeper. + The default [depth] is 2, thus when {name} is a |List| + or |Dictionary| the values cannot be changed. + *E743* + For unlimited depth use [!] and omit [depth]. + However, there is a maximum depth of 100 to catch + loops. + + Note that when two variables refer to the same |List| + and you lock one of them, the |List| will also be + locked when used through the other variable. + Example: > + :let l = [0, 1, 2, 3] + :let cl = l + :lockvar l + :let cl[1] = 99 " won't work! +< You may want to make a copy of a list to avoid this. + See |deepcopy()|. + + +:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* + Unlock the internal variable {name}. Does the + opposite of |:lockvar|. + + +:if {expr1} *:if* *:endif* *:en* *E171* *E579* *E580* +:en[dif] Execute the commands until the next matching ":else" + or ":endif" if {expr1} evaluates to non-zero. + + From Vim version 4.5 until 5.0, every Ex command in + between the ":if" and ":endif" is ignored. These two + commands were just to allow for future expansions in a + backwards compatible way. Nesting was allowed. Note + that any ":else" or ":elseif" was ignored, the "else" + part was not executed either. + + You can use this to remain compatible with older + versions: > + :if version >= 500 + : version-5-specific-commands + :endif +< The commands still need to be parsed to find the + "endif". Sometimes an older Vim has a problem with a + new command. For example, ":silent" is recognized as + a ":substitute" command. In that case ":execute" can + avoid problems: > + :if version >= 600 + : execute "silent 1,$delete" + :endif +< + NOTE: The ":append" and ":insert" commands don't work + properly in between ":if" and ":endif". + + *:else* *:el* *E581* *E583* +:el[se] Execute the commands until the next matching ":else" + or ":endif" if they previously were not being + executed. + + *:elseif* *:elsei* *E582* *E584* +:elsei[f] {expr1} Short for ":else" ":if", with the addition that there + is no extra ":endif". + +:wh[ile] {expr1} *:while* *:endwhile* *:wh* *:endw* + *E170* *E585* *E588* *E733* +:endw[hile] Repeat the commands between ":while" and ":endwhile", + as long as {expr1} evaluates to non-zero. + When an error is detected from a command inside the + loop, execution continues after the "endwhile". + Example: > + :let lnum = 1 + :while lnum <= line("$") + :call FixLine(lnum) + :let lnum = lnum + 1 + :endwhile +< + NOTE: The ":append" and ":insert" commands don't work + properly inside a ":while" and ":for" loop. + +:for {var} in {list} *:for* *E690* *E732* +:endfo[r] *:endfo* *:endfor* + Repeat the commands between ":for" and ":endfor" for + each item in {list}. Variable {var} is set to the + value of each item. + When an error is detected for a command inside the + loop, execution continues after the "endfor". + Changing {list} inside the loop affects what items are + used. Make a copy if this is unwanted: > + :for item in copy(mylist) +< When not making a copy, Vim stores a reference to the + next item in the list, before executing the commands + with the current item. Thus the current item can be + removed without effect. Removing any later item means + it will not be found. Thus the following example + works (an inefficient way to make a list empty): > + :for item in mylist + :call remove(mylist, 0) + :endfor +< Note that reordering the list (e.g., with sort() or + reverse()) may have unexpected effects. + Note that the type of each list item should be + identical to avoid errors for the type of {var} + changing. Unlet the variable at the end of the loop + to allow multiple item types. + +:for [{var1}, {var2}, ...] in {listlist} +:endfo[r] + Like ":for" above, but each item in {listlist} must be + a list, of which each item is assigned to {var1}, + {var2}, etc. Example: > + :for [lnum, col] in [[1, 3], [2, 5], [3, 8]] + :echo getline(lnum)[col] + :endfor +< + *:continue* *:con* *E586* +:con[tinue] When used inside a ":while" or ":for" loop, jumps back + to the start of the loop. + If it is used after a |:try| inside the loop but + before the matching |:finally| (if present), the + commands following the ":finally" up to the matching + |:endtry| are executed first. This process applies to + all nested ":try"s inside the loop. The outermost + ":endtry" then jumps back to the start of the loop. + + *:break* *:brea* *E587* +:brea[k] When used inside a ":while" or ":for" loop, skips to + the command after the matching ":endwhile" or + ":endfor". + If it is used after a |:try| inside the loop but + before the matching |:finally| (if present), the + commands following the ":finally" up to the matching + |:endtry| are executed first. This process applies to + all nested ":try"s inside the loop. The outermost + ":endtry" then jumps to the command after the loop. + +:try *:try* *:endt* *:endtry* *E600* *E601* *E602* +:endt[ry] Change the error handling for the commands between + ":try" and ":endtry" including everything being + executed across ":source" commands, function calls, + or autocommand invocations. + + When an error or interrupt is detected and there is + a |:finally| command following, execution continues + after the ":finally". Otherwise, or when the + ":endtry" is reached thereafter, the next + (dynamically) surrounding ":try" is checked for + a corresponding ":finally" etc. Then the script + processing is terminated. (Whether a function + definition has an "abort" argument does not matter.) + Example: > + :try | edit too much | finally | echo "cleanup" | endtry + :echo "impossible" " not reached, script terminated above +< + Moreover, an error or interrupt (dynamically) inside + ":try" and ":endtry" is converted to an exception. It + can be caught as if it were thrown by a |:throw| + command (see |:catch|). In this case, the script + processing is not terminated. + + The value "Vim:Interrupt" is used for an interrupt + exception. An error in a Vim command is converted + to a value of the form "Vim({command}):{errmsg}", + other errors are converted to a value of the form + "Vim:{errmsg}". {command} is the full command name, + and {errmsg} is the message that is displayed if the + error exception is not caught, always beginning with + the error number. + Examples: > + :try | sleep 100 | catch /^Vim:Interrupt$/ | endtry + :try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry +< + *:cat* *:catch* *E603* *E604* *E605* +:cat[ch] /{pattern}/ The following commands until the next ":catch", + |:finally|, or |:endtry| that belongs to the same + |:try| as the ":catch" are executed when an exception + matching {pattern} is being thrown and has not yet + been caught by a previous ":catch". Otherwise, these + commands are skipped. + When {pattern} is omitted all errors are caught. + Examples: > + :catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C) + :catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors + :catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts + :catch /^Vim(write):/ " catch all errors in :write + :catch /^Vim\%((\a\+)\)\=:E123/ " catch error E123 + :catch /my-exception/ " catch user exception + :catch /.*/ " catch everything + :catch " same as /.*/ +< + Another character can be used instead of / around the + {pattern}, so long as it does not have a special + meaning (e.g., '|' or '"') and doesn't occur inside + {pattern}. + NOTE: It is not reliable to ":catch" the TEXT of + an error message because it may vary in different + locales. + + *:fina* *:finally* *E606* *E607* +:fina[lly] The following commands until the matching |:endtry| + are executed whenever the part between the matching + |:try| and the ":finally" is left: either by falling + through to the ":finally" or by a |:continue|, + |:break|, |:finish|, or |:return|, or by an error or + interrupt or exception (see |:throw|). + + *:th* *:throw* *E608* +:th[row] {expr1} The {expr1} is evaluated and thrown as an exception. + If the ":throw" is used after a |:try| but before the + first corresponding |:catch|, commands are skipped + until the first ":catch" matching {expr1} is reached. + If there is no such ":catch" or if the ":throw" is + used after a ":catch" but before the |:finally|, the + commands following the ":finally" (if present) up to + the matching |:endtry| are executed. If the ":throw" + is after the ":finally", commands up to the ":endtry" + are skipped. At the ":endtry", this process applies + again for the next dynamically surrounding ":try" + (which may be found in a calling function or sourcing + script), until a matching ":catch" has been found. + If the exception is not caught, the command processing + is terminated. + Example: > + :try | throw "oops" | catch /^oo/ | echo "caught" | endtry +< + + *:ec* *:echo* +:ec[ho] {expr1} .. Echoes each {expr1}, with a space in between. The + first {expr1} starts on a new line. + Also see |:comment|. + Use "\n" to start a new line. Use "\r" to move the + cursor to the first column. + Uses the highlighting set by the |:echohl| command. + Cannot be followed by a comment. + Example: > + :echo "the value of 'shell' is" &shell +< A later redraw may make the message disappear again. + To avoid that a command from before the ":echo" causes + a redraw afterwards (redraws are often postponed until + you type something), force a redraw with the |:redraw| + command. Example: > + :new | redraw | echo "there is a new window" +< + *:echon* +:echon {expr1} .. Echoes each {expr1}, without anything added. Also see + |:comment|. + Uses the highlighting set by the |:echohl| command. + Cannot be followed by a comment. + Example: > + :echon "the value of 'shell' is " &shell +< + Note the difference between using ":echo", which is a + Vim command, and ":!echo", which is an external shell + command: > + :!echo % --> filename +< The arguments of ":!" are expanded, see |:_%|. > + :!echo "%" --> filename or "filename" +< Like the previous example. Whether you see the double + quotes or not depends on your 'shell'. > + :echo % --> nothing +< The '%' is an illegal character in an expression. > + :echo "%" --> % +< This just echoes the '%' character. > + :echo expand("%") --> filename +< This calls the expand() function to expand the '%'. + + *:echoh* *:echohl* +:echoh[l] {name} Use the highlight group {name} for the following + |:echo|, |:echon| and |:echomsg| commands. Also used + for the |input()| prompt. Example: > + :echohl WarningMsg | echo "Don't panic!" | echohl None +< Don't forget to set the group back to "None", + otherwise all following echo's will be highlighted. + + *:echom* *:echomsg* +:echom[sg] {expr1} .. Echo the expression(s) as a true message, saving the + message in the |message-history|. + Spaces are placed between the arguments as with the + |:echo| command. But unprintable characters are + displayed, not interpreted. + Uses the highlighting set by the |:echohl| command. + Example: > + :echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see." +< + *:echoe* *:echoerr* +:echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the + message in the |message-history|. When used in a + script or function the line number will be added. + Spaces are placed between the arguments as with the + :echo command. When used inside a try conditional, + the message is raised as an error exception instead + (see |try-echoerr|). + Example: > + :echoerr "This script just failed!" +< If you just want a highlighted message use |:echohl|. + And to get a beep: > + :exe "normal \" +< + *:exe* *:execute* +:exe[cute] {expr1} .. Executes the string that results from the evaluation + of {expr1} as an Ex command. Multiple arguments are + concatenated, with a space in between. {expr1} is + used as the processed command, command line editing + keys are not recognized. + Cannot be followed by a comment. + Examples: > + :execute "buffer " nextbuf + :execute "normal " count . "w" +< + ":execute" can be used to append a command to commands + that don't accept a '|'. Example: > + :execute '!ls' | echo "theend" + +< ":execute" is also a nice way to avoid having to type + control characters in a Vim script for a ":normal" + command: > + :execute "normal ixxx\" +< This has an character, see |expr-string|. + + Note: The executed string may be any command-line, but + you cannot start or end a "while", "for" or "if" + command. Thus this is illegal: > + :execute 'while i > 5' + :execute 'echo "test" | break' +< + It is allowed to have a "while" or "if" command + completely in the executed string: > + :execute 'while i < 5 | echo i | let i = i + 1 | endwhile' +< + + *:comment* + ":execute", ":echo" and ":echon" cannot be followed by + a comment directly, because they see the '"' as the + start of a string. But, you can use '|' followed by a + comment. Example: > + :echo "foo" | "this is a comment + +============================================================================== +8. Exception handling *exception-handling* + +The Vim script language comprises an exception handling feature. This section +explains how it can be used in a Vim script. + +Exceptions may be raised by Vim on an error or on interrupt, see +|catch-errors| and |catch-interrupt|. You can also explicitly throw an +exception by using the ":throw" command, see |throw-catch|. + + +TRY CONDITIONALS *try-conditionals* + +Exceptions can be caught or can cause cleanup code to be executed. You can +use a try conditional to specify catch clauses (that catch exceptions) and/or +a finally clause (to be executed for cleanup). + A try conditional begins with a |:try| command and ends at the matching +|:endtry| command. In between, you can use a |:catch| command to start +a catch clause, or a |:finally| command to start a finally clause. There may +be none or multiple catch clauses, but there is at most one finally clause, +which must not be followed by any catch clauses. The lines before the catch +clauses and the finally clause is called a try block. > + + :try + : ... + : ... TRY BLOCK + : ... + :catch /{pattern}/ + : ... + : ... CATCH CLAUSE + : ... + :catch /{pattern}/ + : ... + : ... CATCH CLAUSE + : ... + :finally + : ... + : ... FINALLY CLAUSE + : ... + :endtry + +The try conditional allows to watch code for exceptions and to take the +appropriate actions. Exceptions from the try block may be caught. Exceptions +from the try block and also the catch clauses may cause cleanup actions. + When no exception is thrown during execution of the try block, the control +is transferred to the finally clause, if present. After its execution, the +script continues with the line following the ":endtry". + When an exception occurs during execution of the try block, the remaining +lines in the try block are skipped. The exception is matched against the +patterns specified as arguments to the ":catch" commands. The catch clause +after the first matching ":catch" is taken, other catch clauses are not +executed. The catch clause ends when the next ":catch", ":finally", or +":endtry" command is reached - whatever is first. Then, the finally clause +(if present) is executed. When the ":endtry" is reached, the script execution +continues in the following line as usual. + When an exception that does not match any of the patterns specified by the +":catch" commands is thrown in the try block, the exception is not caught by +that try conditional and none of the catch clauses is executed. Only the +finally clause, if present, is taken. The exception pends during execution of +the finally clause. It is resumed at the ":endtry", so that commands after +the ":endtry" are not executed and the exception might be caught elsewhere, +see |try-nesting|. + When during execution of a catch clause another exception is thrown, the +remaining lines in that catch clause are not executed. The new exception is +not matched against the patterns in any of the ":catch" commands of the same +try conditional and none of its catch clauses is taken. If there is, however, +a finally clause, it is executed, and the exception pends during its +execution. The commands following the ":endtry" are not executed. The new +exception might, however, be caught elsewhere, see |try-nesting|. + When during execution of the finally clause (if present) an exception is +thrown, the remaining lines in the finally clause are skipped. If the finally +clause has been taken because of an exception from the try block or one of the +catch clauses, the original (pending) exception is discarded. The commands +following the ":endtry" are not executed, and the exception from the finally +clause is propagated and can be caught elsewhere, see |try-nesting|. + +The finally clause is also executed, when a ":break" or ":continue" for +a ":while" loop enclosing the complete try conditional is executed from the +try block or a catch clause. Or when a ":return" or ":finish" is executed +from the try block or a catch clause of a try conditional in a function or +sourced script, respectively. The ":break", ":continue", ":return", or +":finish" pends during execution of the finally clause and is resumed when the +":endtry" is reached. It is, however, discarded when an exception is thrown +from the finally clause. + When a ":break" or ":continue" for a ":while" loop enclosing the complete +try conditional or when a ":return" or ":finish" is encountered in the finally +clause, the rest of the finally clause is skipped, and the ":break", +":continue", ":return" or ":finish" is executed as usual. If the finally +clause has been taken because of an exception or an earlier ":break", +":continue", ":return", or ":finish" from the try block or a catch clause, +this pending exception or command is discarded. + +For examples see |throw-catch| and |try-finally|. + + +NESTING OF TRY CONDITIONALS *try-nesting* + +Try conditionals can be nested arbitrarily. That is, a complete try +conditional can be put into the try block, a catch clause, or the finally +clause of another try conditional. If the inner try conditional does not +catch an exception thrown in its try block or throws a new exception from one +of its catch clauses or its finally clause, the outer try conditional is +checked according to the rules above. If the inner try conditional is in the +try block of the outer try conditional, its catch clauses are checked, but +otherwise only the finally clause is executed. It does not matter for +nesting, whether the inner try conditional is directly contained in the outer +one, or whether the outer one sources a script or calls a function containing +the inner try conditional. + +When none of the active try conditionals catches an exception, just their +finally clauses are executed. Thereafter, the script processing terminates. +An error message is displayed in case of an uncaught exception explicitly +thrown by a ":throw" command. For uncaught error and interrupt exceptions +implicitly raised by Vim, the error message(s) or interrupt message are shown +as usual. + +For examples see |throw-catch|. + + +EXAMINING EXCEPTION HANDLING CODE *except-examine* + +Exception handling code can get tricky. If you are in doubt what happens, set +'verbose' to 13 or use the ":13verbose" command modifier when sourcing your +script file. Then you see when an exception is thrown, discarded, caught, or +finished. When using a verbosity level of at least 14, things pending in +a finally clause are also shown. This information is also given in debug mode +(see |debug-scripts|). + + +THROWING AND CATCHING EXCEPTIONS *throw-catch* + +You can throw any number or string as an exception. Use the |:throw| command +and pass the value to be thrown as argument: > + :throw 4711 + :throw "string" +< *throw-expression* +You can also specify an expression argument. The expression is then evaluated +first, and the result is thrown: > + :throw 4705 + strlen("string") + :throw strpart("strings", 0, 6) + +An exception might be thrown during evaluation of the argument of the ":throw" +command. Unless it is caught there, the expression evaluation is abandoned. +The ":throw" command then does not throw a new exception. + Example: > + + :function! Foo(arg) + : try + : throw a:arg + : catch /foo/ + : endtry + : return 1 + :endfunction + : + :function! Bar() + : echo "in Bar" + : return 4710 + :endfunction + : + :throw Foo("arrgh") + Bar() + +This throws "arrgh", and "in Bar" is not displayed since Bar() is not +executed. > + :throw Foo("foo") + Bar() +however displays "in Bar" and throws 4711. + +Any other command that takes an expression as argument might also be +abandoned by an (uncaught) exception during the expression evaluation. The +exception is then propagated to the caller of the command. + Example: > + + :if Foo("arrgh") + : echo "then" + :else + : echo "else" + :endif + +Here neither of "then" or "else" is displayed. + + *catch-order* +Exceptions can be caught by a try conditional with one or more |:catch| +commands, see |try-conditionals|. The values to be caught by each ":catch" +command can be specified as a pattern argument. The subsequent catch clause +gets executed when a matching exception is caught. + Example: > + + :function! Foo(value) + : try + : throw a:value + : catch /^\d\+$/ + : echo "Number thrown" + : catch /.*/ + : echo "String thrown" + : endtry + :endfunction + : + :call Foo(0x1267) + :call Foo('string') + +The first call to Foo() displays "Number thrown", the second "String thrown". +An exception is matched against the ":catch" commands in the order they are +specified. Only the first match counts. So you should place the more +specific ":catch" first. The following order does not make sense: > + + : catch /.*/ + : echo "String thrown" + : catch /^\d\+$/ + : echo "Number thrown" + +The first ":catch" here matches always, so that the second catch clause is +never taken. + + *throw-variables* +If you catch an exception by a general pattern, you may access the exact value +in the variable |v:exception|: > + + : catch /^\d\+$/ + : echo "Number thrown. Value is" v:exception + +You may also be interested where an exception was thrown. This is stored in +|v:throwpoint|. Note that "v:exception" and "v:throwpoint" are valid for the +exception most recently caught as long it is not finished. + Example: > + + :function! Caught() + : if v:exception != "" + : echo 'Caught "' . v:exception . '" in ' . v:throwpoint + : else + : echo 'Nothing caught' + : endif + :endfunction + : + :function! Foo() + : try + : try + : try + : throw 4711 + : finally + : call Caught() + : endtry + : catch /.*/ + : call Caught() + : throw "oops" + : endtry + : catch /.*/ + : call Caught() + : finally + : call Caught() + : endtry + :endfunction + : + :call Foo() + +This displays > + + Nothing caught + Caught "4711" in function Foo, line 4 + Caught "oops" in function Foo, line 10 + Nothing caught + +A practical example: The following command ":LineNumber" displays the line +number in the script or function where it has been used: > + + :function! LineNumber() + : return substitute(v:throwpoint, '.*\D\(\d\+\).*', '\1', "") + :endfunction + :command! LineNumber try | throw "" | catch | echo LineNumber() | endtry +< + *try-nested* +An exception that is not caught by a try conditional can be caught by +a surrounding try conditional: > + + :try + : try + : throw "foo" + : catch /foobar/ + : echo "foobar" + : finally + : echo "inner finally" + : endtry + :catch /foo/ + : echo "foo" + :endtry + +The inner try conditional does not catch the exception, just its finally +clause is executed. The exception is then caught by the outer try +conditional. The example displays "inner finally" and then "foo". + + *throw-from-catch* +You can catch an exception and throw a new one to be caught elsewhere from the +catch clause: > + + :function! Foo() + : throw "foo" + :endfunction + : + :function! Bar() + : try + : call Foo() + : catch /foo/ + : echo "Caught foo, throw bar" + : throw "bar" + : endtry + :endfunction + : + :try + : call Bar() + :catch /.*/ + : echo "Caught" v:exception + :endtry + +This displays "Caught foo, throw bar" and then "Caught bar". + + *rethrow* +There is no real rethrow in the Vim script language, but you may throw +"v:exception" instead: > + + :function! Bar() + : try + : call Foo() + : catch /.*/ + : echo "Rethrow" v:exception + : throw v:exception + : endtry + :endfunction +< *try-echoerr* +Note that this method cannot be used to "rethrow" Vim error or interrupt +exceptions, because it is not possible to fake Vim internal exceptions. +Trying so causes an error exception. You should throw your own exception +denoting the situation. If you want to cause a Vim error exception containing +the original error exception value, you can use the |:echoerr| command: > + + :try + : try + : asdf + : catch /.*/ + : echoerr v:exception + : endtry + :catch /.*/ + : echo v:exception + :endtry + +This code displays + + Vim(echoerr):Vim:E492: Not an editor command: asdf ~ + + +CLEANUP CODE *try-finally* + +Scripts often change global settings and restore them at their end. If the +user however interrupts the script by pressing CTRL-C, the settings remain in +an inconsistent state. The same may happen to you in the development phase of +a script when an error occurs or you explicitly throw an exception without +catching it. You can solve these problems by using a try conditional with +a finally clause for restoring the settings. Its execution is guaranteed on +normal control flow, on error, on an explicit ":throw", and on interrupt. +(Note that errors and interrupts from inside the try conditional are converted +to exceptions. When not caught, they terminate the script after the finally +clause has been executed.) +Example: > + + :try + : let s:saved_ts = &ts + : set ts=17 + : + : " Do the hard work here. + : + :finally + : let &ts = s:saved_ts + : unlet s:saved_ts + :endtry + +This method should be used locally whenever a function or part of a script +changes global settings which need to be restored on failure or normal exit of +that function or script part. + + *break-finally* +Cleanup code works also when the try block or a catch clause is left by +a ":continue", ":break", ":return", or ":finish". + Example: > + + :let first = 1 + :while 1 + : try + : if first + : echo "first" + : let first = 0 + : continue + : else + : throw "second" + : endif + : catch /.*/ + : echo v:exception + : break + : finally + : echo "cleanup" + : endtry + : echo "still in while" + :endwhile + :echo "end" + +This displays "first", "cleanup", "second", "cleanup", and "end". > + + :function! Foo() + : try + : return 4711 + : finally + : echo "cleanup\n" + : endtry + : echo "Foo still active" + :endfunction + : + :echo Foo() "returned by Foo" + +This displays "cleanup" and "4711 returned by Foo". You don't need to add an +extra ":return" in the finally clause. (Above all, this would override the +return value.) + + *except-from-finally* +Using either of ":continue", ":break", ":return", ":finish", or ":throw" in +a finally clause is possible, but not recommended since it abandons the +cleanup actions for the try conditional. But, of course, interrupt and error +exceptions might get raised from a finally clause. + Example where an error in the finally clause stops an interrupt from +working correctly: > + + :try + : try + : echo "Press CTRL-C for interrupt" + : while 1 + : endwhile + : finally + : unlet novar + : endtry + :catch /novar/ + :endtry + :echo "Script still running" + :sleep 1 + +If you need to put commands that could fail into a finally clause, you should +think about catching or ignoring the errors in these commands, see +|catch-errors| and |ignore-errors|. + + +CATCHING ERRORS *catch-errors* + +If you want to catch specific errors, you just have to put the code to be +watched in a try block and add a catch clause for the error message. The +presence of the try conditional causes all errors to be converted to an +exception. No message is displayed and |v:errmsg| is not set then. To find +the right pattern for the ":catch" command, you have to know how the format of +the error exception is. + Error exceptions have the following format: > + + Vim({cmdname}):{errmsg} +or > + Vim:{errmsg} + +{cmdname} is the name of the command that failed; the second form is used when +the command name is not known. {errmsg} is the error message usually produced +when the error occurs outside try conditionals. It always begins with +a capital "E", followed by a two or three-digit error number, a colon, and +a space. + +Examples: + +The command > + :unlet novar +normally produces the error message > + E108: No such variable: "novar" +which is converted inside try conditionals to an exception > + Vim(unlet):E108: No such variable: "novar" + +The command > + :dwim +normally produces the error message > + E492: Not an editor command: dwim +which is converted inside try conditionals to an exception > + Vim:E492: Not an editor command: dwim + +You can catch all ":unlet" errors by a > + :catch /^Vim(unlet):/ +or all errors for misspelled command names by a > + :catch /^Vim:E492:/ + +Some error messages may be produced by different commands: > + :function nofunc +and > + :delfunction nofunc +both produce the error message > + E128: Function name must start with a capital: nofunc +which is converted inside try conditionals to an exception > + Vim(function):E128: Function name must start with a capital: nofunc +or > + Vim(delfunction):E128: Function name must start with a capital: nofunc +respectively. You can catch the error by its number independently on the +command that caused it if you use the following pattern: > + :catch /^Vim(\a\+):E128:/ + +Some commands like > + :let x = novar +produce multiple error messages, here: > + E121: Undefined variable: novar + E15: Invalid expression: novar +Only the first is used for the exception value, since it is the most specific +one (see |except-several-errors|). So you can catch it by > + :catch /^Vim(\a\+):E121:/ + +You can catch all errors related to the name "nofunc" by > + :catch /\/ + +You can catch all Vim errors in the ":write" and ":read" commands by > + :catch /^Vim(\(write\|read\)):E\d\+:/ + +You can catch all Vim errors by the pattern > + :catch /^Vim\((\a\+)\)\=:E\d\+:/ +< + *catch-text* +NOTE: You should never catch the error message text itself: > + :catch /No such variable/ +only works in the english locale, but not when the user has selected +a different language by the |:language| command. It is however helpful to +cite the message text in a comment: > + :catch /^Vim(\a\+):E108:/ " No such variable + + +IGNORING ERRORS *ignore-errors* + +You can ignore errors in a specific Vim command by catching them locally: > + + :try + : write + :catch + :endtry + +But you are strongly recommended NOT to use this simple form, since it could +catch more than you want. With the ":write" command, some autocommands could +be executed and cause errors not related to writing, for instance: > + + :au BufWritePre * unlet novar + +There could even be such errors you are not responsible for as a script +writer: a user of your script might have defined such autocommands. You would +then hide the error from the user. + It is much better to use > + + :try + : write + :catch /^Vim(write):/ + :endtry + +which only catches real write errors. So catch only what you'd like to ignore +intentionally. + +For a single command that does not cause execution of autocommands, you could +even suppress the conversion of errors to exceptions by the ":silent!" +command: > + :silent! nunmap k +This works also when a try conditional is active. + + +CATCHING INTERRUPTS *catch-interrupt* + +When there are active try conditionals, an interrupt (CTRL-C) is converted to +the exception "Vim:Interrupt". You can catch it like every exception. The +script is not terminated, then. + Example: > + + :function! TASK1() + : sleep 10 + :endfunction + + :function! TASK2() + : sleep 20 + :endfunction + + :while 1 + : let command = input("Type a command: ") + : try + : if command == "" + : continue + : elseif command == "END" + : break + : elseif command == "TASK1" + : call TASK1() + : elseif command == "TASK2" + : call TASK2() + : else + : echo "\nIllegal command:" command + : continue + : endif + : catch /^Vim:Interrupt$/ + : echo "\nCommand interrupted" + : " Caught the interrupt. Continue with next prompt. + : endtry + :endwhile + +You can interrupt a task here by pressing CTRL-C; the script then asks for +a new command. If you press CTRL-C at the prompt, the script is terminated. + +For testing what happens when CTRL-C would be pressed on a specific line in +your script, use the debug mode and execute the |>quit| or |>interrupt| +command on that line. See |debug-scripts|. + + +CATCHING ALL *catch-all* + +The commands > + + :catch /.*/ + :catch // + :catch + +catch everything, error exceptions, interrupt exceptions and exceptions +explicitly thrown by the |:throw| command. This is useful at the top level of +a script in order to catch unexpected things. + Example: > + + :try + : + : " do the hard work here + : + :catch /MyException/ + : + : " handle known problem + : + :catch /^Vim:Interrupt$/ + : echo "Script interrupted" + :catch /.*/ + : echo "Internal error (" . v:exception . ")" + : echo " - occurred at " . v:throwpoint + :endtry + :" end of script + +Note: Catching all might catch more things than you want. Thus, you are +strongly encouraged to catch only for problems that you can really handle by +specifying a pattern argument to the ":catch". + Example: Catching all could make it nearly impossible to interrupt a script +by pressing CTRL-C: > + + :while 1 + : try + : sleep 1 + : catch + : endtry + :endwhile + + +EXCEPTIONS AND AUTOCOMMANDS *except-autocmd* + +Exceptions may be used during execution of autocommands. Example: > + + :autocmd User x try + :autocmd User x throw "Oops!" + :autocmd User x catch + :autocmd User x echo v:exception + :autocmd User x endtry + :autocmd User x throw "Arrgh!" + :autocmd User x echo "Should not be displayed" + : + :try + : doautocmd User x + :catch + : echo v:exception + :endtry + +This displays "Oops!" and "Arrgh!". + + *except-autocmd-Pre* +For some commands, autocommands get executed before the main action of the +command takes place. If an exception is thrown and not caught in the sequence +of autocommands, the sequence and the command that caused its execution are +abandoned and the exception is propagated to the caller of the command. + Example: > + + :autocmd BufWritePre * throw "FAIL" + :autocmd BufWritePre * echo "Should not be displayed" + : + :try + : write + :catch + : echo "Caught:" v:exception "from" v:throwpoint + :endtry + +Here, the ":write" command does not write the file currently being edited (as +you can see by checking 'modified'), since the exception from the BufWritePre +autocommand abandons the ":write". The exception is then caught and the +script displays: > + + Caught: FAIL from BufWrite Auto commands for "*" +< + *except-autocmd-Post* +For some commands, autocommands get executed after the main action of the +command has taken place. If this main action fails and the command is inside +an active try conditional, the autocommands are skipped and an error exception +is thrown that can be caught by the caller of the command. + Example: > + + :autocmd BufWritePost * echo "File successfully written!" + : + :try + : write /i/m/p/o/s/s/i/b/l/e + :catch + : echo v:exception + :endtry + +This just displays: > + + Vim(write):E212: Can't open file for writing (/i/m/p/o/s/s/i/b/l/e) + +If you really need to execute the autocommands even when the main action +fails, trigger the event from the catch clause. + Example: > + + :autocmd BufWritePre * set noreadonly + :autocmd BufWritePost * set readonly + : + :try + : write /i/m/p/o/s/s/i/b/l/e + :catch + : doautocmd BufWritePost /i/m/p/o/s/s/i/b/l/e + :endtry +< +You can also use ":silent!": > + + :let x = "ok" + :let v:errmsg = "" + :autocmd BufWritePost * if v:errmsg != "" + :autocmd BufWritePost * let x = "after fail" + :autocmd BufWritePost * endif + :try + : silent! write /i/m/p/o/s/s/i/b/l/e + :catch + :endtry + :echo x + +This displays "after fail". + +If the main action of the command does not fail, exceptions from the +autocommands will be catchable by the caller of the command: > + + :autocmd BufWritePost * throw ":-(" + :autocmd BufWritePost * echo "Should not be displayed" + : + :try + : write + :catch + : echo v:exception + :endtry +< + *except-autocmd-Cmd* +For some commands, the normal action can be replaced by a sequence of +autocommands. Exceptions from that sequence will be catchable by the caller +of the command. + Example: For the ":write" command, the caller cannot know whether the file +had actually been written when the exception occurred. You need to tell it in +some way. > + + :if !exists("cnt") + : let cnt = 0 + : + : autocmd BufWriteCmd * if &modified + : autocmd BufWriteCmd * let cnt = cnt + 1 + : autocmd BufWriteCmd * if cnt % 3 == 2 + : autocmd BufWriteCmd * throw "BufWriteCmdError" + : autocmd BufWriteCmd * endif + : autocmd BufWriteCmd * write | set nomodified + : autocmd BufWriteCmd * if cnt % 3 == 0 + : autocmd BufWriteCmd * throw "BufWriteCmdError" + : autocmd BufWriteCmd * endif + : autocmd BufWriteCmd * echo "File successfully written!" + : autocmd BufWriteCmd * endif + :endif + : + :try + : write + :catch /^BufWriteCmdError$/ + : if &modified + : echo "Error on writing (file contents not changed)" + : else + : echo "Error after writing" + : endif + :catch /^Vim(write):/ + : echo "Error on writing" + :endtry + +When this script is sourced several times after making changes, it displays +first > + File successfully written! +then > + Error on writing (file contents not changed) +then > + Error after writing +etc. + + *except-autocmd-ill* +You cannot spread a try conditional over autocommands for different events. +The following code is ill-formed: > + + :autocmd BufWritePre * try + : + :autocmd BufWritePost * catch + :autocmd BufWritePost * echo v:exception + :autocmd BufWritePost * endtry + : + :write + + +EXCEPTION HIERARCHIES AND PARAMETERIZED EXCEPTIONS *except-hier-param* + +Some programming languages allow to use hierarchies of exception classes or to +pass additional information with the object of an exception class. You can do +similar things in Vim. + In order to throw an exception from a hierarchy, just throw the complete +class name with the components separated by a colon, for instance throw the +string "EXCEPT:MATHERR:OVERFLOW" for an overflow in a mathematical library. + When you want to pass additional information with your exception class, add +it in parentheses, for instance throw the string "EXCEPT:IO:WRITEERR(myfile)" +for an error when writing "myfile". + With the appropriate patterns in the ":catch" command, you can catch for +base classes or derived classes of your hierarchy. Additional information in +parentheses can be cut out from |v:exception| with the ":substitute" command. + Example: > + + :function! CheckRange(a, func) + : if a:a < 0 + : throw "EXCEPT:MATHERR:RANGE(" . a:func . ")" + : endif + :endfunction + : + :function! Add(a, b) + : call CheckRange(a:a, "Add") + : call CheckRange(a:b, "Add") + : let c = a:a + a:b + : if c < 0 + : throw "EXCEPT:MATHERR:OVERFLOW" + : endif + : return c + :endfunction + : + :function! Div(a, b) + : call CheckRange(a:a, "Div") + : call CheckRange(a:b, "Div") + : if (a:b == 0) + : throw "EXCEPT:MATHERR:ZERODIV" + : endif + : return a:a / a:b + :endfunction + : + :function! Write(file) + : try + : execute "write" a:file + : catch /^Vim(write):/ + : throw "EXCEPT:IO(" . getcwd() . ", " . a:file . "):WRITEERR" + : endtry + :endfunction + : + :try + : + : " something with arithmetics and I/O + : + :catch /^EXCEPT:MATHERR:RANGE/ + : let function = substitute(v:exception, '.*(\(\a\+\)).*', '\1', "") + : echo "Range error in" function + : + :catch /^EXCEPT:MATHERR/ " catches OVERFLOW and ZERODIV + : echo "Math error" + : + :catch /^EXCEPT:IO/ + : let dir = substitute(v:exception, '.*(\(.\+\),\s*.\+).*', '\1', "") + : let file = substitute(v:exception, '.*(.\+,\s*\(.\+\)).*', '\1', "") + : if file !~ '^/' + : let file = dir . "/" . file + : endif + : echo 'I/O error for "' . file . '"' + : + :catch /^EXCEPT/ + : echo "Unspecified error" + : + :endtry + +The exceptions raised by Vim itself (on error or when pressing CTRL-C) use +a flat hierarchy: they are all in the "Vim" class. You cannot throw yourself +exceptions with the "Vim" prefix; they are reserved for Vim. + Vim error exceptions are parameterized with the name of the command that +failed, if known. See |catch-errors|. + + +PECULIARITIES + *except-compat* +The exception handling concept requires that the command sequence causing the +exception is aborted immediately and control is transferred to finally clauses +and/or a catch clause. + +In the Vim script language there are cases where scripts and functions +continue after an error: in functions without the "abort" flag or in a command +after ":silent!", control flow goes to the following line, and outside +functions, control flow goes to the line following the outermost ":endwhile" +or ":endif". On the other hand, errors should be catchable as exceptions +(thus, requiring the immediate abortion). + +This problem has been solved by converting errors to exceptions and using +immediate abortion (if not suppressed by ":silent!") only when a try +conditional is active. This is no restriction since an (error) exception can +be caught only from an active try conditional. If you want an immediate +termination without catching the error, just use a try conditional without +catch clause. (You can cause cleanup code being executed before termination +by specifying a finally clause.) + +When no try conditional is active, the usual abortion and continuation +behavior is used instead of immediate abortion. This ensures compatibility of +scripts written for Vim 6.1 and earlier. + +However, when sourcing an existing script that does not use exception handling +commands (or when calling one of its functions) from inside an active try +conditional of a new script, you might change the control flow of the existing +script on error. You get the immediate abortion on error and can catch the +error in the new script. If however the sourced script suppresses error +messages by using the ":silent!" command (checking for errors by testing +|v:errmsg| if appropriate), its execution path is not changed. The error is +not converted to an exception. (See |:silent|.) So the only remaining cause +where this happens is for scripts that don't care about errors and produce +error messages. You probably won't want to use such code from your new +scripts. + + *except-syntax-err* +Syntax errors in the exception handling commands are never caught by any of +the ":catch" commands of the try conditional they belong to. Its finally +clauses, however, is executed. + Example: > + + :try + : try + : throw 4711 + : catch /\(/ + : echo "in catch with syntax error" + : catch + : echo "inner catch-all" + : finally + : echo "inner finally" + : endtry + :catch + : echo 'outer catch-all caught "' . v:exception . '"' + : finally + : echo "outer finally" + :endtry + +This displays: > + inner finally + outer catch-all caught "Vim(catch):E54: Unmatched \(" + outer finally +The original exception is discarded and an error exception is raised, instead. + + *except-single-line* +The ":try", ":catch", ":finally", and ":endtry" commands can be put on +a single line, but then syntax errors may make it difficult to recognize the +"catch" line, thus you better avoid this. + Example: > + :try | unlet! foo # | catch | endtry +raises an error exception for the trailing characters after the ":unlet!" +argument, but does not see the ":catch" and ":endtry" commands, so that the +error exception is discarded and the "E488: Trailing characters" message gets +displayed. + + *except-several-errors* +When several errors appear in a single command, the first error message is +usually the most specific one and therefor converted to the error exception. + Example: > + echo novar +causes > + E121: Undefined variable: novar + E15: Invalid expression: novar +The value of the error exception inside try conditionals is: > + Vim(echo):E121: Undefined variable: novar +< *except-syntax-error* +But when a syntax error is detected after a normal error in the same command, +the syntax error is used for the exception being thrown. + Example: > + unlet novar # +causes > + E108: No such variable: "novar" + E488: Trailing characters +The value of the error exception inside try conditionals is: > + Vim(unlet):E488: Trailing characters +This is done because the syntax error might change the execution path in a way +not intended by the user. Example: > + try + try | unlet novar # | catch | echo v:exception | endtry + catch /.*/ + echo "outer catch:" v:exception + endtry +This displays "outer catch: Vim(unlet):E488: Trailing characters", and then +a "E600: Missing :endtry" error message is given, see |except-single-line|. + +============================================================================== +9. Examples *eval-examples* + +Printing in Hex ~ +> + :" The function Nr2Hex() returns the Hex string of a number. + :func Nr2Hex(nr) + : let n = a:nr + : let r = "" + : while n + : let r = '0123456789ABCDEF'[n % 16] . r + : let n = n / 16 + : endwhile + : return r + :endfunc + + :" The function String2Hex() converts each character in a string to a two + :" character Hex string. + :func String2Hex(str) + : let out = '' + : let ix = 0 + : while ix < strlen(a:str) + : let out = out . Nr2Hex(char2nr(a:str[ix])) + : let ix = ix + 1 + : endwhile + : return out + :endfunc + +Example of its use: > + :echo Nr2Hex(32) +result: "20" > + :echo String2Hex("32") +result: "3332" + + +Sorting lines (by Robert Webb) ~ + +Here is a Vim script to sort lines. Highlight the lines in Vim and type +":Sort". This doesn't call any external programs so it'll work on any +platform. The function Sort() actually takes the name of a comparison +function as its argument, like qsort() does in C. So you could supply it +with different comparison functions in order to sort according to date etc. +> + :" Function for use with Sort(), to compare two strings. + :func! Strcmp(str1, str2) + : if (a:str1 < a:str2) + : return -1 + : elseif (a:str1 > a:str2) + : return 1 + : else + : return 0 + : endif + :endfunction + + :" Sort lines. SortR() is called recursively. + :func! SortR(start, end, cmp) + : if (a:start >= a:end) + : return + : endif + : let partition = a:start - 1 + : let middle = partition + : let partStr = getline((a:start + a:end) / 2) + : let i = a:start + : while (i <= a:end) + : let str = getline(i) + : exec "let result = " . a:cmp . "(str, partStr)" + : if (result <= 0) + : " Need to put it before the partition. Swap lines i and partition. + : let partition = partition + 1 + : if (result == 0) + : let middle = partition + : endif + : if (i != partition) + : let str2 = getline(partition) + : call setline(i, str2) + : call setline(partition, str) + : endif + : endif + : let i = i + 1 + : endwhile + + : " Now we have a pointer to the "middle" element, as far as partitioning + : " goes, which could be anywhere before the partition. Make sure it is at + : " the end of the partition. + : if (middle != partition) + : let str = getline(middle) + : let str2 = getline(partition) + : call setline(middle, str2) + : call setline(partition, str) + : endif + : call SortR(a:start, partition - 1, a:cmp) + : call SortR(partition + 1, a:end, a:cmp) + :endfunc + + :" To Sort a range of lines, pass the range to Sort() along with the name of a + :" function that will compare two lines. + :func! Sort(cmp) range + : call SortR(a:firstline, a:lastline, a:cmp) + :endfunc + + :" :Sort takes a range of lines and sorts them. + :command! -nargs=0 -range Sort ,call Sort("Strcmp") +< + *sscanf* +There is no sscanf() function in Vim. If you need to extract parts from a +line, you can use matchstr() and substitute() to do it. This example shows +how to get the file name, line number and column number out of a line like +"foobar.txt, 123, 45". > + :" Set up the match bit + :let mx='\(\f\+\),\s*\(\d\+\),\s*\(\d\+\)' + :"get the part matching the whole expression + :let l = matchstr(line, mx) + :"get each item out of the match + :let file = substitute(l, mx, '\1', '') + :let lnum = substitute(l, mx, '\2', '') + :let col = substitute(l, mx, '\3', '') + +The input is in the variable "line", the results in the variables "file", +"lnum" and "col". (idea from Michael Geddes) + +============================================================================== +10. No +eval feature *no-eval-feature* + +When the |+eval| feature was disabled at compile time, none of the expression +evaluation commands are available. To prevent this from causing Vim scripts +to generate all kinds of errors, the ":if" and ":endif" commands are still +recognized, though the argument of the ":if" and everything between the ":if" +and the matching ":endif" is ignored. Nesting of ":if" blocks is allowed, but +only if the commands are at the start of the line. The ":else" command is not +recognized. + +Example of how to avoid executing commands when the |+eval| feature is +missing: > + + :if 1 + : echo "Expression evaluation is compiled in" + :else + : echo "You will _never_ see this message" + :endif + +============================================================================== +11. The sandbox *eval-sandbox* *sandbox* *E48* + +The 'foldexpr', 'includeexpr', 'indentexpr', 'statusline' and 'foldtext' +options are evaluated in a sandbox. This means that you are protected from +these expressions having nasty side effects. This gives some safety for when +these options are set from a modeline. It is also used when the command from +a tags file is executed and for CTRL-R = in the command line. +The sandbox is also used for the |:sandbox| command. + +These items are not allowed in the sandbox: + - changing the buffer text + - defining or changing mapping, autocommands, functions, user commands + - setting certain options (see |option-summary|) + - executing a shell command + - reading or writing a file + - jumping to another buffer or editing a file + - executing Python, Perl, etc. commands +This is not guaranteed 100% secure, but it should block most attacks. + + *:san* *:sandbox* +:san[dbox] {cmd} Execute {cmd} in the sandbox. Useful to evaluate an + option that may have been set from a modeline, e.g. + 'foldexpr'. + + *sandbox-option* +A few options contain an expression. When this expression is evaluated it may +have to be done in the sandbox to avoid a security risk. But the sandbox is +restrictive, thus this only happens when the option was set from an insecure +location. Insecure in this context are: +- sourcing a .vimrc or .exrc in the current directory +- while executing in the sandbox +- value coming from a modeline + +Note that when in the sandbox and saving an option value and restoring it, the +option will still be marked as it was set in the sandbox. + +============================================================================== +12. Textlock *textlock* + +In a few situations it is not allowed to change the text in the buffer, jump +to another window and some other things that might confuse or break what Vim +is currently doing. This mostly applies to things that happen when Vim is +actually doing something else. For example, evaluating the 'balloonexpr' may +happen any moment the mouse cursor is resting at some position. + +This is not allowed when the textlock is active: + - changing the buffer text + - jumping to another buffer or window + - editing another file + - closing a window or quitting Vim + - etc. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/farsi.txt b/Aufgabe5/doc.lang/farsi.txt new file mode 100644 index 0000000..d655caf --- /dev/null +++ b/Aufgabe5/doc.lang/farsi.txt @@ -0,0 +1,269 @@ +*farsi.txt* For Vim version 7.0. Last change: 2005 Mar 29 + + + VIM REFERENCE MANUAL by Mortaza Ghassab Shiran + + +Right to Left and Farsi Mapping for Vim *farsi* *Farsi* + +{Vi does not have any of these commands} + + *E27* +In order to use right-to-left and Farsi mapping support, it is necessary to +compile Vim with the |+farsi| feature. + +These functions have been made by Mortaza G. Shiran + + +Introduction +------------ +In right-to-left oriented files the characters appear on the screen from right +to left. This kind of file is most useful when writing Farsi documents, +composing faxes or writing Farsi memos. + +The commands, prompts and help files are not in Farsi, therefore the user +interface remains the standard Vi interface. + + +Highlights +---------- +o Editing left-to-right files as in the original Vim, no change. + +o Viewing and editing files in right-to-left windows. File orientation is + per window, so it is possible to view the same file in right-to-left and + left-to-right modes, simultaneously. + +o Compatibility to the original Vim. Almost all features work in + right-to-left mode (see bugs below). + +o Changing keyboard mapping and reverse insert modes using a single + command. + +o Backing from reverse insert mode to the correct place in the file + (if possible). + +o While in Farsi mode, numbers are entered from left to right. Upon entering + a none number character, that character will be inserted just into the + left of the last number. + +o No special terminal with right-to-left capabilities is required. The + right-to-left changes are completely hardware independent. Only + Farsi font is necessary. + +o Farsi keymapping on the command line in reverse insert mode. + +o Toggling between left-to-right and right-to-left via F8 function key. + +o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9 + function key. Since this makes sense only for the text written in + right-to-left mode, this function is also supported only in right-to-left + mode. + +Farsi Fonts *farsi fonts* +----------- + +If the "extra" archive has been unpacked, the following files are found in the +subdirectories of the '$VIM/farsi' directory: + + + far-a01.pcf X Windows fonts for Unix including Linux systems + + far-a01.bf X Windows fonts for SunOS + + far-a01.f16 a screen fonts for Unix including Linux systems + + far-a01.fon a monospaced fonts for Windows NT/95/98 + + far-a01.com a screen fonts for DOS + + +Font Installation +----------------- + +o Installation of fonts for MS Window systems (NT/95/98) + + From 'Control Panel' folder, start the 'Fonts' program. Then from 'file' + menu item select 'Install New Fonts ...'. Browse and select the + 'far-a01.fon', then follow the installation guide. + NOTE: several people have reported that this does not work. The solution + is unknown. + +o Installation of fonts for X Window systems (Unix/Linux) + + Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a + directory of your choice. Change to the directory containing the Farsi + fonts and execute the following commands: + + > mkfontdir + > xset +fp path_name_of_farsi_fonts_directory + +o Installation of fonts for X Window systems (SunOS) + + Copy far-a01.bf font into a directory of your choice. + Change to the directory containing the far-a01.fb fonts and + execute the following commands: + + > fldfamily + > xset +fp path_name_of_fonts_directory + +o Installation of ASCII screen fonts (Unix/Linux) + + For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts + directory and execute the setfont program as "setfont far-a01.f16". For + other systems (e.g. SCO Unix), please refer to the fonts installation + section of your system administration manuals. + +o Installation of ASCII screen fonts (DOS) + + After system power on, prior to the first use of Vim, upload the Farsi + fonts by executing the far-a01.com font uploading program. + + +Usage +----- +Prior to starting Vim, the environment in which Vim can run in Farsi mode, +must be set. In addition to installation of Farsi fonts, following points +refer to some of the system environments, which you may need to set: +Key code mapping, loading graphic card in ASCII screen mode, setting the IO +driver in 8 bit clean mode ... . + +o Setting the Farsi fonts + + + For Vim GUI set the 'guifont' to far-a01. This is done by entering + ':set guifont=far-a01' in the Vim window. + + You can have 'guifont' set to far-a01 by Vim during the Vim startup + by appending the ':set guifont=far-a01' into your .vimrc file + (in case of NT/95/98 platforms _vimrc). + + Under the X Window environment, you can also start Vim with the + '-fn far-a01' option. + + + For Vim within a xterm, start a xterm with the Farsi fonts (e.g. + kterm -fn far-a01). Then start Vim inside the kterm. + + + For Vim under DOS, prior to the first usage of Vim, upload the Farsi + fonts by executing the far-a01.com fonts uploading program. + +o Farsi Keymapping Activation + + To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'. + This is done by entering ':set akm' or ':set fk' in the Vim window. + You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm' + or ':set fk' in your .vimrc file or _vimrc in case of NT/95/98 platforms. + + To turn off the Farsi keymapping as a default second language keymapping, + reset the 'altkeymap' by entering ':set noakm'. + +o right-to-left Farsi Mode + + By default Vim starts in Left-to-right mode. Following are ways to change + the window orientation: + + + Start Vim with the -F option (e.g. vim -F ...). + + + Use the F8 function key to toggle between left-to-right and right-to-left. + + + While in Left-to-right mode, enter 'set rl' in the command line ('rl' is + the abbreviation for rightleft). + + + Put the 'set rl' line in your '.vimrc' file to start Vim in + right-to-left mode permanently. + +Encoding +-------- + +The letter encoding used is the Vim extended ISIR-3342 standard with a built +in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard. + +For document portability reasons, the letter encoding is kept the same across +different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...). + + +o Keyboard + + + CTRL-_ in insert/replace modes toggles between Farsi(akm)/Latin + mode as follows: + + + CTRL-_ moves the cursor to the end of the typed text in edit mode. + + + CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/ + Latin. The Farsi text is then entered in reverse insert mode. + + + F8 - Toggles between left-to-right and right-to-left. + + + F9 - Toggles the encoding between ISIR-3342 standard and Vim extended + ISIR-3342 (supported only in right-to-left mode). + + + Keyboard mapping is based on the Iranian ISIRI-2901 standard. + Following table shows the keyboard mapping while Farsi(akm) mode set: + + ------------------------------------- + ` 1 2 3 4 5 6 7 8 9 0 - = + + ------------------------------------- + ~ ! @ # $ % ^ & * ( ) _ + + ~ + ------------------------------------- + q w e r t z u i o p [ ] + + ------------------------------------- + Q W E R T Z U I O P { } + [ ] { } + ------------------------------------- + a s d f g h j k l ; ' \ + + ------------------------------------- + A S D F G H J K L : " | + + ------------------------------------- + < y x c v b n m , . / + + ------------------------------------- + > Y X C V B N M < > ? + + ------------------------------------- + +Note: + stands for Farsi PSP (break without space) + + stands for Farsi PCN (for HAMZE attribute ) + +Restrictions +------------ + +o In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not + supported. + +o If you change the character mapping between Latin/Farsi, the redo buffer + will be reset (emptied). That is, redo is valid and will function (using + '.') only within the mode you are in. + +o While numbers are entered in Farsi mode, the redo buffer will be reset + (emptied). That is, you cannot redo the last changes (using '.') after + entering numbers. + +o While in left-to-right mode and Farsi mode set, CTRL-R is not supported. + +o While in right-to-left mode, the search on 'Latin' pattern does not work, + except if you enter the Latin search pattern in reverse. + +o In command mode there is no support for entering numbers from left + to right and also for the sake of flexibility the keymapping logic is + restricted. + +o Under the X Window environment, if you want to run Vim within a xterm + terminal emulator and Farsi mode set, you need to have an ANSI compatible + xterm terminal emulator. This is because the letter codes above 128 decimal + have certain meanings in the standard xterm terminal emulator. + + Note: Under X Window environment, Vim GUI works fine in Farsi mode. + This eliminates the need of any xterm terminal emulator. + + +Bugs +---- +While in insert/replace and Farsi mode set, if you repeatedly change the +cursor position (via cursor movement) and enter new text and then try to undo +the last change, the undo will lag one change behind. But as you continue to +undo, you will reach the original line of text. You can also use U to undo all +changes made in the current line. + +For more information about the bugs refer to rileft.txt. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/filetype.txt b/Aufgabe5/doc.lang/filetype.txt new file mode 100644 index 0000000..58b33b8 --- /dev/null +++ b/Aufgabe5/doc.lang/filetype.txt @@ -0,0 +1,561 @@ +*filetype.txt* For Vim version 7.0. Last change: 2006 Apr 28 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Filetypes *filetype* *file-type* + +1. Filetypes |filetypes| +2. Filetype plugin |filetype-plugins| +3. Docs for the default filetype plugins. |ftplugin-docs| + +Also see |autocmd.txt|. + +{Vi does not have any of these commands} + +============================================================================== +1. Filetypes *filetypes* *file-types* + +Vim can detect the type of file that is edited. This is done by checking the +file name and sometimes by inspecting the contents of the file for specific +text. + + *:filetype* *:filet* +To enable file type detection, use this command in your vimrc: > + :filetype on +Each time a new or existing file is edited, Vim will try to recognize the type +of the file and set the 'filetype' option. This will trigger the FileType +event, which can be used to set the syntax highlighting, set options, etc. + +NOTE: Filetypes and 'compatible' don't work together well, since being Vi +compatible means options are global. Resetting 'compatible' is recommended, +if you didn't do that already. + +Detail: The ":filetype on" command will load one of these files: + Amiga $VIMRUNTIME/filetype.vim + Mac $VIMRUNTIME:filetype.vim + MS-DOS $VIMRUNTIME\filetype.vim + RiscOS Vim:Filetype + Unix $VIMRUNTIME/filetype.vim + VMS $VIMRUNTIME/filetype.vim + This file is a Vim script that defines autocommands for the + BufNewFile and BufRead events. If the file type is not found by the + name, the file $VIMRUNTIME/scripts.vim is used to detect it from the + contents of the file. + +To add your own file types, see |new-filetype| below. To search for help on a +filetype prepend "ft-" and optionally append "-syntax", "-indent" or +"-plugin". For example: > + :help ft-vim-indent + :help ft-vim-syntax + :help ft-man-plugin + +If the file type is not detected automatically, or it finds the wrong type, +you can either set the 'filetype' option manually, or add a modeline to your +file. Example, for in an IDL file use the command: > + :set filetype=idl + +or add this |modeline| to the file: + /* vim: set filetype=idl : */ ~ + + *:filetype-plugin-on* +You can enable loading the plugin files for specific file types with: > + :filetype plugin on +If filetype detection was not switched on yet, it will be as well. +This actually loads the file "ftplugin.vim" in 'runtimepath'. +The result is that when a file is edited its plugin file is loaded (if there +is one for the detected filetype). |filetype-plugin| + + *:filetype-plugin-off* +You can disable it again with: > + :filetype plugin off +The filetype detection is not switched off then. But if you do switch off +filetype detection, the plugins will not be loaded either. +This actually loads the file "ftplugof.vim" in 'runtimepath'. + + *:filetype-indent-on* +You can enable loading the indent file for specific file types with: > + :filetype indent on +If filetype detection was not switched on yet, it will be as well. +This actually loads the file "indent.vim" in 'runtimepath'. +The result is that when a file is edited its indent file is loaded (if there +is one for the detected filetype). |indent-expression| + + *:filetype-indent-off* +You can disable it again with: > + :filetype indent off +The filetype detection is not switched off then. But if you do switch off +filetype detection, the indent files will not be loaded either. +This actually loads the file "indoff.vim" in 'runtimepath'. +This disables auto-indenting for files you will open. It will keep working in +already opened files. Reset 'autoindent', 'cindent', 'smartindent' and/or +'indentexpr' to disable indenting in an opened file. + + *:filetype-off* +To disable file type detection, use this command: > + :filetype off +This will keep the flags for "plugin" and "indent", but since no file types +are being detected, they won't work until the next ":filetype on". + + +Overview: *:filetype-overview* + +command detection plugin indent ~ +:filetype on on unchanged unchanged +:filetype off off unchanged unchanged +:filetype plugin on on on unchanged +:filetype plugin off unchanged off unchanged +:filetype indent on on unchanged on +:filetype indent off unchanged unchanged off +:filetype plugin indent on on on on +:filetype plugin indent off unchanged off off + +To see the current status, type: > + :filetype +The output looks something like this: > + filetype detection:ON plugin:ON indent:OFF + +The file types are also used for syntax highlighting. If the ":syntax on" +command is used, the file type detection is installed too. There is no need +to do ":filetype on" after ":syntax on". + +To disable one of the file types, add a line in the your filetype file, see +|remove-filetype|. + + *filetype-detect* +To detect the file type again: > + :filetype detect +Use this if you started with an empty file and typed text that makes it +possible to detect the file type. For example, when you entered this in a +shell script: "#!/bin/csh". + When filetype detection was off, it will be enabled first, like the "on" +argument was used. + + *filetype-overrule* +When the same extension is used for two filetypes, Vim tries to guess what +kind of file it is. This doesn't always work. A number of global variables +can be used to overrule the filetype used for certain extensions: + + file name variable ~ + *.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax| + *.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax| + *.asm g:asmsyntax |ft-asm-syntax| + *.prg g:filetype_prg + *.pl g:filetype_pl + *.inc g:filetype_inc + *.w g:filetype_w |ft-cweb-syntax| + *.i g:filetype_i |ft-progress-syntax| + *.p g:filetype_p |ft-pascal-syntax| + *.sh g:bash_is_sh |ft-sh-syntax| + *.tex g:tex_flavor |ft-tex-plugin| + + *filetype-ignore* +To avoid that certain files are being inspected, the g:ft_ignore_pat variable +is used. The default value is set like this: > + :let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' +This means that the contents of compressed files are not inspected. + + *new-filetype* +If a file type that you want to use is not detected yet, there are four ways +to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.vim +file. It will be overwritten when installing a new version of Vim. + +A. If you want to overrule all default file type checks. + This works by writing one file for each filetype. The disadvantage is that + means there can be many files. The advantage is that you can simply drop + this file in the right directory to make it work. + *ftdetect* + 1. Create your user runtime directory. You would normally use the first + item of the 'runtimepath' option. Then create the directory "ftdetect" + inside it. Example for Unix: > + :!mkdir ~/.vim + :!mkdir ~/.vim/ftdetect +< + 2. Create a file that contains an autocommand to detect the file type. + Example: > + au BufRead,BufNewFile *.mine set filetype=mine +< Note that there is no "augroup" command, this has already been done + when sourcing your file. You could also use the pattern "*" and then + check the contents of the file to recognize it. + Write this file as "mine.vim" in the "ftdetect" directory in your user + runtime directory. For example, for Unix: > + :w ~/.vim/ftdetect/mine.vim + +< 3. To use the new filetype detection you must restart Vim. + + The files in the "ftdetect" directory are used after all the default + checks, thus they can overrule a previously detected file type. But you + can also use |:setfiletype| to keep a previously detected filetype. + +B. If you want to detect your file after the default file type checks. + + This works like A above, but instead of setting 'filetype' unconditionally + use ":setfiletype". This will only set 'filetype' if no file type was + detected yet. Example: > + au BufRead,BufNewFile *.txt setfiletype text +< + You can also use the already detected file type in your command. For + example, to use the file type "mypascal" when "pascal" has been detected: > + au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal + | endif + +C. If your file type can be detected by the file name. + 1. Create your user runtime directory. You would normally use the first + item of the 'runtimepath' option. Example for Unix: > + :!mkdir ~/.vim +< + 2. Create a file that contains autocommands to detect the file type. + Example: > + " my filetype file + if exists("did_load_filetypes") + finish + endif + augroup filetypedetect + au! BufRead,BufNewFile *.mine setfiletype mine + au! BufRead,BufNewFile *.xyz setfiletype drawing + augroup END +< Write this file as "filetype.vim" in your user runtime directory. For + example, for Unix: > + :w ~/.vim/filetype.vim + +< 3. To use the new filetype detection you must restart Vim. + + Your filetype.vim will be sourced before the default FileType autocommands + have been installed. Your autocommands will match first, and the + ":setfiletype" command will make sure that no other autocommands will set + 'filetype' after this. + *new-filetype-scripts* +D. If your filetype can only be detected by inspecting the contents of the + file. + + 1. Create your user runtime directory. You would normally use the first + item of the 'runtimepath' option. Example for Unix: > + :!mkdir ~/.vim +< + 2. Create a vim script file for doing this. Example: > + if did_filetype() " filetype already set.. + finish " ..don't do these checks + endif + if getline(1) =~ '^#!.*\' + setfiletype mine + elseif getline(1) =~? '\' + setfiletype drawing + endif +< See $VIMRUNTIME/scripts.vim for more examples. + Write this file as "scripts.vim" in your user runtime directory. For + example, for Unix: > + :w ~/.vim/scripts.vim +< + 3. The detection will work right away, no need to restart Vim. + + Your scripts.vim is loaded before the default checks for file types, which + means that your rules override the default rules in + $VIMRUNTIME/scripts.vim. + + *remove-filetype* +If a file type is detected that is wrong for you, install a filetype.vim or +scripts.vim to catch it (see above). You can set 'filetype' to a non-existing +name to avoid that it will be set later anyway: > + :set filetype=ignored + +If you are setting up a system with many users, and you don't want each user +to add/remove the same filetypes, consider writing the filetype.vim and +scripts.vim files in a runtime directory that is used for everybody. Check +the 'runtimepath' for a directory to use. If there isn't one, set +'runtimepath' in the |system-vimrc|. Be careful to keep the default +directories! + + + *autocmd-osfiletypes* +On operating systems which support storing a file type with the file, you can +specify that an autocommand should only be executed if the file is of a +certain type. + +The actual type checking depends on which platform you are running Vim +on; see your system's documentation for details. + +To use osfiletype checking in an autocommand you should put a list of types to +match in angle brackets in place of a pattern, like this: > + + :au BufRead *.html,<&faf;HTML> runtime! syntax/html.vim + +This will match: + +- Any file whose name ends in `.html' +- Any file whose type is `&faf' or 'HTML', where the meaning of these types + depends on which version of Vim you are using. + Unknown types are considered NOT to match. + +You can also specify a type and a pattern at the same time (in which case they +must both match): > + + :au BufRead <&fff>diff* + +This will match files of type `&fff' whose names start with `diff'. + +Note that osfiletype checking is skipped if Vim is compiled without the +|+osfiletype| feature. + + *plugin-details* +The "plugin" directory can be in any of the directories in the 'runtimepath' +option. All of these directories will be searched for plugins and they are +all loaded. For example, if this command: > + + set runtimepath + +produces this output: > + + runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60 + +then Vim will load all plugins in these directories: > + + /etc/vim/plugin/ + ~/.vim/plugin/ + /usr/local/share/vim/vim60/plugin/ + +Note that the last one is the value of $VIMRUNTIME which has been expanded. + +What if it looks like your plugin is not being loaded? You can find out what +happens when Vim starts up by using the |-V| argument: > + vim -V1 +You will see a lot of messages, in between them is a remark about loading the +plugins. It starts with: > + Searching for "plugin/*.vim" in +There you can see where Vim looks for your plugin scripts. + +============================================================================== +2. Filetype plugin *filetype-plugins* + +When loading filetype plugins has been enabled |:filetype-plugin-on|, options +will be set and mappings defined. These are all local to the buffer, they +will not be used for other files. + +Defining mappings for a filetype may get in the way of the mappings you +define yourself. There are a few ways to avoid this: +1. Set the "maplocalleader" variable to the key sequence you want the mappings + to start with. Example: > + :let maplocalleader = "," +< All mappings will then start with a comma instead of the default, which + is a backslash. Also see ||. + +2. Define your own mapping. Example: > + :map ,p MailQuote +< You need to check the description of the plugin file below for the + functionality it offers and the string to map to. + You need to define your own mapping before the plugin is loaded (before + editing a file of that type). The plugin will then skip installing the + default mapping. + +3. Disable defining mappings for a specific filetype by setting a variable, + which contains the name of the filetype. For the "mail" filetype this + would be: > + :let no_mail_maps = 1 + +4. Disable defining mappings for all filetypes by setting a variable: > + :let no_plugin_maps = 1 +< + + *ftplugin-overrule* +If a global filetype plugin does not do exactly what you want, there are three +ways to change this: + +1. Add a few settings. + You must create a new filetype plugin in a directory early in + 'runtimepath'. For Unix, for example you could use this file: > + vim ~/.vim/ftplugin/fortran.vim +< You can set those settings and mappings that you would like to add. Note + that the global plugin will be loaded after this, it may overrule the + settings that you do here. If this is the case, you need to use one of the + following two methods. + +2. Make a copy of the plugin and change it. + You must put the copy in a directory early in 'runtimepath'. For Unix, for + example, you could do this: > + cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim +< Then you can edit the copied file to your liking. Since the b:did_ftplugin + variable will be set, the global plugin will not be loaded. + A disadvantage of this method is that when the distributed plugin gets + improved, you will have to copy and modify it again. + +3. Overrule the settings after loading the global plugin. + You must create a new filetype plugin in a directory from the end of + 'runtimepath'. For Unix, for example, you could use this file: > + vim ~/.vim/after/ftplugin/fortran.vim +< In this file you can change just those settings that you want to change. + +============================================================================== +3. Docs for the default filetype plugins. *ftplugin-docs* + + +CHANGELOG *ft-changelog-plugin* + +Allows for easy entrance of Changelog entries in Changelog files. There are +some commands, mappings, and variables worth exploring: + +Options: +'comments' is made empty to not mess up formatting. +'textwidth' is set to 78, which is standard. +'formatoptions' the 't' flag is added to wrap when inserting text. + +Commands: +NewChangelogEntry Adds a new Changelog entry in an intelligent fashion + (see below). + +Local mappings: +o Starts a new Changelog entry in an equally intelligent + fashion (see below). + +Global mappings: + NOTE: The global mappings are accessed by sourcing the + ftplugin/changelog.vim file first, e.g. with > + runtime ftplugin/changelog.vim +< in your |.vimrc|. +o Switches to the ChangeLog buffer opened for the + current directory, or opens it in a new buffer if it + exists in the current directory. Then it does the + same as the local o described above. + +Variables: +g:changelog_timeformat The date (and time) format used in ChangeLog entries. + The format accepted is the same as for the + |strftime()| function. + The default is "%Y-%m-%d" which is the standard format + for many ChangeLog layouts. +g:changelog_username The name and email address of the user. + The default is deduced from environment variables and + system files. It searches /etc/passwd for the comment + part of the current user, which informally contains + the real name of the user up to the first separating + comma. then it checks the $NAME environment variable + and finally runs `whoami` and `hostname` to build an + email address. The final form is > + Full Name +< +g:changelog_new_date_format + The format to use when creating a new date-entry. + The following table describes special tokens in the + string: + %% insert a single '%' character + %d insert the date from above + %u insert the user from above + %c where to position cursor when done + The default is "%d %u\n\n\t* %c\n\n", which produces + something like (| is where cursor will be, unless at + the start of the line where it denotes the beginning + of the line) > + |2003-01-14 Full Name + | + | * | +< +g:changelog_new_entry_format + The format used when creating a new entry. + The following table describes special tokens in the + string: + %c where to position cursor when done + The default is "\t*%c", which produces something + similar to > + | * | +< +g:changelog_date_entry_search + The search pattern to use when searching for a + date-entry. + The same tokens that can be used for + g:changelog_new_date_format can be used here as well. + The default is '^\s*%d\_s*%u' which finds lines + matching the form > + |2003-01-14 Full Name +< and some similar formats. + +The Changelog entries are inserted where they add the least amount of text. +After figuring out the current date and user, the file is searched for an +entry beginning with the current date and user and if found adds another item +under it. If not found, a new entry and item is prepended to the beginning of +the Changelog. + + +FORTRAN *ft-fortran-plugin* + +Options: +'expandtab' is switched on to avoid tabs as required by the Fortran + standards unless the user has set fortran_have_tabs in .vimrc. +'textwidth' is set to 72 for fixed source format as required by the + Fortran standards and to 80 for free source format. +'formatoptions' is set to break code and comment lines and to preserve long + lines. You can format comments with |gq|. +For further discussion of fortran_have_tabs and the method used for the +detection of source format see |ft-fortran-syntax|. + + +MAIL *ft-mail-plugin* + +Options: +'modeline' is switched off to avoid the danger of trojan horses, and to + avoid that a Subject line with "Vim:" in it will cause an + error message. +'textwidth' is set to 72. This is often recommended for e-mail. +'formatoptions' is set to break text lines and to repeat the comment leader + in new lines, so that a leading ">" for quotes is repeated. + You can also format quoted text with |gq|. + +Local mappings: +q or \\MailQuote + Quotes the text selected in Visual mode, or from the cursor position + to the end of the file in Normal mode. This means "> " is inserted in + each line. + +MAN *ft-man-plugin* *:Man* + +Displays a manual page in a nice way. Also see the user manual +|find-manpage|. + +To start using the ":Man" command before any manual page was loaded, source +this script from your startup vimrc file: > + + runtime ftplugin/man.vim + +Options: +'iskeyword' the '.' character is added to be able to use CTRL-] on the + manual page name. + +Commands: +Man {name} Display the manual page for {name} in a window. +Man {number} {name} + Display the manual page for {name} in a section {number}. + +Global mapping: +K Displays the manual page for the word under the cursor. + +Local mappings: +CTRL-] Jump to the manual page for the word under the cursor. +CTRL-T Jump back to the previous manual page. + + +RPM SPEC *ft-spec-plugin* + +Since the text for this plugin is rather long it has been put in a separate +file: |pi_spec.txt|. + + +SQL *ft-sql* + +Since the text for this plugin is rather long it has been put in a separate +file: |sql.txt|. + + +TEX *ft-tex-plugin* + +If the first line of a *.tex file has the form > + %& +then this determined the file type: plaintex (for plain TeX), context (for +ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to +choose context or tex. If no keywords are found, it defaults to plaintex. +You can change the default by defining the variable g:tex_flavor to the format +(not the file type) you use most. Use one of these: > + let g:tex_flavor = "plain" + let g:tex_flavor = "context" + let g:tex_flavor = "latex" +Currently no other formats are recognized. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/fold.txt b/Aufgabe5/doc.lang/fold.txt new file mode 100644 index 0000000..d29fa4c --- /dev/null +++ b/Aufgabe5/doc.lang/fold.txt @@ -0,0 +1,583 @@ +*fold.txt* For Vim version 7.0. Last change: 2006 Mar 29 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Folding *Folding* *folding* + +You can find an introduction on folding in chapter 28 of the user manual. +|usr_28.txt| + +1. Fold methods |fold-methods| +2. Fold commands |fold-commands| +3. Fold options |fold-options| +4. Behavior of folds |fold-behavior| + +{Vi has no Folding} +{not available when compiled without the +folding feature} + +============================================================================== +1. Fold methods *fold-methods* + +The folding method can be set with the 'foldmethod' option. + +When setting 'foldmethod' to a value other than "manual", all folds are +deleted and new ones created. Switching to the "manual" method doesn't remove +the existing folds. This can be used to first define the folds automatically +and then change them manually. + +There are six methods to select folds: + manual manually define folds + indent more indent means a higher fold level + expr specify an expression to define folds + syntax folds defined by syntax highlighting + diff folds for unchanged text + marker folds defined by markers in the text + + +MANUAL *fold-manual* + +Use commands to manually define the fold regions. This can also be used by a +script that parses text to find folds. + +The level of a fold is only defined by its nesting. To increase the fold +level of a fold for a range of lines, define a fold inside it that has the +same lines. + +The manual folds are lost when you abandon the file. To save the folds use +the |:mkview| command. The view can be restored later with |:loadview|. + + +INDENT *fold-indent* + +The folds are automatically defined by the indent of the lines. + +The foldlevel is computed from the indent of the line, divided by the +'shiftwidth' (rounded down). A sequence of lines with the same or higher fold +level form a fold, with the lines with a higher level forming a nested fold. + +The nesting of folds is limited with 'foldnestmax'. + +Some lines are ignored and get the fold level of the line above or below it, +whatever is the lowest. These are empty or white lines and lines starting +with a character in 'foldignore'. White space is skipped before checking for +characters in 'foldignore'. For C use "#" to ignore preprocessor lines. + +When you want to ignore lines in another way, use the 'expr' method. The +|indent()| function can be used in 'foldexpr' to get the indent of a line. + + +EXPR *fold-expr* + +The folds are automatically defined by their foldlevel, like with the "indent" +method. The value of the 'foldexpr' option is evaluated to get the foldlevel +of a line. Examples: +This will create a fold for all consecutive lines that start with a Tab: > + :set foldexpr=getline(v:lnum)[0]==\"\\t\" +This will call a function to compute the fold level: > + :set foldexpr=MyFoldLevel(v:lnum) +This will make a fold out of paragraphs separated by blank lines: > + :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1 +this does the same: > + :set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1 + +Note that backslashes must be used to escape characters that ":set" handles +differently (space, backslash, double quote, etc., see |option-backslash|). + +These are the conditions with which the expression is evaluated: +- The current buffer and window are set for the line. +- The variable "v:lnum" is set to the line number. +- The result is used for the fold level in this way: + value meaning ~ + 0 the line is not in a fold + 1, 2, .. the line is in a fold with this level + -1 the fold level is undefined, use the fold level of a + line before or after this line, whichever is the + lowest. + "=" use fold level from the previous line + "a1", "a2", .. add one, two, .. to the fold level of the previous + line + "s1", "s2", .. subtract one, two, .. from the fold level of the + previous line + "<1", "<2", .. a fold with this level ends at this line + ">1", ">2", .. a fold with this level starts at this line + +It is not required to mark the start (end) of a fold with ">1" ("<1"), a fold +will also start (end) when the fold level is higher (lower) than the fold +level of the previous line. + +There must be no side effects from the expression. The text in the buffer, +cursor position, the search patterns, options etc. must not be changed. +You can change and restore them if you are careful. + +If there is some error in the expression, or the resulting value isn't +recognized, there is no error message and the fold level will be zero. +For debugging the 'debug' option can be set to "msg", the error messages will +be visible then. + +Note: Since the expression has to be evaluated for every line, this fold +method can be very slow! + +Try to avoid the "=", "a" and "s" return values, since Vim often has to search +backwards for a line for which the fold level is defined. This can be slow. + +|foldlevel()| can be useful to compute a fold level relative to a previous +fold level. But note that foldlevel() may return -1 if the level is not known +yet. And it returns the level at the start of the line, while a fold might +end in that line. + + +SYNTAX *fold-syntax* + +A fold is defined by syntax items that have the "fold" argument. |:syn-fold| + +The fold level is defined by nesting folds. The nesting of folds is limited +with 'foldnestmax'. + +Be careful to specify proper syntax syncing. If this is not done right, folds +may differ from the displayed highlighting. This is especially relevant when +using patterns that match more than one line. In case of doubt, try using +brute-force syncing: > + :syn sync fromstart + + +DIFF *fold-diff* + +The folds are automatically defined for text that is not part of a change or +close to a change. + +This method only works properly when the 'diff' option is set for the current +window and changes are being displayed. Otherwise the whole buffer will be +one big fold. + +The 'diffopt' option can be used to specify the context. That is, the number +of lines between the fold and a change that are not included in the fold. For +example, to use a context of 8 lines: > + :set diffopt=filler,context:8 +The default context is six lines. + +When 'scrollbind' is also set, Vim will attempt to keep the same folds open in +other diff windows, so that the same text is visible. + + +MARKER *fold-marker* + +Markers in the text tell where folds start and end. This allows you to +precisely specify the folds. This will allow deleting and putting a fold, +without the risk of including the wrong lines. The 'foldtext' option is +normally set such that the text before the marker shows up in the folded line. +This makes it possible to give a name to the fold. + +Markers can have a level included, or can use matching pairs. Including a +level is easier, you don't have to add end markers and avoid problems with +non-matching marker pairs. Example: > + /* global variables {{{1 */ + int varA, varB; + + /* functions {{{1 */ + /* funcA() {{{2 */ + void funcA() {} + + /* funcB() {{{2 */ + void funcB() {} + +A fold starts at a "{{{" marker. The following number specifies the fold +level. What happens depends on the difference between the current fold level +and the level given by the marker: +1. If a marker with the same fold level is encountered, the previous fold + ends and another fold with the same level starts. +2. If a marker with a higher fold level is found, a nested fold is started. +3. if a marker with a lower fold level is found, all folds up to and including + this level end and a fold with the specified level starts. + +The number indicates the fold level. A zero cannot be used (a marker with +level zero is ignored). You can use "}}}" with a digit to indicate the level +of the fold that ends. The fold level of the following line will be one less +than the indicated level. Note that Vim doesn't look back to the level of the +matching marker (that would take too much time). Example: > + + {{{1 + fold level here is 1 + {{{3 + fold level here is 3 + }}}3 + fold level here is 2 + +You can also use matching pairs of "{{{" and "}}}" markers to define folds. +Each "{{{" increases the fold level by one, each "}}}" decreases the fold +level by one. Be careful to keep the markers matching! Example: > + + {{{ + fold level here is 1 + {{{ + fold level here is 2 + }}} + fold level here is 1 + +You can mix using markers with a number and without a number. A useful way of +doing this is to use numbered markers for large folds, and unnumbered markers +locally in a function. For example use level one folds for the sections of +your file like "structure definitions", "local variables" and "functions". +Use level 2 markers for each definition and function, Use unnumbered markers +inside functions. When you make changes in a function to split up folds, you +don't have to renumber the markers. + +The markers can be set with the 'foldmarker' option. It is recommended to +keep this at the default value of "{{{,}}}", so that files can be exchanged +between Vim users. Only change it when it is required for the file (e.g., it +contains markers from another folding editor, or the default markers cause +trouble for the language of the file). + + *fold-create-marker* +"zf" can be used to create a fold defined by markers. Vim will insert the +markers for you. Vim will append the start and end marker, as specified with +'foldmarker'. The markers are appended to the end of the line. +'commentstring' is used if it isn't empty. +This does not work properly when: +- The line already contains a marker with a level number. Vim then doesn't + know what to do. +- Folds nearby use a level number in their marker which gets in the way. +- The line is inside a comment, 'commentstring' isn't empty and nested + comments don't work. For example with C: adding /* {{{ */ inside a comment + will truncate the existing comment. Either put the marker before or after + the comment, or add the marker manually. +Generally it's not a good idea to let Vim create markers when you already have +markers with a level number. + + *fold-delete-marker* +"zd" can be used to delete a fold defined by markers. Vim will delete the +markers for you. Vim will search for the start and end markers, as specified +with 'foldmarker', at the start and end of the fold. When the text around the +marker matches with 'commentstring', that text is deleted as well. +This does not work properly when: +- A line contains more than one marker and one of them specifies a level. + Only the first one is removed, without checking if this will have the + desired effect of deleting the fold. +- The marker contains a level number and is used to start or end several folds + at the same time. + +============================================================================== +2. Fold commands *fold-commands* *E490* + +All folding commands start with "z". Hint: the "z" looks like a folded piece +of paper, if you look at it from the side. + + +CREATING AND DELETING FOLDS ~ + *zf* *E350* +zf{motion} or +{Visual}zf Operator to create a fold. + This only works when 'foldmethod' is "manual" or "marker". + The new fold will be closed for the "manual" method. + 'foldenable' will be set. + Also see |fold-create-marker|. + + *zF* +zF Create a fold for N lines. Works like "zf". + +:{range}fo[ld] *:fold* *:fo* + Create a fold for the lines in {range}. Works like "zf". + + *zd* *E351* +zd Delete one fold at the cursor. When the cursor is on a folded + line, that fold is deleted. Nested folds are moved one level + up. In Visual mode all folds (partially) in the selected area + are deleted. Careful: This easily deletes more folds than you + expect and there is no undo. + This only works when 'foldmethod' is "manual" or "marker". + Also see |fold-delete-marker|. + + *zD* +zD Delete folds recursively at the cursor. In Visual mode all + folds (partially) in the selected area and all nested folds in + them are deleted. + This only works when 'foldmethod' is "manual" or "marker". + Also see |fold-delete-marker|. + + *zE* *E352* +zE Eliminate all folds in the window. + This only works when 'foldmethod' is "manual" or "marker". + Also see |fold-delete-marker|. + + +OPENING AND CLOSING FOLDS ~ + +A fold smaller than 'foldminlines' will always be displayed like it was open. +Therefore the commands below may work differently on small folds. + + *zo* +zo Open one fold under the cursor. When a count is given, that + many folds deep will be opened. In Visual mode one level of + folds is opened for all lines in the selected area. + + *zO* +zO Open all folds under the cursor recursively. Folds that don't + contain the cursor line are unchanged. + In Visual mode it opens all folds that are in the selected + area, also those that are only partly selected. + + *zc* +zc Close one fold under the cursor. When a count is given, that + many folds deep are closed. In Visual mode one level of folds + is closed for all lines in the selected area. + 'foldenable' will be set. + + *zC* +zC Close all folds under the cursor recursively. Folds that + don't contain the cursor line are unchanged. + In Visual mode it closes all folds that are in the selected + area, also those that are only partly selected. + 'foldenable' will be set. + + *za* +za When on a closed fold: open it. When folds are nested, you + may have to use "za" several times. When a count is given, + that many closed folds are opened. + When on an open fold: close it and set 'foldenable'. This + will only close one level, since using "za" again will open + the fold. When a count is given that many folds will be + closed (that's not the same as repeating "za" that many + times). + + *zA* +zA When on a closed fold: open it recursively. + When on an open fold: close it recursively and set + 'foldenable'. + + *zv* +zv View cursor line: Open just enough folds to make the line in + which the cursor is located not folded. + + *zx* +zx Update folds: Undo manually opened and closed folds: re-apply + 'foldlevel', then do "zv": View cursor line. + + *zX* +zX Undo manually opened and closed folds: re-apply 'foldlevel'. + + *zm* +zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was + already zero nothing happens. + 'foldenable' will be set. + + *zM* +zM Close all folds: set 'foldlevel' to 0. + 'foldenable' will be set. + + *zr* +zr Reduce folding: Add one to 'foldlevel'. + + *zR* +zR Open all folds. This sets 'foldlevel' to highest fold level. + + *:foldo* *:foldopen* +:{range}foldo[pen][!] + Open folds in {range}. When [!] is added all folds are + opened. Useful to see all the text in {range}. Without [!] + one level of folds is opened. + + *:foldc* *:foldclose* +:{range}foldc[lose][!] + Close folds in {range}. When [!] is added all folds are + closed. Useful to hide all the text in {range}. Without [!] + one level of folds is closed. + + *zn* +zn Fold none: reset 'foldenable'. All folds will be open. + + *zN* +zN Fold normal: set 'foldenable'. All folds will be as they + were before. + + *zi* +zi Invert 'foldenable'. + + +MOVING OVER FOLDS ~ + *[z* +[z Move to the start of the current open fold. If already at the + start, move to the start of the fold that contains it. If + there is no containing fold, the command fails. + When a count is used, repeats the command N times. + + *]z* +]z Move to the end of the current open fold. If already at the + end, move to the end of the fold that contains it. If there + is no containing fold, the command fails. + When a count is used, repeats the command N times. + + *zj* +zj Move downwards to the start of the next fold. A closed fold + is counted as one fold. + When a count is used, repeats the command N times. + This command can be used after an |operator|. + + *zk* +zk Move upwards to the end of the previous fold. A closed fold + is counted as one fold. + When a count is used, repeats the command N times. + This command can be used after an |operator|. + + +EXECUTING COMMANDS ON FOLDS ~ + +:[range]foldd[oopen] {cmd} *:foldd* *:folddoopen* + Execute {cmd} on all lines that are not in a closed fold. + When [range] is given, only these lines are used. + Each time {cmd} is executed the cursor is positioned on the + line it is executed for. + This works like the ":global" command: First all lines that + are not in a closed fold are marked. Then the {cmd} is + executed for all marked lines. Thus when {cmd} changes the + folds, this has no influence on where it is executed (except + when lines are deleted, of course). + Example: > + :folddoopen s/end/loop_end/ge +< Note the use of the "e" flag to avoid getting an error message + where "end" doesn't match. + +:[range]folddoc[losed] {cmd} *:folddoc* *:folddoclosed* + Execute {cmd} on all lines that are in a closed fold. + Otherwise like ":folddoopen". + +============================================================================== +3. Fold options *fold-options* + +COLORS *fold-colors* + +The colors of a closed fold are set with the Folded group |hl-Folded|. The +colors of the fold column are set with the FoldColumn group |hl-FoldColumn|. +Example to set the colors: > + + :highlight Folded guibg=grey guifg=blue + :highlight FoldColumn guibg=darkgrey guifg=white + + +FOLDLEVEL *fold-foldlevel* + +'foldlevel' is a number option: The higher the more folded regions are open. +When 'foldlevel' is 0, all folds are closed. +When 'foldlevel' is positive, some folds are closed. +When 'foldlevel' is very high, all folds are open. +'foldlevel' is applied when it is changed. After that manually folds can be +opened and closed. +When increased, folds above the new level are opened. No manually opened +folds will be closed. +When decreased, folds above the new level are closed. No manually closed +folds will be opened. + + +FOLDTEXT *fold-foldtext* + +'foldtext' is a string option that specifies an expression. This expression +is evaluated to obtain the text displayed for a closed fold. Example: > + + :set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g') + +This shows the first line of the fold, with "/*", "*/" and "{{{" removed. +Note the use of backslashes to avoid some characters to be interpreted by the +":set" command. It's simpler to define a function and call that: > + + :set foldtext=MyFoldText() + :function MyFoldText() + : let line = getline(v:foldstart) + : let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + : return v:folddashes . sub + :endfunction + +Evaluating 'foldtext' is done in the |sandbox|. The current window is set to +the window that displays the line. Errors are ignored. + +The default value is |foldtext()|. This returns a reasonable text for most +types of folding. If you don't like it, you can specify your own 'foldtext' +expression. It can use these special Vim variables: + v:foldstart line number of first line in the fold + v:foldend line number of last line in the fold + v:folddashes a string that contains dashes to represent the + foldlevel. + v:foldlevel the foldlevel of the fold + +In the result a TAB is replaced with a space and unprintable characters are +made into printable characters. + +The resulting line is truncated to fit in the window, it never wraps. +When there is room after the text, it is filled with the character specified +by 'fillchars'. + +Note that backslashes need to be used for characters that the ":set" command +handles differently: Space, backslash and double-quote. |option-backslash| + + +FOLDCOLUMN *fold-foldcolumn* + +'foldcolumn' is a number, which sets the width for a column on the side of the +window to indicate folds. When it is zero, there is no foldcolumn. A normal +value is 4 or 5. The minimal useful value is 2, although 1 still provides +some information. The maximum is 12. + +An open fold is indicated with a column that has a '-' at the top and '|' +characters below it. This column stops where the open fold stops. When folds +nest, the nested fold is one character right of the fold it's contained in. + +A closed fold is indicated with a '+'. + +Where the fold column is too narrow to display all nested folds, digits are +shown to indicate the nesting level. + +The mouse can also be used to open and close folds by clicking in the +fold column: +- Click on a '+' to open the closed fold at this row. +- Click on any other non-blank character to close the open fold at this row. + + +OTHER OPTIONS + +'foldenable' 'fen': Open all folds while not set. +'foldexpr' 'fde': Expression used for "expr" folding. +'foldignore' 'fdi': Characters used for "indent" folding. +'foldmarker' 'fmr': Defined markers used for "marker" folding. +'foldmethod' 'fdm': Name of the current folding method. +'foldminlines' 'fml': Minimum number of screen lines for a fold to be + displayed closed. +'foldnestmax' 'fdn': Maximum nesting for "indent" and "syntax" folding. +'foldopen' 'fdo': Which kinds of commands open closed folds. +'foldclose' 'fcl': When the folds not under the cursor are closed. + +============================================================================== +4. Behavior of folds *fold-behavior* + +When moving the cursor upwards or downwards and when scrolling, the cursor +will move to the first line of a sequence of folded lines. When the cursor is +already on a folded line, it moves to the next unfolded line or the next +closed fold. + +While the cursor is on folded lines, the cursor is always displayed in the +first column. The ruler does show the actual cursor position, but since the +line is folded, it cannot be displayed there. + +Many movement commands handle a sequence of folded lines like an empty line. +For example, the "w" command stops once in the first column. + +When in Insert mode, the cursor line is never folded. That allows you to see +what you type! + +When using an operator, a closed fold is included as a whole. Thus "dl" +deletes the whole closed fold under the cursor. + +For Ex commands the range is adjusted to always start at the first line of a +closed fold and end at the last line of a closed fold. Thus this command: > + :s/foo/bar/g +when used with the cursor on a closed fold, will replace "foo" with "bar" in +all lines of the fold. +This does not happen for |:folddoopen| and |:folddoclosed|. + +When editing a buffer that has been edited before, the last used folding +settings are used again. For manual folding the defined folds are restored. +For all folding methods the manually opened and closed folds are restored. +If this buffer has been edited in this window, the values from back then are +used. Otherwise the values from the window where the buffer was edited last +are used. + +============================================================================== + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/getscript.txt b/Aufgabe5/doc.lang/getscript.txt new file mode 100644 index 0000000..d43b9be --- /dev/null +++ b/Aufgabe5/doc.lang/getscript.txt @@ -0,0 +1,303 @@ +*getscript.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + Get the Latest VimScripts + +Authors: Charles E. Campbell, Jr. + (remove NOSPAM from the email address) + *GetLatestVimScripts-copyright* +Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. + The VIM LICENSE applies to GetLatestVimScripts.vim and + GetLatestVimScripts.txt (see |copyright|) except use + "GetLatestVimScripts" instead of "Vim". + No warranty, express or implied. Use At-Your-Own-Risk. + + +============================================================================== +1. Contents *glvs-contents* + + 1. Contents.......................................: |glvs-contents| + 2. GetLatestVimScripts Usage......................: |glvs| + 3. GetLatestVimScripts Data File..................: |glvs-data| + 4. GetLatestVimScripts Plugins....................: |glvs-plugins| + 5. GetLatestVimScripts AutoInstall................: |glvs-autoinstall| + 6. GetLatestVimScripts Algorithm..................: |glvs-alg| + 7. GetLatestVimScripts History....................: |glvs-hist| + + +============================================================================== +2. GetLatestVimScripts Usage *getlatestvimscripts* *getscript* *glvs* + + While in vim, type +> + :GetLatestVimScripts +< + Unless its been defined elsewhere, +> + :GLVS +< + will also work. + + The script will attempt to update and, if so directed, automatically + install scripts from http://vim.sourceforge.net/. To do so it will + peruse a file, [.vim|vimfiles]/GetLatest/GetLatestVimScripts.dat + (see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin + directory (see |glvs-plugins|). + + Scripts which have been downloaded will appear in the .../GetLatest + subdirectory. + + The file will be automatically be updated to + reflect the latest version of script(s) so downloaded. + + +============================================================================== +3. GetLatestVimScripts Data File *getlatestvimscripts-data* *glvs-data* + + The Data file has a header which should appear as: +> + ScriptID SourceID Filename + -------------------------- +< + Below that are three columns; the first two are numeric followed by a + text column. + + The first number on each line gives the script's ScriptID. When + you're about to use a web browser to look at scripts on + http://vim.sf.net/, just before you click on the script's link, you'll + see a line resembling + + http://vim.sourceforge.net/scripts/script.php?script_id=40 + + The "40" happens to be a ScriptID that GetLatestVimScripts needs to + download the associated page. + + The second number on each line gives the script's SourceID. The + SourceID records the count of uploaded scripts as determined by + vim.sf.net; hence it serves to indicate "when" a script was uploaded. + Setting the SourceID to 1 insures that GetLatestVimScripts will assume + that the script it has is out-of-date. + + The SourceID is extracted by GetLatestVimScripts from the script's + page on vim.sf.net; whenever its greater than the one stored in the + GetLatestVimScripts.dat file, the script will be downloaded. + + If your script's author has included a special comment line in his/her + plugin, the plugin itself will be used by GetLatestVimScripts to build + your file, including any dependencies on + other scripts it may have. + + If your comment field begins with :AutoInstall:, GetLatestVimScripts + will attempt to automatically install the script. Thus, + GetLatestVimScripts thus provides a comprehensive ability to keep your + plugins up-to-date! + +============================================================================== +4. GetLatestVimScripts Plugins *getlatestvimscripts-plugins* *glvs-plugins* + + + If a plugin author includes the following comment anywhere in their + plugin, GetLatestVimScripts will find it and use it to build user's + GetLatestVimScripts.dat files: +> + src_id + v + " GetLatestVimScripts: ### ### yourscriptname + ^ + scriptid +< + As an author, you should include such a line in to refer to your own + script plus any additional lines describing any plugin dependencies it + may have. Same format, of course! + + If your command is auto-installable (see |glvs-autoinstall|), and most + scripts are, then you may include :AutoInstall: at the start of + "yourscriptname". + + GetLatestVimScript commands for those scripts are then appended, if + not already present, to the user's GetLatest/GetLatestVimScripts.dat + file. Its a relatively painless way to automate the acquisition of + any scripts your plugins depend upon. + + Now, as an author, you probably don't want GetLatestVimScripts to + download your own scripts for you yourself, thereby overwriting your + not-yet-released hard work. GetLatestVimScripts provides a solution + for this: put +> + 0 0 yourscriptname +< + into your file and GetLatestVimScripts will + skip examining the "yourscriptname" scripts for those + GetLatestVimScript comment lines. As a result, those lines won't be + inadvertently installed into your file and + subsequently used to download your own scripts. This is especially + important to do if you've included the :AutoInstall: option. + + Be certain to use the same "yourscriptname" in the "0 0 + yourscriptname" line as you've used in your GetLatestVimScript + comment! + + +============================================================================== +5. GetLatestVimScripts AutoInstall *getlatestvimscripts-autoinstall* + *glvs-autoinstall* + + GetLatestVimScripts now supports "AutoInstall". Not all scripts are + supportive of auto-install, as they may have special things you need + to do to install them (please refer to the script's "install" + directions). On the other hand, most scripts will be + auto-installable. + + To let GetLatestVimScripts do an autoinstall, the data file's comment + field should begin with (surrounding blanks are ignored): + + :AutoInstall: + + Both colons are needed, and it should begin the comment + (yourscriptname) field. + + One may prevent any autoinstalling by putting the following line + in your <.vimrc>: +> + let g:GetLatestVimScripts_allowautoinstall= 0 +< + + With :AutoInstall: enabled, as it is by default, files which end with + + ---.tar.bz2 : decompressed and untarred in [.vim|vimfiles] directory + ---.tar.gz : decompressed and untarred in [.vim|vimfiles] directory + ---.vim.bz2 : decompressed and moved to the .vim/plugin directory + ---.vim.gz : decompressed and moved to the .vim/plugin directory + ---.zip : unzipped in [.vim|vimfiles] directory + ---.vim : moved to [.vim|vimfiles]/plugin directory + + and which merely need to have their components placed by the + untar/gunzip or move-to-plugin-directory process should be + auto-installable. + + When is a script not auto-installable? Let me give an example: +> + [.vim|vimfiles]/after/syntax/blockhl.vim +< + The script provides block highlighting for C/C++ + programs; it is available at: +> + http://vim.sourceforge.net/scripts/script.php?script_id=104 +< + Currently, vim's after/syntax only supports by-filetype scripts (in + blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install + would possibly overwrite the current user's after/syntax/c.vim file. + + In my own case, I use (renamed to + after/syntax/c.vim) to allow a after/syntax/c/ directory: +> + http://vim.sourceforge.net/scripts/script.php?script_id=1023 +< + The script allows multiple syntax files to exist separately in the + after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and + build an appropriate tarball for auto-install because of the potential + for the after/syntax/c.vim contained in it to overwrite a user's + c.vim. + + +============================================================================== +6. GetLatestVimScripts Algorithm *getlatestvimscripts-algorithm* + *glvs-alg* + + The Vim sourceforge page dynamically creates a page by keying off of + the so-called script-id. Within the webpage of + + http://vim.sourceforge.net/scripts/script.php?script_id=40 + + is a line specifying the latest source-id (src_id). The source + identifier numbers are always increasing, hence if the src_id is + greater than the one recorded for the script in GetLatestVimScripts + then its time to download a newer copy of that script. + + GetLatestVimScripts will then download the script and update its + internal database of script ids, source ids, and scriptnames. + + The AutoInstall process will: + + Move the file from GetLatest/ to the following directory + Unix : $HOME/.vim + Windows: $HOME\vimfiles + + if the downloaded file ends with ".bz2" + bunzip2 it + else if the downloaded file ends with ".gz" + gunzip it + if the resulting file ends with ".zip" + unzip it + else if the resulting file ends with ".tar" + tar -oxvf it + else if the resulting file ends with ".vim" + move it to the plugin subdirectory + + +============================================================================== +7. GetLatestVimScripts History *getlatestvimscripts-history* *glvs-hist* + + v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use; + unzip needs the -o flag to overwrite. + v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong + script! Fixed. + v18 Mar 21, 2005 : * bugfix to automatic database construction + * bugfix - nowrapscan caused an error + (tnx to David Green for the fix) + Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in + :AutoInstall:s, even though its o/s is windows + Apr 01, 2005 * when downloading errors occurred, GLVS was + terminating early. It now just goes on to trying + the next script (after trying three times to + download a script description page) + Apr 20, 2005 * bugfix - when a failure to download occurred, + GetLatestVimScripts would stop early and claim that + everything was current. Fixed. + v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which + defaults to 1, can be used to prevent all + :AutoInstall: + v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent + * fixed bug with :AutoInstall: use of helptags + v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't + always preventing downloads (just usually). Fixed. + v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than + s:dotvim. Fixed. + v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid + is zero. Useful for script authors; that way their + own GetLatestVimScripts activity won't overwrite + their scripts. + v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that + was intended only for testing. Removed, now works. + * :AutoInstall: implemented + v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin: + * :GetLatestVimScripts command + * (runtimepath)/GetLatest/GetLatestVimScripts.dat + now holds scripts that need updating + v10 Apr 19, 2004 : * moved history from script to doc + v9 Jan 23, 2004 : windows (win32/win16/win95) will use + double quotes ("") whereas other systems will use + single quotes ('') around the urls in calls via wget + v8 Dec 01, 2003 : makes three tries at downloading + v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id=" + not found in downloaded webpage + Uses t_ti, t_te, and rs to make progress visible + v6 Aug 06, 2003 : final status messages now display summary of work + ( "Downloaded someqty scripts" or + "Everything was current") + Now GetLatestVimScripts is careful about downloading + GetLatestVimScripts.vim itself! + (goes to ) + v5 Aug 04, 2003 : missing an endif near bottom + v4 Jun 17, 2003 : redraw! just before each "considering" message + v3 May 27, 2003 : Protects downloaded files from errant shell + expansions with single quotes: '...' + v2 May 14, 2003 : extracts name of item to be obtained from the + script file. Uses it instead of comment field + for output filename; comment is used in the + "considering..." line and is now just a comment! + * Fixed a bug: a string-of-numbers is not the + same as a number, so I added zero to them + and they became numbers. Fixes comparison. + +============================================================================== +vim:tw=78:ts=8:ft=help diff --git a/Aufgabe5/doc.lang/gui.txt b/Aufgabe5/doc.lang/gui.txt new file mode 100644 index 0000000..ba62fc5 --- /dev/null +++ b/Aufgabe5/doc.lang/gui.txt @@ -0,0 +1,993 @@ +*gui.txt* For Vim version 7.0. Last change: 2006 May 04 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Vim's Graphical User Interface *gui* *GUI* + +1. Starting the GUI |gui-start| +2. Scrollbars |gui-scrollbars| +3. Mouse Control |gui-mouse| +4. Making GUI Selections |gui-selections| +5. Menus |menus| +6. Extras |gui-extras| +7. Shell Commands |gui-shell| + +Other GUI documentation: +|gui_x11.txt| For specific items of the X11 GUI. +|gui_w32.txt| For specific items of the Win32 GUI. + +{Vi does not have any of these commands} + +============================================================================== +1. Starting the GUI *gui-start* *E229* *E233* + +First you must make sure you actually have a version of Vim with the GUI code +included. You can check this with the ":version" command, it says "with xxx +GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., or +"MS-Windows 32 bit GUI version". + +How to start the GUI depends on the system used. Mostly you can run the +GUI version of Vim with: + gvim [options] [files...] + +The X11 version of Vim can run both in GUI and in non-GUI mode. See +|gui-x11-start|. + + *gui-init* *gvimrc* *.gvimrc* *_gvimrc* +The gvimrc file is where GUI-specific startup commands should be placed. It +is always sourced after the |vimrc| file. If you have one then the $MYGVIMRC +environment variable has its name. + +When the GUI starts up initializations are carried out, in this order: +- The 'term' option is set to "builgin_gui" and terminal options are reset to + their default value for the GUI |terminal-options|. +- If the system menu file exists, it is sourced. The name of this file is + normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also + see |$VIMRUNTIME|. To skip loading the system menu include 'M' in + 'guioptions'. *buffers-menu* *no_buffers_menu* + The system menu file includes a "Buffers" menu. If you don't want this, set + the "no_buffers_menu" variable in your .vimrc (not .gvimrc!): > + :let no_buffers_menu = 1 +< NOTE: Switching on syntax highlighting also loads the menu file, thus + disabling the Buffers menu must be done before ":syntax on". + The path names are truncated to 35 characters. You can truncate them at a + different length, for example 50, like this: > + :let bmenu_max_pathlen = 50 +- If the "-U {gvimrc}" command-line option has been used when starting Vim, + the {gvimrc} file will be read for initializations. The following + initializations are skipped. When {gvimrc} is "NONE" no file will be read + for initializations. +- For Unix and MS-Windows, if the system gvimrc exists, it is sourced. The + name of this file is normally "$VIM/gvimrc". You can check this with + ":version". Also see |$VIM|. +- The following are tried, and only the first one that exists is used: + - If the GVIMINIT environment variable exists and is not empty, it is + executed as an Ex command. + - If the user gvimrc file exists, it is sourced. The name of this file is + normally "$HOME/.gvimrc". You can check this with ":version". + - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used. + - When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice + versa. + The name of the first file found is stored in $MYGVIMRC, unless it was + already set. +- If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc + is sourced, if it exists and isn't the same file as the system or user + gvimrc file. If this file is not owned by you, some security restrictions + apply. When ".gvimrc" is not found, "_gvimrc" is tried too. For Macintosh + and DOS/Win32 "_gvimrc" is tried first. + +NOTE: All but the first one are not carried out if Vim was started with +"-u NONE" and no "-U" argument was given, or when started with "-U NONE". + +All this happens AFTER the normal Vim initializations, like reading your +.vimrc file. See |initialization|. +But the GUI window is only opened after all the initializations have been +carried out. If you want some commands to be executed just after opening the +GUI window, use the |GUIEnter| autocommand event. Example: > + :autocmd GUIEnter * winpos 100 50 + +You can use the gvimrc files to set up your own customized menus (see |:menu|) +and initialize other things that you may want to set up differently from the +terminal version. + +Recommended place for your personal GUI initializations: + Unix $HOME/.gvimrc + OS/2 $HOME/.gvimrc or $VIM/.gvimrc + MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc + Amiga s:.gvimrc or $VIM/.gvimrc + +There are a number of options which only have meaning in the GUI version of +Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are +documented in |options.txt| with all the other options. + +If using the Motif or Athena version of the GUI (but not for the GTK+ or +Win32 version), a number of X resources are available. See |gui-resources|. + +Another way to set the colors for different occasions is with highlight +groups. The "Normal" group is used to set the background and foreground +colors. Example (which looks nice): > + + :highlight Normal guibg=grey90 + +The "guibg" and "guifg" settings override the normal background and +foreground settings. The other settings for the Normal highlight group are +not used. Use the 'guifont' option to set the font. + +Also check out the 'guicursor' option, to set the colors for the cursor in +various modes. + +Vim tries to make the window fit on the screen when it starts up. This avoids +that you can't see part of it. On the X Window System this requires a bit of +guesswork. You can change the height that is used for the window title and a +task bar with the 'guiheadroom' option. + + *:winp* *:winpos* *E188* +:winp[os] + Display current position of the top left corner of the GUI vim + window in pixels. Does not work in all versions. + +:winp[os] {X} {Y} *E466* + Put the GUI vim window at the given {X} and {Y} coordinates. + The coordinates should specify the position in pixels of the + top left corner of the window. Does not work in all versions. + Does work in an (new) xterm |xterm-color|. + When the GUI window has not been opened yet, the values are + remembered until the window is opened. The position is + adjusted to make the window fit on the screen (if possible). + + *:win* *:winsize* *E465* +:win[size] {width} {height} + Set the window height to {width} by {height} characters. + Obsolete, use ":set lines=11 columns=22". + If you get less lines than expected, check the 'guiheadroom' + option. + +If you are running the X Window System, you can get information about the +window Vim is running in with this command: > + :!xwininfo -id $WINDOWID + +============================================================================== +2. Scrollbars *gui-scrollbars* + +There are vertical scrollbars and a horizontal scrollbar. You may +configure which ones appear with the 'guioptions' option. + +The interface looks like this (with ":set guioptions=mlrb"): + + +------------------------------+ + | File Edit Help | <- Menu bar (m) + +-+--------------------------+-+ + |^| |^| + |#| Text area. |#| + | | | | + |v|__________________________|v| + Normal status line -> |-+ File.c 5,2 +-| + between Vim windows |^|""""""""""""""""""""""""""|^| + | | | | + | | Another file buffer. | | + | | | | + |#| |#| + Left scrollbar (l) -> |#| |#| <- Right + |#| |#| scrollbar (r) + | | | | + |v| |v| + +-+--------------------------+-+ + | |< #### >| | <- Bottom + +-+--------------------------+-+ scrollbar (b) + +Any of the scrollbar or menu components may be turned off by not putting the +appropriate letter in the 'guioptions' string. The bottom scrollbar is +only useful when 'nowrap' is set. + + +VERTICAL SCROLLBARS *gui-vert-scroll* + +Each Vim window has a scrollbar next to it which may be scrolled up and down +to move through the text in that buffer. The size of the scrollbar-thumb +indicates the fraction of the buffer which can be seen in the window. +When the scrollbar is dragged all the way down, the last line of the file +will appear in the top of the window. + +If a window is shrunk to zero height (by the growth of another window) its +scrollbar disappears. It reappears when the window is restored. + +If a window is vertically split, it will get a scrollbar when it is the +current window and when, taking the middle of the current window and drawing a +vertical line, this line goes through the window. +When there are scrollbars on both sides, and the middle of the current window +is on the left half, the right scrollbar column will contain scrollbars for +the rightmost windows. The same happens on the other side. + + +HORIZONTAL SCROLLBARS *gui-horiz-scroll* + +The horizontal scrollbar (at the bottom of the Vim GUI) may be used to +scroll text sideways when the 'wrap' option is turned off. The +scrollbar-thumb size is such that the text of the longest visible line may be +scrolled as far as possible left and right. The cursor is moved when +necessary, it must remain on a visible character (unless 'virtualedit' is +set). + +Computing the length of the longest visible line takes quite a bit of +computation, and it has to be done every time something changes. If this +takes too much time or you don't like the cursor jumping to another line, +include the 'h' flag in 'guioptions'. Then the scrolling is limited by the +text of the current cursor line. + + *athena-intellimouse* +If you have an Intellimouse and an X server that supports using the wheel, +then you can use the wheel to scroll the text up and down in gvim. This works +with XFree86 4.0 and later, and with some older versions when you add patches. +See |scroll-mouse-wheel|. + +For older versions of XFree86 you must patch your X server. The following +page has a bit of information about using the Intellimouse on Linux as well as +links to the patches and X server binaries (may not have the one you need +though): + http://www.inria.fr/koala/colas/mouse-wheel-scroll/ + +============================================================================== +3. Mouse Control *gui-mouse* + +The mouse only works if the appropriate flag in the 'mouse' option is set. +When the GUI is switched on, and 'mouse' wasn't set yet, the 'mouse' option is +automatically set to "a", enabling it for all modes except for the +|hit-enter| prompt. If you don't want this, a good place to change the +'mouse' option is the "gvimrc" file. + +Other options that are relevant: +'mousefocus' window focus follows mouse pointer |gui-mouse-focus| +'mousemodel' what mouse button does which action +'mousehide' hide mouse pointer while typing text +'selectmode' whether to start Select mode or Visual mode + +A quick way to set these is with the ":behave" command. + *:behave* *:be* +:be[have] {model} Set behavior for mouse and selection. Valid + arguments are: + mswin MS-Windows behavior + xterm Xterm behavior + + Using ":behave" changes these options: + option mswin xterm ~ + 'selectmode' "mouse,key" "" + 'mousemodel' "popup" "extend" + 'keymodel' "startsel,stopsel" "" + 'selection' "exclusive" "inclusive" + +In the $VIMRUNTIME directory, there is a script called |mswin.vim|, which will +also map a few keys to the MS-Windows cut/copy/paste commands. This is NOT +compatible, since it uses the CTRL-V, CTRL-X and CTRL-C keys. If you don't +mind, use this command: > + :so $VIMRUNTIME/mswin.vim + +For scrolling with a wheel on a mouse, see |scroll-mouse-wheel|. + + +3.1 Moving Cursor with Mouse *gui-mouse-move* + +Click the left mouse button somewhere in a text buffer where you want the +cursor to go, and it does! +This works in when 'mouse' contains ~ +Normal mode 'n' or 'a' +Visual mode 'v' or 'a' +Insert mode 'i' or 'a' + +Select mode is handled like Visual mode. + +You may use this with an operator such as 'd' to delete text from the current +cursor position to the position you point to with the mouse. That is, you hit +'d' and then click the mouse somewhere. + + *gui-mouse-focus* +The 'mousefocus' option can be set to make the keyboard focus follow the +mouse pointer. This means that the window where the mouse pointer is, is the +active window. Warning: this doesn't work very well when using a menu, +because the menu command will always be applied to the top window. + +If you are on the ':' line (or '/' or '?'), then clicking the left or right +mouse button will position the cursor on the ':' line (if 'mouse' contains +'c', 'a' or 'A'). + +In any situation the middle mouse button may be clicked to paste the current +selection. + + +3.2 Selection with Mouse *gui-mouse-select* + +The mouse can be used to start a selection. How depends on the 'mousemodel' +option: +'mousemodel' is "extend": use the right mouse button +'mousemodel' is "popup": use the left mouse button, while keeping the Shift +key pressed. + +If there was no selection yet, this starts a selection from the old cursor +position to the position pointed to with the mouse. If there already is a +selection then the closest end will be extended. + +If 'selectmode' contains "mouse", then the selection will be in Select mode. +This means that typing normal text will replace the selection. See +|Select-mode|. Otherwise, the selection will be in Visual mode. + +Double clicking may be done to make the selection word-wise, triple clicking +makes it line-wise, and quadruple clicking makes it rectangular block-wise. + +See |gui-selections| on how the selection is used. + + +3.3 Other Text Selection with Mouse *gui-mouse-modeless* + *modeless-selection* +A different kind of selection is used when: +- in Command-line mode +- in the Command-line window and pointing in another window +- at the |hit-enter| prompt +- whenever the current mode is not in the 'mouse' option +- when holding the CTRL and SHIFT keys in the GUI +Since Vim continues like the selection isn't there, and there is no mode +associated with the selection, this is called modeless selection. Any text in +the Vim window can be selected. Select the text by pressing the left mouse +button at the start, drag to the end and release. To extend the selection, +use the right mouse button when 'mousemodel' is "extend", or the left mouse +button with the shift key pressed when 'mousemodel' is "popup". +The middle mouse button pastes the text. +The selection is removed when the selected text is scrolled or changed. +On the command line CTRL-Y can be used to copy the selection into the +clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y . + + +3.4 Using Mouse on Status Lines *gui-mouse-status* + +Clicking the left or right mouse button on the status line below a Vim +window makes that window the current window. This actually happens on button +release (to be able to distinguish a click from a drag action). + +With the left mouse button a status line can be dragged up and down, thus +resizing the windows above and below it. This does not change window focus. + +The same can be used on the vertical separator: click to give the window left +of it focus, drag left and right to make windows wider and narrower. + + +3.5 Various Mouse Clicks *gui-mouse-various* + + Search forward for the word under the mouse click. + When 'mousemodel' is "popup" this starts or extends a + selection. + Search backward for the word under the mouse click. + Jump to the tag name under the mouse click. + Jump back to position before the previous tag jump + (same as "CTRL-T") + + +3.6 Mouse Mappings *gui-mouse-mapping* + +The mouse events, complete with modifiers, may be mapped. Eg: > + :map + :map + :map + :map <2-S-LeftMouse> <2-RightMouse> + :map <2-S-LeftDrag> <2-RightDrag> + :map <2-S-LeftRelease> <2-RightRelease> + :map <3-S-LeftMouse> <3-RightMouse> + :map <3-S-LeftDrag> <3-RightDrag> + :map <3-S-LeftRelease> <3-RightRelease> + :map <4-S-LeftMouse> <4-RightMouse> + :map <4-S-LeftDrag> <4-RightDrag> + :map <4-S-LeftRelease> <4-RightRelease> +These mappings make selection work the way it probably should in a Motif +application, with shift-left mouse allowing for extending the visual area +rather than the right mouse button. + +Mouse mapping with modifiers does not work for modeless selection. + + +3.7 Drag and drop *drag-n-drop* + +You can drag and drop one or more files into the Vim window, where they will +be opened as if a |:drop| command was used. + +If you hold down Shift while doing this, Vim changes to the first dropped +file's directory. If you hold Ctrl Vim will always split a new window for the +file. Otherwise it's only done if the current buffer has been changed. + +You can also drop a directory on Vim. This starts the explorer plugin for +that directory (assuming it was enabled, otherwise you'll get an error +message). Keep Shift pressed to change to the directory instead. + +If Vim happens to be editing a command line, the names of the dropped files +and directories will be inserted at the cursor. This allows you to use these +names with any Ex command. Special characters (space, tab, double quote and +'|'; backslash on non-MS-Windows systems) will be escaped. + +============================================================================== +4. Making GUI Selections *gui-selections* + + *quotestar* +You may make selections with the mouse (see |gui-mouse-select|), or by using +Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then +whenever a selection is started (Visual or Select mode), or when the selection +is changed, Vim becomes the owner of the windowing system's primary selection +(on MS-Windows the |gui-clipboard| is used; under X11, the |x11-selection| is +used - you should read whichever of these is appropriate now). + + *clipboard* +There is a special register for storing this selection, it is the "* +register. Nothing is put in here unless the information about what text is +selected is about to change (e.g. with a left mouse click somewhere), or when +another application wants to paste the selected text. Then the text is put +in the "* register. For example, to cut a line and make it the current +selection/put it on the clipboard: > + + "*dd + +Similarly, when you want to paste a selection from another application, e.g., +by clicking the middle mouse button, the selection is put in the "* register +first, and then 'put' like any other register. For example, to put the +selection (contents of the clipboard): > + + "*p + +When using this register under X11, also see |x11-selection|. This also +explains the related "+ register. + +Note that when pasting text from one Vim into another separate Vim, the type +of selection (character, line, or block) will also be copied. For other +applications the type is always character. However, if the text gets +transferred via the |x11-cut-buffer|, the selection type is ALWAYS lost. + +When the "unnamed" string is included in the 'clipboard' option, the unnamed +register is the same as the "* register. Thus you can yank to and paste the +selection without prepending "* to commands. + +============================================================================== +5. Menus *menus* + +For an introduction see |usr_42.txt| in the user manual. + + +5.1 Using Menus *using-menus* + +Basically, menus can be used just like mappings. You can define your own +menus, as many as you like. +Long-time Vim users won't use menus much. But the power is in adding your own +menus and menu items. They are most useful for things that you can't remember +what the key sequence was. + +For creating menus in a different language, see |:menutrans|. + + *menu.vim* +The default menus are read from the file "$VIMRUNTIME/menu.vim". See +|$VIMRUNTIME| for where the path comes from. You can set up your own menus. +Starting off with the default set is a good idea. You can add more items, or, +if you don't like the defaults at all, start with removing all menus +|:unmenu-all|. You can also avoid the default menus being loaded by adding +this line to your .vimrc file (NOT your .gvimrc file!): > + :let did_install_default_menus = 1 +If you also want to avoid the Syntax menu: > + :let did_install_syntax_menu = 1 +If you do want the Syntax menu but not all the entries for each available +syntax file (which take quite a bit of time to load): > + :let skip_syntax_sel_menu = 1 +< + *console-menus* +Although this documentation is in the GUI section, you can actually use menus +in console mode too. You will have to load |menu.vim| explicitly then, it is +not done by default. You can use the |:emenu| command and command-line +completion with 'wildmenu' to access the menu entries almost like a real menu +system. To do this, put these commands in your .vimrc file: > + :source $VIMRUNTIME/menu.vim + :set wildmenu + :set cpo-=< + :set wcm= + :map :emenu +Pressing will start the menu. You can now use the cursor keys to select +a menu entry. Hit to execute it. Hit if you want to cancel. +This does require the |+menu| feature enabled at compile time. + + *tear-off-menus* +GTK+ and Motif support Tear-off menus. These are sort of sticky menus or +pop-up menus that are present all the time. If the resizing does not work +correctly, this may be caused by using something like "Vim*geometry" in the +defaults. Use "Vim.geometry" instead. + +The Win32 GUI version emulates Motif's tear-off menus. Actually, a Motif user +will spot the differences easily, but hopefully they're just as useful. You +can also use the |:tearoff| command together with |hidden-menus| to create +floating menus that do not appear on the main menu bar. + + +5.2 Creating New Menus *creating-menus* + + *:me* *:menu* *:noreme* *:noremenu* + *:am* *:amenu* *:an* *:anoremenu* + *:nme* *:nmenu* *:nnoreme* *:nnoremenu* + *:ome* *:omenu* *:onoreme* *:onoremenu* + *:vme* *:vmenu* *:vnoreme* *:vnoremenu* + *:xme* *:xmenu* *:xnoreme* *:xnoremenu* + *:sme* *:smenu* *:snoreme* *:snoremenu* + *:ime* *:imenu* *:inoreme* *:inoremenu* + *:cme* *:cmenu* *:cnoreme* *:cnoremenu* + *E330* *E327* *E331* *E336* *E333* + *E328* *E329* *E337* +To create a new menu item, use the ":menu" commands. They are mostly like +the ":map" set of commands but the first argument is a menu item name, given +as a path of menus and submenus with a '.' between them, e.g.: > + + :menu File.Save :w + :inoremenu File.Save :w + :menu Edit.Big\ Changes.Delete\ All\ Spaces :%s/[ ^I]//g + +This last one will create a new item in the menu bar called "Edit", holding +the mouse button down on this will pop up a menu containing the item +"Big Changes", which is a sub-menu containing the item "Delete All Spaces", +which when selected, performs the operation. + +Special characters in a menu name: + + & The next character is the shortcut key. Make sure each + shortcut key is only used once in a (sub)menu. If you want to + insert a literal "&" in the menu name use "&&". + Separates the menu name from right-aligned text. This can be + used to show the equivalent typed command. The text "" + can be used here for convenience. If you are using a real + Tab, don't forget to put a backslash before it! +Example: > + + :amenu &File.&Open:e :browse e + +[typed literally] +With the shortcut "F" (while keeping the key pressed), and then "O", +this menu can be used. The second part is shown as "Open :e". The ":e" +is right aligned, and the "O" is underlined, to indicate it is the shortcut. + +The ":amenu" command can be used to define menu entries for all modes at once. +To make the command work correctly, a character is automatically inserted for +some modes: + mode inserted appended ~ + Normal nothing nothing + Visual + Insert + Cmdline + Op-pending + +Appending CTRL-\ CTRL-G is for going back to insert mode when 'insertmode' is +set. |CTRL-\_CTRL-G| + +Example: > + + :amenu File.Next :next^M + +is equal to: > + + :nmenu File.Next :next^M + :vmenu File.Next ^C:next^M^\^G + :imenu File.Next ^O:next^M + :cmenu File.Next ^C:next^M^\^G + :omenu File.Next ^C:next^M^\^G + +Careful: In Insert mode this only works for a SINGLE Normal mode command, +because of the CTRL-O. If you have two or more commands, you will need to use +the ":imenu" command. For inserting text in any mode, you can use the +expression register: > + + :amenu Insert.foobar "='foobar'P + +Note that the '<' and 'k' flags in 'cpoptions' also apply here (when +included they make the <> form and raw key codes not being recognized). + +Note that in Cmdline mode executes the command, like in a mapping. This +is Vi compatible. Use CTRL-C to quit Cmdline mode. + + *:menu-* *:menu-silent* +To define a menu which will not be echoed on the command line, add +"" as the first argument. Example: > + :menu Settings.Ignore\ case :set ic +The ":set ic" will not be echoed when using this menu. Messages from the +executed command are still given though. To shut them up too, add a ":silent" +in the executed command: > + :menu Search.Header :exe ":silent normal /Header\r" +"" may also appear just after "" or " + +See |mysyntaxfile-add| for installing script languages permanently. + + +APACHE *apache.vim* *ft-apache-syntax* + +The apache syntax file provides syntax highlighting depending on Apache HTTP +server version, by default for 1.3.x. Set "apache_version" to Apache version +(as a string) to get highlighting for another version. Example: > + + :let apache_version = "2.0" +< + + *asm.vim* *asmh8300.vim* *nasm.vim* *masm.vim* *asm68k* +ASSEMBLY *ft-asm-syntax* *ft-asmh8300-syntax* *ft-nasm-syntax* + *ft-masm-syntax* *ft-asm68k-syntax* *fasm.vim* + +Files matching "*.i" could be Progress or Assembly. If the automatic detection +doesn't work for you, or you don't edit Progress at all, use this in your +startup vimrc: > + :let filetype_i = "asm" +Replace "asm" with the type of assembly you use. + +There are many types of assembly languages that all use the same file name +extensions. Therefore you will have to select the type yourself, or add a +line in the assembly file that Vim will recognize. Currently these syntax +files are included: + asm GNU assembly (the default) + asm68k Motorola 680x0 assembly + asmh8300 Hitachi H-8300 version of GNU assembly + ia64 Intel Itanium 64 + fasm Flat assembly (http://flatassembler.net) + masm Microsoft assembly (probably works for any 80x86) + nasm Netwide assembly + tasm Turbo Assembly (with opcodes 80x86 up to Pentium, and + MMX) + pic PIC assembly (currently for PIC16F84) + +The most flexible is to add a line in your assembly file containing: > + :asmsyntax=nasm +Replace "nasm" with the name of the real assembly syntax. This line must be +one of the first five lines in the file. + +The syntax type can always be overruled for a specific buffer by setting the +b:asmsyntax variable: > + :let b:asmsyntax=nasm + +If b:asmsyntax is not set, either automatically or by hand, then the value of +the global variable asmsyntax is used. This can be seen as a default assembly +language: > + :let asmsyntax=nasm + +As a last resort, if nothing is defined, the "asm" syntax is used. + + +Netwide assembler (nasm.vim) optional highlighting ~ + +To enable a feature: > + :let {variable}=1|set syntax=nasm +To disable a feature: > + :unlet {variable} |set syntax=nasm + +Variable Highlight ~ +nasm_loose_syntax unofficial parser allowed syntax not as Error + (parser dependent; not recommended) +nasm_ctx_outside_macro contexts outside macro not as Error +nasm_no_warn potentially risky syntax not as ToDo + + +ASPPERL and ASPVBS *ft-aspperl-syntax* *ft-aspvbs-syntax* + +*.asp and *.asa files could be either Perl or Visual Basic script. Since it's +hard to detect this you can set two global variables to tell Vim what you are +using. For Perl script use: > + :let g:filetype_asa = "aspperl" + :let g:filetype_asp = "aspperl" +For Visual Basic use: > + :let g:filetype_asa = "aspvbs" + :let g:filetype_asp = "aspvbs" + + +BAAN *baan.vim* *baan-syntax* + +The baan.vim gives syntax support for BaanC of release BaanIV upto SSA ERP LN +for both 3 GL and 4 GL programming. Large number of standard defines/constants +are supported. + +Some special violation of coding standards will be signalled when one specify +in ones |.vimrc|: > + let baan_code_stds=1 + +*baan-folding* + +Syntax folding can be enabled at various levels through the variables +mentioned below (Set those in your |.vimrc|). The more complex folding on +source blocks and SQL can be CPU intensive. + +To allow any folding and enable folding at function level use: > + let baan_fold=1 +Folding can be enabled at source block level as if, while, for ,... The +indentation preceding the begin/end keywords has to match (spaces are not +considered equal to a tab). > + let baan_fold_block=1 +Folding can be enabled for embedded SQL blocks as SELECT, SELECTDO, +SELECTEMPTY, ... The indentation preceding the begin/end keywords has to +match (spaces are not considered equal to a tab). > + let baan_fold_sql=1 +Note: Block folding can result in many small folds. It is suggested to |:set| +the options 'foldminlines' and 'foldnestmax' in |.vimrc| or use |:setlocal| in +.../after/syntax/baan.vim (see |after-directory|). Eg: > + set foldminlines=5 + set foldnestmax=6 + + +BASIC *basic.vim* *vb.vim* *ft-basic-syntax* *ft-vb-syntax* + +Both Visual Basic and "normal" basic use the extension ".bas". To detect +which one should be used, Vim checks for the string "VB_Name" in the first +five lines of the file. If it is not found, filetype will be "basic", +otherwise "vb". Files with the ".frm" extension will always be seen as Visual +Basic. + + +C *c.vim* *ft-c-syntax* + +A few things in C highlighting are optional. To enable them assign any value +to the respective variable. Example: > + :let c_comment_strings=1 +To disable them use ":unlet". Example: > + :unlet c_comment_strings + +Variable Highlight ~ +c_gnu GNU gcc specific items +c_comment_strings strings and numbers inside a comment +c_space_errors trailing white space and spaces before a +c_no_trail_space_error ... but no trailing spaces +c_no_tab_space_error ... but no spaces before a +c_no_bracket_error don't highlight {}; inside [] as errors +c_no_curly_error don't highlight {}; inside [] and () as errors; + except { and } in first column +c_no_ansi don't do standard ANSI types and constants +c_ansi_typedefs ... but do standard ANSI types +c_ansi_constants ... but do standard ANSI constants +c_no_utf don't highlight \u and \U in strings +c_syntax_for_h use C syntax for *.h files, instead of C++ +c_no_if0 don't highlight "#if 0" blocks as comments +c_no_cformat don't highlight %-formats in strings +c_no_c99 don't highlight C99 standard items + +When 'foldmethod' is set to "syntax" then /* */ comments and { } blocks will +become a fold. If you don't want comments to become a fold use: > + :let c_no_comment_fold = 1 +"#if 0" blocks are also folded, unless: > + :let c_no_if0_fold = 1 + +If you notice highlighting errors while scrolling backwards, which are fixed +when redrawing with CTRL-L, try setting the "c_minlines" internal variable +to a larger number: > + :let c_minlines = 100 +This will make the syntax synchronization start 100 lines before the first +displayed line. The default value is 50 (15 when c_no_if0 is set). The +disadvantage of using a larger number is that redrawing can become slow. + +When using the "#if 0" / "#endif" comment highlighting, notice that this only +works when the "#if 0" is within "c_minlines" from the top of the window. If +you have a long "#if 0" construct it will not be highlighted correctly. + +To match extra items in comments, use the cCommentGroup cluster. +Example: > + :au Syntax c call MyCadd() + :function MyCadd() + : syn keyword cMyItem contained Ni + : syn cluster cCommentGroup add=cMyItem + : hi link cMyItem Title + :endfun + +ANSI constants will be highlighted with the "cConstant" group. This includes +"NULL", "SIG_IGN" and others. But not "TRUE", for example, because this is +not in the ANSI standard. If you find this confusing, remove the cConstant +highlighting: > + :hi link cConstant NONE + +If you see '{' and '}' highlighted as an error where they are OK, reset the +highlighting for cErrInParen and cErrInBracket. + +If you want to use folding in your C files, you can add these lines in a file +an the "after" directory in 'runtimepath'. For Unix this would be +~/.vim/after/syntax/c.vim. > + syn region myFold start="{" end="}" transparent fold + syn sync fromstart + set foldmethod=syntax + +CH *ch.vim* *ft-ch-syntax* + +C/C++ interpreter. Ch has similar syntax highlighting to C and builds upon +the C syntax file. See |c.vim| for all the settings that are available for C. + +By setting a variable you can tell Vim to use Ch syntax for *.h files, instead +of C or C++: > + :let ch_syntax_for_h = 1 + + +CHILL *chill.vim* *ft-chill-syntax* + +Chill syntax highlighting is similar to C. See |c.vim| for all the settings +that are available. Additionally there is: + +chill_space_errors like c_space_errors +chill_comment_string like c_comment_strings +chill_minlines like c_minlines + + +CHANGELOG *changelog.vim* *ft-changelog-syntax* + +ChangeLog supports highlighting spaces at the start of a line. +If you do not like this, add following line to your .vimrc: > + let g:changelog_spacing_errors = 0 +This works the next time you edit a changelog file. You can also use +"b:changelog_spacing_errors" to set this per buffer (before loading the syntax +file). + +You can change the highlighting used, e.g., to flag the spaces as an error: > + :hi link ChangelogError Error +Or to avoid the highlighting: > + :hi link ChangelogError NONE +This works immediately. + + +COBOL *cobol.vim* *ft-cobol-syntax* + +COBOL highlighting has different needs for legacy code than it does for fresh +development. This is due to differences in what is being done (maintenance +versus development) and other factors. To enable legacy code highlighting, +add this line to your .vimrc: > + :let cobol_legacy_code = 1 +To disable it again, use this: > + :unlet cobol_legacy_code + + +COLD FUSION *coldfusion.vim* *ft-coldfusion-syntax* + +The ColdFusion has its own version of HTML comments. To turn on ColdFusion +comment highlighting, add the following line to your startup file: > + + :let html_wrong_comments = 1 + +The ColdFusion syntax file is based on the HTML syntax file. + + +CSH *csh.vim* *ft-csh-syntax* + +This covers the shell named "csh". Note that on some systems tcsh is actually +used. + +Detecting whether a file is csh or tcsh is notoriously hard. Some systems +symlink /bin/csh to /bin/tcsh, making it almost impossible to distinguish +between csh and tcsh. In case VIM guesses wrong you can set the +"filetype_csh" variable. For using csh: > + + :let filetype_csh = "csh" + +For using tcsh: > + + :let filetype_csh = "tcsh" + +Any script with a tcsh extension or a standard tcsh filename (.tcshrc, +tcsh.tcshrc, tcsh.login) will have filetype tcsh. All other tcsh/csh scripts +will be classified as tcsh, UNLESS the "filetype_csh" variable exists. If the +"filetype_csh" variable exists, the filetype will be set to the value of the +variable. + + +CYNLIB *cynlib.vim* *ft-cynlib-syntax* + +Cynlib files are C++ files that use the Cynlib class library to enable +hardware modelling and simulation using C++. Typically Cynlib files have a .cc +or a .cpp extension, which makes it very difficult to distinguish them from a +normal C++ file. Thus, to enable Cynlib highlighting for .cc files, add this +line to your .vimrc file: > + + :let cynlib_cyntax_for_cc=1 + +Similarly for cpp files (this extension is only usually used in Windows) > + + :let cynlib_cyntax_for_cpp=1 + +To disable these again, use this: > + + :unlet cynlib_cyntax_for_cc + :unlet cynlib_cyntax_for_cpp +< + +CWEB *cweb.vim* *ft-cweb-syntax* + +Files matching "*.w" could be Progress or cweb. If the automatic detection +doesn't work for you, or you don't edit Progress at all, use this in your +startup vimrc: > + :let filetype_w = "cweb" + + +DESKTOP *desktop.vim* *ft-desktop-syntax* + +Primary goal of this syntax file is to highlight .desktop and .directory files +according to freedesktop.org standard: http://pdx.freedesktop.org/Standards/ +But actually almost none implements this standard fully. Thus it will +highlight all Unix ini files. But you can force strict highlighting according +to standard by placing this in your vimrc file: > + :let enforce_freedesktop_standard = 1 + + +DIRCOLORS *dircolors.vim* *ft-dircolors-syntax* + +The dircolors utility highlighting definition has one option. It exists to +provide compatibility with the Slackware GNU/Linux distributions version of +the command. It adds a few keywords that are generally ignored by most +versions. On Slackware systems, however, the utility accepts the keywords and +uses them for processing. To enable the Slackware keywords add the following +line to your startup file: > + let dircolors_is_slackware = 1 + + +DOCBOOK *docbk.vim* *ft-docbk-syntax* *docbook* +DOCBOOK XML *docbkxml.vim* *ft-docbkxml-syntax* +DOCBOOK SGML *docbksgml.vim* *ft-docbksgml-syntax* + +There are two types of DocBook files: SGML and XML. To specify what type you +are using the "b:docbk_type" variable should be set. Vim does this for you +automatically if it can recognize the type. When Vim can't guess it the type +defaults to XML. +You can set the type manually: > + :let docbk_type = "sgml" +or: > + :let docbk_type = "xml" +You need to do this before loading the syntax file, which is complicated. +Simpler is setting the filetype to "docbkxml" or "docbksgml": > + :set filetype=docbksgml +or: > + :set filetype=docbkxml + + +DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax* + +There is one option with highlighting DOS batch files. This covers new +extensions to the Command Interpreter introduced with Windows 2000 and +is controlled by the variable dosbatch_cmdextversion. For Windows NT +this should have the value 1, and for Windows 2000 it should be 2. +Select the version you want with the following line: > + + :let dosbatch_cmdextversion = 1 + +If this variable is not defined it defaults to a value of 2 to support +Windows 2000. + +A second option covers whether *.btm files should be detected as type +"dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter +is used by default. You may select the former with the following line: > + + :let g:dosbatch_syntax_for_btm = 1 + +If this variable is undefined or zero, btm syntax is selected. + + +DOXYGEN *doxygen.vim* *doxygen-syntax* + +Doxygen generates code documentation using a special documentation format +(similar to Javadoc). This syntax script adds doxygen highlighting to c, cpp +and idl files, and should also work with java. + +There are a few of ways to turn on doxygen formatting. It can be done explicity +or in a modeline by appending '.doxygen' to the syntax of the file. Example: > + :set syntax=c.doxygen +or > + // vim:syntax=c.doxygen + +To use doxygen formatting on top of any filetype, add the following to your +.vimrc for each filetype, replacing {filetype} with the relevent value. > + :let g:syntax_extra_{filetype}='doxygen' + +It can also be done automaticly for c, cpp and idl files by setting the global +or buffer-local variable load_doxygen_syntax. This is done by adding the +following to your .vimrc. > + :let g:load_doxygen_syntax=1 + +There are a couple of variables that have an affect on syntax highlighting, and +are to do with non-standard highlighting options. + +Variable Default Effect ~ +g:doxygen_enhanced_color +g:doxygen_enhanced_colour 0 Use non-standard highlighting for + doxygen comments. + +doxygen_my_rendering 0 Disable rendering of HTML bold, italic + and html_my_rendering underline. + +doxygen_javadoc_autobrief 1 Set to 0 to disable javadoc autobrief + colour highlighting. + +doxygen_end_punctuation '[.]' Set to regexp match for the ending + punctuation of brief + +There are also some hilight groups worth mentioning as they can be useful in +configuration. + +Highlight Effect ~ +doxygenErrorComment The colour of an end-comment when missing + punctuation in a code, verbatim or dot section +doxygenLinkError The colour of an end-comment when missing the + \endlink from a \link section. + + +DTD *dtd.vim* *ft-dtd-syntax* + +The DTD syntax highlighting is case sensitive by default. To disable +case-sensitive highlighting, add the following line to your startup file: > + + :let dtd_ignore_case=1 + +The DTD syntax file will highlight unknown tags as errors. If +this is annoying, it can be turned off by setting: > + + :let dtd_no_tag_errors=1 + +before sourcing the dtd.vim syntax file. +Parameter entity names are highlighted in the definition using the +'Type' highlighting group and 'Comment' for punctuation and '%'. +Parameter entity instances are highlighted using the 'Constant' +highlighting group and the 'Type' highlighting group for the +delimiters % and ;. This can be turned off by setting: > + + :let dtd_no_param_entities=1 + +The DTD syntax file is also included by xml.vim to highlight included dtd's. + + +EIFFEL *eiffel.vim* *ft-eiffel-syntax* + +While Eiffel is not case-sensitive, its style guidelines are, and the +syntax highlighting file encourages their use. This also allows to +highlight class names differently. If you want to disable case-sensitive +highlighting, add the following line to your startup file: > + + :let eiffel_ignore_case=1 + +Case still matters for class names and TODO marks in comments. + +Conversely, for even stricter checks, add one of the following lines: > + + :let eiffel_strict=1 + :let eiffel_pedantic=1 + +Setting eiffel_strict will only catch improper capitalization for the +five predefined words "Current", "Void", "Result", "Precursor", and +"NONE", to warn against their accidental use as feature or class names. + +Setting eiffel_pedantic will enforce adherence to the Eiffel style +guidelines fairly rigorously (like arbitrary mixes of upper- and +lowercase letters as well as outdated ways to capitalize keywords). + +If you want to use the lower-case version of "Current", "Void", +"Result", and "Precursor", you can use > + + :let eiffel_lower_case_predef=1 + +instead of completely turning case-sensitive highlighting off. + +Support for ISE's proposed new creation syntax that is already +experimentally handled by some compilers can be enabled by: > + + :let eiffel_ise=1 + +Finally, some vendors support hexadecimal constants. To handle them, add > + + :let eiffel_hex_constants=1 + +to your startup file. + + +ERLANG *erlang.vim* *ft-erlang-syntax* + +The erlang highlighting supports Erlang (ERicsson LANGuage). +Erlang is case sensitive and default extension is ".erl". + +If you want to disable keywords highlighting, put in your .vimrc: > + :let erlang_keywords = 1 +If you want to disable built-in-functions highlighting, put in your +.vimrc file: > + :let erlang_functions = 1 +If you want to disable special characters highlighting, put in +your .vimrc: > + :let erlang_characters = 1 + + +FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax* + +FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com + +Syntax highlighting is available for the most common elements of FlexWiki +syntax. The associated ftplugin script sets some buffer-local options to make +editing FlexWiki pages more convenient. FlexWiki considers a newline as the +start of a new paragraph, so the ftplugin sets 'tw'=0 (unlimited line length), +'wrap' (wrap long lines instead of using horizontal scrolling), 'linebreak' +(to wrap at a character in 'breakat' instead of at the last char on screen), +and so on. It also includes some keymaps that are disabled by default. + +If you want to enable the keymaps that make "j" and "k" and the cursor keys +move up and down by display lines, add this to your .vimrc: > + :let flexwiki_maps = 1 + + +FORM *form.vim* *ft-form-syntax* + +The coloring scheme for syntax elements in the FORM file uses the default +modes Conditional, Number, Statement, Comment, PreProc, Type, and String, +following the language specifications in 'Symbolic Manipulation with FORM'' by +J.A.M. Vermaseren, CAN, Netherlands, 1991. + +If you want include your own changes to the default colors, you have to +redefine the following syntax groups: + + - formConditional + - formNumber + - formStatement + - formHeaderStatement + - formComment + - formPreProc + - formDirective + - formType + - formString + +Note that the form.vim syntax file implements FORM preprocessor commands and +directives per default in the same syntax group. + +A predefined enhanced color mode for FORM is available to distinguish between +header statements and statements in the body of a FORM program. To activate +this mode define the following variable in your vimrc file > + + :let form_enhanced_color=1 + +The enhanced mode also takes advantage of additional color features for a dark +gvim display. Here, statements are colored LightYellow instead of Yellow, and +conditionals are LightBlue for better distinction. + + +FORTRAN *fortran.vim* *ft-fortran-syntax* + +Default highlighting and dialect ~ +Highlighting appropriate for f95 (Fortran 95) is used by default. This choice +should be appropriate for most users most of the time because Fortran 95 is a +superset of Fortran 90 and almost a superset of Fortran 77. + +Fortran source code form ~ +Fortran 9x code can be in either fixed or free source form. Note that the +syntax highlighting will not be correct if the form is incorrectly set. + +When you create a new fortran file, the syntax script assumes fixed source +form. If you always use free source form, then > + :let fortran_free_source=1 +in your .vimrc prior to the :syntax on command. If you always use fixed source +form, then > + :let fortran_fixed_source=1 +in your .vimrc prior to the :syntax on command. + +If the form of the source code depends upon the file extension, then it is +most convenient to set fortran_free_source in a ftplugin file. For more +information on ftplugin files, see |ftplugin|. For example, if all your +fortran files with an .f90 extension are written in free source form and the +rest in fixed source form, add the following code to your ftplugin file > + let s:extfname = expand("%:e") + if s:extfname ==? "f90" + let fortran_free_source=1 + unlet! fortran_fixed_source + else + let fortran_fixed_source=1 + unlet! fortran_free_source + endif +Note that this will work only if the "filetype plugin indent on" command +precedes the "syntax on" command in your .vimrc file. + +When you edit an existing fortran file, the syntax script will assume free +source form if the fortran_free_source variable has been set, and assumes +fixed source form if the fortran_fixed_source variable has been set. If +neither of these variables have been set, the syntax script attempts to +determine which source form has been used by examining the first five columns +of the first 250 lines of your file. If no signs of free source form are +detected, then the file is assumed to be in fixed source form. The algorithm +should work in the vast majority of cases. In some cases, such as a file that +begins with 250 or more full-line comments, the script may incorrectly decide +that the fortran code is in fixed form. If that happens, just add a +non-comment statement beginning anywhere in the first five columns of the +first twenty five lines, save (:w) and then reload (:e!) the file. + +Tabs in fortran files ~ +Tabs are not recognized by the Fortran standards. Tabs are not a good idea in +fixed format fortran source code which requires fixed column boundaries. +Therefore, tabs are marked as errors. Nevertheless, some programmers like +using tabs. If your fortran files contain tabs, then you should set the +variable fortran_have_tabs in your .vimrc with a command such as > + :let fortran_have_tabs=1 +placed prior to the :syntax on command. Unfortunately, the use of tabs will +mean that the syntax file will not be able to detect incorrect margins. + +Syntax folding of fortran files ~ +If you wish to use foldmethod=syntax, then you must first set the variable +fortran_fold with a command such as > + :let fortran_fold=1 +to instruct the syntax script to define fold regions for program units, that +is main programs starting with a program statement, subroutines, function +subprograms, block data subprograms, interface blocks, and modules. If you +also set the variable fortran_fold_conditionals with a command such as > + :let fortran_fold_conditionals=1 +then fold regions will also be defined for do loops, if blocks, and select +case constructs. If you also set the variable +fortran_fold_multilinecomments with a command such as > + :let fortran_fold_multilinecomments=1 +then fold regions will also be defined for three or more consecutive comment +lines. Note that defining fold regions can be slow for large files. + +If fortran_fold, and possibly fortran_fold_conditionals and/or +fortran_fold_multilinecomments, have been set, then vim will fold your file if +you set foldmethod=syntax. Comments or blank lines placed between two program +units are not folded because they are seen as not belonging to any program +unit. + +More precise fortran syntax ~ +If you set the variable fortran_more_precise with a command such as > + :let fortran_more_precise=1 +then the syntax coloring will be more precise but slower. In particular, +statement labels used in do, goto and arithmetic if statements will be +recognized, as will construct names at the end of a do, if, select or forall +construct. + +Non-default fortran dialects ~ +The syntax script supports five Fortran dialects: f95, f90, f77, the Lahey +subset elf90, and the Imagine1 subset F. + +If you use f77 with extensions, even common ones like do/enddo loops, do/while +loops and free source form that are supported by most f77 compilers including +g77 (GNU Fortran), then you will probably find the default highlighting +satisfactory. However, if you use strict f77 with no extensions, not even free +source form or the MIL STD 1753 extensions, then the advantages of setting the +dialect to f77 are that names such as SUM are recognized as user variable +names and not highlighted as f9x intrinsic functions, that obsolete constructs +such as ASSIGN statements are not highlighted as todo items, and that fixed +source form will be assumed. + +If you use elf90 or F, the advantage of setting the dialect appropriately is +that f90 features excluded from these dialects will be highlighted as todo +items and that free source form will be assumed as required for these +dialects. + +The dialect can be selected by setting the variable fortran_dialect. The +permissible values of fortran_dialect are case-sensitive and must be "f95", +"f90", "f77", "elf" or "F". Invalid values of fortran_dialect are ignored. + +If all your fortran files use the same dialect, set fortran_dialect in your +.vimrc prior to your syntax on statement. If the dialect depends upon the file +extension, then it is most convenient to set it in a ftplugin file. For more +information on ftplugin files, see |ftplugin|. For example, if all your +fortran files with an .f90 extension are written in the elf subset, your +ftplugin file should contain the code > + let s:extfname = expand("%:e") + if s:extfname ==? "f90" + let fortran_dialect="elf" + else + unlet! fortran_dialect + endif +Note that this will work only if the "filetype plugin indent on" command +precedes the "syntax on" command in your .vimrc file. + +Finer control is necessary if the file extension does not uniquely identify +the dialect. You can override the default dialect, on a file-by-file basis, by +including a comment with the directive "fortran_dialect=xx" (where xx=f77 or +elf or F or f90 or f95) in one of the first three lines in your file. For +example, your older .f files may be written in extended f77 but your newer +ones may be F codes, and you would identify the latter by including in the +first three lines of those files a Fortran comment of the form > + ! fortran_dialect=F +F overrides elf if both directives are present. + +Limitations ~ +Parenthesis checking does not catch too few closing parentheses. Hollerith +strings are not recognized. Some keywords may be highlighted incorrectly +because Fortran90 has no reserved words. + +For further information related to fortran, see |ft-fortran-indent| and +|ft-fortran-plugin|. + + +FVWM CONFIGURATION FILES *fvwm.vim* *ft-fvwm-syntax* + +In order for Vim to recognize Fvwm configuration files that do not match +the patterns *fvwmrc* or *fvwm2rc* , you must put additional patterns +appropriate to your system in your myfiletypes.vim file. For these +patterns, you must set the variable "b:fvwm_version" to the major version +number of Fvwm, and the 'filetype' option to fvwm. + +For example, to make Vim identify all files in /etc/X11/fvwm2/ +as Fvwm2 configuration files, add the following: > + + :au! BufNewFile,BufRead /etc/X11/fvwm2/* let b:fvwm_version = 2 | + \ set filetype=fvwm + +If you'd like Vim to highlight all valid color names, tell it where to +find the color database (rgb.txt) on your system. Do this by setting +"rgb_file" to its location. Assuming your color database is located +in /usr/X11/lib/X11/, you should add the line > + + :let rgb_file = "/usr/X11/lib/X11/rgb.txt" + +to your .vimrc file. + + +GSP *gsp.vim* *ft-gsp-syntax* + +The default coloring style for GSP pages is defined by |html.vim|, and +the coloring for java code (within java tags or inline between backticks) +is defined by |java.vim|. The following HTML groups defined in |html.vim| +are redefined to incorporate and highlight inline java code: + + htmlString + htmlValue + htmlEndTag + htmlTag + htmlTagN + +Highlighting should look fine most of the places where you'd see inline +java code, but in some special cases it may not. To add another HTML +group where you will have inline java code where it does not highlight +correctly, just copy the line you want from |html.vim| and add gspJava +to the contains clause. + +The backticks for inline java are highlighted according to the htmlError +group to make them easier to see. + + +GROFF *groff.vim* *ft-groff-syntax* + +The groff syntax file is a wrapper for |nroff.vim|, see the notes +under that heading for examples of use and configuration. The purpose +of this wrapper is to set up groff syntax extensions by setting the +filetype from a |modeline| or in a personal filetype definitions file +(see |filetype.txt|). + + +HASKELL *haskell.vim* *lhaskell.vim* *ft-haskell-syntax* + +The Haskell syntax files support plain Haskell code as well as literate +Haskell code, the latter in both Bird style and TeX style. The Haskell +syntax highlighting will also highlight C preprocessor directives. + +If you want to highlight delimiter characters (useful if you have a +light-coloured background), add to your .vimrc: > + :let hs_highlight_delimiters = 1 +To treat True and False as keywords as opposed to ordinary identifiers, +add: > + :let hs_highlight_boolean = 1 +To also treat the names of primitive types as keywords: > + :let hs_highlight_types = 1 +And to treat the names of even more relatively common types as keywords: > + :let hs_highlight_more_types = 1 +If you want to highlight the names of debugging functions, put in +your .vimrc: > + :let hs_highlight_debug = 1 + +The Haskell syntax highlighting also highlights C preprocessor +directives, and flags lines that start with # but are not valid +directives as erroneous. This interferes with Haskell's syntax for +operators, as they may start with #. If you want to highlight those +as operators as opposed to errors, put in your .vimrc: > + :let hs_allow_hash_operator = 1 + +The syntax highlighting for literate Haskell code will try to +automatically guess whether your literate Haskell code contains +TeX markup or not, and correspondingly highlight TeX constructs +or nothing at all. You can override this globally by putting +in your .vimrc > + :let lhs_markup = none +for no highlighting at all, or > + :let lhs_markup = tex +to force the highlighting to always try to highlight TeX markup. +For more flexibility, you may also use buffer local versions of +this variable, so e.g. > + :let b:lhs_markup = tex +will force TeX highlighting for a particular buffer. It has to be +set before turning syntax highlighting on for the buffer or +loading a file. + + +HTML *html.vim* *ft-html-syntax* + +The coloring scheme for tags in the HTML file works as follows. + +The <> of opening tags are colored differently than the of a closing tag. +This is on purpose! For opening tags the 'Function' color is used, while for +closing tags the 'Type' color is used (See syntax.vim to check how those are +defined for you) + +Known tag names are colored the same way as statements in C. Unknown tag +names are colored with the same color as the <> or respectively which +makes it easy to spot errors + +Note that the same is true for argument (or attribute) names. Known attribute +names are colored differently than unknown ones. + +Some HTML tags are used to change the rendering of text. The following tags +are recognized by the html.vim syntax coloring file and change the way normal +text is shown: ( is used as an alias for , +while as an alias for ),

-

, , and <A>, but +only if used as a link (that is, it must include a href as in +<A href="somfile.html">). + +If you want to change how such text is rendered, you must redefine the +following syntax groups: + + - htmlBold + - htmlBoldUnderline + - htmlBoldUnderlineItalic + - htmlUnderline + - htmlUnderlineItalic + - htmlItalic + - htmlTitle for titles + - htmlH1 - htmlH6 for headings + +To make this redefinition work you must redefine them all with the exception +of the last two (htmlTitle and htmlH[1-6], which are optional) and define the +following variable in your vimrc (this is due to the order in which the files +are read during initialization) > + :let html_my_rendering=1 + +If you'd like to see an example download mysyntax.vim at +http://www.fleiner.com/vim/download.html + +You can also disable this rendering by adding the following line to your +vimrc file: > + :let html_no_rendering=1 + +HTML comments are rather special (see an HTML reference document for the +details), and the syntax coloring scheme will highlight all errors. +However, if you prefer to use the wrong style (starts with <!-- and +ends with --!>) you can define > + :let html_wrong_comments=1 + +JavaScript and Visual Basic embedded inside HTML documents are highlighted as +'Special' with statements, comments, strings and so on colored as in standard +programming languages. Note that only JavaScript and Visual Basic are currently +supported, no other scripting language has been added yet. + +Embedded and inlined cascading style sheets (CSS) are highlighted too. + +There are several html preprocessor languages out there. html.vim has been +written such that it should be trivial to include it. To do so add the +following two lines to the syntax coloring file for that language +(the example comes from the asp.vim file): + + runtime! syntax/html.vim + syn cluster htmlPreproc add=asp + +Now you just need to make sure that you add all regions that contain +the preprocessor language to the cluster htmlPreproc. + + +HTML/OS (by Aestiva) *htmlos.vim* *ft-htmlos-syntax* + +The coloring scheme for HTML/OS works as follows: + +Functions and variable names are the same color by default, because VIM +doesn't specify different colors for Functions and Identifiers. To change +this (which is recommended if you want function names to be recognizable in a +different color) you need to add the following line to either your ~/.vimrc: > + :hi Function term=underline cterm=bold ctermfg=LightGray + +Of course, the ctermfg can be a different color if you choose. + +Another issues that HTML/OS runs into is that there is no special filetype to +signify that it is a file with HTML/OS coding. You can change this by opening +a file and turning on HTML/OS syntax by doing the following: > + :set syntax=htmlos + +Lastly, it should be noted that the opening and closing characters to begin a +block of HTML/OS code can either be << or [[ and >> or ]], respectively. + + +IA64 *ia64.vim* *intel-itanium* *ft-ia64-syntax* + +Highlighting for the Intel Itanium 64 assembly language. See |asm.vim| for +how to recognize this filetype. + +To have *.inc files be recognized as IA64, add this to your .vimrc file: > + :let g:filetype_inc = "ia64" + + +INFORM *inform.vim* *ft-inform-syntax* + +Inform highlighting includes symbols provided by the Inform Library, as +most programs make extensive use of it. If do not wish Library symbols +to be highlighted add this to your vim startup: > + :let inform_highlight_simple=1 + +By default it is assumed that Inform programs are Z-machine targeted, +and highlights Z-machine assembly language symbols appropriately. If +you intend your program to be targeted to a Glulx/Glk environment you +need to add this to your startup sequence: > + :let inform_highlight_glulx=1 + +This will highlight Glulx opcodes instead, and also adds glk() to the +set of highlighted system functions. + +The Inform compiler will flag certain obsolete keywords as errors when +it encounters them. These keywords are normally highlighted as errors +by Vim. To prevent such error highlighting, you must add this to your +startup sequence: > + :let inform_suppress_obsolete=1 + +By default, the language features highlighted conform to Compiler +version 6.30 and Library version 6.11. If you are using an older +Inform development environment, you may with to add this to your +startup sequence: > + :let inform_highlight_old=1 + +IDL *idl.vim* *idl-syntax* + +IDL (Interface Definition Language) files are used to define RPC calls. In +Microsoft land, this is also used for defining COM interfaces and calls. + +IDL's structure is simple enough to permit a full grammar based approach to +rather than using a few heuristics. The result is large and somewhat +repetative but seems to work. + +There are some Microsoft extensions to idl files that are here. Some of them +are disabled by defining idl_no_ms_extensions. + +The more complex of the extensions are disabled by defining idl_no_extensions. + +Variable Effect ~ + +idl_no_ms_extensions Disable some of the Microsoft specific + extensions +idl_no_extensions Disable complex extensions +idlsyntax_showerror Show IDL errors (can be rather intrusive, but + quite helpful) +idlsyntax_showerror_soft Use softer colours by default for errors + + +JAVA *java.vim* *ft-java-syntax* + +The java.vim syntax highlighting file offers several options: + +In Java 1.0.2 it was never possible to have braces inside parens, so this was +flagged as an error. Since Java 1.1 this is possible (with anonymous +classes), and therefore is no longer marked as an error. If you prefer the old +way, put the following line into your vim startup file: > + :let java_mark_braces_in_parens_as_errors=1 + +All identifiers in java.lang.* are always visible in all classes. To +highlight them use: > + :let java_highlight_java_lang_ids=1 + +You can also highlight identifiers of most standard Java packages if you +download the javaid.vim script at http://www.fleiner.com/vim/download.html. +If you prefer to only highlight identifiers of a certain package, say java.io +use the following: > + :let java_highlight_java_io=1 +Check the javaid.vim file for a list of all the packages that are supported. + +Function names are not highlighted, as the way to find functions depends on +how you write Java code. The syntax file knows two possible ways to highlight +functions: + +If you write function declarations that are always indented by either +a tab, 8 spaces or 2 spaces you may want to set > + :let java_highlight_functions="indent" +However, if you follow the Java guidelines about how functions and classes are +supposed to be named (with respect to upper and lowercase), use > + :let java_highlight_functions="style" +If both options do not work for you, but you would still want function +declarations to be highlighted create your own definitions by changing the +definitions in java.vim or by creating your own java.vim which includes the +original one and then adds the code to highlight functions. + +In Java 1.1 the functions System.out.println() and System.err.println() should +only be used for debugging. Therefore it is possible to highlight debugging +statements differently. To do this you must add the following definition in +your startup file: > + :let java_highlight_debug=1 +The result will be that those statements are highlighted as 'Special' +characters. If you prefer to have them highlighted differently you must define +new highlightings for the following groups.: + Debug, DebugSpecial, DebugString, DebugBoolean, DebugType +which are used for the statement itself, special characters used in debug +strings, strings, boolean constants and types (this, super) respectively. I +have opted to chose another background for those statements. + +In order to help you to write code that can be easily ported between +Java and C++, all C++ keywords are marked as error in a Java program. +However, if you use them regularly, you may want to define the following +variable in your .vimrc file: > + :let java_allow_cpp_keywords=1 + +Javadoc is a program that takes special comments out of Java program files and +creates HTML pages. The standard configuration will highlight this HTML code +similarly to HTML files (see |html.vim|). You can even add Javascript +and CSS inside this code (see below). There are four differences however: + 1. The title (all characters up to the first '.' which is followed by + some white space or up to the first '@') is colored differently (to change + the color change the group CommentTitle). + 2. The text is colored as 'Comment'. + 3. HTML comments are colored as 'Special' + 4. The special Javadoc tags (@see, @param, ...) are highlighted as specials + and the argument (for @see, @param, @exception) as Function. +To turn this feature off add the following line to your startup file: > + :let java_ignore_javadoc=1 + +If you use the special Javadoc comment highlighting described above you +can also turn on special highlighting for Javascript, visual basic +scripts and embedded CSS (stylesheets). This makes only sense if you +actually have Javadoc comments that include either Javascript or embedded +CSS. The options to use are > + :let java_javascript=1 + :let java_css=1 + :let java_vb=1 + +In order to highlight nested parens with different colors define colors +for javaParen, javaParen1 and javaParen2, for example with > + :hi link javaParen Comment +or > + :hi javaParen ctermfg=blue guifg=#0000ff + +If you notice highlighting errors while scrolling backwards, which are fixed +when redrawing with CTRL-L, try setting the "java_minlines" internal variable +to a larger number: > + :let java_minlines = 50 +This will make the syntax synchronization start 50 lines before the first +displayed line. The default value is 10. The disadvantage of using a larger +number is that redrawing can become slow. + + +LACE *lace.vim* *ft-lace-syntax* + +Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the +style guide lines are not. If you prefer case insensitive highlighting, just +define the vim variable 'lace_case_insensitive' in your startup file: > + :let lace_case_insensitive=1 + + +LEX *lex.vim* *ft-lex-syntax* + +Lex uses brute-force synchronizing as the "^%%$" section delimiter +gives no clue as to what section follows. Consequently, the value for > + :syn sync minlines=300 +may be changed by the user if s/he is experiencing synchronization +difficulties (such as may happen with large lex files). + + +LISP *lisp.vim* *ft-lisp-syntax* + +The lisp syntax highlighting provides two options: > + + g:lisp_instring : if it exists, then "(...)" strings are highlighted + as if the contents of the string were lisp. + Useful for AutoLisp. + g:lisp_rainbow : if it exists and is nonzero, then differing levels + of parenthesization will receive different + highlighting. +< +The g:lisp_rainbow option provides 10 levels of individual colorization for +the parentheses and backquoted parentheses. Because of the quantity of +colorization levels, unlike non-rainbow highlighting, the rainbow mode +specifies its highlighting using ctermfg and guifg, thereby bypassing the +usual colorscheme control using standard highlighting groups. The actual +highlighting used depends on the dark/bright setting (see |'bg'|). + + +LITE *lite.vim* *ft-lite-syntax* + +There are two options for the lite syntax highlighting. + +If you like SQL syntax highlighting inside Strings, use this: > + + :let lite_sql_query = 1 + +For syncing, minlines defaults to 100. If you prefer another value, you can +set "lite_minlines" to the value you desire. Example: > + + :let lite_minlines = 200 + + +LPC *lpc.vim* *ft-lpc-syntax* + +LPC stands for a simple, memory-efficient language: Lars Pensj| C. The +file name of LPC is usually *.c. Recognizing these files as LPC would bother +users writing only C programs. If you want to use LPC syntax in Vim, you +should set a variable in your .vimrc file: > + + :let lpc_syntax_for_c = 1 + +If it doesn't work properly for some particular C or LPC files, use a +modeline. For a LPC file: + + // vim:set ft=lpc: + +For a C file that is recognized as LPC: + + // vim:set ft=c: + +If you don't want to set the variable, use the modeline in EVERY LPC file. + +There are several implementations for LPC, we intend to support most widely +used ones. Here the default LPC syntax is for MudOS series, for MudOS v22 +and before, you should turn off the sensible modifiers, and this will also +asserts the new efuns after v22 to be invalid, don't set this variable when +you are using the latest version of MudOS: > + + :let lpc_pre_v22 = 1 + +For LpMud 3.2 series of LPC: > + + :let lpc_compat_32 = 1 + +For LPC4 series of LPC: > + + :let lpc_use_lpc4_syntax = 1 + +For uLPC series of LPC: +uLPC has been developed to Pike, so you should use Pike syntax +instead, and the name of your source file should be *.pike + + +LUA *lua.vim* *ft-lua-syntax* + +This syntax file may be used for Lua 4.0, Lua 5.0 or Lua 5.1 (the latter is +the default). You can select one of these versions using the global variables +lua_version and lua_subversion. For example, to activate Lua +4.0 syntax highlighting, use this command: > + + :let lua_version = 4 + +If you are using Lua 5.0, use these commands: > + + :let lua_version = 5 + :let lua_subversion = 0 + +To restore highlighting for Lua 5.1: > + + :let lua_version = 5 + :let lua_subversion = 1 + + +MAIL *mail.vim* *ft-mail.vim* + +Vim highlights all the standard elements of an email (headers, signatures, +quoted text and URLs / email addresses). In keeping with standard conventions, +signatures begin in a line containing only "--" followed optionally by +whitespaces and end with a newline. + +Vim treats lines beginning with ']', '}', '|', '>' or a word followed by '>' +as quoted text. However Vim highlights headers and signatures in quoted text +only if the text is quoted with '>' (optionally followed by one space). + +By default mail.vim synchronises syntax to 100 lines before the first +displayed line. If you have a slow machine, and generally deal with emails +with short headers, you can change this to a smaller value: > + + :let mail_minlines = 30 + + +MAKE *make.vim* *ft-make-syntax* + +In makefiles, commands are usually highlighted to make it easy for you to spot +errors. However, this may be too much coloring for you. You can turn this +feature off by using: > + + :let make_no_commands = 1 + + +MAPLE *maple.vim* *ft-maple-syntax* + +Maple V, by Waterloo Maple Inc, supports symbolic algebra. The language +supports many packages of functions which are selectively loaded by the user. +The standard set of packages' functions as supplied in Maple V release 4 may be +highlighted at the user's discretion. Users may place in their .vimrc file: > + + :let mvpkg_all= 1 + +to get all package functions highlighted, or users may select any subset by +choosing a variable/package from the table below and setting that variable to +1, also in their .vimrc file (prior to sourcing +$VIMRUNTIME/syntax/syntax.vim). + + Table of Maple V Package Function Selectors > + mv_DEtools mv_genfunc mv_networks mv_process + mv_Galois mv_geometry mv_numapprox mv_simplex + mv_GaussInt mv_grobner mv_numtheory mv_stats + mv_LREtools mv_group mv_orthopoly mv_student + mv_combinat mv_inttrans mv_padic mv_sumtools + mv_combstruct mv_liesymm mv_plots mv_tensor + mv_difforms mv_linalg mv_plottools mv_totorder + mv_finance mv_logic mv_powseries + + +MATHEMATICA *mma.vim* *ft-mma-syntax* *ft-mathematica-syntax* + +Empty *.m files will automatically be presumed to be Matlab files unless you +have the following in your .vimrc: > + + let filetype_m = "mma" + + +MOO *moo.vim* *ft-moo-syntax* + +If you use C-style comments inside expressions and find it mangles your +highlighting, you may want to use extended (slow!) matches for C-style +comments: > + + :let moo_extended_cstyle_comments = 1 + +To disable highlighting of pronoun substitution patterns inside strings: > + + :let moo_no_pronoun_sub = 1 + +To disable highlighting of the regular expression operator '%|', and matching +'%(' and '%)' inside strings: > + + :let moo_no_regexp = 1 + +Unmatched double quotes can be recognized and highlighted as errors: > + + :let moo_unmatched_quotes = 1 + +To highlight builtin properties (.name, .location, .programmer etc.): > + + :let moo_builtin_properties = 1 + +Unknown builtin functions can be recognized and highlighted as errors. If you +use this option, add your own extensions to the mooKnownBuiltinFunction group. +To enable this option: > + + :let moo_unknown_builtin_functions = 1 + +An example of adding sprintf() to the list of known builtin functions: > + + :syn keyword mooKnownBuiltinFunction sprintf contained + + +MSQL *msql.vim* *ft-msql-syntax* + +There are two options for the msql syntax highlighting. + +If you like SQL syntax highlighting inside Strings, use this: > + + :let msql_sql_query = 1 + +For syncing, minlines defaults to 100. If you prefer another value, you can +set "msql_minlines" to the value you desire. Example: > + + :let msql_minlines = 200 + + +NCF *ncf.vim* *ft-ncf-syntax* + +There is one option for NCF syntax highlighting. + +If you want to have unrecognized (by ncf.vim) statements highlighted as +errors, use this: > + + :let ncf_highlight_unknowns = 1 + +If you don't want to highlight these errors, leave it unset. + + +NROFF *nroff.vim* *ft-nroff-syntax* + +The nroff syntax file works with AT&T n/troff out of the box. You need to +activate the GNU groff extra features included in the syntax file before you +can use them. + +For example, Linux and BSD distributions use groff as their default text +processing package. In order to activate the extra syntax highlighting +features for groff, add the following option to your start-up files: > + + :let b:nroff_is_groff = 1 + +Groff is different from the old AT&T n/troff that you may still find in +Solaris. Groff macro and request names can be longer than 2 characters and +there are extensions to the language primitives. For example, in AT&T troff +you access the year as a 2-digit number with the request \(yr. In groff you +can use the same request, recognized for compatibility, or you can use groff's +native syntax, \[yr]. Furthermore, you can use a 4-digit year directly: +\[year]. Macro requests can be longer than 2 characters, for example, GNU mm +accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim +environments. + +In order to obtain the best formatted output g/troff can give you, you should +follow a few simple rules about spacing and punctuation. + +1. Do not leave empty spaces at the end of lines. + +2. Leave one space and one space only after an end-of-sentence period, + exclamation mark, etc. + +3. For reasons stated below, it is best to follow all period marks with a + carriage return. + +The reason behind these unusual tips is that g/n/troff have a line breaking +algorithm that can be easily upset if you don't follow the rules given above. + +Unlike TeX, troff fills text line-by-line, not paragraph-by-paragraph and, +furthermore, it does not have a concept of glue or stretch, all horizontal and +vertical space input will be output as is. + +Therefore, you should be careful about not using more space between sentences +than you intend to have in your final document. For this reason, the common +practice is to insert a carriage return immediately after all punctuation +marks. If you want to have "even" text in your final processed output, you +need to maintaining regular spacing in the input text. To mark both trailing +spaces and two or more spaces after a punctuation as an error, use: > + + :let nroff_space_errors = 1 + +Another technique to detect extra spacing and other errors that will interfere +with the correct typesetting of your file, is to define an eye-catching +highlighting definition for the syntax groups "nroffDefinition" and +"nroffDefSpecial" in your configuration files. For example: > + + hi def nroffDefinition term=italic cterm=italic gui=reverse + hi def nroffDefSpecial term=italic,bold cterm=italic,bold + \ gui=reverse,bold + +If you want to navigate preprocessor entries in your source file as easily as +with section markers, you can activate the following option in your .vimrc +file: > + + let b:preprocs_as_sections = 1 + +As well, the syntax file adds an extra paragraph marker for the extended +paragraph macro (.XP) in the ms package. + +Finally, there is a |groff.vim| syntax file that can be used for enabling +groff syntax highlighting either on a file basis or globally by default. + + +OCAML *ocaml.vim* *ft-ocaml-syntax* + +The OCaml syntax file handles files having the following prefixes: .ml, +.mli, .mll and .mly. By setting the following variable > + + :let ocaml_revised = 1 + +you can switch from standard OCaml-syntax to revised syntax as supported +by the camlp4 preprocessor. Setting the variable > + + :let ocaml_noend_error = 1 + +prevents highlighting of "end" as error, which is useful when sources +contain very long structures that Vim does not synchronize anymore. + + +PAPP *papp.vim* *ft-papp-syntax* + +The PApp syntax file handles .papp files and, to a lesser extend, .pxml +and .pxsl files which are all a mixture of perl/xml/html/other using xml +as the top-level file format. By default everything inside phtml or pxml +sections is treated as a string with embedded preprocessor commands. If +you set the variable: > + + :let papp_include_html=1 + +in your startup file it will try to syntax-hilight html code inside phtml +sections, but this is relatively slow and much too colourful to be able to +edit sensibly. ;) + +The newest version of the papp.vim syntax file can usually be found at +http://papp.plan9.de. + + +PASCAL *pascal.vim* *ft-pascal-syntax* + +Files matching "*.p" could be Progress or Pascal. If the automatic detection +doesn't work for you, or you don't edit Progress at all, use this in your +startup vimrc: > + + :let filetype_p = "pascal" + +The Pascal syntax file has been extended to take into account some extensions +provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler. +Delphi keywords are also supported. By default, Turbo Pascal 7.0 features are +enabled. If you prefer to stick with the standard Pascal keywords, add the +following line to your startup file: > + + :let pascal_traditional=1 + +To switch on Delphi specific constructions (such as one-line comments, +keywords, etc): > + + :let pascal_delphi=1 + + +The option pascal_symbol_operator controls whether symbol operators such as +, +*, .., etc. are displayed using the Operator color or not. To colorize symbol +operators, add the following line to your startup file: > + + :let pascal_symbol_operator=1 + +Some functions are highlighted by default. To switch it off: > + + :let pascal_no_functions=1 + +Furthermore, there are specific variable for some compiler. Besides +pascal_delphi, there are pascal_gpc and pascal_fpc. Default extensions try to +match Turbo Pascal. > + + :let pascal_gpc=1 + +or > + + :let pascal_fpc=1 + +To ensure that strings are defined on a single line, you can define the +pascal_one_line_string variable. > + + :let pascal_one_line_string=1 + +If you dislike <Tab> chars, you can set the pascal_no_tabs variable. Tabs +will be highlighted as Error. > + + :let pascal_no_tabs=1 + + + +PERL *perl.vim* *ft-perl-syntax* + +There are a number of possible options to the perl syntax highlighting. + +If you use POD files or POD segments, you might: > + + :let perl_include_pod = 1 + +The reduce the complexity of parsing (and increase performance) you can switch +off two elements in the parsing of variable names and contents. > + +To handle package references in variable and function names not differently +from the rest of the name (like 'PkgName::' in '$PkgName::VarName'): > + + :let perl_no_scope_in_variables = 1 + +(In Vim 6.x it was the other way around: "perl_want_scope_in_variables" +enabled it.) + +If you do not want complex things like '@{${"foo"}}' to be parsed: > + + :let perl_no_extended_vars = 1 + +(In Vim 6.x it was the other way around: "perl_extended_vars" enabled it.) + +The coloring strings can be changed. By default strings and qq friends will be +highlighted like the first line. If you set the variable +perl_string_as_statement, it will be highlighted as in the second line. + + "hello world!"; qq|hello world|; + ^^^^^^^^^^^^^^NN^^^^^^^^^^^^^^^N (unlet perl_string_as_statement) + S^^^^^^^^^^^^SNNSSS^^^^^^^^^^^SN (let perl_string_as_statement) + +(^ = perlString, S = perlStatement, N = None at all) + +The syncing has 3 options. The first two switch off some triggering of +synchronization and should only be needed in case it fails to work properly. +If while scrolling all of a sudden the whole screen changes color completely +then you should try and switch off one of those. Let me know if you can figure +out the line that causes the mistake. + +One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less. > + + :let perl_no_sync_on_sub + :let perl_no_sync_on_global_var + +Below you can set the maximum distance VIM should look for starting points for +its attempts in syntax highlighting. > + + :let perl_sync_dist = 100 + +If you want to use folding with perl, set perl_fold: > + + :let perl_fold = 1 + +If you want to fold blocks in if statements, etc. as well set the following: > + + :let perl_fold_blocks = 1 + +To avoid folding packages or subs when perl_fold is let, let the appropriate +variable(s): > + + :unlet perl_nofold_packages + :unlet perl_nofold_subs + + + +PHP3 and PHP4 *php.vim* *php3.vim* *ft-php-syntax* *ft-php3-syntax* + +[note: previously this was called "php3", but since it now also supports php4 +it has been renamed to "php"] + +There are the following options for the php syntax highlighting. + +If you like SQL syntax highlighting inside Strings: > + + let php_sql_query = 1 + +For highlighting the Baselib methods: > + + let php_baselib = 1 + +Enable HTML syntax highlighting inside strings: > + + let php_htmlInStrings = 1 + +Using the old colorstyle: > + + let php_oldStyle = 1 + +Enable highlighting ASP-style short tags: > + + let php_asp_tags = 1 + +Disable short tags: > + + let php_noShortTags = 1 + +For highlighting parent error ] or ): > + + let php_parent_error_close = 1 + +For skipping an php end tag, if there exists an open ( or [ without a closing +one: > + + let php_parent_error_open = 1 + +Enable folding for classes and functions: > + + let php_folding = 1 + +Selecting syncing method: > + + let php_sync_method = x + +x = -1 to sync by search (default), +x > 0 to sync at least x lines backwards, +x = 0 to sync from start. + + +PLAINTEX *plaintex.vim* *ft-plaintex-syntax* + +TeX is a typesetting language, and plaintex is the file type for the "plain" +variant of TeX. If you never want your *.tex files recognized as plain TeX, +see |ft-tex-plugin|. + +This syntax file has the option > + + let g:plaintex_delimiters = 1 + +if you want to highlight brackets "[]" and braces "{}". + + +PPWIZARD *ppwiz.vim* *ft-ppwiz-syntax* + +PPWizard is a preprocessor for HTML and OS/2 INF files + +This syntax file has the options: + +- ppwiz_highlight_defs : determines highlighting mode for PPWizard's + definitions. Possible values are + + ppwiz_highlight_defs = 1 : PPWizard #define statements retain the + colors of their contents (e.g. PPWizard macros and variables) + + ppwiz_highlight_defs = 2 : preprocessor #define and #evaluate + statements are shown in a single color with the exception of line + continuation symbols + + The default setting for ppwiz_highlight_defs is 1. + +- ppwiz_with_html : If the value is 1 (the default), highlight literal + HTML code; if 0, treat HTML code like ordinary text. + + +PHTML *phtml.vim* *ft-phtml-syntax* + +There are two options for the phtml syntax highlighting. + +If you like SQL syntax highlighting inside Strings, use this: > + + :let phtml_sql_query = 1 + +For syncing, minlines defaults to 100. If you prefer another value, you can +set "phtml_minlines" to the value you desire. Example: > + + :let phtml_minlines = 200 + + +POSTSCRIPT *postscr.vim* *ft-postscr-syntax* + +There are several options when it comes to highlighting PostScript. + +First which version of the PostScript language to highlight. There are +currently three defined language versions, or levels. Level 1 is the original +and base version, and includes all extensions prior to the release of level 2. +Level 2 is the most common version around, and includes its own set of +extensions prior to the release of level 3. Level 3 is currently the highest +level supported. You select which level of the PostScript language you want +highlighted by defining the postscr_level variable as follows: > + + :let postscr_level=2 + +If this variable is not defined it defaults to 2 (level 2) since this is +the most prevalent version currently. + +Note, not all PS interpreters will support all language features for a +particular language level. In particular the %!PS-Adobe-3.0 at the start of +PS files does NOT mean the PostScript present is level 3 PostScript! + +If you are working with Display PostScript, you can include highlighting of +Display PS language features by defining the postscr_display variable as +follows: > + + :let postscr_display=1 + +If you are working with Ghostscript, you can include highlighting of +Ghostscript specific language features by defining the variable +postscr_ghostscript as follows: > + + :let postscr_ghostscript=1 + +PostScript is a large language, with many predefined elements. While it +useful to have all these elements highlighted, on slower machines this can +cause Vim to slow down. In an attempt to be machine friendly font names and +character encodings are not highlighted by default. Unless you are working +explicitly with either of these this should be ok. If you want them to be +highlighted you should set one or both of the following variables: > + + :let postscr_fonts=1 + :let postscr_encodings=1 + +There is a stylistic option to the highlighting of and, or, and not. In +PostScript the function of these operators depends on the types of their +operands - if the operands are booleans then they are the logical operators, +if they are integers then they are binary operators. As binary and logical +operators can be highlighted differently they have to be highlighted one way +or the other. By default they are treated as logical operators. They can be +highlighted as binary operators by defining the variable +postscr_andornot_binary as follows: > + + :let postscr_andornot_binary=1 +< + + *ptcap.vim* *ft-printcap-syntax* +PRINTCAP + TERMCAP *ft-ptcap-syntax* *ft-termcap-syntax* + +This syntax file applies to the printcap and termcap databases. + +In order for Vim to recognize printcap/termcap files that do not match +the patterns *printcap*, or *termcap*, you must put additional patterns +appropriate to your system in your |myfiletypefile| file. For these +patterns, you must set the variable "b:ptcap_type" to either "print" or +"term", and then the 'filetype' option to ptcap. + +For example, to make Vim identify all files in /etc/termcaps/ as termcap +files, add the following: > + + :au BufNewFile,BufRead /etc/termcaps/* let b:ptcap_type = "term" | + \ set filetype=ptcap + +If you notice highlighting errors while scrolling backwards, which +are fixed when redrawing with CTRL-L, try setting the "ptcap_minlines" +internal variable to a larger number: > + + :let ptcap_minlines = 50 + +(The default is 20 lines.) + + +PROGRESS *progress.vim* *ft-progress-syntax* + +Files matching "*.w" could be Progress or cweb. If the automatic detection +doesn't work for you, or you don't edit cweb at all, use this in your +startup vimrc: > + :let filetype_w = "progress" +The same happens for "*.i", which could be assembly, and "*.p", which could be +Pascal. Use this if you don't use assembly and Pascal: > + :let filetype_i = "progress" + :let filetype_p = "progress" + + +PYTHON *python.vim* *ft-python-syntax* + +There are four options to control Python syntax highlighting. + +For highlighted numbers: > + :let python_highlight_numbers = 1 + +For highlighted builtin functions: > + :let python_highlight_builtins = 1 + +For highlighted standard exceptions: > + :let python_highlight_exceptions = 1 + +For highlighted trailing whitespace and mix of spaces and tabs: + :let python_highlight_space_errors = 1 + +If you want all possible Python highlighting (the same as setting the +preceding three options): > + :let python_highlight_all = 1 + + +QUAKE *quake.vim* *ft-quake-syntax* + +The Quake syntax definition should work for most any FPS (First Person +Shooter) based on one of the Quake engines. However, the command names vary +a bit between the three games (Quake, Quake 2, and Quake 3 Arena) so the +syntax definition checks for the existence of three global variables to allow +users to specify what commands are legal in their files. The three variables +can be set for the following effects: + +set to highlight commands only available in Quake: > + :let quake_is_quake1 = 1 + +set to highlight commands only available in Quake 2: > + :let quake_is_quake2 = 1 + +set to highlight commands only available in Quake 3 Arena: > + :let quake_is_quake3 = 1 + +Any combination of these three variables is legal, but might highlight more +commands than are actually available to you by the game. + + +READLINE *readline.vim* *ft-readline-syntax* + +The readline library is primarily used by the BASH shell, which adds quite a +few commands and options to the ones already available. To highlight these +items as well you can add the following to your |vimrc| or just type it in the +command line before loading a file with the readline syntax: > + let readline_has_bash = 1 + +This will add highlighting for the commands that BASH (version 2.05a and +later, and part earlier) adds. + + +REXX *rexx.vim* *ft-rexx-syntax* + +If you notice highlighting errors while scrolling backwards, which are fixed +when redrawing with CTRL-L, try setting the "rexx_minlines" internal variable +to a larger number: > + :let rexx_minlines = 50 +This will make the syntax synchronization start 50 lines before the first +displayed line. The default value is 10. The disadvantage of using a larger +number is that redrawing can become slow. + + +RUBY *ruby.vim* *ft-ruby-syntax* + +There are a number of options to the Ruby syntax highlighting. + +By default, the "end" keyword is colorized according to the opening statement +of the block it closes. While useful, this feature can be expensive; if you +experience slow redrawing (or you are on a terminal with poor color support) +you may want to turn it off by defining the "ruby_no_expensive" variable: > + + :let ruby_no_expensive = 1 + +In this case the same color will be used for all control keywords. + +If you do want this feature enabled, but notice highlighting errors while +scrolling backwards, which are fixed when redrawing with CTRL-L, try setting +the "ruby_minlines" variable to a value larger than 50: > + + :let ruby_minlines = 100 + +Ideally, this value should be a number of lines large enough to embrace your +largest class or module. + +Highlighting of special identifiers can be disabled by defining +"ruby_no_identifiers": > + + :let ruby_no_identifiers = 1 + +This will prevent highlighting of special identifiers like "ConstantName", +"$global_var", "@@class_var", "@instance_var", "| block_param |", and +":symbol". + +Significant methods of Kernel, Module and Object are highlighted by default. +This can be disabled by defining "ruby_no_special_methods": > + + :let ruby_no_special_methods = 1 + +This will prevent highlighting of important methods such as "require", "attr", +"private", "raise" and "proc". + +Whitespace errors can be highlighted by defining "ruby_space_errors": > + + :let ruby_space_errors = 1 + +This will highlight trailing whitespace and tabs preceded by a space character +as errors. This can be refined by defining "ruby_no_trail_space_error" and +"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after +spaces respectively. + +Folding can be enabled by defining "ruby_fold": > + + :let ruby_fold = 1 + +This will set the 'foldmethod' option to "syntax" and allow folding of +classes, modules, methods, code blocks, heredocs and comments. +SCHEME *scheme.vim* *ft-scheme-syntax* + +By default only R5RS keywords are highlighted and properly indented. + +MzScheme-specific stuff will be used if b:is_mzscheme or g:is_mzscheme +variables are defined. + +Also scheme.vim supports keywords of the Chicken Scheme->C compiler. Define +b:is_chicken or g:is_chicken, if you need them. + + +SDL *sdl.vim* *ft-sdl-syntax* + +The SDL highlighting probably misses a few keywords, but SDL has so many +of them it's almost impossibly to cope. + +The new standard, SDL-2000, specifies that all identifiers are +case-sensitive (which was not so before), and that all keywords can be +used either completely lowercase or completely uppercase. To have the +highlighting reflect this, you can set the following variable: > + :let sdl_2000=1 + +This also sets many new keywords. If you want to disable the old +keywords, which is probably a good idea, use: > + :let SDL_no_96=1 + + +The indentation is probably also incomplete, but right now I am very +satisfied with it for my own projects. + + +SED *sed.vim* *ft-sed-syntax* + +To make tabs stand out from regular blanks (accomplished by using Todo +highlighting on the tabs), define "highlight_sedtabs" by putting > + + :let highlight_sedtabs = 1 + +in the vimrc file. (This special highlighting only applies for tabs +inside search patterns, replacement texts, addresses or text included +by an Append/Change/Insert command.) If you enable this option, it is +also a good idea to set the tab width to one character; by doing that, +you can easily count the number of tabs in a string. + +Bugs: + + The transform command (y) is treated exactly like the substitute + command. This means that, as far as this syntax file is concerned, + transform accepts the same flags as substitute, which is wrong. + (Transform accepts no flags.) I tolerate this bug because the + involved commands need very complex treatment (95 patterns, one for + each plausible pattern delimiter). + + +SGML *sgml.vim* *ft-sgml-syntax* + +The coloring scheme for tags in the SGML file works as follows. + +The <> of opening tags are colored differently than the </> of a closing tag. +This is on purpose! For opening tags the 'Function' color is used, while for +closing tags the 'Type' color is used (See syntax.vim to check how those are +defined for you) + +Known tag names are colored the same way as statements in C. Unknown tag +names are not colored which makes it easy to spot errors. + +Note that the same is true for argument (or attribute) names. Known attribute +names are colored differently than unknown ones. + +Some SGML tags are used to change the rendering of text. The following tags +are recognized by the sgml.vim syntax coloring file and change the way normal +text is shown: <varname> <emphasis> <command> <function> <literal> +<replaceable> <ulink> and <link>. + +If you want to change how such text is rendered, you must redefine the +following syntax groups: + + - sgmlBold + - sgmlBoldItalic + - sgmlUnderline + - sgmlItalic + - sgmlLink for links + +To make this redefinition work you must redefine them all and define the +following variable in your vimrc (this is due to the order in which the files +are read during initialization) > + let sgml_my_rendering=1 + +You can also disable this rendering by adding the following line to your +vimrc file: > + let sgml_no_rendering=1 + +(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) + + +SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* + +This covers the "normal" Unix (Borne) sh, bash and the Korn shell. + +Vim attempts to determine which shell type is in use by specifying that +various filenames are of specific types: > + + ksh : .kshrc* *.ksh + bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash +< +If none of these cases pertain, then the first line of the file is examined +(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, +then that shelltype is used. However some files (ex. .profile) are known to +be shell files but the type is not apparent. Furthermore, on many systems +sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). + +One may specify a global default by instantiating one of the following three +variables in your <.vimrc>: + + ksh: > + let g:is_kornshell = 1 +< posix: (using this is the same as setting is_kornshell to 1) > + let g:is_posix = 1 +< bash: > + let g:is_bash = 1 +< sh: (default) Borne shell > + let g:is_sh = 1 + +If there's no "#! ..." line, and the user hasn't availed himself/herself of a +default sh.vim syntax setting as just shown, then syntax/sh.vim will assume +the Borne shell syntax. No need to quote RFCs or market penetration +statistics in error reports, please -- just select the default version of +the sh your system uses in your <.vimrc>. + +If, in your <.vimrc>, you set > + let g:sh_fold_enabled= 1 +> +then various syntax items (HereDocuments and function bodies) become +syntax-foldable (see |:syn-fold|). + +If you notice highlighting errors while scrolling backwards, which are fixed +when redrawing with CTRL-L, try setting the "sh_minlines" internal variable +to a larger number. Example: > + + let sh_minlines = 500 + +This will make syntax synchronization start 500 lines before the first +displayed line. The default value is 200. The disadvantage of using a larger +number is that redrawing can become slow. + +If you don't have much to synchronize on, displaying can be very slow. To +reduce this, the "sh_maxlines" internal variable can be set. Example: > + + let sh_maxlines = 100 +< +The default is to use the twice sh_minlines. Set it to a smaller number to +speed up displaying. The disadvantage is that highlight errors may appear. + + +SPEEDUP (AspenTech plant simulator) *spup.vim* *ft-spup-syntax* + +The Speedup syntax file has some options: + +- strict_subsections : If this variable is defined, only keywords for + sections and subsections will be highlighted as statements but not + other keywords (like WITHIN in the OPERATION section). + +- highlight_types : Definition of this variable causes stream types + like temperature or pressure to be highlighted as Type, not as a + plain Identifier. Included are the types that are usually found in + the DECLARE section; if you defined own types, you have to include + them in the syntax file. + +- oneline_comments : this value ranges from 1 to 3 and determines the + highlighting of # style comments. + + oneline_comments = 1 : allow normal Speedup code after an even + number of #s. + + oneline_comments = 2 : show code starting with the second # as + error. This is the default setting. + + oneline_comments = 3 : show the whole line as error if it contains + more than one #. + +Since especially OPERATION sections tend to become very large due to +PRESETting variables, syncing may be critical. If your computer is +fast enough, you can increase minlines and/or maxlines near the end of +the syntax file. + + +SQL *sql.vim* *ft-sql-syntax* + *sqlinformix.vim* *ft-sqlinformix-syntax* + *sqlanywhere.vim* *ft-sqlanywhere-syntax* + +While there is an ANSI standard for SQL, most database engines add their own +custom extensions. Vim currently supports the Oracle and Informix dialects of +SQL. Vim assumes "*.sql" files are Oracle SQL by default. + +Vim currently has SQL support for a variety of different vendors via syntax +scripts. You can change Vim's default from Oracle to any of the current SQL +supported types. You can also easily alter the SQL dialect being used on a +buffer by buffer basis. + +For more detailed instructions see |sql.txt|. + + +TCSH *tcsh.vim* *ft-tcsh-syntax* + +This covers the shell named "tcsh". It is a superset of csh. See |csh.vim| +for how the filetype is detected. + +Tcsh does not allow \" in strings unless the "backslash_quote" shell variable +is set. If you want VIM to assume that no backslash quote constructs exist add +this line to your .vimrc: > + + :let tcsh_backslash_quote = 0 + +If you notice highlighting errors while scrolling backwards, which are fixed +when redrawing with CTRL-L, try setting the "tcsh_minlines" internal variable +to a larger number: > + + :let tcsh_minlines = 100 + +This will make the syntax synchronization start 100 lines before the first +displayed line. The default value is 15. The disadvantage of using a larger +number is that redrawing can become slow. + + +TEX *tex.vim* *ft-tex-syntax* + +*tex-folding* +Want Syntax Folding? ~ + +As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, +sections, subsections, etc are supported. Put > + let g:tex_fold_enabled=1 +in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a +modeline at the end of your LaTeX file: > + % vim: fdm=syntax +< +*tex-runon* +Run-on Comments/Math? ~ + +The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The +highlighting supports three primary zones/regions: normal, texZone, and +texMathZone. Although considerable effort has been made to have these zones +terminate properly, zones delineated by $..$ and $$..$$ cannot be synchronized +as there's no difference between start and end patterns. Consequently, a +special "TeX comment" has been provided > + %stopzone +which will forcibly terminate the highlighting of either a texZone or a +texMathZone. + +*tex-slow* +Slow Syntax Highlighting? ~ + +If you have a slow computer, you may wish to reduce the values for > + :syn sync maxlines=200 + :syn sync minlines=50 +(especially the latter). If your computer is fast, you may wish to +increase them. This primarily affects synchronizing (i.e. just what group, +if any, is the text at the top of the screen supposed to be in?). + +*tex-error* +Excessive Error Highlighting? ~ + +The <tex.vim> supports lexical error checking of various sorts. Thus, +although the error checking is ofttimes very useful, it can indicate +errors where none actually are. If this proves to be a problem for you, +you may put in your <.vimrc> the following statement: > + let tex_no_error=1 +and all error checking by <syntax/tex.vim> will be suppressed. + +*tex-math* +Need a new Math Group? ~ + +If you want to include a new math group in your LaTeX, the following +code shows you an example as to how you might do so: > + call TexNewMathZone(sfx,mathzone,starform) +You'll want to provide the new math group with a unique suffix +(currently, A-L and V-Z are taken by <syntax/tex.vim> itself). +As an example, consider how eqnarray is set up by <syntax/tex.vim>: > + call TexNewMathZone("D","eqnarray",1) +You'll need to change "mathzone" to the name of your new math group, +and then to the call to it in .vim/after/syntax/tex.vim. +The "starform" variable, if true, implies that your new math group +has a starred form (ie. eqnarray*). + +*tex-style* +Starting a New Style? ~ + +One may use "\makeatletter" in *.tex files, thereby making the use of "@" in +commands available. However, since the *.tex file doesn't have one of the +following suffices: sty cls clo dtx ltx, the syntax highlighting will flag +such use of @ as an error. To solve this: > + + :let b:tex_stylish = 1 + :set ft=tex + +Putting "let g:tex_stylish=1" into your <.vimrc> will make <syntax/tex.vim> +always accept such use of @. + + +TF *tf.vim* *ft-tf-syntax* + +There is one option for the tf syntax highlighting. + +For syncing, minlines defaults to 100. If you prefer another value, you can +set "tf_minlines" to the value you desire. Example: > + + :let tf_minlines = your choice + + +VIM *vim.vim* *ft-vim-syntax* + +There is a tradeoff between more accurate syntax highlighting versus +screen updating speed. To improve accuracy, you may wish to increase +the g:vim_minlines variable. The g:vim_maxlines variable may be used +to improve screen updating rates (see |:syn-sync| for more on this). + + g:vim_minlines : used to set synchronization minlines + g:vim_maxlines : used to set synchronization maxlines + +The g:vimembedscript option allows for somewhat faster loading of syntax +highlighting for vim scripts at the expense of supporting syntax highlighting +for external scripting languages (currently perl, python, ruby, and tcl). + + g:vimembedscript == 1 (default) <vim.vim> will allow highlighting + g:vimembedscript doesn't exist of supported embedded scripting + languages: perl, python, ruby and + tcl. + + g:vimembedscript == 0 Syntax highlighting for embedded + scripting languages will not be + loaded. + +Not all error highlighting that syntax/vim.vim does may be correct; VimL is a +difficult language to highlight correctly. A way to suppress error +highlighting is to put: > + + let g:vimsyntax_noerror = 1 + +in your |vimrc|. + + +XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax* + +The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both +variants are supported. Automatic detection is used, but is far from perfect. +You may need to specify the version manually. Set the variable +xf86conf_xfree86_version to 3 or 4 according to your XFree86 version in +your .vimrc. Example: > + :let xf86conf_xfree86_version=3 +When using a mix of versions, set the b:xf86conf_xfree86_version variable. + +Note that spaces and underscores in option names are not supported. Use +"SyncOnGreen" instead of "__s yn con gr_e_e_n" if you want the option name +highlighted. + + +XML *xml.vim* *ft-xml-syntax* + +Xml namespaces are highlighted by default. This can be inhibited by +setting a global variable: > + + :let g:xml_namespace_transparent=1 +< + *xml-folding* +The xml syntax file provides syntax |folding| (see |:syn-fold|) between +start and end tags. This can be turned on by > + + :let g:xml_syntax_folding = 1 + :set foldmethod=syntax + +Note: syntax folding might slow down syntax highlighting significantly, +especially for large files. + + +X Pixmaps (XPM) *xpm.vim* *ft-xpm-syntax* + +xpm.vim creates its syntax items dynamically based upon the contents of the +XPM file. Thus if you make changes e.g. in the color specification strings, +you have to source it again e.g. with ":set syn=xpm". + +To copy a pixel with one of the colors, yank a "pixel" with "yl" and insert it +somewhere else with "P". + +Do you want to draw with the mouse? Try the following: > + :function! GetPixel() + : let c = getline(".")[col(".") - 1] + : echo c + : exe "noremap <LeftMouse> <LeftMouse>r".c + : exe "noremap <LeftDrag> <LeftMouse>r".c + :endfunction + :noremap <RightMouse> <LeftMouse>:call GetPixel()<CR> + :set guicursor=n:hor20 " to see the color beneath the cursor +This turns the right button into a pipette and the left button into a pen. +It will work with XPM files that have one character per pixel only and you +must not click outside of the pixel strings, but feel free to improve it. + +It will look much better with a font in a quadratic cell size, e.g. for X: > + :set guifont=-*-clean-medium-r-*-*-8-*-*-*-*-80-* + +============================================================================== +5. Defining a syntax *:syn-define* *E410* + +Vim understands three types of syntax items: + +1. Keyword + It can only contain keyword characters, according to the 'iskeyword' + option. It cannot contain other syntax items. It will only match with a + complete word (there are no keyword characters before or after the match). + The keyword "if" would match in "if(a=b)", but not in "ifdef x", because + "(" is not a keyword character and "d" is. + +2. Match + This is a match with a single regexp pattern. + +3. Region + This starts at a match of the "start" regexp pattern and ends with a match + with the "end" regexp pattern. Any other text can appear in between. A + "skip" regexp pattern can be used to avoid matching the "end" pattern. + +Several syntax ITEMs can be put into one syntax GROUP. For a syntax group +you can give highlighting attributes. For example, you could have an item +to define a "/* .. */" comment and another one that defines a "// .." comment, +and put them both in the "Comment" group. You can then specify that a +"Comment" will be in bold font and have a blue color. You are free to make +one highlight group for one syntax item, or put all items into one group. +This depends on how you want to specify your highlighting attributes. Putting +each item in its own group results in having to specify the highlighting +for a lot of groups. + +Note that a syntax group and a highlight group are similar. For a highlight +group you will have given highlight attributes. These attributes will be used +for the syntax group with the same name. + +In case more than one item matches at the same position, the one that was +defined LAST wins. Thus you can override previously defined syntax items by +using an item that matches the same text. But a keyword always goes before a +match or region. And a keyword with matching case always goes before a +keyword with ignoring case. + + +PRIORITY *:syn-priority* + +When several syntax items may match, these rules are used: + +1. When multiple Match or Region items start in the same position, the item + defined last has priority. +2. A Keyword has priority over Match and Region items. +3. An item that starts in an earlier position has priority over items that + start in later positions. + + +DEFINING CASE *:syn-case* *E390* + +:sy[ntax] case [match | ignore] + This defines if the following ":syntax" commands will work with + matching case, when using "match", or with ignoring case, when using + "ignore". Note that any items before this are not affected, and all + items until the next ":syntax case" command are affected. + + +SPELL CHECKING *:syn-spell* + +:sy[ntax] spell [toplevel | notoplevel | default] + This defines where spell checking is to be done for text that is not + in a syntax item: + + toplevel: Text is spell checked. + notoplevel: Text is not spell checked. + default: When there is a @Spell cluster no spell checking. + + For text in syntax items use the @Spell and @NoSpell clusters + |spell-syntax|. When there is no @Spell and no @NoSpell cluster then + spell checking is done for "default" and "toplevel". + + To activate spell checking the 'spell' option must be set. + + +DEFINING KEYWORDS *:syn-keyword* + +:sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}] + + This defines a number of keywords. + + {group-name} Is a syntax group name such as "Comment". + [{options}] See |:syn-arguments| below. + {keyword} .. Is a list of keywords which are part of this group. + + Example: > + :syntax keyword Type int long char +< + The {options} can be given anywhere in the line. They will apply to + all keywords given, also for options that come after a keyword. + These examples do exactly the same: > + :syntax keyword Type contained int long char + :syntax keyword Type int long contained char + :syntax keyword Type int long char contained +< *E789* + When you have a keyword with an optional tail, like Ex commands in + Vim, you can put the optional characters inside [], to define all the + variations at once: > + :syntax keyword vimCommand ab[breviate] n[ext] +< + Don't forget that a keyword can only be recognized if all the + characters are included in the 'iskeyword' option. If one character + isn't, the keyword will never be recognized. + Multi-byte characters can also be used. These do not have to be in + 'iskeyword'. + + A keyword always has higher priority than a match or region, the + keyword is used if more than one item matches. Keywords do not nest + and a keyword can't contain anything else. + + Note that when you have a keyword that is the same as an option (even + one that isn't allowed here), you can not use it. Use a match + instead. + + The maximum length of a keyword is 80 characters. + + The same keyword can be defined multiple times, when its containment + differs. For example, you can define the keyword once not contained + and use one highlight group, and once contained, and use a different + highlight group. Example: > + :syn keyword vimCommand tag + :syn keyword vimSetting contained tag +< When finding "tag" outside of any syntax item, the "vimCommand" + highlight group is used. When finding "tag" in a syntax item that + contains "vimSetting", the "vimSetting" group is used. + + +DEFINING MATCHES *:syn-match* + +:sy[ntax] match {group-name} [{options}] [excludenl] {pattern} [{options}] + + This defines one match. + + {group-name} A syntax group name such as "Comment". + [{options}] See |:syn-arguments| below. + [excludenl] Don't make a pattern with the end-of-line "$" + extend a containing match or region. Must be + given before the pattern. |:syn-excludenl| + {pattern} The search pattern that defines the match. + See |:syn-pattern| below. + Note that the pattern may match more than one + line, which makes the match depend on where + Vim starts searching for the pattern. You + need to make sure syncing takes care of this. + + Example (match a character constant): > + :syntax match Character /'.'/hs=s+1,he=e-1 +< + +DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end* + *E398* *E399* +:sy[ntax] region {group-name} [{options}] + [matchgroup={group-name}] + [keepend] + [extend] + [excludenl] + start={start_pattern} .. + [skip={skip_pattern}] + end={end_pattern} .. + [{options}] + + This defines one region. It may span several lines. + + {group-name} A syntax group name such as "Comment". + [{options}] See |:syn-arguments| below. + [matchgroup={group-name}] The syntax group to use for the following + start or end pattern matches only. Not used + for the text in between the matched start and + end patterns. Use NONE to reset to not using + a different group for the start or end match. + See |:syn-matchgroup|. + keepend Don't allow contained matches to go past a + match with the end pattern. See + |:syn-keepend|. + extend Override a "keepend" for an item this region + is contained in. See |:syn-extend|. + excludenl Don't make a pattern with the end-of-line "$" + extend a containing match or item. Only + useful for end patterns. Must be given before + the patterns it applies to. |:syn-excludenl| + start={start_pattern} The search pattern that defines the start of + the region. See |:syn-pattern| below. + skip={skip_pattern} The search pattern that defines text inside + the region where not to look for the end + pattern. See |:syn-pattern| below. + end={end_pattern} The search pattern that defines the end of + the region. See |:syn-pattern| below. + + Example: > + :syntax region String start=+"+ skip=+\\"+ end=+"+ +< + The start/skip/end patterns and the options can be given in any order. + There can be zero or one skip pattern. There must be one or more + start and end patterns. This means that you can omit the skip + pattern, but you must give at least one start and one end pattern. It + is allowed to have white space before and after the equal sign + (although it mostly looks better without white space). + + When more than one start pattern is given, a match with one of these + is sufficient. This means there is an OR relation between the start + patterns. The last one that matches is used. The same is true for + the end patterns. + + The search for the end pattern starts right after the start pattern. + Offsets are not used for this. This implies that the match for the + end pattern will never overlap with the start pattern. + + The skip and end pattern can match across line breaks, but since the + search for the pattern can start in any line it often does not do what + you want. The skip pattern doesn't avoid a match of an end pattern in + the next line. Use single-line patterns to avoid trouble. + + Note: The decision to start a region is only based on a matching start + pattern. There is no check for a matching end pattern. This does NOT + work: > + :syn region First start="(" end=":" + :syn region Second start="(" end=";" +< The Second always matches before the First (last defined pattern has + higher priority). The Second region then continues until the next + ';', no matter if there is a ':' before it. Using a match does work: > + :syn match First "(\_.\{-}:" + :syn match Second "(\_.\{-};" +< This pattern matches any character or line break with "\_." and + repeats that with "\{-}" (repeat as few as possible). + + *:syn-keepend* + By default, a contained match can obscure a match for the end pattern. + This is useful for nesting. For example, a region that starts with + "{" and ends with "}", can contain another region. An encountered "}" + will then end the contained region, but not the outer region: + { starts outer "{}" region + { starts contained "{}" region + } ends contained "{}" region + } ends outer "{} region + If you don't want this, the "keepend" argument will make the matching + of an end pattern of the outer region also end any contained item. + This makes it impossible to nest the same region, but allows for + contained items to highlight parts of the end pattern, without causing + that to skip the match with the end pattern. Example: > + :syn match vimComment +"[^"]\+$+ + :syn region vimCommand start="set" end="$" contains=vimComment keepend +< The "keepend" makes the vimCommand always end at the end of the line, + even though the contained vimComment includes a match with the <EOL>. + + When "keepend" is not used, a match with an end pattern is retried + after each contained match. When "keepend" is included, the first + encountered match with an end pattern is used, truncating any + contained matches. + *:syn-extend* + The "keepend" behavior can be changed by using the "extend" argument. + When an item with "extend" is contained in an item that uses + "keepend", the "keepend" is ignored and the containing region will be + extended. + This can be used to have some contained items extend a region while + others don't. Example: > + + :syn region htmlRef start=+<a>+ end=+</a>+ keepend contains=htmlItem,htmlScript + :syn match htmlItem +<[^>]*>+ contained + :syn region htmlScript start=+<script+ end=+</script[^>]*>+ contained extend + +< Here the htmlItem item does not make the htmlRef item continue + further, it is only used to highlight the <> items. The htmlScript + item does extend the htmlRef item. + + Another example: > + :syn region xmlFold start="<a>" end="</a>" fold transparent keepend extend +< This defines a region with "keepend", so that its end cannot be + changed by contained items, like when the "</a>" is matched to + highlight it differently. But when the xmlFold region is nested (it + includes itself), the "extend" applies, so that the "</a>" of a nested + region only ends that region, and not the one it is contained in. + + *:syn-excludenl* + When a pattern for a match or end pattern of a region includes a '$' + to match the end-of-line, it will make a region item that it is + contained in continue on the next line. For example, a match with + "\\$" (backslash at the end of the line) can make a region continue + that would normally stop at the end of the line. This is the default + behavior. If this is not wanted, there are two ways to avoid it: + 1. Use "keepend" for the containing item. This will keep all + contained matches from extending the match or region. It can be + used when all contained items must not extend the containing item. + 2. Use "excludenl" in the contained item. This will keep that match + from extending the containing match or region. It can be used if + only some contained items must not extend the containing item. + "excludenl" must be given before the pattern it applies to. + + *:syn-matchgroup* + "matchgroup" can be used to highlight the start and/or end pattern + differently than the body of the region. Example: > + :syntax region String matchgroup=Quote start=+"+ skip=+\\"+ end=+"+ +< This will highlight the quotes with the "Quote" group, and the text in + between with the "String" group. + The "matchgroup" is used for all start and end patterns that follow, + until the next "matchgroup". Use "matchgroup=NONE" to go back to not + using a matchgroup. + + In a start or end pattern that is highlighted with "matchgroup" the + contained items of the region are not used. This can be used to avoid + that a contained item matches in the start or end pattern match. When + using "transparent", this does not apply to a start or end pattern + match that is highlighted with "matchgroup". + + Here is an example, which highlights three levels of parentheses in + different colors: > + :sy region par1 matchgroup=par1 start=/(/ end=/)/ contains=par2 + :sy region par2 matchgroup=par2 start=/(/ end=/)/ contains=par3 contained + :sy region par3 matchgroup=par3 start=/(/ end=/)/ contains=par1 contained + :hi par1 ctermfg=red guifg=red + :hi par2 ctermfg=blue guifg=blue + :hi par3 ctermfg=darkgreen guifg=darkgreen + +============================================================================== +6. :syntax arguments *:syn-arguments* + +The :syntax commands that define syntax items take a number of arguments. +The common ones are explained here. The arguments may be given in any order +and may be mixed with patterns. + +Not all commands accept all arguments. This table shows which arguments +can not be used for all commands: + *E395* *E396* + contains oneline fold display extend ~ +:syntax keyword - - - - - +:syntax match yes - yes yes yes +:syntax region yes yes yes yes yes + +These arguments can be used for all three commands: + contained + containedin + nextgroup + transparent + skipwhite + skipnl + skipempty + + +contained *:syn-contained* + +When the "contained" argument is given, this item will not be recognized at +the top level, but only when it is mentioned in the "contains" field of +another match. Example: > + :syntax keyword Todo TODO contained + :syntax match Comment "//.*" contains=Todo + + +display *:syn-display* + +If the "display" argument is given, this item will be skipped when the +detected highlighting will not be displayed. This will speed up highlighting, +by skipping this item when only finding the syntax state for the text that is +to be displayed. + +Generally, you can use "display" for match and region items that meet these +conditions: +- The item does not continue past the end of a line. Example for C: A region + for a "/*" comment can't contain "display", because it continues on the next + line. +- The item does not contain items that continue past the end of the line or + make it continue on the next line. +- The item does not change the size of any item it is contained in. Example + for C: A match with "\\$" in a preprocessor match can't have "display", + because it may make that preprocessor match shorter. +- The item does not allow other items to match that didn't match otherwise, + and that item may extend the match too far. Example for C: A match for a + "//" comment can't use "display", because a "/*" inside that comment would + match then and start a comment which extends past the end of the line. + +Examples, for the C language, where "display" can be used: +- match with a number +- match with a label + + +transparent *:syn-transparent* + +If the "transparent" argument is given, this item will not be highlighted +itself, but will take the highlighting of the item it is contained in. This +is useful for syntax items that don't need any highlighting but are used +only to skip over a part of the text. + +The "contains=" argument is also inherited from the item it is contained in, +unless a "contains" argument is given for the transparent item itself. To +avoid that unwanted items are contained, use "contains=NONE". Example, which +highlights words in strings, but makes an exception for "vim": > + :syn match myString /'[^']*'/ contains=myWord,myVim + :syn match myWord /\<[a-z]*\>/ contained + :syn match myVim /\<vim\>/ transparent contained contains=NONE + :hi link myString String + :hi link myWord Comment +Since the "myVim" match comes after "myWord" it is the preferred match (last +match in the same position overrules an earlier one). The "transparent" +argument makes the "myVim" match use the same highlighting as "myString". But +it does not contain anything. If the "contains=NONE" argument would be left +out, then "myVim" would use the contains argument from myString and allow +"myWord" to be contained, which will be highlighted as a Constant. This +happens because a contained match doesn't match inside itself in the same +position, thus the "myVim" match doesn't overrule the "myWord" match here. + +When you look at the colored text, it is like looking at layers of contained +items. The contained item is on top of the item it is contained in, thus you +see the contained item. When a contained item is transparent, you can look +through, thus you see the item it is contained in. In a picture: + + look from here + + | | | | | | + V V V V V V + + xxxx yyy more contained items + .................... contained item (transparent) + ============================= first item + +The 'x', 'y' and '=' represent a highlighted syntax item. The '.' represent a +transparent group. + +What you see is: + + =======xxxx=======yyy======== + +Thus you look through the transparent "....". + + +oneline *:syn-oneline* + +The "oneline" argument indicates that the region does not cross a line +boundary. It must match completely in the current line. However, when the +region has a contained item that does cross a line boundary, it continues on +the next line anyway. A contained item can be used to recognize a line +continuation pattern. But the "end" pattern must still match in the first +line, otherwise the region doesn't even start. + +When the start pattern includes a "\n" to match an end-of-line, the end +pattern must be found in the same line as where the start pattern ends. The +end pattern may also include an end-of-line. Thus the "oneline" argument +means that the end of the start pattern and the start of the end pattern must +be within one line. This can't be changed by a skip pattern that matches a +line break. + + +fold *:syn-fold* + +The "fold" argument makes the fold level increased by one for this item. +Example: > + :syn region myFold start="{" end="}" transparent fold + :syn sync fromstart + :set foldmethod=syntax +This will make each {} block form one fold. + +The fold will start on the line where the item starts, and end where the item +ends. If the start and end are within the same line, there is no fold. +The 'foldnestmax' option limits the nesting of syntax folds. +{not available when Vim was compiled without |+folding| feature} + + + *:syn-contains* *E405* *E406* *E407* *E408* *E409* +contains={groupname},.. + +The "contains" argument is followed by a list of syntax group names. These +groups will be allowed to begin inside the item (they may extend past the +containing group's end). This allows for recursive nesting of matches and +regions. If there is no "contains" argument, no groups will be contained in +this item. The group names do not need to be defined before they can be used +here. + +contains=ALL + If the only item in the contains list is "ALL", then all + groups will be accepted inside the item. + +contains=ALLBUT,{group-name},.. + If the first item in the contains list is "ALLBUT", then all + groups will be accepted inside the item, except the ones that + are listed. Example: > + :syntax region Block start="{" end="}" ... contains=ALLBUT,Function + +contains=TOP + If the first item in the contains list is "TOP", then all + groups will be accepted that don't have the "contained" + argument. +contains=TOP,{group-name},.. + Like "TOP", but excluding the groups that are listed. + +contains=CONTAINED + If the first item in the contains list is "CONTAINED", then + all groups will be accepted that have the "contained" + argument. +contains=CONTAINED,{group-name},.. + Like "CONTAINED", but excluding the groups that are + listed. + + +The {group-name} in the "contains" list can be a pattern. All group names +that match the pattern will be included (or excluded, if "ALLBUT" is used). +The pattern cannot contain white space or a ','. Example: > + ... contains=Comment.*,Keyw[0-3] +The matching will be done at moment the syntax command is executed. Groups +that are defined later will not be matched. Also, if the current syntax +command defines a new group, it is not matched. Be careful: When putting +syntax commands in a file you can't rely on groups NOT being defined, because +the file may have been sourced before, and ":syn clear" doesn't remove the +group names. + +The contained groups will also match in the start and end patterns of a +region. If this is not wanted, the "matchgroup" argument can be used +|:syn-matchgroup|. The "ms=" and "me=" offsets can be used to change the +region where contained items do match. Note that this may also limit the +area that is highlighted + + +containedin={groupname}... *:syn-containedin* + +The "containedin" argument is followed by a list of syntax group names. The +item will be allowed to begin inside these groups. This works as if the +containing item has a "contains=" argument that includes this item. + +The {groupname}... can be used just like for "contains", as explained above. + +This is useful when adding a syntax item afterwards. An item can be told to +be included inside an already existing item, without changing the definition +of that item. For example, to highlight a word in a C comment after loading +the C syntax: > + :syn keyword myword HELP containedin=cComment contained +Note that "contained" is also used, to avoid that the item matches at the top +level. + +Matches for "containedin" are added to the other places where the item can +appear. A "contains" argument may also be added as usual. Don't forget that +keywords never contain another item, thus adding them to "containedin" won't +work. + + +nextgroup={groupname},.. *:syn-nextgroup* + +The "nextgroup" argument is followed by a list of syntax group names, +separated by commas (just like with "contains", so you can also use patterns). + +If the "nextgroup" argument is given, the mentioned syntax groups will be +tried for a match, after the match or region ends. If none of the groups have +a match, highlighting continues normally. If there is a match, this group +will be used, even when it is not mentioned in the "contains" field of the +current group. This is like giving the mentioned group priority over all +other groups. Example: > + :syntax match ccFoobar "Foo.\{-}Bar" contains=ccFoo + :syntax match ccFoo "Foo" contained nextgroup=ccFiller + :syntax region ccFiller start="." matchgroup=ccBar end="Bar" contained + +This will highlight "Foo" and "Bar" differently, and only when there is a +"Bar" after "Foo". In the text line below, "f" shows where ccFoo is used for +highlighting, and "bbb" where ccBar is used. > + + Foo asdfasd Bar asdf Foo asdf Bar asdf + fff bbb fff bbb + +Note the use of ".\{-}" to skip as little as possible until the next Bar. +when ".*" would be used, the "asdf" in between "Bar" and "Foo" would be +highlighted according to the "ccFoobar" group, because the ccFooBar match +would include the first "Foo" and the last "Bar" in the line (see |pattern|). + + +skipwhite *:syn-skipwhite* +skipnl *:syn-skipnl* +skipempty *:syn-skipempty* + +These arguments are only used in combination with "nextgroup". They can be +used to allow the next group to match after skipping some text: + skipwhite skip over space and Tab characters + skipnl skip over the end of a line + skipempty skip over empty lines (implies a "skipnl") + +When "skipwhite" is present, the white space is only skipped if there is no +next group that matches the white space. + +When "skipnl" is present, the match with nextgroup may be found in the next +line. This only happens when the current item ends at the end of the current +line! When "skipnl" is not present, the nextgroup will only be found after +the current item in the same line. + +When skipping text while looking for a next group, the matches for other +groups are ignored. Only when no next group matches, other items are tried +for a match again. This means that matching a next group and skipping white +space and <EOL>s has a higher priority than other items. + +Example: > + :syn match ifstart "\<if.*" nextgroup=ifline skipwhite skipempty + :syn match ifline "[^ \t].*" nextgroup=ifline skipwhite skipempty contained + :syn match ifline "endif" contained +Note that the "[^ \t].*" match matches all non-white text. Thus it would also +match "endif". Therefore the "endif" match is put last, so that it takes +precedence. +Note that this example doesn't work for nested "if"s. You need to add +"contains" arguments to make that work (omitted for simplicity of the +example). + +============================================================================== +7. Syntax patterns *:syn-pattern* *E401* *E402* + +In the syntax commands, a pattern must be surrounded by two identical +characters. This is like it works for the ":s" command. The most common to +use is the double quote. But if the pattern contains a double quote, you can +use another character that is not used in the pattern. Examples: > + :syntax region Comment start="/\*" end="\*/" + :syntax region String start=+"+ end=+"+ skip=+\\"+ + +See |pattern| for the explanation of what a pattern is. Syntax patterns are +always interpreted like the 'magic' options is set, no matter what the actual +value of 'magic' is. And the patterns are interpreted like the 'l' flag is +not included in 'cpoptions'. This was done to make syntax files portable and +independent of 'compatible' and 'magic' settings. + +Try to avoid patterns that can match an empty string, such as "[a-z]*". +This slows down the highlighting a lot, because it matches everywhere. + + *:syn-pattern-offset* +The pattern can be followed by a character offset. This can be used to +change the highlighted part, and to change the text area included in the +match or region (which only matters when trying to match other items). Both +are relative to the matched pattern. The character offset for a skip +pattern can be used to tell where to continue looking for an end pattern. + +The offset takes the form of "{what}={offset}" +The {what} can be one of seven strings: + +ms Match Start offset for the start of the matched text +me Match End offset for the end of the matched text +hs Highlight Start offset for where the highlighting starts +he Highlight End offset for where the highlighting ends +rs Region Start offset for where the body of a region starts +re Region End offset for where the body of a region ends +lc Leading Context offset past "leading context" of pattern + +The {offset} can be: + +s start of the matched pattern +s+{nr} start of the matched pattern plus {nr} chars to the right +s-{nr} start of the matched pattern plus {nr} chars to the left +e end of the matched pattern +e+{nr} end of the matched pattern plus {nr} chars to the right +e-{nr} end of the matched pattern plus {nr} chars to the left +{nr} (for "lc" only): start matching {nr} chars to the left + +Examples: "ms=s+1", "hs=e-2", "lc=3". + +Although all offsets are accepted after any pattern, they are not always +meaningful. This table shows which offsets are actually used: + + ms me hs he rs re lc ~ +match item yes yes yes yes - - yes +region item start yes - yes - yes - yes +region item skip - yes - - - - yes +region item end - yes - yes - yes yes + +Offsets can be concatenated, with a ',' in between. Example: > + :syn match String /"[^"]*"/hs=s+1,he=e-1 +< + some "string" text + ^^^^^^ highlighted + +Notes: +- There must be no white space between the pattern and the character + offset(s). +- The highlighted area will never be outside of the matched text. +- A negative offset for an end pattern may not always work, because the end + pattern may be detected when the highlighting should already have stopped. +- The start of a match cannot be in a line other than where the pattern + matched. This doesn't work: "a\nb"ms=e. You can make the highlighting + start in another line, this does work: "a\nb"hs=e. + +Example (match a comment but don't highlight the /* and */): > + :syntax region Comment start="/\*"hs=e+1 end="\*/"he=s-1 +< + /* this is a comment */ + ^^^^^^^^^^^^^^^^^^^ highlighted + +A more complicated Example: > + :syn region Exa matchgroup=Foo start="foo"hs=s+2,rs=e+2 matchgroup=Bar end="bar"me=e-1,he=e-1,re=s-1 +< + abcfoostringbarabc + mmmmmmmmmmm match + sssrrreee highlight start/region/end ("Foo", "Exa" and "Bar") + +Leading context *:syn-lc* *:syn-leading* *:syn-context* + +Note: This is an obsolete feature, only included for backwards compatibility +with previous Vim versions. It's now recommended to use the |/\@<=| construct +in the pattern. + +The "lc" offset specifies leading context -- a part of the pattern that must +be present, but is not considered part of the match. An offset of "lc=n" will +cause Vim to step back n columns before attempting the pattern match, allowing +characters which have already been matched in previous patterns to also be +used as leading context for this match. This can be used, for instance, to +specify that an "escaping" character must not precede the match: > + + :syn match ZNoBackslash "[^\\]z"ms=s+1 + :syn match WNoBackslash "[^\\]w"lc=1 + :syn match Underline "_\+" +< + ___zzzz ___wwww + ^^^ ^^^ matches Underline + ^ ^ matches ZNoBackslash + ^^^^ matches WNoBackslash + +The "ms" offset is automatically set to the same value as the "lc" offset, +unless you set "ms" explicitly. + + +Multi-line patterns *:syn-multi-line* + +The patterns can include "\n" to match an end-of-line. Mostly this works as +expected, but there are a few exceptions. + +When using a start pattern with an offset, the start of the match is not +allowed to start in a following line. The highlighting can start in a +following line though. + +The skip pattern can include the "\n", but the search for an end pattern will +continue in the first character of the next line, also when that character is +matched by the skip pattern. This is because redrawing may start in any line +halfway a region and there is no check if the skip pattern started in a +previous line. For example, if the skip pattern is "a\nb" and an end pattern +is "b", the end pattern does match in the second line of this: > + x x a + b x x +Generally this means that the skip pattern should not match any characters +after the "\n". + + +External matches *:syn-ext-match* + +These extra regular expression items are available in region patterns: + + */\z(* */\z(\)* *E50* *E52* + \z(\) Marks the sub-expression as "external", meaning that it is can + be accessed from another pattern match. Currently only usable + in defining a syntax region start pattern. + + */\z1* */\z2* */\z3* */\z4* */\z5* + \z1 ... \z9 */\z6* */\z7* */\z8* */\z9* *E66* *E67* + Matches the same string that was matched by the corresponding + sub-expression in a previous start pattern match. + +Sometimes the start and end patterns of a region need to share a common +sub-expression. A common example is the "here" document in Perl and many Unix +shells. This effect can be achieved with the "\z" special regular expression +items, which marks a sub-expression as "external", in the sense that it can be +referenced from outside the pattern in which it is defined. The here-document +example, for instance, can be done like this: > + :syn region hereDoc start="<<\z(\I\i*\)" end="^\z1$" + +As can be seen here, the \z actually does double duty. In the start pattern, +it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it +changes the \1 back-reference into an external reference referring to the +first external sub-expression in the start pattern. External references can +also be used in skip patterns: > + :syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1" + +Note that normal and external sub-expressions are completely orthogonal and +indexed separately; for instance, if the pattern "\z(..\)\(..\)" is applied +to the string "aabb", then \1 will refer to "bb" and \z1 will refer to "aa". +Note also that external sub-expressions cannot be accessed as back-references +within the same pattern like normal sub-expressions. If you want to use one +sub-expression as both a normal and an external sub-expression, you can nest +the two, as in "\(\z(...\)\)". + +Note that only matches within a single line can be used. Multi-line matches +cannot be referred to. + +============================================================================== +8. Syntax clusters *:syn-cluster* *E400* + +:sy[ntax] cluster {cluster-name} [contains={group-name}..] + [add={group-name}..] + [remove={group-name}..] + +This command allows you to cluster a list of syntax groups together under a +single name. + + contains={group-name}.. + The cluster is set to the specified list of groups. + add={group-name}.. + The specified groups are added to the cluster. + remove={group-name}.. + The specified groups are removed from the cluster. + +A cluster so defined may be referred to in a contains=.., nextgroup=.., add=.. +or remove=.. list with a "@" prefix. You can also use this notation to +implicitly declare a cluster before specifying its contents. + +Example: > + :syntax match Thing "# [^#]\+ #" contains=@ThingMembers + :syntax cluster ThingMembers contains=ThingMember1,ThingMember2 + +As the previous example suggests, modifications to a cluster are effectively +retroactive; the membership of the cluster is checked at the last minute, so +to speak: > + :syntax keyword A aaa + :syntax keyword B bbb + :syntax cluster AandB contains=A + :syntax match Stuff "( aaa bbb )" contains=@AandB + :syntax cluster AandB add=B " now both keywords are matched in Stuff + +This also has implications for nested clusters: > + :syntax keyword A aaa + :syntax keyword B bbb + :syntax cluster SmallGroup contains=B + :syntax cluster BigGroup contains=A,@SmallGroup + :syntax match Stuff "( aaa bbb )" contains=@BigGroup + :syntax cluster BigGroup remove=B " no effect, since B isn't in BigGroup + :syntax cluster SmallGroup remove=B " now bbb isn't matched within Stuff + +============================================================================== +9. Including syntax files *:syn-include* *E397* + +It is often useful for one language's syntax file to include a syntax file for +a related language. Depending on the exact relationship, this can be done in +two different ways: + + - If top-level syntax items in the included syntax file are to be + allowed at the top level in the including syntax, you can simply use + the |:runtime| command: > + + " In cpp.vim: + :runtime! syntax/c.vim + :unlet b:current_syntax + +< - If top-level syntax items in the included syntax file are to be + contained within a region in the including syntax, you can use the + ":syntax include" command: + +:sy[ntax] include [@{grouplist-name}] {file-name} + + All syntax items declared in the included file will have the + "contained" flag added. In addition, if a group list is specified, + all top-level syntax items in the included file will be added to + that list. > + + " In perl.vim: + :syntax include @Pod <sfile>:p:h/pod.vim + :syntax region perlPOD start="^=head" end="^=cut" contains=@Pod +< + When {file-name} is an absolute path (starts with "/", "c:", "$VAR" + or "<sfile>") that file is sourced. When it is a relative path + (e.g., "syntax/pod.vim") the file is searched for in 'runtimepath'. + All matching files are loaded. Using a relative path is + recommended, because it allows a user to replace the included file + with his own version, without replacing the file that does the ":syn + include". + +============================================================================== +10. Synchronizing *:syn-sync* *E403* *E404* + +Vim wants to be able to start redrawing in any position in the document. To +make this possible it needs to know the syntax state at the position where +redrawing starts. + +:sy[ntax] sync [ccomment [group-name] | minlines={N} | ...] + +There are four ways to synchronize: +1. Always parse from the start of the file. + |:syn-sync-first| +2. Based on C-style comments. Vim understands how C-comments work and can + figure out if the current line starts inside or outside a comment. + |:syn-sync-second| +3. Jumping back a certain number of lines and start parsing there. + |:syn-sync-third| +4. Searching backwards in the text for a pattern to sync on. + |:syn-sync-fourth| + + *:syn-sync-maxlines* *:syn-sync-minlines* +For the last three methods, the line range where the parsing can start is +limited by "minlines" and "maxlines". + +If the "minlines={N}" argument is given, the parsing always starts at least +that many lines backwards. This can be used if the parsing may take a few +lines before it's correct, or when it's not possible to use syncing. + +If the "maxlines={N}" argument is given, the number of lines that are searched +for a comment or syncing pattern is restricted to N lines backwards (after +adding "minlines"). This is useful if you have few things to sync on and a +slow machine. Example: > + :syntax sync ccomment maxlines=500 +< + *:syn-sync-linebreaks* +When using a pattern that matches multiple lines, a change in one line may +cause a pattern to no longer match in a previous line. This means has to +start above where the change was made. How many lines can be specified with +the "linebreaks" argument. For example, when a pattern may include one line +break use this: > + :syntax sync linebreaks=1 +The result is that redrawing always starts at least one line before where a +change was made. The default value for "linebreaks" is zero. Usually the +value for "minlines" is bigger than "linebreaks". + + +First syncing method: *:syn-sync-first* +> + :syntax sync fromstart + +The file will be parsed from the start. This makes syntax highlighting +accurate, but can be slow for long files. Vim caches previously parsed text, +so that it's only slow when parsing the text for the first time. However, +when making changes some part of the next needs to be parsed again (worst +case: to the end of the file). + +Using "fromstart" is equivalent to using "minlines" with a very large number. + + +Second syncing method: *:syn-sync-second* *:syn-sync-ccomment* + +For the second method, only the "ccomment" argument needs to be given. +Example: > + :syntax sync ccomment + +When Vim finds that the line where displaying starts is inside a C-style +comment, the last region syntax item with the group-name "Comment" will be +used. This requires that there is a region with the group-name "Comment"! +An alternate group name can be specified, for example: > + :syntax sync ccomment javaComment +This means that the last item specified with "syn region javaComment" will be +used for the detected C comment region. This only works properly if that +region does have a start pattern "\/*" and an end pattern "*\/". + +The "maxlines" argument can be used to restrict the search to a number of +lines. The "minlines" argument can be used to at least start a number of +lines back (e.g., for when there is some construct that only takes a few +lines, but it hard to sync on). + +Note: Syncing on a C comment doesn't work properly when strings are used +that cross a line and contain a "*/". Since letting strings cross a line +is a bad programming habit (many compilers give a warning message), and the +chance of a "*/" appearing inside a comment is very small, this restriction +is hardly ever noticed. + + +Third syncing method: *:syn-sync-third* + +For the third method, only the "minlines={N}" argument needs to be given. +Vim will subtract {N} from the line number and start parsing there. This +means {N} extra lines need to be parsed, which makes this method a bit slower. +Example: > + :syntax sync minlines=50 + +"lines" is equivalent to "minlines" (used by older versions). + + +Fourth syncing method: *:syn-sync-fourth* + +The idea is to synchronize on the end of a few specific regions, called a +sync pattern. Only regions can cross lines, so when we find the end of some +region, we might be able to know in which syntax item we are. The search +starts in the line just above the one where redrawing starts. From there +the search continues backwards in the file. + +This works just like the non-syncing syntax items. You can use contained +matches, nextgroup, etc. But there are a few differences: +- Keywords cannot be used. +- The syntax items with the "sync" keyword form a completely separated group + of syntax items. You can't mix syncing groups and non-syncing groups. +- The matching works backwards in the buffer (line by line), instead of + forwards. +- A line continuation pattern can be given. It is used to decide which group + of lines need to be searched like they were one line. This means that the + search for a match with the specified items starts in the first of the + consecutive that contain the continuation pattern. +- When using "nextgroup" or "contains", this only works within one line (or + group of continued lines). +- When using a region, it must start and end in the same line (or group of + continued lines). Otherwise the end is assumed to be at the end of the + line (or group of continued lines). +- When a match with a sync pattern is found, the rest of the line (or group of + continued lines) is searched for another match. The last match is used. + This is used when a line can contain both the start end the end of a region + (e.g., in a C-comment like /* this */, the last "*/" is used). + +There are two ways how a match with a sync pattern can be used: +1. Parsing for highlighting starts where redrawing starts (and where the + search for the sync pattern started). The syntax group that is expected + to be valid there must be specified. This works well when the regions + that cross lines cannot contain other regions. +2. Parsing for highlighting continues just after the match. The syntax group + that is expected to be present just after the match must be specified. + This can be used when the previous method doesn't work well. It's much + slower, because more text needs to be parsed. +Both types of sync patterns can be used at the same time. + +Besides the sync patterns, other matches and regions can be specified, to +avoid finding unwanted matches. + +[The reason that the sync patterns are given separately, is that mostly the +search for the sync point can be much simpler than figuring out the +highlighting. The reduced number of patterns means it will go (much) +faster.] + + *syn-sync-grouphere* *E393* *E394* + :syntax sync match {sync-group-name} grouphere {group-name} "pattern" .. + + Define a match that is used for syncing. {group-name} is the + name of a syntax group that follows just after the match. Parsing + of the text for highlighting starts just after the match. A region + must exist for this {group-name}. The first one defined will be used. + "NONE" can be used for when there is no syntax group after the match. + + *syn-sync-groupthere* + :syntax sync match {sync-group-name} groupthere {group-name} "pattern" .. + + Like "grouphere", but {group-name} is the name of a syntax group that + is to be used at the start of the line where searching for the sync + point started. The text between the match and the start of the sync + pattern searching is assumed not to change the syntax highlighting. + For example, in C you could search backwards for "/*" and "*/". If + "/*" is found first, you know that you are inside a comment, so the + "groupthere" is "cComment". If "*/" is found first, you know that you + are not in a comment, so the "groupthere" is "NONE". (in practice + it's a bit more complicated, because the "/*" and "*/" could appear + inside a string. That's left as an exercise to the reader...). + + :syntax sync match .. + :syntax sync region .. + + Without a "groupthere" argument. Define a region or match that is + skipped while searching for a sync point. + + *syn-sync-linecont* + :syntax sync linecont {pattern} + + When {pattern} matches in a line, it is considered to continue in + the next line. This means that the search for a sync point will + consider the lines to be concatenated. + +If the "maxlines={N}" argument is given too, the number of lines that are +searched for a match is restricted to N. This is useful if you have very +few things to sync on and a slow machine. Example: > + :syntax sync maxlines=100 + +You can clear all sync settings with: > + :syntax sync clear + +You can clear specific sync patterns with: > + :syntax sync clear {sync-group-name} .. + +============================================================================== +11. Listing syntax items *:syntax* *:sy* *:syn* *:syn-list* + +This command lists all the syntax items: > + + :sy[ntax] [list] + +To show the syntax items for one syntax group: > + + :sy[ntax] list {group-name} + +To list the syntax groups in one cluster: *E392* > + + :sy[ntax] list @{cluster-name} + +See above for other arguments for the ":syntax" command. + +Note that the ":syntax" command can be abbreviated to ":sy", although ":syn" +is mostly used, because it looks better. + +============================================================================== +12. Highlight command *:highlight* *:hi* *E28* *E411* *E415* + +There are three types of highlight groups: +- The ones used for specific languages. For these the name starts with the + name of the language. Many of these don't have any attributes, but are + linked to a group of the second type. +- The ones used for all syntax languages. +- The ones used for the 'highlight' option. + *hitest.vim* +You can see all the groups currently active with this command: > + :so $VIMRUNTIME/syntax/hitest.vim +This will open a new window containing all highlight group names, displayed +in their own color. + + *:colo* *:colorscheme* *E185* +:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' + for the file "colors/{name}.vim. The first one that + is found is loaded. + To see the name of the currently active color scheme + (if there is one): > + :echo g:colors_name +< Doesn't work recursively, thus you can't use + ":colorscheme" in a color scheme script. + After the color scheme has been loaded the + |ColorScheme| autocommand event is triggered. + For info about writing a colorscheme file: > + :edit $VIMRUNTIME/colors/README.txt + +:hi[ghlight] List all the current highlight groups that have + attributes set. + +:hi[ghlight] {group-name} + List one highlight group. + +:hi[ghlight] clear Reset all highlighting to the defaults. Removes all + highlighting for groups added by the user! + Uses the current value of 'background' to decide which + default colors to use. + +:hi[ghlight] clear {group-name} +:hi[ghlight] {group-name} NONE + Disable the highlighting for one highlight group. It + is _not_ set back to the default colors. + +:hi[ghlight] [default] {group-name} {key}={arg} .. + Add a highlight group, or change the highlighting for + an existing group. + See |highlight-args| for the {key}={arg} arguments. + See |:highlight-default| for the optional [default] + argument. + +Normally a highlight group is added once when starting up. This sets the +default values for the highlighting. After that, you can use additional +highlight commands to change the arguments that you want to set to non-default +values. The value "NONE" can be used to switch the value off or go back to +the default value. + +A simple way to change colors is with the |:colorscheme| command. This loads +a file with ":highlight" commands such as this: > + + :hi Comment gui=bold + +Note that all settings that are not included remain the same, only the +specified field is used, and settings are merged with previous ones. So, the +result is like this single command has been used: > + :hi Comment term=bold ctermfg=Cyan guifg=#80a0ff gui=bold +< + *:highlight-verbose* +When listing a highlight group and 'verbose' is non-zero, the listing will +also tell where it was last set. Example: > + :verbose hi Comment +< Comment xxx term=bold ctermfg=4 guifg=Blue ~ + Last set from /home/mool/vim/vim7/runtime/syntax/syncolor.vim ~ + +When ":hi clear" is used then the script where this command is used will be +mentioned for the default values. See |:verbose-cmd| for more information. + + *highlight-args* *E416* *E417* *E423* +There are three types of terminals for highlighting: +term a normal terminal (vt100, xterm) +cterm a color terminal (MS-DOS console, color-xterm, these have the "Co" + termcap entry) +gui the GUI + +For each type the highlighting can be given. This makes it possible to use +the same syntax file on all terminals, and use the optimal highlighting. + +1. highlight arguments for normal terminals + + *bold* *underline* *undercurl* + *inverse* *italic* *standout* +term={attr-list} *attr-list* *highlight-term* *E418* + attr-list is a comma separated list (without spaces) of the + following items (in any order): + bold + underline + undercurl not always available + reverse + inverse same as reverse + italic + standout + NONE no attributes used (used to reset it) + + Note that "bold" can be used here and by using a bold font. They + have the same effect. + "undercurl" is a curly underline. When "undercurl" is not possible + then "underline" is used. In general "undercurl" is only available in + the GUI. The color is set with |highlight-guisp|. + +start={term-list} *highlight-start* *E422* +stop={term-list} *term-list* *highlight-stop* + These lists of terminal codes can be used to get + non-standard attributes on a terminal. + + The escape sequence specified with the "start" argument + is written before the characters in the highlighted + area. It can be anything that you want to send to the + terminal to highlight this area. The escape sequence + specified with the "stop" argument is written after the + highlighted area. This should undo the "start" argument. + Otherwise the screen will look messed up. + + The {term-list} can have two forms: + + 1. A string with escape sequences. + This is any string of characters, except that it can't start with + "t_" and blanks are not allowed. The <> notation is recognized + here, so you can use things like "<Esc>" and "<Space>". Example: + start=<Esc>[27h;<Esc>[<Space>r; + + 2. A list of terminal codes. + Each terminal code has the form "t_xx", where "xx" is the name of + the termcap entry. The codes have to be separated with commas. + White space is not allowed. Example: + start=t_C1,t_BL + The terminal codes must exist for this to work. + + +2. highlight arguments for color terminals + +cterm={attr-list} *highlight-cterm* + See above for the description of {attr-list} |attr-list|. + The "cterm" argument is likely to be different from "term", when + colors are used. For example, in a normal terminal comments could + be underlined, in a color terminal they can be made Blue. + Note: Many terminals (e.g., DOS console) can't mix these attributes + with coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=". + +ctermfg={color-nr} *highlight-ctermfg* *E421* +ctermbg={color-nr} *highlight-ctermbg* + The {color-nr} argument is a color number. Its range is zero to + (not including) the number given by the termcap entry "Co". + The actual color with this number depends on the type of terminal + and its settings. Sometimes the color also depends on the settings of + "cterm". For example, on some systems "cterm=bold ctermfg=3" gives + another color, on others you just get color 3. + + For an xterm this depends on your resources, and is a bit + unpredictable. See your xterm documentation for the defaults. The + colors for a color-xterm can be changed from the .Xdefaults file. + Unfortunately this means that it's not possible to get the same colors + for each user. See |xterm-color| for info about color xterms. + + The MSDOS standard colors are fixed (in a console window), so these + have been used for the names. But the meaning of color names in X11 + are fixed, so these color settings have been used, to make the + highlighting settings portable (complicated, isn't it?). The + following names are recognized, with the color number used: + + *cterm-colors* + NR-16 NR-8 COLOR NAME ~ + 0 0 Black + 1 4 DarkBlue + 2 2 DarkGreen + 3 6 DarkCyan + 4 1 DarkRed + 5 5 DarkMagenta + 6 3 Brown, DarkYellow + 7 7 LightGray, LightGrey, Gray, Grey + 8 0* DarkGray, DarkGrey + 9 4* Blue, LightBlue + 10 2* Green, LightGreen + 11 6* Cyan, LightCyan + 12 1* Red, LightRed + 13 5* Magenta, LightMagenta + 14 3* Yellow, LightYellow + 15 7* White + + The number under "NR-16" is used for 16-color terminals ('t_Co' + greater than or equal to 16). The number under "NR-8" is used for + 8-color terminals ('t_Co' less than 16). The '*' indicates that the + bold attribute is set for ctermfg. In many 8-color terminals (e.g., + "linux"), this causes the bright colors to appear. This doesn't work + for background colors! Without the '*' the bold attribute is removed. + If you want to set the bold attribute in a different way, put a + "cterm=" argument AFTER the "ctermfg=" or "ctermbg=" argument. Or use + a number instead of a color name. + + The case of the color names is ignored. + Note that for 16 color ansi style terminals (including xterms), the + numbers in the NR-8 column is used. Here '*' means 'add 8' so that Blue + is 12, DarkGray is 8 etc. + + Note that for some color terminals these names may result in the wrong + colors! + + *:hi-normal-cterm* + When setting the "ctermfg" or "ctermbg" colors for the Normal group, + these will become the colors used for the non-highlighted text. + Example: > + :highlight Normal ctermfg=grey ctermbg=darkblue +< When setting the "ctermbg" color for the Normal group, the + 'background' option will be adjusted automatically. This causes the + highlight groups that depend on 'background' to change! This means + you should set the colors for Normal first, before setting other + colors. + When a colorscheme is being used, changing 'background' causes it to + be reloaded, which may reset all colors (including Normal). First + delete the "colors_name" variable when you don't want this. + + When you have set "ctermfg" or "ctermbg" for the Normal group, Vim + needs to reset the color when exiting. This is done with the "op" + termcap entry |t_op|. If this doesn't work correctly, try setting the + 't_op' option in your .vimrc. + *E419* *E420* + When Vim knows the normal foreground and background colors, "fg" and + "bg" can be used as color names. This only works after setting the + colors for the Normal group and for the MS-DOS console. Example, for + reverse video: > + :highlight Visual ctermfg=bg ctermbg=fg +< Note that the colors are used that are valid at the moment this + command are given. If the Normal group colors are changed later, the + "fg" and "bg" colors will not be adjusted. + + +3. highlight arguments for the GUI + +gui={attr-list} *highlight-gui* + These give the attributes to use in the GUI mode. + See |attr-list| for a description. + Note that "bold" can be used here and by using a bold font. They + have the same effect. + Note that the attributes are ignored for the "Normal" group. + +font={font-name} *highlight-font* + font-name is the name of a font, as it is used on the system Vim + runs on. For X11 this is a complicated name, for example: > + font=-misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1 +< + The font-name "NONE" can be used to revert to the default font. + When setting the font for the "Normal" group, this becomes the default + font (until the 'guifont' option is changed; the last one set is + used). + The following only works with Motif and Athena, not with other GUIs: + When setting the font for the "Menu" group, the menus will be changed. + When setting the font for the "Tooltip" group, the tooltips will be + changed. + All fonts used, except for Menu and Tooltip, should be of the same + character size as the default font! Otherwise redrawing problems will + occur. + +guifg={color-name} *highlight-guifg* +guibg={color-name} *highlight-guibg* +guisp={color-name} *highlight-guisp* + These give the foreground (guifg), background (guibg) and special + (guisp) color to use in the GUI. "guisp" is used for undercurl. + There are a few special names: + NONE no color (transparent) + bg use normal background color + background use normal background color + fg use normal foreground color + foreground use normal foreground color + To use a color name with an embedded space or other special character, + put it in single quotes. The single quote cannot be used then. + Example: > + :hi comment guifg='salmon pink' +< + *gui-colors* + Suggested color names (these are available on most systems): + Red LightRed DarkRed + Green LightGreen DarkGreen SeaGreen + Blue LightBlue DarkBlue SlateBlue + Cyan LightCyan DarkCyan + Magenta LightMagenta DarkMagenta + Yellow LightYellow Brown DarkYellow + Gray LightGray DarkGray + Black White + Orange Purple Violet + + In the Win32 GUI version, additional system colors are available. See + |win32-colors|. + + You can also specify a color by its Red, Green and Blue values. + The format is "#rrggbb", where + "rr" is the Red value + "gg" is the Green value + "bb" is the Blue value + All values are hexadecimal, range from "00" to "ff". Examples: > + :highlight Comment guifg=#11f0c3 guibg=#ff00ff +< + *highlight-groups* *highlight-default* +These are the default highlighting groups. These groups are used by the +'highlight' option default. Note that the highlighting depends on the value +of 'background'. You can see the current settings with the ":highlight" +command. + *hl-Cursor* +Cursor the character under the cursor + *hl-CursorIM* +CursorIM like Cursor, but used when in IME mode |CursorIM| + *hl-CursorColumn* +CursorColumn the screen column that the cursor is in when 'cursorcolumn' is + set + *hl-CursorLine* +CursorLine the screen line that the cursor is in when 'cursorline' is + set + *hl-Directory* +Directory directory names (and other special names in listings) + *hl-DiffAdd* +DiffAdd diff mode: Added line |diff.txt| + *hl-DiffChange* +DiffChange diff mode: Changed line |diff.txt| + *hl-DiffDelete* +DiffDelete diff mode: Deleted line |diff.txt| + *hl-DiffText* +DiffText diff mode: Changed text within a changed line |diff.txt| + *hl-ErrorMsg* +ErrorMsg error messages on the command line + *hl-VertSplit* +VertSplit the column separating vertically split windows + *hl-Folded* +Folded line used for closed folds + *hl-FoldColumn* +FoldColumn 'foldcolumn' + *hl-SignColumn* +SignColumn column where |signs| are displayed + *hl-IncSearch* +IncSearch 'incsearch' highlighting; also used for the text replaced with + ":s///c" + *hl-LineNr* +LineNr Line number for ":number" and ":#" commands, and when 'number' + option is set. + *hl-MatchParen* +MatchParen The character under the cursor or just before it, if it + is a paired bracket, and its match. |pi_paren.txt| + + *hl-ModeMsg* +ModeMsg 'showmode' message (e.g., "-- INSERT --") + *hl-MoreMsg* +MoreMsg |more-prompt| + *hl-NonText* +NonText '~' and '@' at the end of the window, characters from + 'showbreak' and other characters that do not really exist in + the text (e.g., ">" displayed when a double-wide character + doesn't fit at the end of the line). + *hl-Normal* +Normal normal text + *hl-Pmenu* +Pmenu Popup menu: normal item. + *hl-PmenuSel* +PmenuSel Popup menu: selected item. + *hl-PmenuSbar* +PmenuSbar Popup menu: scrollbar. + *hl-PmenuThumb* +PmenuThumb Popup menu: Thumb of the scrollbar. + *hl-Question* +Question |hit-enter| prompt and yes/no questions + *hl-Search* +Search Last search pattern highlighting (see 'hlsearch'). + Also used for highlighting the current line in the quickfix + window and similar items that need to stand out. + *hl-SpecialKey* +SpecialKey Meta and special keys listed with ":map", also for text used + to show unprintable characters in the text, 'listchars'. + Generally: text that is displayed differently from what it + really is. + *hl-SpellBad* +SpellBad Word that is not recognized by the spellchecker. |spell| + This will be combined with the highlighting used otherwise. + *hl-SpellCap* +SpellCap Word that should start with a capital. |spell| + This will be combined with the highlighting used otherwise. + *hl-SpellLocal* +SpellLocal Word that is recognized by the spellchecker as one that is + used in another region. |spell| + This will be combined with the highlighting used otherwise. + *hl-SpellRare* +SpellRare Word that is recognized by the spellchecker as one that is + hardly ever used. |spell| + This will be combined with the highlighting used otherwise. + *hl-StatusLine* +StatusLine status line of current window + *hl-StatusLineNC* +StatusLineNC status lines of not-current windows + Note: if this is equal to "StatusLine" Vim will use "^^^" in + the status line of the current window. + *hl-TabLine* +TabLine tab pages line, not active tab page label + *hl-TabLineFill* +TabLineFill tab pages line, where there are no labels + *hl-TabLineSel* +TabLineSel tab pages line, active tab page label + *hl-Title* +Title titles for output from ":set all", ":autocmd" etc. + *hl-Visual* +Visual Visual mode selection + *hl-VisualNOS* +VisualNOS Visual mode selection when vim is "Not Owning the Selection". + Only X11 Gui's |gui-x11| and |xterm-clipboard| supports this. + *hl-WarningMsg* +WarningMsg warning messages + *hl-WildMenu* +WildMenu current match in 'wildmenu' completion + + *hl-User1* *hl-User1..9* *hl-User9* +The 'statusline' syntax allows the use of 9 different highlights in the +statusline and ruler (via 'rulerformat'). The names are User1 to User9. + +For the GUI you can use these groups to set the colors for the menu, +scrollbars and tooltips. They don't have defaults. This doesn't work for the +Win32 GUI. Only three highlight arguments have any effect here: font, guibg, +and guifg. + + *hl-Menu* +Menu Current font, background and foreground colors of the menus. + Also used for the toolbar. + Applicable highlight arguments: font, guibg, guifg. + + NOTE: For Motif and Athena the font argument actually + specifies a fontset at all times, no matter if 'guifontset' is + empty, and as such it is tied to the current |:language| when + set. + + *hl-Scrollbar* +Scrollbar Current background and foreground of the main window's + scrollbars. + Applicable highlight arguments: guibg, guifg. + + *hl-Tooltip* +Tooltip Current font, background and foreground of the tooltips. + Applicable highlight arguments: font, guibg, guifg. + + NOTE: For Motif and Athena the font argument actually + specifies a fontset at all times, no matter if 'guifontset' is + empty, and as such it is tied to the current |:language| when + set. + +============================================================================== +13. Linking groups *:hi-link* *:highlight-link* *E412* *E413* + +When you want to use the same highlighting for several syntax groups, you +can do this more easily by linking the groups into one common highlight +group, and give the color attributes only for that group. + +To set a link: + + :hi[ghlight][!] [default] link {from-group} {to-group} + +To remove a link: + + :hi[ghlight][!] [default] link {from-group} NONE + +Notes: *E414* +- If the {from-group} and/or {to-group} doesn't exist, it is created. You + don't get an error message for a non-existing group. +- As soon as you use a ":highlight" command for a linked group, the link is + removed. +- If there are already highlight settings for the {from-group}, the link is + not made, unless the '!' is given. For a ":highlight link" command in a + sourced file, you don't get an error message. This can be used to skip + links for groups that already have settings. + + *:hi-default* *:highlight-default* +The [default] argument is used for setting the default highlighting for a +group. If highlighting has already been specified for the group the command +will be ignored. Also when there is an existing link. + +Using [default] is especially useful to overrule the highlighting of a +specific syntax file. For example, the C syntax file contains: > + :highlight default link cComment Comment +If you like Question highlighting for C comments, put this in your vimrc file: > + :highlight link cComment Question +Without the "default" in the C syntax file, the highlighting would be +overruled when the syntax file is loaded. + +============================================================================== +14. Cleaning up *:syn-clear* *E391* + +If you want to clear the syntax stuff for the current buffer, you can use this +command: > + :syntax clear + +This command should be used when you want to switch off syntax highlighting, +or when you want to switch to using another syntax. It's normally not needed +in a syntax file itself, because syntax is cleared by the autocommands that +load the syntax file. +The command also deletes the "b:current_syntax" variable, since no syntax is +loaded after this command. + +If you want to disable syntax highlighting for all buffers, you need to remove +the autocommands that load the syntax files: > + :syntax off + +What this command actually does, is executing the command > + :source $VIMRUNTIME/syntax/nosyntax.vim +See the "nosyntax.vim" file for details. Note that for this to work +$VIMRUNTIME must be valid. See |$VIMRUNTIME|. + +To clean up specific syntax groups for the current buffer: > + :syntax clear {group-name} .. +This removes all patterns and keywords for {group-name}. + +To clean up specific syntax group lists for the current buffer: > + :syntax clear @{grouplist-name} .. +This sets {grouplist-name}'s contents to an empty list. + + *:syntax-reset* *:syn-reset* +If you have changed the colors and messed them up, use this command to get the +defaults back: > + + :syntax reset + +This doesn't change the colors for the 'highlight' option. + +Note that the syntax colors that you set in your vimrc file will also be reset +back to their Vim default. +Note that if you are using a color scheme, the colors defined by the color +scheme for syntax highlighting will be lost. + +What this actually does is: > + + let g:syntax_cmd = "reset" + runtime! syntax/syncolor.vim + +Note that this uses the 'runtimepath' option. + + *syncolor* +If you want to use different colors for syntax highlighting, you can add a Vim +script file to set these colors. Put this file in a directory in +'runtimepath' which comes after $VIMRUNTIME, so that your settings overrule +the default colors. This way these colors will be used after the ":syntax +reset" command. + +For Unix you can use the file ~/.vim/after/syntax/syncolor.vim. Example: > + + if &background == "light" + highlight comment ctermfg=darkgreen guifg=darkgreen + else + highlight comment ctermfg=green guifg=green + endif + + *E679* +Do make sure this syncolor.vim script does not use a "syntax on", set the +'background' option or uses a "colorscheme" command, because it results in an +endless loop. + +Note that when a color scheme is used, there might be some confusion whether +your defined colors are to be used or the colors from the scheme. This +depends on the color scheme file. See |:colorscheme|. + + *syntax_cmd* +The "syntax_cmd" variable is set to one of these values when the +syntax/syncolor.vim files are loaded: + "on" ":syntax on" command. Highlight colors are overruled but + links are kept + "enable" ":syntax enable" command. Only define colors for groups that + don't have highlighting yet. Use ":syntax default". + "reset" ":syntax reset" command or loading a color scheme. Define all + the colors. + "skip" Don't define colors. Used to skip the default settings when a + syncolor.vim file earlier in 'runtimepath' has already set + them. + +============================================================================== +15. Highlighting tags *tag-highlight* + +If you want to highlight all the tags in your file, you can use the following +mappings. + + <F11> -- Generate tags.vim file, and highlight tags. + <F12> -- Just highlight tags based on existing tags.vim file. +> + :map <F11> :sp tags<CR>:%s/^\([^ :]*:\)\=\([^ ]*\).*/syntax keyword Tag \2/<CR>:wq! tags.vim<CR>/^<CR><F12> + :map <F12> :so tags.vim<CR> + +WARNING: The longer the tags file, the slower this will be, and the more +memory Vim will consume. + +Only highlighting typedefs, unions and structs can be done too. For this you +must use Exuberant ctags (found at http://ctags.sf.net). + +Put these lines in your Makefile: + +# Make a highlight file for types. Requires Exuberant ctags and awk +types: types.vim +types.vim: *.[ch] + ctags -i=gstuS -o- *.[ch] |\ + awk 'BEGIN{printf("syntax keyword Type\t")}\ + {printf("%s ", $$1)}END{print ""}' > $@ + +And put these lines in your .vimrc: > + + " load the types.vim highlighting file, if it exists + autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') . '/types.vim' + autocmd BufRead,BufNewFile *.[ch] if filereadable(fname) + autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname + autocmd BufRead,BufNewFile *.[ch] endif + +============================================================================== +16. Color xterms *xterm-color* *color-xterm* + +Most color xterms have only eight colors. If you don't get colors with the +default setup, it should work with these lines in your .vimrc: > + :if &term =~ "xterm" + : if has("terminfo") + : set t_Co=8 + : set t_Sf=<Esc>[3%p1%dm + : set t_Sb=<Esc>[4%p1%dm + : else + : set t_Co=8 + : set t_Sf=<Esc>[3%dm + : set t_Sb=<Esc>[4%dm + : endif + :endif +< [<Esc> is a real escape, type CTRL-V <Esc>] + +You might want to change the first "if" to match the name of your terminal, +e.g. "dtterm" instead of "xterm". + +Note: Do these settings BEFORE doing ":syntax on". Otherwise the colors may +be wrong. + *xiterm* *rxvt* +The above settings have been mentioned to work for xiterm and rxvt too. +But for using 16 colors in an rxvt these should work with terminfo: > + :set t_AB=<Esc>[%?%p1%{8}%<%t25;%p1%{40}%+%e5;%p1%{32}%+%;%dm + :set t_AF=<Esc>[%?%p1%{8}%<%t22;%p1%{30}%+%e1;%p1%{22}%+%;%dm +< + *colortest.vim* +To test your color setup, a file has been included in the Vim distribution. +To use it, execute this command: > + :runtime syntax/colortest.vim + +Some versions of xterm (and other terminals, like the Linux console) can +output lighter foreground colors, even though the number of colors is defined +at 8. Therefore Vim sets the "cterm=bold" attribute for light foreground +colors, when 't_Co' is 8. + + *xfree-xterm* +To get 16 colors or more, get the newest xterm version (which should be +included with XFree86 3.3 and later). You can also find the latest version +at: > + http://invisible-island.net/xterm/xterm.html +Here is a good way to configure it. This uses 88 colors and enables the +termcap-query feature, which allows Vim to ask the xterm how many colors it +supports. > + ./configure --disable-bold-color --enable-88-color --enable-tcap-query +If you only get 8 colors, check the xterm compilation settings. +(Also see |UTF8-xterm| for using this xterm with UTF-8 character encoding). + +This xterm should work with these lines in your .vimrc (for 16 colors): > + :if has("terminfo") + : set t_Co=16 + : set t_AB=<Esc>[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm + : set t_AF=<Esc>[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm + :else + : set t_Co=16 + : set t_Sf=<Esc>[3%dm + : set t_Sb=<Esc>[4%dm + :endif +< [<Esc> is a real escape, type CTRL-V <Esc>] + +Without |+terminfo|, Vim will recognize these settings, and automatically +translate cterm colors of 8 and above to "<Esc>[9%dm" and "<Esc>[10%dm". +Colors above 16 are also translated automatically. + +For 256 colors this has been reported to work: > + + :set t_AB=<Esc>[48;5;%dm + :set t_AF=<Esc>[38;5;%dm + +Or just set the TERM environment variable to "xterm-color" or "xterm-16color" +and try if that works. + +You probably want to use these X resources (in your ~/.Xdefaults file): + XTerm*color0: #000000 + XTerm*color1: #c00000 + XTerm*color2: #008000 + XTerm*color3: #808000 + XTerm*color4: #0000c0 + XTerm*color5: #c000c0 + XTerm*color6: #008080 + XTerm*color7: #c0c0c0 + XTerm*color8: #808080 + XTerm*color9: #ff6060 + XTerm*color10: #00ff00 + XTerm*color11: #ffff00 + XTerm*color12: #8080ff + XTerm*color13: #ff40ff + XTerm*color14: #00ffff + XTerm*color15: #ffffff + Xterm*cursorColor: Black + +[Note: The cursorColor is required to work around a bug, which changes the +cursor color to the color of the last drawn text. This has been fixed by a +newer version of xterm, but not everybody is it using yet.] + +To get these right away, reload the .Xdefaults file to the X Option database +Manager (you only need to do this when you just changed the .Xdefaults file): > + xrdb -merge ~/.Xdefaults +< + *xterm-blink* *xterm-blinking-cursor* +To make the cursor blink in an xterm, see tools/blink.c. Or use Thomas +Dickey's xterm above patchlevel 107 (see above for where to get it), with +these resources: + XTerm*cursorBlink: on + XTerm*cursorOnTime: 400 + XTerm*cursorOffTime: 250 + XTerm*cursorColor: White + + *hpterm-color* +These settings work (more or less) for a hpterm, which only supports 8 +foreground colors: > + :if has("terminfo") + : set t_Co=8 + : set t_Sf=<Esc>[&v%p1%dS + : set t_Sb=<Esc>[&v7S + :else + : set t_Co=8 + : set t_Sf=<Esc>[&v%dS + : set t_Sb=<Esc>[&v7S + :endif +< [<Esc> is a real escape, type CTRL-V <Esc>] + + *Eterm* *enlightened-terminal* +These settings have been reported to work for the Enlightened terminal +emulator, or Eterm. They might work for all xterm-like terminals that use the +bold attribute to get bright colors. Add an ":if" like above when needed. > + :set t_Co=16 + :set t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{22}%+%d;1%;m + :set t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{32}%+%d;1%;m +< + *TTpro-telnet* +These settings should work for TTpro telnet. Tera Term Pro is a freeware / +open-source program for MS-Windows. > + set t_Co=16 + set t_AB=^[[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{32}%+5;%;%dm + set t_AF=^[[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{22}%+1;%;%dm +Also make sure TTpro's Setup / Window / Full Color is enabled, and make sure +that Setup / Font / Enable Bold is NOT enabled. +(info provided by John Love-Jensen <eljay@Adobe.COM>) + + vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/tabpage.txt b/Aufgabe5/doc.lang/tabpage.txt new file mode 100644 index 0000000..a6bbd64 --- /dev/null +++ b/Aufgabe5/doc.lang/tabpage.txt @@ -0,0 +1,371 @@ +*tabpage.txt* For Vim version 7.0. Last change: 2006 May 02 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Editing with windows in multiple tab pages. *tab-page* *tabpage* + +The commands which have been added to use multiple tab pages are explained +here. Additionally, there are explanations for commands that work differently +when used in combination with more than one tab page. + +1. Introduction |tab-page-intro| +2. Commands |tab-page-commands| +3. Other items |tab-page-other| +4. Setting 'tabline' |setting-tabline| +5. Setting 'guitablabel' |setting-guitablabel| + +{Vi does not have any of these commands} +{not able to use multiple tab pages when the |+windows| feature was disabled +at compile time} + +============================================================================== +1. Introduction *tab-page-intro* + +A tab page holds one or more windows. You can easily switch between tab +pages, so that you have several collections of windows to work on different +things. + +Usually you will see a list of labels at the top of the Vim window, one for +each tab page. With the mouse you can click on the label to jump to that tab +page. There are other ways to move between tab pages, see below. + +Most commands work only in the current tab page. That includes the |CTRL-W| +commands, |:windo|, |:all| and |:ball| (when not using the |:tab| modifier). +The commands that are aware of other tab pages than the current one are +mentioned below. + +Tabs are also a nice way to edit a buffer temporarily without changing the +current window layout. Open a new tab page, do whatever you want to do and +close the tab page. + +============================================================================== +2. Commands *tab-page-commands* + +OPENING A NEW TAB PAGE: + +When starting Vim "vim -p filename ..." opens each file argument in a separate +tab page (up to 'tabpagemax'). |-p| + +A double click with the mouse in the non-GUI tab pages line opens a new, empty +tab page. It is placed left of the position of the click. The first click +may select another tab page first, causing an extra screen update. + +This also works in a few GUI versions, esp. Win32 and Motif. But only when +clicking right of the labels. + +In the GUI tab pages line you can use the right mouse button to open menu. +|tabline-menu|. + +:tabe[dit] *:tabe* *:tabedit* *:tabnew* +:tabnew Open a new tab page with an empty window, after the current + tab page. + +:tabe[dit] [++opt] [+cmd] {file} +:tabnew [++opt] [+cmd] {file} + Open a new tab page and edit {file}, like with |:edit|. + +:tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind* + Open a new tab page and edit {file} in 'path', like with + |:find|. + {not available when the |+file_in_path| feature was disabled + at compile time} + +:[count]tab {cmd} *:tab* + Execute {cmd} and when it opens a new window open a new tab + page instead. Doesn't work for |:diffsplit| or |:diffpatch|. + When [count] is omitted the tab page appears after the current + one. When [count] is specified the new tab page comes after + tab page [count]. Use ":0tab cmd" to get the new tab page as + the first one. Examples: > + :tab split " opens current buffer in new tab page + :tab help gt " opens tab page with help for "gt" + +CTRL-W gf Open a new tab page and edit the file name under the cursor. + See |CTRL-W_gf|. + +CTRL-W gF Open a new tab page and edit the file name under the cursor + and jump to the line number following the file name. + See |CTRL-W_gF|. + +CLOSING A TAB PAGE: + +Closing the last window of a tab page closes the tab page too, unless there is +only one tab page. + +Using the mouse: If the tab page line is displayed you can click in the "X" at +the top right to close the current tab page. A custom |'tabline'| may show +something else. + + *:tabc* *:tabclose* +:tabc[lose][!] Close current tab page. + This command fails when: + - There is only one tab page on the screen. *E784* + - When 'hidden' is not set, [!] is not used, a buffer has + changes, and there is no other window on this buffer. + Changes to the buffer are not written and won't get lost, so + this is a "safe" command. + +:tabc[lose][!] {count} + Close tab page {count}. Fails in the same way as ':tabclose" + above. + + *:tabo* *:tabonly* +:tabo[nly][!] Close all other tab pages. + When the 'hidden' option is set, all buffers in closed windows + become hidden. + When 'hidden' is not set, and the 'autowrite' option is set, + modified buffers are written. Otherwise, windows that have + buffers that are modified are not removed, unless the [!] is + given, then they become hidden. But modified buffers are + never abandoned, so changes cannot get lost. + + +SWITCHING TO ANOTHER TAB PAGE: + +Using the mouse: If the tab page line is displayed you can click in a tab page +label to switch to that tab page. Click where there is no label to go to the +next tab page. |'tabline'| + +:tabn[ext] *:tabn* *:tabnext* *gt* +gt *CTRL-<PageDown>* *<C-PageDown>* +<C-PageDown> *i_CTRL-<PageDown>* *i_<C-PageDown>* + Go to the next tab page. Wraps around from the last to the + first one. + +:tabn[ext] {count} *CTRL-<PageUp>* *<C-PageUp>* +{count}gt *i_CTRL-<PageUp>* *i_<C-PageUp>* +<C-PageUp> Go to tab page {count}. The first tab page has number one. + + +:tabp[revious] *:tabp* *:tabprevious* *gT* +:tabN[ext] *:tabN* *:tabNext* +gT Go to the previous tab page. Wraps around from the first one + to the last one. + +:tabp[revious] {count} +:tabN[ext] {count} +{count}gT Go {count} tab pages back. Wraps around from the first one + to the last one. + +:tabr[ewind] *:tabfir* *:tabfirst* *:tabr* *:tabrewind* +:tabfir[st] Go to the first tab page. + + *:tabl* *:tablast* +:tabl[ast] Go to the last tab page. + + +Other commands: + *:tabs* +:tabs List the tab pages and the windows they contain. + Shows a ">" for the current window. + Shows a "+" for modified buffers. + + +REORDERING TAB PAGES: + +:tabm[ove] [N] *:tabm* *:tabmove* + Move the current tab page to after tab page N. Use zero to + make the current tab page the first one. Without N the tab + page is made the last one. + + +LOOPING OVER TAB PAGES: + + *:tabd* *:tabdo* +:tabd[o] {cmd} Execute {cmd} in each tab page. + It works like doing this: > + :tabfirst + :{cmd} + :tabnext + :{cmd} + etc. +< This only operates in the current window of each tab page. + When an error is detected on one tab page, further tab pages + will not be visited. + The last tab page (or where an error occurred) becomes the + current tab page. + {cmd} can contain '|' to concatenate several commands. + {cmd} must not open or close tab pages or reorder them. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Also see |:windo|, |:argdo| and |:bufdo|. + +============================================================================== +3. Other items *tab-page-other* + + *tabline-menu* +The GUI tab pages line has a popup menu. It is accessed with a right click. +The entries are: + Close Close the tab page under the mouse pointer. The + current one if there is no label under the mouse + pointer. + New Tab Open a tab page, editing an empty buffer. It appears + to the left of the mouse pointer. + Open Tab... Like "New Tab" and additionaly use a file selector to + select a file to edit. + +Diff mode works per tab page. You can see the diffs between several files +within one tab page. Other tab pages can show differences between other +files. + +Variables local to a tab page start with "t:". |tabpage-variable| + +Currently there is only one option local to a tab page: 'cmdheight'. + +The TabLeave and TabEnter autocommand events can be used to do something when +switching from one tab page to another. The exact order depends on what you +are doing. When creating a new tab page this works as if you create a new +window on the same buffer and then edit another buffer. Thus ":tabnew" +triggers: + WinLeave leave current window + TabLeave leave current tab page + TabEnter enter new tab page + WinEnter enter window in new tab page + BufLeave leave current buffer + BufEnter enter new empty buffer + +When switching to another tab page the order is: + BufLeave + WinLeave + TabLeave + TabEnter + WinEnter + BufEnter + +============================================================================== +4. Setting 'tabline' *setting-tabline* + +The 'tabline' option specifies what the line with tab pages labels looks like. +It is only used when there is no GUI tab line. + +You can use the 'showtabline' option to specify when you want the line with +tab page labels to appear: never, when there is more than one tab page or +always. + +The highlighting of the tab pages line is set with the groups TabLine +TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill| + +The 'tabline' option allows you to define your preferred way to tab pages +labels. This isn't easy, thus an example will be given here. + +For basics see the 'statusline' option. The same items can be used in the +'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and +|tabpagewinnr()| functions are useful. + +Since the number of tab labels will vary, you need to use an expresion for the +whole option. Something like: > + :set tabline=%!MyTabLine() + +Then define the MyTabLine() function to list all the tab pages labels. A +convenient method is to split it in two parts: First go over all the tab +pages and define labels for them. Then get the label for each tab page. > + + function MyTabLine() + let s = '' + for i in range(tabpagenr('$')) + " select the highlighting + if i + 1 == tabpagenr() + let s .= '%#TabLineSel#' + else + let s .= '%#TabLine#' + endif + + " set the tab page number (for mouse clicks) + let s .= '%' . (i + 1) . 'T' + + " the label is made by MyTabLabel() + let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' + endfor + + " after the last tab fill with TabLineFill and reset tab page nr + let s .= '%#TabLineFill#%T' + + " right-align the label to close the current tab page + if tabpagenr('$') > 1 + let s .= '%=%#TabLine#%999Xclose' + endif + + return s + endfunction + +Now the MyTabLabel() function is called for each tab page to get its label. > + + function MyTabLabel(n) + let buflist = tabpagebuflist(a:n) + let winnr = tabpagewinnr(a:n) + return bufname(buflist[winnr - 1]) + endfunction + +This is just a simplistic example that results in a tab pages line that +resembles the default, but without adding a + for a modified buffer or +trunctating the names. You will want to reduce the width of labels in a +clever way when there is not enough room. Check the 'columns' option for the +space available. + +============================================================================== +5. Setting 'guitablabel' *setting-guitablabel* + +When the GUI tab pages line is displayed, 'guitablabel' can be used to +specify the label to display for each tab page. Unlike 'tabline', which +specifies the whole tab pages line at once, 'guitablabel' is used for each +label separately. + +'guitabtooltip' is very similar and is used for the tooltip of the same label. +This only appears when the mouse pointer hovers over the label, thus it +usually is longer. Only supported on some systems though. + +See the 'statusline' option for the format of the value. + +The "%N" item can be used for the current tab page number. The |v:lnum| +variable is also set to this number when the option is evaluated. +The items that use a file name refer to the current window of the tab page. + +Note that syntax highlighting is not used for the option. The %T and %X +items are also ignored. + +A simple example that puts the tab page number and the buffer name in the +label: > + :set guitablabel=%N\ %f + +An example that resembles the default 'guitablabel': Show the number of +windows in the tab page and a '+' if there is a modifed buffer: > + + function GuiTabLabel() + let label = '' + let bufnrlist = tabpagebuflist(v:lnum) + + " Add '+' if one of the buffers in the tab page is modified + for bufnr in bufnrlist + if getbufvar(bufnr, "&modified") + let label = '+' + break + endif + endfor + + " Append the number of windows in the tab page if more than one + let wincount = tabpagewinnr(v:lnum, '$') + if wincount > 1 + let label .= wincount + endif + if label != '' + let label .= ' ' + endif + + " Append the buffer name + return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) + endfunction + + set guitablabel=%{GuiTabLabel()} + +Note that the function must be defined before setting the option, otherwise +you get an error message for the function not being known. + +If you want to fall back to the default label, return an empty string. + +If you want to show something specific for a tab page, you might want to use a +tab page local variable. |t:var| + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/tagsrch.txt b/Aufgabe5/doc.lang/tagsrch.txt new file mode 100644 index 0000000..0acdf2c --- /dev/null +++ b/Aufgabe5/doc.lang/tagsrch.txt @@ -0,0 +1,833 @@ +*tagsrch.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Tags and special searches *tags-and-searches* + +See section |29.1| of the user manual for an introduction. + +1. Jump to a tag |tag-commands| +2. Tag stack |tag-stack| +3. Tag match list |tag-matchlist| +4. Tags details |tag-details| +5. Tags file format |tags-file-format| +6. Include file searches |include-search| + +============================================================================== +1. Jump to a tag *tag-commands* + + *tag* *tags* +A tag is an identifier that appears in a "tags" file. It is a sort of label +that can be jumped to. For example: In C programs each function name can be +used as a tag. The "tags" file has to be generated by a program like ctags, +before the tag commands can be used. + +With the ":tag" command the cursor will be positioned on the tag. With the +CTRL-] command, the keyword on which the cursor is standing is used as the +tag. If the cursor is not on a keyword, the first keyword to the right of the +cursor is used. + +The ":tag" command works very well for C programs. If you see a call to a +function and wonder what that function does, position the cursor inside of the +function name and hit CTRL-]. This will bring you to the function definition. +An easy way back is with the CTRL-T command. Also read about the tag stack +below. + + *:ta* *:tag* *E426* *E429* +:[count]ta[g][!] {ident} + Jump to the definition of {ident}, using the + information in the tags file(s). Put {ident} in the + tag stack. See |tag-!| for [!]. + {ident} can be a regexp pattern, see |tag-regexp|. + When there are several matching tags for {ident}, jump + to the [count] one. When [count] is omitted the + first one is jumped to. See |tag-matchlist| for + jumping to other matching tags. + +g<LeftMouse> *g<LeftMouse>* +<C-LeftMouse> *<C-LeftMouse>* *CTRL-]* +CTRL-] Jump to the definition of the keyword under the + cursor. Same as ":tag {ident}", where {ident} is the + keyword under or after cursor. + When there are several matching tags for {ident}, jump + to the [count] one. When no [count] is given the + first one is jumped to. See |tag-matchlist| for + jumping to other matching tags. + {Vi: identifier after the cursor} + + *v_CTRL-]* +{Visual}CTRL-] Same as ":tag {ident}", where {ident} is the text that + is highlighted. {not in Vi} + + *telnet-CTRL-]* +CTRL-] is the default telnet escape key. When you type CTRL-] to jump to a +tag, you will get the telnet prompt instead. Most versions of telnet allow +changing or disabling the default escape key. See the telnet man page. You +can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e +{EscapeCharacter} {Hostname}' to specify another escape character. If +possible, try to use "ssh" instead of "telnet" to avoid this problem. + + *tag-priority* +When there are multiple matches for a tag, this priority is used: +1. "FSC" A full matching static tag for the current file. +2. "F C" A full matching global tag for the current file. +3. "F " A full matching global tag for another file. +4. "FS " A full matching static tag for another file. +5. " SC" An ignore-case matching static tag for the current file. +6. " C" An ignore-case matching global tag for the current file. +7. " " An ignore-case matching global tag for another file. +8. " S " An ignore-case matching static tag for another file. + +Note that when the current file changes, the priority list is mostly not +changed, to avoid confusion when using ":tnext". It is changed when using +":tag {ident}". + +The ignore-case matches are not found for a ":tag" command when the +'ignorecase' option is off. They are found when a pattern is used (starting +with a "/") and for ":tselect", also when 'ignorecase' is off. Note that +using ignore-case tag searching disables binary searching in the tags file, +which causes a slowdown. This can be avoided by fold-case sorting the tag +file. See the 'tagbsearch' option for an explanation. + +============================================================================== +2. Tag stack *tag-stack* *tagstack* *E425* + +On the tag stack is remembered which tags you jumped to, and from where. +Tags are only pushed onto the stack when the 'tagstack' option is set. + +g<RightMouse> *g<RightMouse>* +<C-RightMouse> *<C-RightMouse>* *CTRL-T* +CTRL-T Jump to [count] older entry in the tag stack + (default 1). {not in Vi} + + *:po* *:pop* *E555* *E556* +:[count]po[p][!] Jump to [count] older entry in tag stack (default 1). + See |tag-!| for [!]. {not in Vi} + +:[count]ta[g][!] Jump to [count] newer entry in tag stack (default 1). + See |tag-!| for [!]. {not in Vi} + + *:tags* +:tags Show the contents of the tag stack. The active + entry is marked with a '>'. {not in Vi} + +The output of ":tags" looks like this: + + # TO tag FROM line in file/line + 1 1 main 1 harddisk2:text/vim/test + > 2 2 FuncA 58 i = FuncA(10); + 3 1 FuncC 357 harddisk2:text/vim/src/amiga.c + +This list shows the tags that you jumped to and the cursor position before +that jump. The older tags are at the top, the newer at the bottom. + +The '>' points to the active entry. This is the tag that will be used by the +next ":tag" command. The CTRL-T and ":pop" command will use the position +above the active entry. + +Below the "TO" is the number of the current match in the match list. Note +that this doesn't change when using ":pop" or ":tag". + +The line number and file name are remembered to be able to get back to where +you were before the tag command. The line number will be correct, also when +deleting/inserting lines, unless this was done by another program (e.g. +another instance of Vim). + +For the current file, the "file/line" column shows the text at the position. +An indent is removed and a long line is truncated to fit in the window. + +You can jump to previously used tags with several commands. Some examples: + + ":pop" or CTRL-T to position before previous tag + {count}CTRL-T to position before {count} older tag + ":tag" to newer tag + ":0tag" to last used tag + +The most obvious way to use this is while browsing through the call graph of +a program. Consider the following call graph: + + main ---> FuncA ---> FuncC + ---> FuncB + +(Explanation: main calls FuncA and FuncB; FuncA calls FuncC). +You can get from main to FuncA by using CTRL-] on the call to FuncA. Then +you can CTRL-] to get to FuncC. If you now want to go back to main you can +use CTRL-T twice. Then you can CTRL-] to FuncB. + +If you issue a ":ta {ident}" or CTRL-] command, this tag is inserted at the +current position in the stack. If the stack was full (it can hold up to 20 +entries), the oldest entry is deleted and the older entries shift one +position up (their index number is decremented by one). If the last used +entry was not at the bottom, the entries below the last used one are +deleted. This means that an old branch in the call graph is lost. After the +commands explained above the tag stack will look like this: + + # TO tag FROM line in file + 1 main 1 harddisk2:text/vim/test + 2 FuncB 59 harddisk2:text/vim/src/main.c + + *E73* +When you try to use the tag stack while it doesn't contain anything you will +get an error message. + +============================================================================== +3. Tag match list *tag-matchlist* *E427* *E428* + +When there are several matching tags, these commands can be used to jump +between them. Note that these command don't change the tag stack, they keep +the same entry. + + *:ts* *:tselect* +:ts[elect][!] [ident] List the tags that match [ident], using the + information in the tags file(s). + When [ident] is not given, the last tag name from the + tag stack is used. + With a '>' in the first column is indicated which is + the current position in the list (if there is one). + [ident] can be a regexp pattern, see |tag-regexp|. + See |tag-priority| for the priorities used in the + listing. {not in Vi} + Example output: + +> + nr pri kind tag file + 1 F f mch_delay os_amiga.c + mch_delay(msec, ignoreinput) + > 2 F f mch_delay os_msdos.c + mch_delay(msec, ignoreinput) + 3 F f mch_delay os_unix.c + mch_delay(msec, ignoreinput) + Enter nr of choice (<CR> to abort): +< + See |tag-priority| for the "pri" column. Note that + this depends on the current file, thus using + ":tselect xxx" can produce different results. + The "kind" column gives the kind of tag, if this was + included in the tags file. + The "info" column shows information that could be + found in the tags file. It depends on the program + that produced the tags file. + When the list is long, you may get the |more-prompt|. + If you already see the tag you want to use, you can + type 'q' and enter the number. + + *:sts* *:stselect* +:sts[elect][!] [ident] Does ":tselect[!] [ident]" and splits the window for + the selected tag. {not in Vi} + + *g]* +g] Like CTRL-], but use ":tselect" instead of ":tag". + {not in Vi} + + *v_g]* +{Visual}g] Same as "g]", but use the highlighted text as the + identifier. {not in Vi} + + *:tj* *:tjump* +:tj[ump][!] [ident] Like ":tselect", but jump to the tag directly when + there is only one match. {not in Vi} + + *:stj* *:stjump* +:stj[ump][!] [ident] Does ":tjump[!] [ident]" and splits the window for the + selected tag. {not in Vi} + + *g_CTRL-]* +g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag". + {not in Vi} + + *v_g_CTRL-]* +{Visual}g CTRL-] Same as "g CTRL-]", but use the highlighted text as + the identifier. {not in Vi} + + *:tn* *:tnext* +:[count]tn[ext][!] Jump to [count] next matching tag (default 1). See + |tag-!| for [!]. {not in Vi} + + *:tp* *:tprevious* +:[count]tp[revious][!] Jump to [count] previous matching tag (default 1). + See |tag-!| for [!]. {not in Vi} + + *:tN* *:tNext* +:[count]tN[ext][!] Same as ":tprevious". {not in Vi} + + *:tr* *:trewind* +:[count]tr[ewind][!] Jump to first matching tag. If [count] is given, jump + to [count]th matching tag. See |tag-!| for [!]. {not + in Vi} + + *:tf* *:tfirst* +:[count]tf[irst][!] Same as ":trewind". {not in Vi} + + *:tl* *:tlast* +:tl[ast][!] Jump to last matching tag. See |tag-!| for [!]. {not + in Vi} + + *:lt* *:ltag* +:lt[ag][!] [ident] Jump to tag [ident] and add the matching tags to a new + location list for the current window. [ident] can be + a regexp pattern, see |tag-regexp|. When [ident] is + not given, the last tag name from the tag stack is + used. The search pattern to locate the tag line is + prefixed with "\V" to escape all the special + characters (very nomagic). The location list showing + the matching tags is independent of the tag stack. + See |tag-!| for [!]. + {not in Vi} + +When there is no other message, Vim shows which matching tag has been jumped +to, and the number of matching tags: > + tag 1 of 3 or more +The " or more" is used to indicate that Vim didn't try all the tags files yet. +When using ":tnext" a few times, or with ":tlast", more matches may be found. + +When you didn't see this message because of some other message, or you just +want to know where you are, this command will show it again (and jump to the +same tag as last time): > + :0tn +< + *tag-skip-file* +When a matching tag is found for which the file doesn't exist, this match is +skipped and the next matching tag is used. Vim reports this, to notify you of +missing files. When the end of the list of matches has been reached, an error +message is given. + + *tag-preview* +The tag match list can also be used in the preview window. The commands are +the same as above, with a "p" prepended. +{not available when compiled without the |+quickfix| feature} + + *:pts* *:ptselect* +:pts[elect][!] [ident] Does ":tselect[!] [ident]" and shows the new tag in a + "Preview" window. See |:ptag| for more info. + {not in Vi} + + *:ptj* *:ptjump* +:ptj[ump][!] [ident] Does ":tjump[!] [ident]" and shows the new tag in a + "Preview" window. See |:ptag| for more info. + {not in Vi} + + *:ptn* *:ptnext* +:[count]ptn[ext][!] ":tnext" in the preview window. See |:ptag|. + {not in Vi} + + *:ptp* *:ptprevious* +:[count]ptp[revious][!] ":tprevious" in the preview window. See |:ptag|. + {not in Vi} + + *:ptN* *:ptNext* +:[count]ptN[ext][!] Same as ":ptprevious". {not in Vi} + + *:ptr* *:ptrewind* +:[count]ptr[ewind][!] ":trewind" in the preview window. See |:ptag|. + {not in Vi} + + *:ptf* *:ptfirst* +:[count]ptf[irst][!] Same as ":ptrewind". {not in Vi} + + *:ptl* *:ptlast* +:ptl[ast][!] ":tlast" in the preview window. See |:ptag|. + {not in Vi} + +============================================================================== +4. Tags details *tag-details* + + *static-tag* +A static tag is a tag that is defined for a specific file. In a C program +this could be a static function. + +In Vi jumping to a tag sets the current search pattern. This means that +the "n" command after jumping to a tag does not search for the same pattern +that it did before jumping to the tag. Vim does not do this as we consider it +to be a bug. You can still find the tag search pattern in the search history. +If you really want the old Vi behavior, set the 't' flag in 'cpoptions'. + + *tag-binary-search* +Vim uses binary searching in the tags file to find the desired tag quickly +(when enabled at compile time |+tag_binary|). But this only works if the +tags file was sorted on ASCII byte value. Therefore, if no match was found, +another try is done with a linear search. If you only want the linear search, +reset the 'tagbsearch' option. Or better: Sort the tags file! + +Note that the binary searching is disabled when not looking for a tag with a +specific name. This happens when ignoring case and when a regular expression +is used that doesn't start with a fixed string. Tag searching can be a lot +slower then. The former can be avoided by case-fold sorting the tags file. +See 'tagbsearch' for details. + + *tag-regexp* +The ":tag" and "tselect" commands accept a regular expression argument. See +|pattern| for the special characters that can be used. +When the argument starts with '/', it is used as a pattern. If the argument +does not start with '/', it is taken literally, as a full tag name. +Examples: > + :tag main +< jumps to the tag "main" that has the highest priority. > + :tag /^get +< jumps to the tag that starts with "get" and has the highest priority. > + :tag /norm +< lists all the tags that contain "norm", including "id_norm". +When the argument both exists literally, and match when used as a regexp, a +literal match has a higher priority. For example, ":tag /open" matches "open" +before "open_file" and "file_open". +When using a pattern case is ignored. If you want to match case use "\C" in +the pattern. + + *tag-!* +If the tag is in the current file this will always work. Otherwise the +performed actions depend on whether the current file was changed, whether a ! +is added to the command and on the 'autowrite' option: + + tag in file autowrite ~ +current file changed ! option action ~ +----------------------------------------------------------------------------- + yes x x x goto tag + no no x x read other file, goto tag + no yes yes x abandon current file, read other file, goto + tag + no yes no on write current file, read other file, goto + tag + no yes no off fail +----------------------------------------------------------------------------- + +- If the tag is in the current file, the command will always work. +- If the tag is in another file and the current file was not changed, the + other file will be made the current file and read into the buffer. +- If the tag is in another file, the current file was changed and a ! is + added to the command, the changes to the current file are lost, the other + file will be made the current file and read into the buffer. +- If the tag is in another file, the current file was changed and the + 'autowrite' option is on, the current file will be written, the other + file will be made the current file and read into the buffer. +- If the tag is in another file, the current file was changed and the + 'autowrite' option is off, the command will fail. If you want to save + the changes, use the ":w" command and then use ":tag" without an argument. + This works because the tag is put on the stack anyway. If you want to lose + the changes you can use the ":tag!" command. + + *tag-security* +Note that Vim forbids some commands, for security reasons. This works like +using the 'secure' option for exrc/vimrc files in the current directory. See +|trojan-horse| and |sandbox|. +When the {tagaddress} changes a buffer, you will get a warning message: + "WARNING: tag command changed a buffer!!!" +In a future version changing the buffer will be impossible. All this for +security reasons: Somebody might hide a nasty command in the tags file, which +would otherwise go unnoticed. Example: > + :$d|/tag-function-name/ +{this security prevention is not present in Vi} + +In Vi the ":tag" command sets the last search pattern when the tag is searched +for. In Vim this is not done, the previous search pattern is still remembered, +unless the 't' flag is present in 'cpoptions'. The search pattern is always +put in the search history, so you can modify it if searching fails. + + *emacs-tags* *emacs_tags* *E430* +Emacs style tag files are only supported if Vim was compiled with the +|+emacs_tags| feature enabled. Sorry, there is no explanation about Emacs tag +files here, it is only supported for backwards compatibility :-). + + *tags-option* +The 'tags' option is a list of file names. Each of these files is searched +for the tag. This can be used to use a different tags file than the default +file "tags". It can also be used to access a common tags file. + +The next file in the list is not used when: +- A matching static tag for the current buffer has been found. +- A matching global tag has been found. +This also depends on the 'ignorecase' option. If it is off, and the tags file +only has a match without matching case, the next tags file is searched for a +match with matching case. If no tag with matching case is found, the first +match without matching case is used. If 'ignorecase' is on, and a matching +global tag with or without matching case is found, this one is used, no +further tags files are searched. + +When a tag file name starts with "./", the '.' is replaced with the path of +the current file. This makes it possible to use a tags file in the directory +where the current file is (no matter what the current directory is). The idea +of using "./" is that you can define which tag file is searched first: In the +current directory ("tags,./tags") or in the directory of the current file +("./tags,tags"). + +For example: > + :set tags=./tags,tags,/home/user/commontags + +In this example the tag will first be searched for in the file "tags" in the +directory where the current file is. Next the "tags" file in the current +directory. If it is not found there, then the file "/home/user/commontags" +will be searched for the tag. + +This can be switched off by including the 'd' flag in 'cpoptions', to make +it Vi compatible. "./tags" will then be the tags file in the current +directory, instead of the tags file in the directory where the current file +is. + +Instead of the comma a space may be used. Then a backslash is required for +the space to be included in the string option: > + :set tags=tags\ /home/user/commontags + +To include a space in a file name use three backslashes. To include a comma +in a file name use two backslashes. For example, use: > + :set tags=tag\\\ file,/home/user/common\\,tags + +for the files "tag file" and "/home/user/common,tags". The 'tags' option will +have the value "tag\ file,/home/user/common\,tags". + +If the 'tagrelative' option is on (which is the default) and using a tag file +in another directory, file names in that tag file are relative to the +directory where the tag file is. + +============================================================================== +5. Tags file format *tags-file-format* *E431* + + *ctags* *jtags* +A tags file can be created with an external command, for example "ctags". It +will contain a tag for each function. Some versions of "ctags" will also make +a tag for each "#defined" macro, typedefs, enums, etc. + +Some programs that generate tags files: +ctags As found on most Unix systems. Only supports C. Only + does the basic work. + *Exuberant_ctags* +exuberant ctags This a very good one. It works for C, C++, Java, + Fortran, Eiffel and others. It can generate tags for + many items. See http://ctags.sourceforge.net. +etags Connected to Emacs. Supports many languages. +JTags For Java, in Java. It can be found at + http://www.fleiner.com/jtags/. +ptags.py For Python, in Python. Found in your Python source + directory at Tools/scripts/ptags.py. +ptags For Perl, in Perl. It can be found at + http://www.eleves.ens.fr:8080/home/nthiery/Tags/. +gnatxref For Ada. See http://www.gnuada.org/. gnatxref is + part of the gnat package. + + +The lines in the tags file must have one of these three formats: + +1. {tagname} {TAB} {tagfile} {TAB} {tagaddress} +2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress} +3. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} .. + +The first is a normal tag, which is completely compatible with Vi. It is the +only format produced by traditional ctags implementations. This is often used +for functions that are global, also referenced in other files. + +The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR> +also works. The <CR> and <NL> characters can never appear inside a line. + + *tag-old-static* +The second format is for a static tag only. It is obsolete now, replaced by +the third format. It is only supported by Elvis 1.x and Vim and a few +versions of ctags. A static tag is often used for functions that are local, +only referenced in the file {tagfile}. Note that for the static tag, the two +occurrences of {tagfile} must be exactly the same. Also see |tags-option| +below, for how static tags are used. + +The third format is new. It includes additional information in optional +fields at the end of each line. It is backwards compatible with Vi. It is +only supported by new versions of ctags (such as Exuberant ctags). + +{tagname} The identifier. Normally the name of a function, but it can + be any identifier. It cannot contain a <Tab>. +{TAB} One <Tab> character. Note: previous versions allowed any + white space here. This has been abandoned to allow spaces in + {tagfile}. It can be re-enabled by including the + |+tag_any_white| feature at compile time. *tag-any-white* +{tagfile} The file that contains the definition of {tagname}. It can + have an absolute or relative path. It may contain environment + variables and wildcards (although the use of wildcards is + doubtful). It cannot contain a <Tab>. +{tagaddress} The Ex command that positions the cursor on the tag. It can + be any Ex command, although restrictions apply (see + |tag-security|). Posix only allows line numbers and search + commands, which are mostly used. +{term} ;" The two characters semicolon and double quote. This is + interpreted by Vi as the start of a comment, which makes the + following be ignored. This is for backwards compatibility + with Vi, it ignores the following fields. +{field} .. A list of optional fields. Each field has the form: + + <Tab>{fieldname}:{value} + + The {fieldname} identifies the field, and can only contain + alphabetical characters [a-zA-Z]. + The {value} is any string, but cannot contain a <Tab>. + These characters are special: + "\t" stands for a <Tab> + "\r" stands for a <CR> + "\n" stands for a <NL> + "\\" stands for a single '\' character + + There is one field that doesn't have a ':'. This is the kind + of the tag. It is handled like it was preceded with "kind:". + See the documentation of ctags for the kinds it produces. + + The only other field currently recognized by Vim is "file:" + (with an empty value). It is used for a static tag. + +The first lines in the tags file can contain lines that start with + !_TAG_ +These are sorted to the first lines, only rare tags that start with "!" can +sort to before them. Vim recognizes two items. The first one is the line +that indicates if the file was sorted. When this line is found, Vim uses +binary searching for the tags file: + !_TAG_FILE_SORTED<Tab>1<Tab>{anything} ~ + +A tag file may be case-fold sorted to avoid a linear search when 'ignorecase' +is on. See 'tagbsearch' for details. The value '2' should be used then: + !_TAG_FILE_SORTED<Tab>2<Tab>{anything} ~ + +The other tag that Vim recognizes, but only when compiled with the +|+multi_byte| feature, is the encoding of the tags file: + !_TAG_FILE_ENCODING<Tab>utf-8<Tab>{anything} ~ +Here "utf-8" is the encoding used for the tags. Vim will then convert the tag +being searched for from 'encoding' to the encoding of the tags file. And when +listing tags the reverse happens. When the conversion fails the unconverted +tag is used. + + *tag-search* +The command can be any Ex command, but often it is a search command. +Examples: + tag1 file1 /^main(argc, argv)/ ~ + tag2 file2 108 ~ + +The command is always executed with 'magic' not set. The only special +characters in a search pattern are "^" (begin-of-line) and "$" (<EOL>). +See |pattern|. Note that you must put a backslash before each backslash in +the search text. This is for backwards compatibility with Vi. + + *E434* *E435* +If the command is a normal search command (it starts and ends with "/" or +"?"), some special handling is done: +- Searching starts on line 1 of the file. + The direction of the search is forward for "/", backward for "?". + Note that 'wrapscan' does not matter, the whole file is always searched. (Vi + does use 'wrapscan', which caused tags sometimes not be found.) {Vi starts + searching in line 2 of another file. It does not find a tag in line 1 of + another file when 'wrapscan' is not set} +- If the search fails, another try is done ignoring case. If that fails too, + a search is done for: + "^tagname[ \t]*(" + (the tag with '^' prepended and "[ \t]*(" appended). When using function + names, this will find the function name when it is in column 0. This will + help when the arguments to the function have changed since the tags file was + made. If this search also fails another search is done with: + "^[#a-zA-Z_].*\<tagname[ \t]*(" + This means: A line starting with '#' or an identifier and containing the tag + followed by white space and a '('. This will find macro names and function + names with a type prepended. {the extra searches are not in Vi} + +============================================================================== +6. Include file searches *include-search* *definition-search* + *E387* *E388* *E389* + +These commands look for a string in the current file and in all encountered +included files (recursively). This can be used to find the definition of a +variable, function or macro. If you only want to search in the current +buffer, use the commands listed at |pattern-searches|. + +These commands are not available when the |+find_in_path| feature was disabled +at compile time. + +When a line is encountered that includes another file, that file is searched +before continuing in the current buffer. Files included by included files are +also searched. When an include file could not be found it is silently +ignored. Use the |:checkpath| command to discover which files could not be +found, possibly your 'path' option is not set up correctly. Note: the +included file is searched, not a buffer that may be editing that file. Only +for the current file the lines in the buffer are used. + +The string can be any keyword or a defined macro. For the keyword any match +will be found. For defined macros only lines that match with the 'define' +option will be found. The default is "^#\s*define", which is for C programs. +For other languages you probably want to change this. See 'define' for an +example for C++. The string cannot contain an end-of-line, only matches +within a line are found. + +When a match is found for a defined macro, the displaying of lines continues +with the next line when a line ends in a backslash. + +The commands that start with "[" start searching from the start of the current +file. The commands that start with "]" start at the current cursor position. + +The 'include' option is used to define a line that includes another file. The +default is "\^#\s*include", which is for C programs. Note: Vim does not +recognize C syntax, if the 'include' option matches a line inside +"#ifdef/#endif" or inside a comment, it is searched anyway. The 'isfname' +option is used to recognize the file name that comes after the matched +pattern. + +The 'path' option is used to find the directory for the include files that +do not have an absolute path. + +The 'comments' option is used for the commands that display a single line or +jump to a line. It defines patterns that may start a comment. Those lines +are ignored for the search, unless [!] is used. One exception: When the line +matches the pattern "^# *define" it is not considered to be a comment. + +If you want to list matches, and then select one to jump to, you could use a +mapping to do that for you. Here is an example: > + + :map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR> +< + *[i* +[i Display the first line that contains the keyword + under the cursor. The search starts at the beginning + of the file. Lines that look like a comment are + ignored (see 'comments' option). If a count is given, + the count'th matching line is displayed, and comment + lines are not ignored. {not in Vi} + + *]i* +]i like "[i", but start at the current cursor position. + {not in Vi} + + *:is* *:isearch* +:[range]is[earch][!] [count] [/]pattern[/] + Like "[i" and "]i", but search in [range] lines + (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + + *[I* +[I Display all lines that contain the keyword under the + cursor. Filenames and line numbers are displayed + for the found lines. The search starts at the + beginning of the file. {not in Vi} + + *]I* +]I like "[I", but start at the current cursor position. + {not in Vi} + + *:il* *:ilist* +:[range]il[ist][!] [/]pattern[/] + Like "[I" and "]I", but search in [range] lines + (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + + *[_CTRL-I* +[ CTRL-I Jump to the first line that contains the keyword + under the cursor. The search starts at the beginning + of the file. Lines that look like a comment are + ignored (see 'comments' option). If a count is given, + the count'th matching line is jumped to, and comment + lines are not ignored. {not in Vi} + + *]_CTRL-I* +] CTRL-I like "[ CTRL-I", but start at the current cursor + position. {not in Vi} + + *:ij* *:ijump* +:[range]ij[ump][!] [count] [/]pattern[/] + Like "[ CTRL-I" and "] CTRL-I", but search in + [range] lines (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + +CTRL-W CTRL-I *CTRL-W_CTRL-I* *CTRL-W_i* +CTRL-W i Open a new window, with the cursor on the first line + that contains the keyword under the cursor. The + search starts at the beginning of the file. Lines + that look like a comment line are ignored (see + 'comments' option). If a count is given, the count'th + matching line is jumped to, and comment lines are not + ignored. {not in Vi} + + *:isp* *:isplit* +:[range]isp[lit][!] [count] [/]pattern[/] + Like "CTRL-W i" and "CTRL-W i", but search in + [range] lines (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + + *[d* +[d Display the first macro definition that contains the + macro under the cursor. The search starts from the + beginning of the file. If a count is given, the + count'th matching line is displayed. {not in Vi} + + *]d* +]d like "[d", but start at the current cursor position. + {not in Vi} + + *:ds* *:dsearch* +:[range]ds[earch][!] [count] [/]string[/] + Like "[d" and "]d", but search in [range] lines + (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + + *[D* +[D Display all macro definitions that contain the macro + under the cursor. Filenames and line numbers are + displayed for the found lines. The search starts + from the beginning of the file. {not in Vi} + + *]D* +]D like "[D", but start at the current cursor position. + {not in Vi} + + *:dli* *:dlist* +:[range]dl[ist][!] [/]string[/] + Like "[D" and "]D", but search in [range] lines + (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + Note that ":dl" works like ":delete" with the "l" + flag. + + *[_CTRL-D* +[ CTRL-D Jump to the first macro definition that contains the + keyword under the cursor. The search starts from + the beginning of the file. If a count is given, the + count'th matching line is jumped to. {not in Vi} + + *]_CTRL-D* +] CTRL-D like "[ CTRL-D", but start at the current cursor + position. {not in Vi} + + *:dj* *:djump* +:[range]dj[ump][!] [count] [/]string[/] + Like "[ CTRL-D" and "] CTRL-D", but search in + [range] lines (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + +CTRL-W CTRL-D *CTRL-W_CTRL-D* *CTRL-W_d* +CTRL-W d Open a new window, with the cursor on the first + macro definition line that contains the keyword + under the cursor. The search starts from the + beginning of the file. If a count is given, the + count'th matching line is jumped to. {not in Vi} + + *:dsp* *:dsplit* +:[range]dsp[lit][!] [count] [/]string[/] + Like "CTRL-W d", but search in [range] lines + (default: whole file). + See |:search-args| for [/] and [!]. {not in Vi} + + *:che* *:checkpath* +:che[ckpath] List all the included files that could not be found. + {not in Vi} + +:che[ckpath]! List all the included files. {not in Vi} + + *:search-args* +Common arguments for the commands above: +[!] When included, find matches in lines that are recognized as comments. + When excluded, a match is ignored when the line is recognized as a + comment (according to 'comments'), or the match is in a C comment (after + "//" or inside /* */). Note that a match may be missed if a line is + recognized as a comment, but the comment ends halfway the line. + And if the line is a comment, but it is not recognized (according to + 'comments') a match may be found in it anyway. Example: > + /* comment + foobar */ +< A match for "foobar" is found, because this line is not recognized as a + comment (even though syntax highlighting does recognize it). + Note: Since a macro definition mostly doesn't look like a comment, the + [!] makes no difference for ":dlist", ":dsearch" and ":djump". +[/] A pattern can be surrounded by '/'. Without '/' only whole words are + matched, using the pattern "\<pattern\>". Only after the second '/' a + next command can be appended with '|'. Example: > + :isearch /string/ | echo "the last one" +< For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern + is used as a literal string, not as a search pattern. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/term.txt b/Aufgabe5/doc.lang/term.txt new file mode 100644 index 0000000..515ceae --- /dev/null +++ b/Aufgabe5/doc.lang/term.txt @@ -0,0 +1,856 @@ +*term.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Terminal information *terminal-info* + +Vim uses information about the terminal you are using to fill the screen and +recognize what keys you hit. If this information is not correct, the screen +may be messed up or keys may not be recognized. The actions which have to be +performed on the screen are accomplished by outputting a string of +characters. Special keys produce a string of characters. These strings are +stored in the terminal options, see |terminal-options|. + +NOTE: Most of this is not used when running the |GUI|. + +1. Startup |startup-terminal| +2. Terminal options |terminal-options| +3. Window size |window-size| +4. Slow and fast terminals |slow-fast-terminal| +5. Using the mouse |mouse-using| + +============================================================================== +1. Startup *startup-terminal* + +When Vim is started a default terminal type is assumed. For the Amiga this is +a standard CLI window, for MS-DOS the pc terminal, for Unix an ansi terminal. +A few other terminal types are always available, see below |builtin-terms|. + +You can give the terminal name with the '-T' Vim argument. If it is not given +Vim will try to get the name from the TERM environment variable. + + *termcap* *terminfo* *E557* *E558* *E559* +On Unix the terminfo database or termcap file is used. This is referred to as +"termcap" in all the documentation. At compile time, when running configure, +the choice whether to use terminfo or termcap is done automatically. When +running Vim the output of ":version" will show |+terminfo| if terminfo is +used. Also see |xterm-screens|. + +On non-Unix systems a termcap is only available if Vim was compiled with +TERMCAP defined. + + *builtin-terms* *builtin_terms* +Which builtin terminals are available depends on a few defines in feature.h, +which need to be set at compile time: + define output of ":version" terminals builtin ~ +NO_BUILTIN_TCAPS -builtin_terms none +SOME_BUILTIN_TCAPS +builtin_terms most common ones (default) +ALL_BUILTIN_TCAPS ++builtin_terms all available + +You can see a list of available builtin terminals with ":set term=xxx" (when +not running the GUI). Also see |+builtin_terms|. + +If the termcap code is included Vim will try to get the strings for the +terminal you are using from the termcap file and the builtin termcaps. Both +are always used, if an entry for the terminal you are using is present. Which +one is used first depends on the 'ttybuiltin' option: + +'ttybuiltin' on 1: builtin termcap 2: external termcap +'ttybuiltin' off 1: external termcap 2: builtin termcap + +If an option is missing in one of them, it will be obtained from the other +one. If an option is present in both, the one first encountered is used. + +Which external termcap file is used varies from system to system and may +depend on the environment variables "TERMCAP" and "TERMPATH". See "man +tgetent". + +Settings depending on terminal *term-dependent-settings* + +If you want to set options or mappings, depending on the terminal name, you +can do this best in your .vimrc. Example: > + + if &term == "xterm" + ... xterm maps and settings ... + elseif &term =~ "vt10." + ... vt100, vt102 maps and settings ... + endif +< + *raw-terminal-mode* +For normal editing the terminal will be put into "raw" mode. The strings +defined with 't_ti' and 't_ks' will be sent to the terminal. Normally this +puts the terminal in a state where the termcap codes are valid and activates +the cursor and function keys. When Vim exits the terminal will be put back +into the mode it was before Vim started. The strings defined with 't_te' and +'t_ke' will be sent to the terminal. On the Amiga, with commands that execute +an external command (e.g., "!!"), the terminal will be put into Normal mode +for a moment. This means that you can stop the output to the screen by +hitting a printing key. Output resumes when you hit <BS>. + + *cs7-problem* +Note: If the terminal settings are changed after running Vim, you might have +an illegal combination of settings. This has been reported on Solaris 2.5 +with "stty cs8 parenb", which is restored as "stty cs7 parenb". Use +"stty cs8 -parenb -istrip" instead, this is restored correctly. + +Some termcap entries are wrong in the sense that after sending 't_ks' the +cursor keys send codes different from the codes defined in the termcap. To +avoid this you can set 't_ks' (and 't_ke') to empty strings. This must be +done during initialization (see |initialization|), otherwise it's too late. + +Some termcap entries assume that the highest bit is always reset. For +example: The cursor-up entry for the Amiga could be ":ku=\E[A:". But the +Amiga really sends "\233A". This works fine if the highest bit is reset, +e.g., when using an Amiga over a serial line. If the cursor keys don't work, +try the entry ":ku=\233A:". + +Some termcap entries have the entry ":ku=\E[A:". But the Amiga really sends +"\233A". On output "\E[" and "\233" are often equivalent, on input they +aren't. You will have to change the termcap entry, or change the key code with +the :set command to fix this. + +Many cursor key codes start with an <Esc>. Vim must find out if this is a +single hit of the <Esc> key or the start of a cursor key sequence. It waits +for a next character to arrive. If it does not arrive within one second a +single <Esc> is assumed. On very slow systems this may fail, causing cursor +keys not to work sometimes. If you discover this problem reset the 'timeout' +option. Vim will wait for the next character to arrive after an <Esc>. If +you want to enter a single <Esc> you must type it twice. Resetting the +'esckeys' option avoids this problem in Insert mode, but you lose the +possibility to use cursor and function keys in Insert mode. + +On the Amiga the recognition of window resizing is activated only when the +terminal name is "amiga" or "builtin_amiga". + +Some terminals have confusing codes for the cursor keys. The televideo 925 is +such a terminal. It sends a CTRL-H for cursor-left. This would make it +impossible to distinguish a backspace and cursor-left. To avoid this problem +CTRL-H is never recognized as cursor-left. + + *vt100-cursor-keys* *xterm-cursor-keys* +Other terminals (e.g., vt100 and xterm) have cursor keys that send <Esc>OA, +<Esc>OB, etc. Unfortunately these are valid commands in insert mode: Stop +insert, Open a new line above the new one, start inserting 'A', 'B', etc. +Instead of performing these commands Vim will erroneously recognize this typed +key sequence as a cursor key movement. To avoid this and make Vim do what you +want in either case you could use these settings: > + :set notimeout " don't timeout on mappings + :set ttimeout " do timeout on terminal key codes + :set timeoutlen=100 " timeout after 100 msec +This requires the key-codes to be sent within 100msec in order to recognize +them as a cursor key. When you type you normally are not that fast, so they +are recognized as individual typed commands, even though Vim receives the same +sequence of bytes. + + *vt100-function-keys* *xterm-function-keys* +An xterm can send function keys F1 to F4 in two modes: vt100 compatible or +not. Because Vim may not know what the xterm is sending, both types of keys +are recognized. The same happens for the <Home> and <End> keys. + normal vt100 ~ + <F1> t_k1 <Esc>[11~ <xF1> <Esc>OP *<xF1>-xterm* + <F2> t_k2 <Esc>[12~ <xF2> <Esc>OQ *<xF2>-xterm* + <F3> t_k3 <Esc>[13~ <xF3> <Esc>OR *<xF3>-xterm* + <F4> t_k4 <Esc>[14~ <xF4> <Esc>OS *<xF4>-xterm* + <Home> t_kh <Esc>[7~ <xHome> <Esc>OH *<xHome>-xterm* + <End> t_@7 <Esc>[4~ <xEnd> <Esc>OF *<xEnd>-xterm* + +When Vim starts, <xF1> is mapped to <F1>, <xF2> to <F2> etc. This means that +by default both codes do the same thing. If you make a mapping for <xF2>, +because your terminal does have two keys, the default mapping is overwritten, +thus you can use the <F2> and <xF2> keys for something different. + + *xterm-shifted-keys* +Newer versions of xterm support shifted function keys and special keys. Vim +recognizes most of them. Use ":set termcap" to check which are supported and +what the codes are. Mostly these are not in a termcap, they are only +supported by the builtin_xterm termcap. + + *xterm-modifier-keys* +Newer versions of xterm support Alt and Ctrl for most function keys. To avoid +having to add all combinations of Alt, Ctrl and Shift for every key a special +sequence is recognized at the end of a termcap entry: ";*X". The "X" can be +any character, often '~' is used. The ";*" stands for an optional modifier +argument. ";2" is Shift, ";3" is Alt, ";5" is Ctrl and ";9" is Meta (when +it's different from Alt). They can be combined. Examples: > + :set <F8>=^[[19;*~ + :set <Home>=^[[1;*H +Another speciality about these codes is that they are not overwritten by +another code. That is to avoid that the codes obtained from xterm directly +|t_RV| overwrite them. + *xterm-scroll-region* +The default termcap entry for xterm on Sun and other platforms does not +contain the entry for scroll regions. Add ":cs=\E[%i%d;%dr:" to the xterm +entry in /etc/termcap and everything should work. + + *xterm-end-home-keys* +On some systems (at least on FreeBSD with XFree86 3.1.2) the codes that the +<End> and <Home> keys send contain a <Nul> character. To make these keys send +the proper key code, add these lines to your ~/.Xdefaults file: + +*VT100.Translations: #override \n\ + <Key>Home: string("0x1b") string("[7~") \n\ + <Key>End: string("0x1b") string("[8~") + + *xterm-8bit* *xterm-8-bit* +Xterm can be run in a mode where it uses 8-bit escape sequences. The CSI code +is used instead of <Esc>[. The advantage is that an <Esc> can quickly be +recognized in Insert mode, because it can't be confused with the start of a +special key. +For the builtin termcap entries, Vim checks if the 'term' option contains +"8bit" anywhere. It then uses 8-bit characters for the termcap entries, the +mouse and a few other things. You would normally set $TERM in your shell to +"xterm-8bit" and Vim picks this up and adjusts to the 8-bit setting +automatically. +When Vim receives a response to the |t_RV| (request version) sequence and it +starts with CSI, it assumes that the terminal is in 8-bit mode and will +convert all key sequences to their 8-bit variants. + +============================================================================== +2. Terminal options *terminal-options* *termcap-options* *E436* + +The terminal options can be set just like normal options. But they are not +shown with the ":set all" command. Instead use ":set termcap". + +It is always possible to change individual strings by setting the +appropriate option. For example: > + :set t_ce=^V^[[K (CTRL-V, <Esc>, [, K) + +{Vi: no terminal options. You have to exit Vi, edit the termcap entry and +try again} + +The options are listed below. The associated termcap code is always equal to +the last two characters of the option name. Only one termcap code is +required: Cursor motion, 't_cm'. + +The options 't_da', 't_db', 't_ms', 't_xs' represent flags in the termcap. +When the termcap flag is present, the option will be set to "y". But any +non-empty string means that the flag is set. An empty string means that the +flag is not set. 't_CS' works like this too, but it isn't a termcap flag. + +OUTPUT CODES + option meaning ~ + + t_AB set background color (ANSI) *t_AB* *'t_AB'* + t_AF set foreground color (ANSI) *t_AF* *'t_AF'* + t_AL add number of blank lines *t_AL* *'t_AL'* + t_al add new blank line *t_al* *'t_al'* + t_bc backspace character *t_bc* *'t_bc'* + t_cd clear to end of screen *t_cd* *'t_cd'* + t_ce clear to end of line *t_ce* *'t_ce'* + t_cl clear screen *t_cl* *'t_cl'* + t_cm cursor motion (required!) *E437* *t_cm* *'t_cm'* + t_Co number of colors *t_Co* *'t_Co'* + t_CS if non-empty, cursor relative to scroll region *t_CS* *'t_CS'* + t_cs define scrolling region *t_cs* *'t_cs'* + t_CV define vertical scrolling region *t_CV* *'t_CV'* + t_da if non-empty, lines from above scroll down *t_da* *'t_da'* + t_db if non-empty, lines from below scroll up *t_db* *'t_db'* + t_DL delete number of lines *t_DL* *'t_DL'* + t_dl delete line *t_dl* *'t_dl'* + t_fs set window title end (from status line) *t_fs* *'t_fs'* + t_ke exit "keypad transmit" mode *t_ke* *'t_ke'* + t_ks start "keypad transmit" mode *t_ks* *'t_ks'* + t_le move cursor one char left *t_le* *'t_le'* + t_mb blinking mode *t_mb* *'t_mb'* + t_md bold mode *t_md* *'t_md'* + t_me Normal mode (undoes t_mr, t_mb, t_md and color) *t_me* *'t_me'* + t_mr reverse (invert) mode *t_mr* *'t_mr'* + *t_ms* *'t_ms'* + t_ms if non-empty, cursor can be moved in standout/inverse mode + t_nd non destructive space character *t_nd* *'t_nd'* + t_op reset to original color pair *t_op* *'t_op'* + t_RI cursor number of chars right *t_RI* *'t_RI'* + t_Sb set background color *t_Sb* *'t_Sb'* + t_Sf set foreground color *t_Sf* *'t_Sf'* + t_se standout end *t_se* *'t_se'* + t_so standout mode *t_so* *'t_so'* + t_sr scroll reverse (backward) *t_sr* *'t_sr'* + t_te out of "termcap" mode *t_te* *'t_te'* + t_ti put terminal in "termcap" mode *t_ti* *'t_ti'* + t_ts set window title start (to status line) *t_ts* *'t_ts'* + t_ue underline end *t_ue* *'t_ue'* + t_us underline mode *t_us* *'t_us'* + t_Ce undercurl end *t_Ce* *'t_Ce'* + t_Cs undercurl mode *t_Cs* *'t_Cs'* + t_ut clearing uses the current background color *t_ut* *'t_ut'* + t_vb visual bell *t_vb* *'t_vb'* + t_ve cursor visible *t_ve* *'t_ve'* + t_vi cursor invisible *t_vi* *'t_vi'* + t_vs cursor very visible *t_vs* *'t_vs'* + *t_xs* *'t_xs'* + t_xs if non-empty, standout not erased by overwriting (hpterm) + t_ZH italics mode *t_ZH* *'t_ZH'* + t_ZR italics end *t_ZR* *'t_ZR'* + +Added by Vim (there are no standard codes for these): + t_IS set icon text start *t_IS* *'t_IS'* + t_IE set icon text end *t_IE* *'t_IE'* + t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'* + t_WS set window size (height, width) in characters *t_WS* *'t_WS'* + t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'* + t_EI end insert mode (block cursor shape) *t_EI* *'t_EI'* + |termcap-cursor-shape| + t_RV request terminal version string (for xterm) *t_RV* *'t_RV'* + |xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes| + +KEY CODES +Note: Use the <> form if possible + + option name meaning ~ + + t_ku <Up> arrow up *t_ku* *'t_ku'* + t_kd <Down> arrow down *t_kd* *'t_kd'* + t_kr <Right> arrow right *t_kr* *'t_kr'* + t_kl <Left> arrow left *t_kl* *'t_kl'* + <xUp> alternate arrow up *<xUp>* + <xDown> alternate arrow down *<xDown>* + <xRight> alternate arrow right *<xRight>* + <xLeft> alternate arrow left *<xLeft>* + <S-Up> shift arrow up + <S-Down> shift arrow down + t_%i <S-Right> shift arrow right *t_%i* *'t_%i'* + t_#4 <S-Left> shift arrow left *t_#4* *'t_#4'* + t_k1 <F1> function key 1 *t_k1* *'t_k1'* + <xF1> alternate F1 *<xF1>* + t_k2 <F2> function key 2 *<F2>* *t_k2* *'t_k2'* + <xF2> alternate F2 *<xF2>* + t_k3 <F3> function key 3 *<F3>* *t_k3* *'t_k3'* + <xF3> alternate F3 *<xF3>* + t_k4 <F4> function key 4 *<F4>* *t_k4* *'t_k4'* + <xF4> alternate F4 *<xF4>* + t_k5 <F5> function key 5 *<F5>* *t_k5* *'t_k5'* + t_k6 <F6> function key 6 *<F6>* *t_k6* *'t_k6'* + t_k7 <F7> function key 7 *<F7>* *t_k7* *'t_k7'* + t_k8 <F8> function key 8 *<F8>* *t_k8* *'t_k8'* + t_k9 <F9> function key 9 *<F9>* *t_k9* *'t_k9'* + t_k; <F10> function key 10 *<F10>* *t_k;* *'t_k;'* + t_F1 <F11> function key 11 *<F11>* *t_F1* *'t_F1'* + t_F2 <F12> function key 12 *<F12>* *t_F2* *'t_F2'* + t_F3 <F13> function key 13 *<F13>* *t_F3* *'t_F3'* + t_F4 <F14> function key 14 *<F14>* *t_F4* *'t_F4'* + t_F5 <F15> function key 15 *<F15>* *t_F5* *'t_F5'* + t_F6 <F16> function key 16 *<F16>* *t_F6* *'t_F6'* + t_F7 <F17> function key 17 *<F17>* *t_F7* *'t_F7'* + t_F8 <F18> function key 18 *<F18>* *t_F8* *'t_F8'* + t_F9 <F19> function key 19 *<F19>* *t_F9* *'t_F9'* + <S-F1> shifted function key 1 + <S-xF1> alternate <S-F1> *<S-xF1>* + <S-F2> shifted function key 2 *<S-F2>* + <S-xF2> alternate <S-F2> *<S-xF2>* + <S-F3> shifted function key 3 *<S-F3>* + <S-xF3> alternate <S-F3> *<S-xF3>* + <S-F4> shifted function key 4 *<S-F4>* + <S-xF4> alternate <S-F4> *<S-xF4>* + <S-F5> shifted function key 5 *<S-F5>* + <S-F6> shifted function key 6 *<S-F6>* + <S-F7> shifted function key 7 *<S-F7>* + <S-F8> shifted function key 8 *<S-F8>* + <S-F9> shifted function key 9 *<S-F9>* + <S-F10> shifted function key 10 *<S-F10>* + <S-F11> shifted function key 11 *<S-F11>* + <S-F12> shifted function key 12 *<S-F12>* + t_%1 <Help> help key *t_%1* *'t_%1'* + t_&8 <Undo> undo key *t_&8* *'t_&8'* + t_kI <Insert> insert key *t_kI* *'t_kI'* + t_kD <Del> delete key *t_kD* *'t_kD'* + t_kb <BS> backspace key *t_kb* *'t_kb'* + t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'* + t_kh <Home> home key *t_kh* *'t_kh'* + t_#2 <S-Home> shifted home key *<S-Home>* *t_#2* *'t_#2'* + <xHome> alternate home key *<xHome>* + t_@7 <End> end key *t_@7* *'t_@7'* + t_*7 <S-End> shifted end key *<S-End>* *t_star7* *'t_star7'* + <xEnd> alternate end key *<xEnd>* + t_kP <PageUp> page-up key *t_kP* *'t_kP'* + t_kN <PageDown> page-down key *t_kN* *'t_kN'* + t_K1 <kHome> keypad home key *t_K1* *'t_K1'* + t_K4 <kEnd> keypad end key *t_K4* *'t_K4'* + t_K3 <kPageUp> keypad page-up key *t_K3* *'t_K3'* + t_K5 <kPageDown> keypad page-down key *t_K5* *'t_K5'* + t_K6 <kPlus> keypad plus key *<kPlus>* *t_K6* *'t_K6'* + t_K7 <kMinus> keypad minus key *<kMinus>* *t_K7* *'t_K7'* + t_K8 <kDivide> keypad divide *<kDivide>* *t_K8* *'t_K8'* + t_K9 <kMultiply> keypad multiply *<kMultiply>* *t_K9* *'t_K9'* + t_KA <kEnter> keypad enter key *<kEnter>* *t_KA* *'t_KA'* + t_KB <kPoint> keypad decimal point *<kPoint>* *t_KB* *'t_KB'* + t_KC <k0> keypad 0 *<k0>* *t_KC* *'t_KC'* + t_KD <k1> keypad 1 *<k1>* *t_KD* *'t_KD'* + t_KE <k2> keypad 2 *<k2>* *t_KE* *'t_KE'* + t_KF <k3> keypad 3 *<k3>* *t_KF* *'t_KF'* + t_KG <k4> keypad 4 *<k4>* *t_KG* *'t_KG'* + t_KH <k5> keypad 5 *<k5>* *t_KH* *'t_KH'* + t_KI <k6> keypad 6 *<k6>* *t_KI* *'t_KI'* + t_KJ <k7> keypad 7 *<k7>* *t_KJ* *'t_KJ'* + t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'* + t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'* + <Mouse> leader of mouse code *<Mouse>* + +Note about t_so and t_mr: When the termcap entry "so" is not present the +entry for "mr" is used. And vice versa. The same is done for "se" and "me". +If your terminal supports both inversion and standout mode, you can see two +different modes. If your terminal supports only one of the modes, both will +look the same. + + *keypad-comma* +The keypad keys, when they are not mapped, behave like the equivalent normal +key. There is one exception: if you have a comma on the keypad instead of a +decimal point, Vim will use a dot anyway. Use these mappings to fix that: > + :noremap <kPoint> , + :noremap! <kPoint> , +< *xterm-codes* +There is a special trick to obtain the key codes which currently only works +for xterm. When |t_RV| is defined and a response is received which indicates +an xterm with patchlevel 141 or higher, Vim uses special escape sequences to +request the key codes directly from the xterm. The responses are used to +adjust the various t_ codes. This avoids the problem that the xterm can +produce different codes, depending on the mode it is in (8-bit, VT102, +VT220, etc.). The result is that codes like <xF1> are no longer needed. +Note: This is only done on startup. If the xterm options are changed after +Vim has started, the escape sequences may not be recognized any more. + + *termcap-colors* +Note about colors: The 't_Co' option tells Vim the number of colors available. +When it is non-zero, the 't_AB' and 't_AF' options are used to set the color. +If one of these is not available, 't_Sb' and 't_Sf' are used. 't_me' is used +to reset to the default colors. + + *termcap-cursor-shape* *termcap-cursor-color* +When Vim enters Insert mode the 't_SI' escape sequence is sent. When leaving +Insert mode 't_EI' is used. But only if both are defined. This can be used +to change the shape or color of the cursor in Insert mode. These are not +standard termcap/terminfo entries, you need to set them yourself. +Example for an xterm, this changes the color of the cursor: > + if &term =~ "xterm" + let &t_SI = "\<Esc>]12;purple\x7" + let &t_EI = "\<Esc>]12;blue\x7" + endif +NOTE: When Vim exits the shape for Normal mode will remain. The shape from +before Vim started will not be restored. +{not available when compiled without the +cursorshape feature} + + *termcap-title* +The 't_ts' and 't_fs' options are used to set the window title if the terminal +allows title setting via sending strings. They are sent before and after the +title string, respectively. Similar 't_IS' and 't_IE' are used to set the +icon text. These are Vim-internal extensions of the Unix termcap, so they +cannot be obtained from an external termcap. However, the builtin termcap +contains suitable entries for xterm and iris-ansi, so you don't need to set +them here. + *hpterm* +If inversion or other highlighting does not work correctly, try setting the +'t_xs' option to a non-empty string. This makes the 't_ce' code be used to +remove highlighting from a line. This is required for "hpterm". Setting the +'weirdinvert' option has the same effect as making 't_xs' non-empty, and vice +versa. + + *scroll-region* +Some termcaps do not include an entry for 'cs' (scroll region), although the +terminal does support it. For example: xterm on a Sun. You can use the +builtin_xterm or define t_cs yourself. For example: > + :set t_cs=^V^[[%i%d;%dr +Where ^V is CTRL-V and ^[ is <Esc>. + +The vertical scroll region t_CV is not a standard termcap code. Vim uses it +internally in the GUI. But it can also be defined for a terminal, if you can +find one that supports it. The two arguments are the left and right column of +the region which to restrict the scrolling to. Just like t_cs defines the top +and bottom lines. Defining t_CV will make scrolling in vertically split +windows a lot faster. Don't set t_CV when t_da or t_db is set (text isn't +cleared when scrolling). + +Unfortunately it is not possible to deduce from the termcap how cursor +positioning should be done when using a scrolling region: Relative to the +beginning of the screen or relative to the beginning of the scrolling region. +Most terminals use the first method. A known exception is the MS-DOS console +(pcterm). The 't_CS' option should be set to any string when cursor +positioning is relative to the start of the scrolling region. It should be +set to an empty string otherwise. It defaults to "yes" when 'term' is +"pcterm". + +Note for xterm users: The shifted cursor keys normally don't work. You can + make them work with the xmodmap command and some mappings in Vim. + + Give these commands in the xterm: + xmodmap -e "keysym Up = Up F13" + xmodmap -e "keysym Down = Down F16" + xmodmap -e "keysym Left = Left F18" + xmodmap -e "keysym Right = Right F19" + + And use these mappings in Vim: + :map <t_F3> <S-Up> + :map! <t_F3> <S-Up> + :map <t_F6> <S-Down> + :map! <t_F6> <S-Down> + :map <t_F8> <S-Left> + :map! <t_F8> <S-Left> + :map <t_F9> <S-Right> + :map! <t_F9> <S-Right> + +Instead of, say, <S-Up> you can use any other command that you want to use the +shift-cursor-up key for. (Note: To help people that have a Sun keyboard with +left side keys F14 is not used because it is confused with the undo key; F15 +is not used, because it does a window-to-front; F17 is not used, because it +closes the window. On other systems you can probably use them.) + +============================================================================== +3. Window size *window-size* + +[This is about the size of the whole window Vim is using, not a window that is +created with the ":split" command.] + +If you are running Vim on an Amiga and the terminal name is "amiga" or +"builtin_amiga", the amiga-specific window resizing will be enabled. On Unix +systems three methods are tried to get the window size: + +- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system) +- the environment variables "LINES" and "COLUMNS" +- from the termcap entries "li" and "co" + +If everything fails a default size of 24 lines and 80 columns is assumed. If +a window-resize signal is received the size will be set again. If the window +size is wrong you can use the 'lines' and 'columns' options to set the +correct values. + +One command can be used to set the screen size: + + *:mod* *:mode* *E359* *E362* +:mod[e] [mode] + +Without argument this only detects the screen size and redraws the screen. +With MS-DOS it is possible to switch screen mode. [mode] can be one of these +values: + "bw40" 40 columns black&white + "c40" 40 columns color + "bw80" 80 columns black&white + "c80" 80 columns color (most people use this) + "mono" 80 columns monochrome + "c4350" 43 or 50 lines EGA/VGA mode + number mode number to use, depends on your video card + +============================================================================== +4. Slow and fast terminals *slow-fast-terminal* + *slow-terminal* + +If you have a fast terminal you may like to set the 'ruler' option. The +cursor position is shown in the status line. If you are using horizontal +scrolling ('wrap' option off) consider setting 'sidescroll' to a small +number. + +If you have a slow terminal you may want to reset the 'showcmd' option. +The command characters will not be shown in the status line. If the terminal +scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved +off the screen (e.g., with "j") Vim will scroll 5 lines at a time. Another +possibility is to reduce the number of lines that Vim uses with the command +"z{height}<CR>". + +If the characters from the terminal are arriving with more than 1 second +between them you might want to set the 'timeout' and/or 'ttimeout' option. +See the "Options" chapter |options|. + +If your terminal does not support a scrolling region, but it does support +insert/delete line commands, scrolling with multiple windows may make the +lines jump up and down. If you don't want this set the 'ttyfast' option. +This will redraw the window instead of scroll it. + +If your terminal scrolls very slowly, but redrawing is not slow, set the +'ttyscroll' option to a small number, e.g., 3. This will make Vim redraw the +screen instead of scrolling, when there are more than 3 lines to be scrolled. + +If you are using a color terminal that is slow, use this command: > + hi NonText cterm=NONE ctermfg=NONE +This avoids that spaces are sent when they have different attributes. On most +terminals you can't see this anyway. + +If you are using Vim over a slow serial line, you might want to try running +Vim inside the "screen" program. Screen will optimize the terminal I/O quite +a bit. + +If you are testing termcap options, but you cannot see what is happening, +you might want to set the 'writedelay' option. When non-zero, one character +is sent to the terminal at a time (does not work for MS-DOS). This makes the +screen updating a lot slower, making it possible to see what is happening. + +============================================================================== +5. Using the mouse *mouse-using* + +This section is about using the mouse on a terminal or a terminal window. How +to use the mouse in a GUI window is explained in |gui-mouse|. For scrolling +with a mouse wheel see |scroll-mouse-wheel|. + +Don't forget to enable the mouse with this commands: > + :set mouse=a +Otherwise Vim won't recognize the mouse in all modes (See 'mouse'). + +Currently the mouse is supported for Unix in an xterm window, in a Linux +console (with GPM |gpm-mouse|), for MS-DOS and in a Windows console. +Mouse clicks can be used to position the cursor, select an area and paste. + +These characters in the 'mouse' option tell in which situations the mouse will +be used by Vim: + n Normal mode + v Visual mode + i Insert mode + c Command-line mode + h all previous modes when in a help file + a all previous modes + r for |hit-enter| prompt + +The default for 'mouse' is empty, the mouse is not used. Normally you would +do: > + :set mouse=a +to start using the mouse (this is equivalent to setting 'mouse' to "nvich"). +If you only want to use the mouse in a few modes or also want to use it for +the two questions you will have to concatenate the letters for those modes. +For example: > + :set mouse=nv +Will make the mouse work in Normal mode and Visual mode. > + :set mouse=h +Will make the mouse work in help files only (so you can use "g<LeftMouse>" to +jump to tags). + +Whether the selection that is started with the mouse is in Visual mode or +Select mode depends on whether "mouse" is included in the 'selectmode' +option. + +In an xterm, with the currently active mode included in the 'mouse' option, +normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key +pressed go to the xterm. With the currently active mode not included in +'mouse' all mouse clicks go to the xterm. + + *xterm-clipboard* +In the Athena and Motif GUI versions, when running in a terminal and there is +access to the X-server (DISPLAY is set), the copy and paste will behave like +in the GUI. If not, the middle mouse button will insert the unnamed register. +In that case, here is how you copy and paste a piece of text: + +Copy/paste with the mouse and Visual mode ('mouse' option must be set, see +above): +1. Press left mouse button on first letter of text, move mouse pointer to last + letter of the text and release the button. This will start Visual mode and + highlight the selected area. +2. Press "y" to yank the Visual text in the unnamed register. +3. Click the left mouse button at the insert position. +4. Click the middle mouse button. + +Shortcut: If the insert position is on the screen at the same time as the +Visual text, you can do 2, 3 and 4 all in one: Click the middle mouse button +at the insert position. + +Note: When the |-X| command line argument is used, Vim will not connect to the +X server and copy/paste to the X clipboard (selection) will not work. Use the +shift key with the mouse buttons to let the xterm do the selection. + + *xterm-command-server* +When the X-server clipboard is available, the command server described in +|x11-clientserver| can be enabled with the --servername command line argument. + + *xterm-copy-paste* +NOTE: In some (older) xterms, it's not possible to move the cursor past column +95. This is an xterm problem, not Vim's. Get a newer xterm |color-xterm|. + +Copy/paste in xterm with (current mode NOT included in 'mouse'): +1. Press left mouse button on first letter of text, move mouse pointer to last + letter of the text and release the button. +2. Use normal Vim commands to put the cursor at the insert position. +3. Press "a" to start Insert mode. +4. Click the middle mouse button. +5. Press ESC to end Insert mode. +(The same can be done with anything in 'mouse' if you keep the shift key +pressed while using the mouse.) + +Note: if you lose the 8th bit when pasting (special characters are translated +into other characters), you may have to do "stty cs8 -istrip -parenb" in your +shell before starting Vim. + +Thus in an xterm the shift and ctrl keys cannot be used with the mouse. Mouse +commands requiring the CTRL modifier can be simulated by typing the "g" key +before using the mouse: + "g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click) + "g<RightMouse>" is "<C-RightMouse> ("CTRL-T") + + *mouse-mode-table* *mouse-overview* +A short overview of what the mouse buttons do, when 'mousemodel' is "extend": + +Normal Mode: +event position selection change action ~ + cursor window ~ +<LeftMouse> yes end yes +<C-LeftMouse> yes end yes "CTRL-]" (2) +<S-LeftMouse> yes no change yes "*" (2) *<S-LeftMouse>* +<LeftDrag> yes start or extend (1) no *<LeftDrag>* +<LeftRelease> yes start or extend (1) no +<MiddleMouse> yes if not active no put +<MiddleMouse> yes if active no yank and put +<RightMouse> yes start or extend yes +<A-RightMouse> yes start or extend blockw. yes *<A-RightMouse>* +<S-RightMouse> yes no change yes "#" (2) *<S-RightMouse>* +<C-RightMouse> no no change no "CTRL-T" +<RightDrag> yes extend no *<RightDrag>* +<RightRelease> yes extend no *<RightRelease>* + +Insert or Replace Mode: +event position selection change action ~ + cursor window ~ +<LeftMouse> yes (cannot be active) yes +<C-LeftMouse> yes (cannot be active) yes "CTRL-O^]" (2) +<S-LeftMouse> yes (cannot be active) yes "CTRL-O*" (2) +<LeftDrag> yes start or extend (1) no like CTRL-O (1) +<LeftRelease> yes start or extend (1) no like CTRL-O (1) +<MiddleMouse> no (cannot be active) no put register +<RightMouse> yes start or extend yes like CTRL-O +<A-RightMouse> yes start or extend blockw. yes +<S-RightMouse> yes (cannot be active) yes "CTRL-O#" (2) +<C-RightMouse> no (cannot be active) no "CTRL-O CTRL-T" + +In a help window: +event position selection change action ~ + cursor window ~ +<2-LeftMouse> yes (cannot be active) no "^]" (jump to help tag) + +When 'mousemodel' is "popup", these are different: + +Normal Mode: +event position selection change action ~ + cursor window ~ +<S-LeftMouse> yes start or extend (1) no +<A-LeftMouse> yes start or extend blockw. no *<A-LeftMouse>* +<RightMouse> no popup menu no + +Insert or Replace Mode: +event position selection change action ~ + cursor window ~ +<S-LeftMouse> yes start or extend (1) no like CTRL-O (1) +<A-LeftMouse> yes start or extend blockw. no +<RightMouse> no popup menu no + +(1) only if mouse pointer moved since press +(2) only if click is in same buffer + +Clicking the left mouse button causes the cursor to be positioned. If the +click is in another window that window is made the active window. When +editing the command-line the cursor can only be positioned on the +command-line. When in Insert mode Vim remains in Insert mode. If 'scrolloff' +is set, and the cursor is positioned within 'scrolloff' lines from the window +border, the text is scrolled. + +A selection can be started by pressing the left mouse button on the first +character, moving the mouse to the last character, then releasing the mouse +button. You will not always see the selection until you release the button, +only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown +immediately. Note that you can make the text scroll by moving the mouse at +least one character in the first/last line in the window when 'scrolloff' is +non-zero. + +In Normal, Visual and Select mode clicking the right mouse button causes the +Visual area to be extended. When 'mousemodel' is "popup", the left button has +to be used while keeping the shift key pressed. When clicking in a window +which is editing another buffer, the Visual or Select mode is stopped. + +In Normal, Visual and Select mode clicking the right mouse button with the alt +key pressed causes the Visual area to become blockwise. When 'mousemodel is +"popup" the left button has to be used with the alt key. Note that this won't +work on systems where the window manager consumes the mouse events when the +alt key is pressed (it may move the window). + + *double-click* +Double, triple and quadruple clicks are supported when the GUI is active, +for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is +available). For selecting text, extra clicks extend the selection: + click select ~ + double word or % match *<2-LeftMouse>* + triple line *<3-LeftMouse>* + quadruple rectangular block *<4-LeftMouse>* +Exception: In a Help window a double click jumps to help for the word that is +clicked on. +A double click on a word selects that word. 'iskeyword' is used to specify +which characters are included in a word. A double click on a character +that has a match selects until that match (like using "v%"). If the match is +an #if/#else/#endif block, the selection becomes linewise. +For MS-DOS and xterm the time for double clicking can be set with the +'mousetime' option. For the other systems this time is defined outside of +Vim. +An example, for using a double click to jump to the tag under the cursor: > + :map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR> + +Dragging the mouse with a double click (button-down, button-up, button-down +and then drag) will result in whole words to be selected. This continues +until the button is released, at which point the selection is per character +again. + + *gpm-mouse* +The GPM mouse is only supported when the |+mouse_gpm| feature was enabled at +compile time. The GPM mouse driver (Linux console) does not support quadruple +clicks. + +In Insert mode, when a selection is started, Vim goes into Normal mode +temporarily. When Visual or Select mode ends, it returns to Insert mode. +This is like using CTRL-O in Insert mode. Select mode is used when the +'selectmode' option contains "mouse". + + *drag-status-line* +When working with several windows, the size of the windows can be changed by +dragging the status line with the mouse. Point the mouse at a status line, +press the left button, move the mouse to the new position of the status line, +release the button. Just clicking the mouse in a status line makes that window +the current window, without moving the cursor. If by selecting a window it +will change position or size, the dragging of the status line will look +confusing, but it will work (just try it). + + *<MiddleRelease>* *<MiddleDrag>* +Mouse clicks can be mapped. The codes for mouse clicks are: + code mouse button normal action ~ + <LeftMouse> left pressed set cursor position + <LeftDrag> left moved while pressed extend selection + <LeftRelease> left released set selection end + <MiddleMouse> middle pressed paste text at cursor position + <MiddleDrag> middle moved while pressed - + <MiddleRelease> middle released - + <RightMouse> right pressed extend selection + <RightDrag> right moved while pressed extend selection + <RightRelease> right released set selection end + <X1Mouse> X1 button pressed - *X1Mouse* + <X1Drag> X1 moved while pressed - *X1Drag* + <X1Release> X1 button release - *X1Release* + <X2Mouse> X2 button pressed - *X2Mouse* + <X2Drag> X2 moved while pressed - *X2Drag* + <X2Release> X2 button release - *X2Release* + +The X1 and X2 buttons refer to the extra buttons found on some mice. The +'Microsoft Explorer' mouse has these buttons available to the right thumb. +Currently X1 and X2 only work on Win32 environments. + +Examples: > + :noremap <MiddleMouse> <LeftMouse><MiddleMouse> +Paste at the position of the middle mouse button click (otherwise the paste +would be done at the cursor position). > + + :noremap <LeftRelease> <LeftRelease>y +Immediately yank the selection, when using Visual mode. + +Note the use of ":noremap" instead of "map" to avoid a recursive mapping. +> + :map <X1Mouse> <C-O> + :map <X2Mouse> <C-I> +Map the X1 and X2 buttons to go forwards and backwards in the jump list, see +|CTRL-O| and |CTRL-I|. + + *mouse-swap-buttons* +To swap the meaning of the left and right mouse buttons: > + :noremap <LeftMouse> <RightMouse> + :noremap <LeftDrag> <RightDrag> + :noremap <LeftRelease> <RightRelease> + :noremap <RightMouse> <LeftMouse> + :noremap <RightDrag> <LeftDrag> + :noremap <RightRelease> <LeftRelease> + :noremap g<LeftMouse> <C-RightMouse> + :noremap g<RightMouse> <C-LeftMouse> + :noremap! <LeftMouse> <RightMouse> + :noremap! <LeftDrag> <RightDrag> + :noremap! <LeftRelease> <RightRelease> + :noremap! <RightMouse> <LeftMouse> + :noremap! <RightDrag> <LeftDrag> + :noremap! <RightRelease> <LeftRelease> +< + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/tips.txt b/Aufgabe5/doc.lang/tips.txt new file mode 100644 index 0000000..597664f --- /dev/null +++ b/Aufgabe5/doc.lang/tips.txt @@ -0,0 +1,508 @@ +*tips.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Tips and ideas for using Vim *tips* + +Don't forget to browse the user manual, it also contains lots of useful tips +|usr_toc.txt|. + +Editing C programs |C-editing| +Finding where identifiers are used |ident-search| +Switching screens in an xterm |xterm-screens| +Scrolling in Insert mode |scroll-insert| +Smooth scrolling |scroll-smooth| +Correcting common typing mistakes |type-mistakes| +Counting words, lines, etc. |count-items| +Restoring the cursor position |restore-position| +Renaming files |rename-files| +Speeding up external commands |speed-up| +Useful mappings |useful-mappings| +Compressing the help files |gzip-helpfile| +Hex editing |hex-editing| +Executing shell commands in a window |shell-window| +Using <> notation in autocommands |autocmd-<>| +Highlighting matching parens |match-parens| + +============================================================================== +Editing C programs *C-editing* + +There are quite a few features in Vim to help you edit C program files. Here +is an overview with tags to jump to: + +|usr_29.txt| Moving through programs chapter in the user manual. +|usr_30.txt| Editing programs chapter in the user manual. +|C-indenting| Automatically set the indent of a line while typing + text. +|=| Re-indent a few lines. +|format-comments| Format comments. + +|:checkpath| Show all recursively included files. +|[i| Search for identifier under cursor in current and + included files. +|[_CTRL-I| Jump to match for "[i" +|[I| List all lines in current and included files where + identifier under the cursor matches. +|[d| Search for define under cursor in current and included + files. + +|CTRL-]| Jump to tag under cursor (e.g., definition of a + function). +|CTRL-T| Jump back to before a CTRL-] command. +|:tselect| Select one tag out of a list of matching tags. + +|gd| Go to Declaration of local variable under cursor. +|gD| Go to Declaration of global variable under cursor. + +|gf| Go to file name under the cursor. + +|%| Go to matching (), {}, [], /* */, #if, #else, #endif. +|[/| Go to previous start of comment. +|]/| Go to next end of comment. +|[#| Go back to unclosed #if, #ifdef, or #else. +|]#| Go forward to unclosed #else or #endif. +|[(| Go back to unclosed '(' +|])| Go forward to unclosed ')' +|[{| Go back to unclosed '{' +|]}| Go forward to unclosed '}' + +|v_ab| Select "a block" from "[(" to "])", including braces +|v_ib| Select "inner block" from "[(" to "])" +|v_aB| Select "a block" from "[{" to "]}", including brackets +|v_iB| Select "inner block" from "[{" to "]}" + +============================================================================== +Finding where identifiers are used *ident-search* + +You probably already know that |tags| can be used to jump to the place where a +function or variable is defined. But sometimes you wish you could jump to all +the places where a function or variable is being used. This is possible in +two ways: +1. Using the |:grep| command. This should work on most Unix systems, + but can be slow (it reads all files) and only searches in one directory. +2. Using ID utils. This is fast and works in multiple directories. It uses a + database to store locations. You will need some additional programs for + this to work. And you need to keep the database up to date. + +Using the GNU id-tools: + +What you need: +- The GNU id-tools installed (mkid is needed to create ID and lid is needed to + use the macros). +- An identifier database file called "ID" in the current directory. You can + create it with the shell command "mkid file1 file2 ..". + +Put this in your .vimrc: > + map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR> + map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR> + + function! ID_search() + let g:word = expand("<cword>") + let x = system("lid --key=none ". g:word) + let x = substitute(x, "\n", " ", "g") + execute "next " . x + endfun + +To use it, place the cursor on a word, type "_u" and vim will load the file +that contains the word. Search for the next occurrence of the word in the +same file with "n". Go to the next file with "_n". + +This has been tested with id-utils-3.2 (which is the name of the id-tools +archive file on your closest gnu-ftp-mirror). + +[the idea for this comes from Andreas Kutschera] + +============================================================================== +Switching screens in an xterm *xterm-screens* *xterm-save-screen* + +(From comp.editors, by Juergen Weigert, in reply to a question) + +:> Another question is that after exiting vim, the screen is left as it +:> was, i.e. the contents of the file I was viewing (editing) was left on +:> the screen. The output from my previous like "ls" were lost, +:> ie. no longer in the scrolling buffer. I know that there is a way to +:> restore the screen after exiting vim or other vi like editors, +:> I just don't know how. Helps are appreciated. Thanks. +: +:I imagine someone else can answer this. I assume though that vim and vi do +:the same thing as each other for a given xterm setup. + +They not necessarily do the same thing, as this may be a termcap vs. +terminfo problem. You should be aware that there are two databases for +describing attributes of a particular type of terminal: termcap and +terminfo. This can cause differences when the entries differ AND when of +the programs in question one uses terminfo and the other uses termcap +(also see |+terminfo|). + +In your particular problem, you are looking for the control sequences +^[[?47h and ^[[?47l. These switch between xterms alternate and main screen +buffer. As a quick workaround a command sequence like > + echo -n "^[[?47h"; vim ... ; echo -n "^[[?47l" +may do what you want. (My notation ^[ means the ESC character, further down +you'll see that the databases use \E instead). + +On startup, vim echoes the value of the termcap variable ti (terminfo: +smcup) to the terminal. When exiting, it echoes te (terminfo: rmcup). Thus +these two variables are the correct place where the above mentioned control +sequences should go. + +Compare your xterm termcap entry (found in /etc/termcap) with your xterm +terminfo entry (retrieved with /usr/5bin/infocmp -C xterm). Both should +contain entries similar to: > + :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h: + +PS: If you find any difference, someone (your sysadmin?) should better check + the complete termcap and terminfo database for consistency. + +NOTE 1: If you recompile Vim with FEAT_XTERM_SAVE defined in feature.h, the +builtin xterm will include the mentioned "te" and "ti" entries. + +NOTE 2: If you want to disable the screen switching, and you don't want to +change your termcap, you can add these lines to your .vimrc: > + :set t_ti= t_te= + +============================================================================== +Scrolling in Insert mode *scroll-insert* + +If you are in insert mode and you want to see something that is just off the +screen, you can use CTRL-X CTRL-E and CTRL-X CTRL-Y to scroll the screen. + |i_CTRL-X_CTRL-E| + +To make this easier, you could use these mappings: > + :inoremap <C-E> <C-X><C-E> + :inoremap <C-Y> <C-X><C-Y> +(Type this literally, make sure the '<' flag is not in 'cpoptions'). +You then lose the ability to copy text from the line above/below the cursor +|i_CTRL-E|. + +Also consider setting 'scrolloff' to a larger value, so that you can always see +some context around the cursor. If 'scrolloff' is bigger than half the window +height, the cursor will always be in the middle and the text is scrolled when +the cursor is moved up/down. + +============================================================================== +Smooth scrolling *scroll-smooth* + +If you like the scrolling to go a bit smoother, you can use these mappings: > + :map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y> + :map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E> + +(Type this literally, make sure the '<' flag is not in 'cpoptions'). + +============================================================================== +Correcting common typing mistakes *type-mistakes* + +When there are a few words that you keep on typing in the wrong way, make +abbreviations that correct them. For example: > + :ab teh the + :ab fro for + +============================================================================== +Counting words, lines, etc. *count-items* + +To count how often any pattern occurs in the current buffer use the substitute +command and add the 'n' flag to avoid the substitution. The reported number +of substitutions is the number of items. Examples: > + + :%s/./&/gn characters + :%s/\i\+/&/gn words + :%s/^//n lines + :%s/the/&/gn "the" anywhere + :%s/\<the\>/&/gn "the" as a word + +You might want to reset 'hlsearch' or do ":nohlsearch". +Add the 'e' flag if you don't want an error when there are no matches. + +An alternative is using |v_g_CTRL-G| in Visual mode. + +If you want to find matches in multiple files use |:vimgrep|. + + *count-bytes* +If you want to count bytes, you can use this: + + Visually select the characters (block is also possible) + Use "y" to yank the characters + Use the strlen() function: > + :echo strlen(@") +A line break is counted for one byte. + +============================================================================== +Restoring the cursor position *restore-position* + +Sometimes you want to write a mapping that makes a change somewhere in the +file and restores the cursor position, without scrolling the text. For +example, to change the date mark in a file: > + :map <F2> msHmtgg/Last [cC]hange:\s*/e+1<CR>"_D"=strftime("%Y %b %d")<CR>p'tzt`s + +Breaking up saving the position: + ms store cursor position in the 's' mark + H go to the first line in the window + mt store this position in the 't' mark + +Breaking up restoring the position: + 't go to the line previously at the top of the window + zt scroll to move this line to the top of the window + `s jump to the original position of the cursor + +============================================================================== +Renaming files *rename-files* + +Say I have a directory with the following files in them (directory picked at +random :-): + +buffer.c +charset.c +digraph.c +... + +and I want to rename *.c *.bla. I'd do it like this: > + + $ vim + :r !ls *.c + :%s/\(.*\).c/mv & \1.bla + :w !sh + :q! + +============================================================================== +Speeding up external commands *speed-up* + +In some situations, execution of an external command can be very slow. This +can also slow down wildcard expansion on Unix. Here are a few suggestions to +increase the speed. + +If your .cshrc (or other file, depending on the shell used) is very long, you +should separate it into a section for interactive use and a section for +non-interactive use (often called secondary shells). When you execute a +command from Vim like ":!ls", you do not need the interactive things (for +example, setting the prompt). Put the stuff that is not needed after these +lines: > + + if ($?prompt == 0) then + exit 0 + endif + +Another way is to include the "-f" flag in the 'shell' option, e.g.: > + + :set shell=csh\ -f + +(the backslash is needed to include the space in the option). +This will make csh completely skip the use of the .cshrc file. This may cause +some things to stop working though. + +============================================================================== +Useful mappings *useful-mappings* + +Here are a few mappings that some people like to use. + + *map-backtick* > + :map ' ` +Make the single quote work like a backtick. Puts the cursor on the column of +a mark, instead of going to the first non-blank character in the line. + + *emacs-keys* +For Emacs-style editing on the command-line: > + " start of line + :cnoremap <C-A> <Home> + " back one character + :cnoremap <C-B> <Left> + " delete character under cursor + :cnoremap <C-D> <Del> + " end of line + :cnoremap <C-E> <End> + " forward one character + :cnoremap <C-F> <Right> + " recall newer command-line + :cnoremap <C-N> <Down> + " recall previous (older) command-line + :cnoremap <C-P> <Up> + " back one word + :cnoremap <Esc><C-B> <S-Left> + " forward one word + :cnoremap <Esc><C-F> <S-Right> + +NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>| + + *format-bullet-list* +This mapping will format any bullet list. It requires that there is an empty +line above and below each list entry. The expression commands are used to +be able to give comments to the parts of the mapping. > + + :let m = ":map _f :set ai<CR>" " need 'autoindent' set + :let m = m . "{O<Esc>" " add empty line above item + :let m = m . "}{)^W" " move to text after bullet + :let m = m . "i <CR> <Esc>" " add space for indent + :let m = m . "gq}" " format text after the bullet + :let m = m . "{dd" " remove the empty line + :let m = m . "5lDJ" " put text after bullet + :execute m |" define the mapping + +(<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not +CTRL-W. You can copy/paste this into Vim if '<' is not included in +'cpoptions'.) + +Note that the last comment starts with |", because the ":execute" command +doesn't accept a comment directly. + +You also need to set 'textwidth' to a non-zero value, e.g., > + :set tw=70 + +A mapping that does about the same, but takes the indent for the list from the +first line (Note: this mapping is a single long line with a lot of spaces): > + :map _f :set ai<CR>}{a <Esc>WWmmkD`mi<CR><Esc>kkddpJgq}'mJO<Esc>j +< + *collapse* +These two mappings reduce a sequence of empty (;b) or blank (;n) lines into a +single line > + :map ;b GoZ<Esc>:g/^$/.,/./-j<CR>Gdd + :map ;n GoZ<Esc>:g/^[ <Tab>]*$/.,/[^ <Tab>]/-j<CR>Gdd + +============================================================================== +Compressing the help files *gzip-helpfile* + +For those of you who are really short on disk space, you can compress the help +files and still be able to view them with Vim. This makes accessing the help +files a bit slower and requires the "gzip" program. + +(1) Compress all the help files: "gzip doc/*.txt". + +(2) Edit "doc/tags" and change the ".txt" to ".txt.gz": > + :%s=\(\t.*\.txt\)\t=\1.gz\t= + +(3) Add this line to your vimrc: > + set helpfile={dirname}/help.txt.gz + +Where {dirname} is the directory where the help files are. The |gzip| plugin +will take care of decompressing the files. +You must make sure that $VIMRUNTIME is set to where the other Vim files are, +when they are not in the same location as the compressed "doc" directory. See +|$VIMRUNTIME|. + +============================================================================== +Executing shell commands in a window *shell-window* + +There have been questions for the possibility to execute a shell in a window +inside Vim. The answer: you can't! Including this would add a lot of code to +Vim, which is a good reason not to do this. After all, Vim is an editor, it +is not supposed to do non-editing tasks. However, to get something like this, +you might try splitting your terminal screen or display window with the +"splitvt" program. You can probably find it on some ftp server. The person +that knows more about this is Sam Lantinga <slouken@cs.ucdavis.edu>. +An alternative is the "window" command, found on BSD Unix systems, which +supports multiple overlapped windows. Or the "screen" program, found at +www.uni-erlangen.de, which supports a stack of windows. + +============================================================================== +Hex editing *hex-editing* *using-xxd* + +See section |23.4| of the user manual. + +If one has a particular extension that one uses for binary files (such as exe, +bin, etc), you may find it helpful to automate the process with the following +bit of autocmds for your <.vimrc>. Change that "*.bin" to whatever +comma-separated list of extension(s) you find yourself wanting to edit: > + + " vim -b : edit binary using xxd-format! + augroup Binary + au! + au BufReadPre *.bin let &bin=1 + au BufReadPost *.bin if &bin | %!xxd + au BufReadPost *.bin set ft=xxd | endif + au BufWritePre *.bin if &bin | %!xxd -r + au BufWritePre *.bin endif + au BufWritePost *.bin if &bin | %!xxd + au BufWritePost *.bin set nomod | endif + augroup END + +============================================================================== +Using <> notation in autocommands *autocmd-<>* + +The <> notation is not recognized in the argument of an :autocmd. To avoid +having to use special characters, you could use a self-destroying mapping to +get the <> notation and then call the mapping from the autocmd. Example: + + *map-self-destroy* > + " This is for automatically adding the name of the file to the menu list. + " It uses a self-destroying mapping! + " 1. use a line in the buffer to convert the 'dots' in the file name to \. + " 2. store that in register '"' + " 3. add that name to the Buffers menu list + " WARNING: this does have some side effects, like overwriting the + " current register contents and removing any mapping for the "i" command. + " + autocmd BufNewFile,BufReadPre * nmap i :nunmap i<CR>O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><CR><CR> + autocmd BufNewFile,BufReadPre * normal i + +Another method, perhaps better, is to use the ":execute" command. In the +string you can use the <> notation by preceding it with a backslash. Don't +forget to double the number of existing backslashes and put a backslash before +'"'. +> + autocmd BufNewFile,BufReadPre * exe "normal O\<C-R>%\<Esc>:.g/\\./s/\\./\\\\./g\<CR>0\"9y$u:menu Buffers.\<C-R>9 :buffer \<C-R>%\<C-V>\<CR>\<CR>" + +For a real buffer menu, user functions should be used (see |:function|), but +then the <> notation isn't used, which defeats using it as an example here. + +============================================================================== +Highlighting matching parens *match-parens* + +This example shows the use of a few advanced tricks: +- using the |CursorMoved| autocommand event +- using |searchpairpos()| to find a matching paren +- using |synID()| to detect whether the cursor is in a string or comment +- using |:match| to highlight something +- using a |pattern| to match a specific position in the file. + +This should be put in a Vim script file, since it uses script-local variables. +It skips matches in strings or comments, unless the cursor started in string +or comment. This requires syntax highlighting. + +A slightly more advanced version is used in the |matchparen| plugin. +> + let s:paren_hl_on = 0 + function s:Highlight_Matching_Paren() + if s:paren_hl_on + match none + let s:paren_hl_on = 0 + endif + + let c_lnum = line('.') + let c_col = col('.') + + let c = getline(c_lnum)[c_col - 1] + let plist = split(&matchpairs, ':\|,') + let i = index(plist, c) + if i < 0 + return + endif + if i % 2 == 0 + let s_flags = 'nW' + let c2 = plist[i + 1] + else + let s_flags = 'nbW' + let c2 = c + let c = plist[i - 1] + endif + if c == '[' + let c = '\[' + let c2 = '\]' + endif + let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . + \ '=~? "string\\|comment"' + execute 'if' s_skip '| let s_skip = 0 | endif' + + let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip) + + if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') + exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col . + \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + let s:paren_hl_on = 1 + endif + endfunction + + autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren() + autocmd InsertEnter * match none +< + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/todo.txt b/Aufgabe5/doc.lang/todo.txt new file mode 100644 index 0000000..13016f6 --- /dev/null +++ b/Aufgabe5/doc.lang/todo.txt @@ -0,0 +1,3507 @@ +*todo.txt* For Vim version 7.0. Last change: 2006 May 07 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + + TODO list for Vim *todo* + +This is a veeeery long list of known bugs, current work and desired +improvements. To make it a little bit accessible, the items are grouped by +subject. In the first column of the line a classification is used to be able +to look for "the next thing to do": + +Priority classification: +9 next point release +8 next release +7 as soon as possible +6 soon +5 should be included +4 nice to have +3 consider including +2 maybe not +1 probably not +- unclassified + + *votes-for-changes* +See |develop.txt| for development plans. You can vote for which items should +be worked on, but only if you sponsor Vim development. See |sponsor|. + + *known-bugs* +-------------------- Known bugs and current work ----------------------- + +Test 61 fails sometimes. This is a timing problem: "sleep 2" sometimes takes +longer than 2 seconds. + + +Awaiting updated patches: +9 Mac unicode patch (Da Woon Jung, Eckehard Berns): + 8 Add patch from Muraoka Taro (Mar 16) to support input method on Mac? + New patch 2004 Jun 16 + - selecting proportional font breaks display + - UTF-8 text causes display problems. Font replacement causes this. + - Command-key mappings do not work. (Alan Schmitt) + - With 'nopaste' pasting is wrong, with 'paste' Command-V doesn't work. + (Alan Schmitt) + - remove 'macatsui' option when this has been fixed. +9 HTML indenting can be slow. Caused by using searchpair(). Can search() + be used instead? +8 Win32: Add minidump generation. (George Reilly, 2006 Apr 24) +8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible. + Aric Blumer has a patch for this. He will update the patch for 6.3. +7 Completion of network shares, patch by Yasuhiro Matsumoto. + Update 2004 Sep 6. + How does this work? Missing comments. +- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav + Smilauer, 2004 Sep 13, fix Oct 31) + Asked for improvements 2004 Dec 20. +8 Add a few more command names to the menus. Patch from Jiri Brezina + (28 feb 2002). Will mess the translations... +7 ATTENTION dialog choices are more logical when "Delete it' appears + before "Quit". Patch by Robert Webb, 2004 May 3. +- Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work + for multi-byte characters. +- Win32: add options to print dialog. Patch from Vipin Aravind. +- Patch to add highlighting for whitespace. (Tom Schumm, 2003 Jul 5) + use the patch that keeps using HLF_8 if HLF_WS has not + been given values. + Add section in help files for these highlight groups? +8 "fg" and "bg" don't work in an xterm. Get default colors from xterm + with an ESC sequence. + xterm can send colors for many things. E.g. for the cursor: + <Esc>]12;?<Bel> + Can use this to get the background color and restore the colors on exit. +7 Add "DefaultFG" and "DefaultBG" for the colors of the menu. (Marcin + Dalecki has a patch for Motif and Carbon) +- Add possibility to highlight specific columns (for Fortran). Or put a + line in between columns (e.g., for 'textwidth'). + Patch to add 'hlcolumn' from Vit Stradal, 2004 May 20. +8 Add functions: + gettext() Translate a message. (Patch from Yasuhiro Matsumoto) + Update 2004 Sep 10 + Another patch from Edward L. Fox (2005 Nov 24) + Search in 'runtimepath'? + More docs needed about how to use this. + How to get the messages into the .po files? + confirm() add "flags" argument, with 'v' for vertical + layout and 'c' for console dialog. (Haegg) + Flemming Madsen has a patch for the 'c' flag + (2003 May 13) + raisewin() raise gvim window (see HierAssist patch for + Tcl implementation ~/vim/HierAssist/ ) +7 Make globpath() also work with upwards search. (Brian Medley) +7 Add patch from Benoit Cerrina to integrate Vim and Perl functions + better. Now also works for Ruby (2001 Nov 10) +- Patch from Herculano de Lima Einloft Neto for better formatting of the + quickfix window (2004 dec 2) +7 When 'rightleft' is set, the search pattern should be displayed right + to left as well? See patch of Dec 26. (Nadim Shaikli) +8 Option to lock all used memory so that it doesn't get swapped to disk + (uncrypted). Patch by Jason Holt, 2003 May 23. Uses mlock. +7 Support a stronger encryption. Jason Holt implemented AES (May 6 2003). +7 Add ! register, for shell commands. (patch from Grenie) +8 In the gzip plugin, also recognize *.gz.orig, *.gz.bak, etc. Like it's + done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1. +7 Add a "-@ filelist" argument: read file names from a file. (David + Kotchan has a patch for it) +8 Include a connection to an external program through a pipe? See + patches from Felbinger for a mathematica interface. + Or use emacs server kind of thing? +7 Add ":justify" command. Patch from Vit Stradal 2002 Nov 25. +- findmatch() should be adjusted for Lisp. See remark at + get_lisp_indent(). Esp. \( and \) should be skipped. (Dorai Sitaram, + incomplete patch Mar 18) +- For GUI Find/Replace dialog support using a regexp. Patch for Motif + and GTK by degreneir (nov 10 and nov 18). +- Patch for "paranoid mode" by Kevin Collins, March 7. Needs much more work. + + +Vi incompatibility: +- Try new POSIX tests, made after my comments. (Geoff Clare, 2005 April 7) + Version 1.5 is in ~/src/posix/1.5. (Lynne Canal) +8 With undo/redo only marks in the changed lines should be changed. Other + marks should be kept. Vi keeps each mark at the same text, even when it + is deleted or restored. (Webb) + Also: A mark is lost after: make change, undo, redo and undo. + Example: "{d''" then "u" then "d''": deletes an extra line, because the '' + position is one line down. (Veselinovic) +8 When stdin is not a tty, and Vim reads commands from it, an error should + make Vim exit. +7 Unix Vim (not gvim): Typing CTRL-C in Ex mode should finish the line + (currently you can continue typing, but it's truncated later anyway). + Requires a way to make CTRL-C interrupt select() when in cooked input. +8 When loading a file in the .exrc, Vi loads the argument anyway. Vim skips + loading the argument if there is a file already. When no file argument + given, Vi starts with an empty buffer, Vim keeps the loaded file. (Bearded) +6 In Insert mode, when using <BS> or <Del>, don't wipe out the text, but + only move back the cursor. Behaves like '$' in 'cpoptions'. Use a flag + in 'cpoptions' to switch this on/off. +8 When editing a file which is a symbolic link, and then opening another + symbolic link on the same file, Vim uses the name of the first one. + Adjust the file name in the buffer to the last one used? Use several file + names in one buffer??? + Also: When first editing file "test", which is symlink to "test2", and + then editing "test2", you end up editing buffer "test" again. It's not + logical that the name that was first used sticks with the buffer. +7 The ":undo" command works differently in Ex mode. Edit a file, make some + changes, "Q", "undo" and _all_ changes are undone, like the ":visual" + command was one command. + On the other hand, an ":undo" command in an Ex script only undoes the last + change (e.g., use two :append commands, then :undo). +7 The ":map" command output overwrites the command. Perhaps it should keep + the ":map" when it's used without arguments? +7 CTRL-L is not the end of a section? It is for Posix! Make it an option. +7 Implement 'prompt' option. Init to off when stdin is not a tty. +7 CTRL-T in Insert mode inserts 'shiftwidth' of spaces at the cursor. Add a + flag in 'cpoptions' for this. +7 Add a way to send an email for a crashed edit session. Create a file when + making changes (containing name of the swap file), delete it when writing + the file. Supply a program that can check for crashed sessions (either + all, for a system startup, or for one user, for in a .login file). +7 Vi doesn't do autoindenting when input is not from a tty (in Ex mode). +7 "z3<CR>" should still use the whole window, but only redisplay 3 lines. +7 ":tag xx" should move the cursor to the first non-blank. Or should it go + to the match with the tag? Option? +7 Implement 'autoprint'/'ap' option. +7 Add flag in 'cpoptions' that makes <BS> after a count work like <Del> + (Sayre). +7 Add flag in 'cpoptions' that makes operator (yank, filter) not move the + cursor, at least when cancelled. (default Vi compatible). +7 This Vi-trick doesn't work: "Q" to go to Ex mode, then "g/pattern/visual". + In Vi you can edit in visual mode, and when doing "Q" you jump to the next + match. Nvi can do it too. +7 Support '\' for line continuation in Ex mode for these commands: (Luebking) + g/./a\ g/pattern1/ s/pattern2/rep1\\ + line 1\ line 2\\ + line 2\ line 3\\ + . line4/ +6 ":e /tmp/$tty" doesn't work. ":e $uid" does. Is $tty not set because of + the way the shell is started? +6 Vi compatibility (optional): make "ia<CR><ESC>10." do the same strange + thing. (only repeat insert for the first line). + + +GTK+ 1 (OK in GTK 2): +8 When using "gvim -geom 40x30" or setting 'columns' in .gvimrc or with a + GUIEnter autocommand, the width is still set to fit the toolbar. Also + happens when changing the font. How to avoid that the toolbar specifies + the minimal window width? +8 When using a theme with different scrollbars (gtkstep), the scrollbars can + be too narrow. (Drazen Kacar) +8 Font "7x14" has a bold version "7x14bold". Try to find the bold font by + appending "bold" when there are not 14 dashes. + +GTK+ GUI known bugs: +9 Crash with X command server over ssh. (Ciaran McCreesh, 2006 Feb 6) +8 GTK 2: Combining UTF-8 characters not displayed properly in menus (Mikolaj + Machowski) They are displayed as separate characters. Problem in + creating a label? +8 GTK 2: Combining UTF-8 characters are sometimes not drawn properly. + Depends on the font size, "monospace 13" has the problem. Vim seems to do + everything right, must be a GTK bug. Is there a way to work around it? +9 Can't paste a Visual selection from GTK-gvim to vim in xterm or Motif gvim + when it is longer than 4000 characters. Works OK from gvim to gvim and + vim to vim. Pasting through xterm (using the shift key) also works. + It starts working after GTK gvim loses the selection and gains it again. +- Gnome2: When moving the toolbar out of the dock, so that it becomes + floating, it can no longer be moved. Therefore making it float has been + blocked for now. + + +Win32 GUI known bugs: +- Win32: tearoff menu window should have a scrollbar when it's taller than + the screen. +8 On Windows 98 the unicows library is needed to support functions with UCS2 + file names. Can we load unicows.dll dynamically? +8 When the primary monitor is below or right of the secondary monitor and + Vim is on the secondary monitor it will often move to the primary monitor. + Window position coordinates can be negative. (James Harvey) +8 The -P argument doesn't work very well with many MDI applications. + The last argument of CreateWindowEx() should be used, see MSDN docs. + Tutorial: http://win32assembly.online.fr/tut32.html +8 In eval.c, io.h is included when MSWIN32 is defined. Shouldn't this be + WIN32? Or can including io.h be moved to vim.h? (Dan Sharp) +7 Windows XP: When using "ClearType" for text smoothing, a column of yellow + pixels remains when typing spaces in front of a "D" ('guifont' set to + "lucida_console:h8"). +6 Win32 GUI: With "-u NONE -U NONE" and doing "CTRL-W v" "CTRL-W o", the ":" + of ":only" is highlighted like the cursor. (Lipelis) +8 When 'encoding' is "utf-8", should use 'guifont' for both normal and wide + characters to make Asian languages work. Win32 fonts contain both + type of characters. +7 When font smoothing is enabled, redrawing can become very slow. The reason + appears to be drawing with a transparent background. Would it be possible + to use an opaque background in most places? +8 Use another default for 'termencoding': the active codepage. Means that + when 'encoding' is changed typing characters still works properly. + Alternative: use the Unicode functions to obtain typed characters. +8 Win32: Multi-byte characters are not displayed, even though the same font + in Notepad can display them. (Srinath Avadhanula) Try with the + UTF-8-demo.txt page with Andale Mono. +7 The cursor color indicating IME mode doesn't work properly. (Shizhu Pan, + 2004 May 9) +8 Win32: When clicking on the gvim title bar, which gives it focus, produces + a file-changed dialog, after clicking on a button in that dialog the gvim + window follows the mouse. The button-up event is lost. Only with + MS-Windows 98? + Try this: ":set sw ts", get enter-prompt, then change the file in a + console, go back to Vim and click "reload" in the dialog for the changed + file: Window moves with the cursor! + Put focus event in input buffer and let generic Vim code handle it? +8 When activating the Vim window with mouse click, don't move cursor to + mouse position. Catch WM_MOUSEACTIVATE. (Luevelsmeyer) +8 Win32: When mouse is hidden and in the toolbar, moving it won't make it + appear. (Sami Salonen) +8 Windows NT: writing to aux.* makes Vim hang. (Acevedo) +8 Win32 GUI: With maximized window, ":set go-=r" doesn't use the space that + comes available. (Poucet) It works OK on Win 98 but doesn't work on Win + NT 4.0. Leaves a grey area where the scrollbar was. ":set go+=r" also + doesn't work properly. +8 When Vim is minimized and when maximizing it a file-changed dialog pops + up, Vim isn't maximized. It should be done before the dialog, so that it + appears in the right position. (Webb) +9 When selecting at the more-prompt or hit-enter-prompt, the right mouse + button doesn't give popup menu. + At the hit-enter prompt CTRL-Y doesn't work to copy the modeless + selection. + On the command line, don't get a popup menu for the right mouse button. + Let the middle button paste selected text (not the clipboard but the + non-Visual selection)? Otherwise CTRL-Y has to be used to copy the text. +8 When 'grepprg' doesn't execute, the error only flashes by, the + user can hardly see what is wrong. (Moore) + Could use vimrun with an "-nowait" argument to only wait when an error + occurs, but "command.com" doesn't return an error code. +8 When the 'shell' cannot be executed, should give an appropriate error msg. + Esp. for a filter command, currently it only complains the file could not + be read. +7 Add an option to add one pixel column to the character width? Lucida + Console italic is wider than the normal font ("d" overlaps with next char). + Opposite of 'linespace': 'columnspace'. +7 At the hit-enter prompt scrolling now no longer works. Need to use the + keyboard to get around this. Pretend <CR> was hit when the user tries to + scroll? +7 Scrollbar width doesn't change when selecting other windows appearance. + Also background color of Toolbar and rectangle below vert. scrollbar. +7 "!start /min cmd" should run in a minimized window, instead of using + "/min" as the command name. (Rogall) +6 Drawing text transparently doesn't seem to work (when drawing part cursor). +8 CTRL key doesn't always work in combination with ALT key. It does work + for function keys, not for alphabetic characters. Perhaps this is because + CTRL-ALT is used by Windows as AltGr? +8 CTRL-- doesn't work for AZERTY, because it's CTRL-[ for QWERTY. How do we + know which keyboard is being used? +7 When scrolling, and a background color is dithered, the dither pattern + doesn't always join correctly between the scrolled area and the new drawn + area (Koloseike). +8 When gui_init_font() is called with "*", p_guifont is freed while it might + still be used somewhere. This is too tricky, do the font selection first, + then set the new font by name (requires putting all logfont parameters in + the font name). + + +Athena and Motif: +6 New Motif toolbar button from Marcin Dalecki: + - When the mouse pointer is over an Agide button the red becomes black. + Something with the way colors are specified in the .xpm file. + - The pixmap is two pixels smaller than it should be. The gap is filled + with grey instead of the current toolbar background color. +9 Can configure be changed to disable netbeans if the Xpm library is + required and it's missing? +8 When using the resource "Vim*borderwidth 2" the widgets are positioned + wrong. +9 XIM is disabled by default for SGI/IRIX. Fix XIM so that 'imdisable' can + be off by default. +9 XIM doesn't work properly for Athena/Motif. (Yasuhiro Matsumoto) For now, + keep XIM active at all times when the input method has the preediting + flag. +8 X11: A menu that contains an umlaut is truncated at that character. + Happens when the locale is "C", which uses ASCII instead of IS0-8859-1. + Is there a way to use latin1 by default? Gnome_init() seems to do this. +8 Perhaps use fontsets for everything? +6 When starting in English and switching the language to Japanese, setting + the locale with ":lang", 'guifontset' and "hi menu font=", deleting all + menus and setting them again, the menus don't use the new font. Most of + the tooltips work though... +7 Motif: when using a file selection dialog, the specified file name is not + always used (when specifying a filter or another directory). +8 When 'encoding' is different from the current locale (e.g., utf-8) the + menu strings don't work. Requires conversion from 'encoding' to the + current locale. Workaround: set 'langmenu'. + + +Athena GUI: +9 When dragging the scrollbar thumb very fast, focus is only obtained in + the scrollbar itself. And the thumb is no longer updated when moving + through files. +7 The file selector is not resizable. With a big font it is difficult to + read long file names. (Schroeder) +4 Re-write the widget attachments and code so that we will not have to go + through and calculate the absolute position of every widget every time the + window is refreshed/changes size. This will help the "flashing-widgets" + problem during a refresh. +5 When starting gvim with all the default colors and then typing + ":hi Menu guibg=cyan", the menus change color but the background of the + pullright pixmap doesn't change colors. + If you type ":hi Menu guibg=cyan font=anyfont", then the pixmap changes + colors as it should. + Allocating a new pixmap and setting the resource doesn't change the + pullright pixmap's colors. Why? Possible Athena bug? + + +Motif GUI: +- gui_mch_browsedir() is missing. +7 Use XmStringCreateLocalized() instead of XmStringCreateSimple()? + David Harrison says it's OK (it exists in Motif 1.2). +8 Lesstif: When deleting a menu that's torn off, the torn off menu becomes + very small instead of disappearing. When closing it, Vim crashes. + (Phillipps) + + +GUI: +9 On Solaris, creating the popup menu causes the right mouse button no + longer to work for extending the selection. (Halevy) +9 When running an external program, it can't always be killed with CTRL-C. + e.g., on Solaris 5.5, when using "K" (Keech). Other 'guipty' problems on + Solaris 2.6. (Marley) +9 On Solaris: Using a "-geometry" argument, bigger than the window where Vim + is started from, causes empty lines below the cmdline. (raf) +8 X11 GUI: When menu is disabled by excluding 'm' from 'guioptions', ALT key + should not be used to trigger a menu (like the Win32 version). +8 When setting 'langmenu', it should be effective immediately. Store both + the English and the translated text in the menu structure. Re-generate + the translation when 'langmenu' has changed. +8 Basic flaw in the GUI code: NextScreen is updated before calling + gui_write(), but the GUI code relies on NextScreen to represent the state + of where it is processing the output. + Need better separation of Vim core and GUI code. +8 When fontset support is enabled, setting 'guifont' to a single font + doesn't work. +8 Menu priority for sub-menus for: Amiga, BeOS. +8 When translating menus ignore the part after the Tab, the shortcut. So + that the same menu item with a different shortcut (e.g., for the Mac) are + still translated. +8 Add menu separators for Amiga, RISCOS. +8 Add way to specify the file filter for the browse dialog. At least for + browse(). +8 Add dialog for search/replace to other GUIs? Tk has something for this, + use that code? Or use console dialog. +8 When selecting a font with the font dialog and the font is invalid, the + error message disappears too quick. +7 More features in the find/replace dialog: + - regexp on/off + - search in selection/buffer/all buffers/directory + when all buffers/directory is used: + - filter for file name + when directory is used: + - subdirectory on/off + - top directory browser +8 gui_check_colors() is not called at the right moment. Do it much later, + to avoid problems. +8 gui_update_cursor() is called for a cursor shape change, even when there + are mappings to be processed. Only do something when going to wait for + input. Or maybe every 100 ms? +8 X11: When the window size is reduced to fit on screen, there are blank + lines below the text and bottom scrollbar. "gvim -geometry 80x78+0+0". + When the "+0+0" is omitted it works. +8 When starting an external command, and 'guipty' set, BS and DEL are mixed + up. Set erase character somehow? +8 A dead circumflex followed by a space should give the '^' character + (Rommel). Look how xterm does this. + Also: Bednar has some code for dead key handling. + Also: Nedit 5.0.2 with USE_XMIM does it right. (Gaya) +8 The compose key doesn't work properly (Cepas). Both for Win32 and X11. +7 The cursor in an inactive window should be hollow. Currently it's not + visible. +7 GUI on Solaris 2.5.1, using /usr/dt/..: When gvim starts, cursor is + hollow, after window lowered/raised it's OK. (Godfrey) +7 When starting GUI with ":gui", and window is made smaller because it + doesn't fit on the screen, there is an extra redraw. +8 When setting font with .Xdefaults, there is an extra empty line at the + bottom, which disappears when using ":set guifont=<Tab>". (Chadzelek) +8 When font shape changes, but not the size, doing ":set font=" does not + redraw the screen with the new font. Also for Win32. + When the size changes, on Solaris 2.5 there isn't a redraw for the + remaining part of the window (Phillipps). +- Flashes really badly in certain cases when running remotely from a Sun. +4 Re-write the code so that the highlighting isn't changed multiple times + when doing a ":hi clear". The color changes happen three or more times + currently. This is very obvious on a 66Mhz 486. + + +MSDOS/DJGPP: +9 Pressing CTRL-C often crashes the console Vim runs in. (Ken Liao) + When 'bioskey' isn't set it doesn't happen. Could be a problem with the + BIOS emulation of the console. Version 5.6 already had this problem. +8 DJGPP: "cd c:" can take us to a directory that no longer exists. + change_drive() doesn't check this. How to check for this error? +9 The 16 bit version runs out of memory very quickly. Should find unused + code and reduce static data. Resetting 'writebackup' helps to be able to + write a file. +9 Crash when running on Windows 98 in a console window and pressing CTRL-C. + Happens now and then. When debugging Vim in gdb this also happens. Since + the console crashes, might be a bug in the DOS console. Resetting + 'bioskey' avoids it, but then CTRL-C doesn't work. +9 DOS: Make CTRL-Fx and ALT-Fx work. + CTRL-F1 = CE-5E, CTRL-F2 = CE-5F, .., CTRL-F10 = CE-67 + ALT-F1 = CE-68, ALT-F2 = CE-69, .., ALT-F10 = CE-71 + Shifted cursor keys produce same codes as unshifted keys. Use bioskey(2) + to get modifier mask for <S-C-M-Fx>. + Use K_SPECIAL/KS_MODIFIER codes to insert modifier mask in input stream? + Make this work like in Win32 console. + Mapping things like <M-A> doesn't work, because it generates an extended + key code. Use a translation table? +9 Can't read an opened swap file when the "share" command has not been used. + At least ignore the swap files that Vim has opened itself. +8 Use DJGPP 2.03. +8 The Dos32 version (DJGPP) can't use long file names on Windows NT. + Check if new package can be used (v2misc/ntlfn08[bs].zip). +8 setlocale() is bogus. +8 Vim busy waits for new characters or mouse clicks. Should put in some + sort of sleep, to avoid eating 50% of the CPU time. Test on an unpatched + Windows 95 system! +8 DJGPP: when shell is bash, make fails. (Donahoe) +7 Hitting CTRL-P twice quickly (e.g., in keyword completion) on a 8088 + machine, starts printer echo! (John Mullin). +7 MSDOS 16 bit version can't work with COMSPEC that has an argument, e.g.: + COMSPEC=C:\WINDOWS\COMMAND.COM /E:4096 (Bradley) + Caused by BCC system() function (Borland "make" has the same problem). +8 Mouse: handle left&right button pressed as middle button pressed. Add + modifier keys shift, ctrl and alt. +7 When too many files are open (depends on FILES), strange things happen. + The Dos16 version runs out of memory, in the Dos32 version "!ls" causes a + crash. Another symptom: .swp files are not deleted, existing files are + "[New file]". +7 DJGPP version doesn't work with graphics display mode. Switch to a mode + that is supported? +8 DJGPP: ":mode" doesn't work for many modes. Disable them. +8 DJGPP: When starting in Ex mode, shouldn't clear the screen. (Walter + Briscoe) + + +MSDOS, OS/2 and Win32: +8 OS/2: Add backtick expansion. Undefine NO_EXPANDPATH and use + gen_expand_wildcards(). +8 OS/2: Add clipboard support? See example clipbrd.exe from Alexander + Wagner. +8 OS/2: Add Extended Attributes support and define HAVE_ACL. +8 OS/2: When editing a file name "foo.txt" that is actually called FOO.txt, + writing uses "foo.txt". Should obtain the real file name. +8 Should $USERPROFILE be preferred above $HOMEDRIVE/$HOMEPATH? No, but it's + a good fallback, thus use: + $HOME + $HOMEDRIVE$HOMEPATH + SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_APPDATA, FALSE); + $USERPROFILE + SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_COMMON_APPDATA, FALSE); + $ALLUSERSPROFILE + $SYSTEMDRIVE\ + C:\ +8 Win32 console: <M-Up> and <M-Down> don't work. (Geddes) We don't have + special keys for these. Should use modifier + key. +8 Win32 console: caps-lock makes non-alpha keys work like with shift. + Should work like in the GUI version. +8 Environment variables in DOS are not case sensitive. Make a define for + STRCMP_ENV(), and use it when comparing environment var names. +8 Setting 'shellslash' has no immediate effect. Change all file names when + it is set/reset? Or only use it when actually executing a shell command? +8 When editing a file on a Samba server, case might matter. ":e file" + followed by ":e FILE" will edit "file" again, even though "FILE" might be + another one. Set last used name in buflist_new()? Fix do_ecmd(), etc. +8 When a buffer is editing a file like "ftp://mach/file", which is not going + to be used like a normal file name, don't change the slashes to + backslashes. (Ronald Hoellwarth) + + +Windows 95: +8 Editing a file by it's short file name and writing it, makes the long file + name disappear. Setting 'backupcopy' helps. + Use FindFirstFile()->cAlternateFileName in fname_case() (George Reilly). +8 Doing wildcard expansion, will match the short filename, but result in the + long filename (both DJGPP and Win32). + + +Win32 console: +9 When editing a file by its short file name, it should be expanded into its + long file name, to avoid problems like these: (Mccollister) + 1) Create a file called ".bashrc" using some other editor. + 2) Drag that file onto a shortcut or the actual executable. + 3) Note that the file name is something like BASHRC~1 + 4) Go to File->Save As menu item and type ".bashrc" as the file name. + 5) Press "Yes" to indicate that I want to overwrite the file. + 6) Note that the message "File exists (add ! to override)" is displayed + and the file is not saved. + Use FindFirstFile() to expand a file name and directory in the path to its + long name. +8 Also implement 'conskey' option for the Win32 console version? Look at + how Xvi does console I/O under Windows NT. +7 Re-install the use of $TERM and support the use of different terminals, + besides the console. +8 Use of <altgr> modifier doesn't work? 5.3 was OK. (Garcia-Suarez/Guckes) +9 Mapping <C-S-Tab> doesn't work correctly. How to see the difference with + <C-S-i>? +9 tmpnam() uses file in root of file system: "\asdf". That doesn't work on + a Netware network drive. Use same function as for Win32 GUI? +8 In os_win32.h, HAVE_STRICMP and HAVE_STRNICMP are defined only if __GNUC__ + is not defined. Shouldn't that be the other way around? +7 Use SetConsoleCP() and SetConsoleOutputCP() to implement 'termencoding'? + Avoids that input and output work differently. Need to be restored when + exiting. + + +Amiga: +8 In mch_inchar() should use convert_input_safe() to handle incomplete byte + sequences. +9 In mch_expandpath() a "*" is to be expanded, but "\*" isn't. Remove + backslashes in result. +8 Executing a shell, only one option for 'shell' is separated. Should do + all options, using white space separation. + + +Macintosh: +- GUI: gui_mch_browsedir() is missing. +7 Patch to add 'transparency' option. Disadvantage: it's slow. (Eckehard + Berns, 2004 May 9) http://ecki.to/vim/TransBack-2004-05-09.diff + Needs more work. Add when someone really wants it. +7 Loading the Perl library only works on OS/X 10.2 or 10.3, never on both. + Load the Perl library dynamically see Python sources file dynload_mac + (Jack) + dynamic linking: http://developer.apple.com/technotes/tn2002/tn2064.html +8 Inputting Unicode characters does not work in the terminal. They appear + to arrive as upper and lower bytes. (David Brown, 2004 April 17) +8 Typing Unicode characters doesn't work at all in the GUI. +9 Problems in Carbon version for OS X: (Benji Fisher) + - keyboard shortcuts in the menus get lost. +8 The Vim/About menu doesn't work. +8 ":gui" doesn't fork. Enabling the code in gui.c to fork causes a SEGV. +8 Define vim_mkdir() for Macintosh. +8 Define mch_writable() for Macintosh. +9 When DiskLock is running, using a swap file causes a crash. Appears to be + a problem with writing a file that starts with a dot. (Giacalone) +9 On G3 Mac, OS version 8, control strip causes characters messed up when + scrolling (CTRL-L cleans it up). (Benji Fisher) +9 On G3 Mac, OS version 8, variable-speed scrolling doesn't work, after two + seconds of scrolling the screen freezes. (Benji Fisher) +9 In mac_expandpath() check that handling of backslashes is done properly. +8 Standard Mac shortcuts are missing. (Amerige) +8 Handling of non-fixed width fonts is wrong. (Amerige) + + +"Small" problems: +9 For Turkish vim_tolower() and vim_toupper() also need to use utf_ + functions for characters below 0x80. (Sertacyildiz) +9 When the last edited file is a help file, using '0 in a new Vim doesn't + edit the file as a help file. +8 When an ":edit" is inside a try command and the ATTENTION prompt is used, + the :catch commands are always executed, also when the file is edited + normally. Should reset did_emsg and undo side effects. Also make sure + the ATTENTION message shows up. Servatius Brandt works on this. +9 When using ":e ++enc=foo file" and the file is already loaded with + 'fileencoding' set to "bar", then do_ecmd() uses that buffer, even though + the fileencoding differs. Reload the buffer in this situation? Need to + check for the buffer to be unmodified. +8 ":g//" gives "Pattern not found error" with E486. Should not use the + error number, it's not a regular error message. +7 Vimtutor leaves escape sequence in terminal. This is the xterm response to + requesting the version number. (Yasuhiro Matsumoto) +8 When redirecting and using ":silent" the current column for displaying and + redirection can be different. Use a separate variable to hold the column + for redirection. +7 There is no way to change directory and go back without changing the local + and/or global directory. Add a way to find out if the current window uses + a local directory. Add cdcmd() that returns ":cd" or ":lcd"? +7 The messages for "vim --help" and "vim --version" don't use + 'termencoding'. +8 When 'scrollbind' is set, a window won't scroll horizontally if the cursor + line is too short. Add a word in 'scrollopt' to allow moving the cursor + to longer line that is visible. A similar thing is done for the GUI when + using the horizontal scrollbar. +7 VisVim can only open one file. Hard to solve: each opened file is passed + with a separate invocation, would need to use timestamps to know the + invocations belong together. +8 When giving a ":bwipeout" command a file-changed dialog may popup for this + buffer, which is pointless. (Mike Williams) +8 On MS-Windows ":make" doesn't show output while it is working. Use the + tee.exe from http://unxutils.sourceforge.net/ ? About 16 Kbyte in the + UnxUtils.zip archive. + Alternate one: http://www.pramodx.20m.com/tee_for_win32.htm, but Walter + Briscoe says it's not as good. +8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters. +8 When doing Insert mode completion a mapping cannot recursively call + edit(), because the completion information is global. Put everything in + an allocated structure? +8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing + ":buf foo<Tab>" doesn't find the second one. (George V. Reilly) +7 Output for ":scriptnames" and ":breaklist" should shorten the file names: + use "~/" when possible. +7 mb_off2cells() doesn't work correctly on the tail byte of a double-byte + character. (Yasuhiro Matsumoto) It should return 1 when used on a tail + byte, like for utf-8. Store second byte of double-byte in ScreenLines2[] + (like for DBCS_JPNU) and put a zero in the second byte (like for UTF-8). +8 'backupdir' and 'directory' should use $TMPDIR, $TMP and/or $TEMP when + defined. +7 Inside a function with "perl <<EOF" a line with "$i++" is recognized as an + ":insert" command, causing the following "endfunction" not to be found. + Add skipping this perl construction inside function definitions. +7 When 'ttimeoutlen' is 10 and 'timeoutlen' is 1000, there is a keycode + "<Esc>a" and a mapping <Esc>x", when typing "<Esc>a" with half a second + delay should not be interpreted as a keycode. (Hans Ginzel) +7 ":botright 1 new" twice causes all window heights to be changed. Make the + bottom window only bigger as much as needed. +7 "[p" doesn't work in Visual mode. (David Brown) +7 The Cygwin and MingW makefiles define "PC", but it's not used anywhere. + Remove? (Dan Sharp) +9 The argument <f-args> of a user command doesn't handle backslashes + properly. "Cmd \ e" is one argument, "Cmd \\ e" still is one argument. + "Cmd \ e" is two arguments, first one ending in space. (Kontra Gergely) +9 User commands use the context of the script they were defined in. This + causes a "s:var" argument to unexpectedly use a variable in the defining + script, not the calling script. Add an argument to ":command": + "-keepcontext". Do replace <SID>, so that a function in the defining + script can be called. +8 The Japanese message translations for MS-Windows are called ja.sjis.po, + but they use encoding cp932. Rename the file and check that it still + works. +9 When a syntax region does not use "keepend" and a contained item does use + "extend", this makes the outer region stop at the end of the contained + region. (Lutz Eymers) Another example Nov 14 2002. +8 A very long message in confirm() can't be quit. Make this possible with + CTRL-C. +7 clip_x11_own_selection() uses CurrentTime, that is not allowed. VNC X + server has a problem with this. (Mark Waggoner) Remembering the timestamp + of events isn't always possible. We don't get them in an xterm. GTK + doesn't obtain the selection again when the timestamp differs, thus it + won't work for GTK anyway. +8 When the clipboard isn't supported: ":yank*" gives a confusing error + message. Specifically mention that the register name is invalid. +8 "gf" always excludes trailing punctuation characters. file_name_in_line() + is currently fixed to use ".,:;!". Add an option to make this + configurable? +8 'hkmap' should probably be global-local. +9 When "$" is in 'cpoptions' and folding is active, a "C" command changes + the folds and resets w_lines_valid. The display updating doesn't work + then. (Pritesh Mistry) +8 ":s!from!to!" works, but ":smagic!from!to!" doesn't. It sees the "!" as a + flag to to the command. Same for ":snomagic". (Johan Spetz) +8 Using ":s" in a function changes the previous replacement string. Save + "old_sub" in save_search_patterns()? +8 When appending to a file and 'patchmode' isn't empty, a backup file is + always written, even when the original file already exists. +7 When using "daw" on the last word in a file and this is a single letter, + nothing is deleted. Should delete the letter and preceding white space. +9 When getting focus while writing a large file, could warn for this file + being changed outside of Vim. Avoid checking this while the file is being + written. +9 The "Error detected while processing modelines" message should have an + error number. +7 The message in bt_dontwrite_msg() could be clearer. +8 The script ID that is stored with an option and displayed with ":verbose + set" isn't reset when the option is set internally. For example when + 'foldlevel' is set from 'foldlevelstart'. +8 Also store the line number with the script ID and use it for ":verbose", + so that "set nocompatible" is found when it changes other option values. +8 In the fileformat dialog, "Cancel" isn't translated. Add a global + variable for this. (Eduardo Fernandez) +9 When editing a file with 'readonly' set, there is no check for an existing + swap file. Then using ":write" (without making any changes) doesn't give + a warning either. Should check for an existing swap file without creating + one. +7 When 'showbreak' is set, the amount of space a Tab occupies changes. + Should work like 'showbreak' is inserted without changing the Tabs. +7 When 'mousefocus' is set and switching to another window with a typed + command, the mouse pointer may be moved to a part of the window that's + covered by another window and we lose focus. Only move in the y + direction, not horizontally? +8 When using CTRL-D after ":help", restrict the number of matches to a + thousand, otherwise using CTRL-D without an argument takes too long. +8 ":hardcopy": + - Using the cterm_color[] table is wrong when t_colors is > 16. + - Need to handle unprintable characters. + - Win32: On a B&W printer syntax highlighting isn't visible. Perform + dithering to make grey text? + - Add a flag in 'printoptions' to add an empty page to make the total + number even. "addempty"? (Mike Williams) + - Respect 'linebreak'. Perhaps also 'showbreak'? + - Should interpreted CTRL-L as a page break. + - Grey line numbers are not always readable. Add field in 'printoptions'. + Default to black when no syntax highlighting. + - Be able to print a window in diff mode. + - Be able to specify a colorscheme to use for printing. And a separate + one for B&W printing (if that can be detected). +8 In Visual block mode with 'lbr' set, a change command doesn't insert the + text in following lines where the linebreak changes. +9 dosinst.c: The DJGPP version can't uninstall the Uninstall registry key on + Windows NT. How to install a .inf file on Windows NT and how to detect + that Windows NT is being used? +8 When 'virtualedit' is "block,insert" and encoding is "utf-8", selecting a + block of one double-wide character, then "d" deletes only half of it. +8 When 'virtualedit' is set, should "I" in blockwise visual mode also insert + in lines that don't extend into the block? +8 With 'virtualedit' set, in Insert mode just after the end of line, CTRL-O + yh does not yank the last character of the line. (Pavel Papushev) + Doing "hl" first appears to make it work. +8 With 'virtualedit' set it's possible to move into the blank area from + 'linebreak'. +8 With 'virtualedit' set and 'selection' "exclusive", a Visual selection + that ends in or after a tab, "d" doesn't delete (part of) the tab. + (Helmut Stiegler) +8 With 'virtualedit' set, a blockwise Visual selection that starts and ends + in a tab, "<" shifts too much. (Helmut Stiegler) +9 When jumping to a tag, the search pattern is put in the history. When + 'magic' is on, the pattern may not work. Translate the pattern depending + on p_magic when putting it in the history? Alternative: Store value of + 'magic' in history. (Margo) +9 optwin.vim: Restoring a mapping for <Space> or <CR> is not correct for + ":noremap". Add "mapcmd({string}, {mode})? Use code from ":mkexrc". +9 incsearch is incorrect for "/that/<Return>/this/;//" (last search pattern + isn't updated). +9 term_console is used before it is set (msdos, Amiga). +9 Get out-of-memory for ":g/^/,$s//@/" on 1000 lines, this is not handled + correctly. Get many error messages while redrawing the screen, which + cause another redraw, etc. +8 [<C-I> doesn't work when '*' is in 'iskeyword'. find_pattern_in_path() + must escape special characters in the pattern. +8 Vim can overwrite a read-only file with ":w!". ":w" can't overwrite an + existing file, "w!" can, but perhaps not a read-only file? Then use + ":w!!" for that. + Or ask for permission to overwrite it (if file can be made writable) and + restore file to readonly afterwards. + Overwriting a file for which a swap file exists is similar issue. +7 When compiled with "xterm_clipboard", startup can be slower and might get + error message for invalid $DISPLAY. Try connecting to the X server in the + background (forked), so that Vim starts up quicker? Connect as soon as + the clipboard is to be used (Visual select mode starts, paste from + clipboard) +7 X11: Some people prefer to use CLIPBOARD instead of PRIMARY for the normal + selection. Add an "xclipboard" argument to the 'clipboard' option? (Mark + Waggoner) +8 For xterm need to open a connection to the X server to get the window + title, which can be slow. Can also get the title with "<Esc>[21t", no + need to use X11 calls. This returns "<Esc>]l{title}<Esc>\". +6 When the xterm reports the number of colors, a redraw occurs. This is + annoying on a slow connection. Wait for the xterm to report the number of + colors before drawing the screen. With a timeout. +8 When the builtin xterm termcap contains codes that are not wanted, need a + way to avoid using the builtin termcap. +8 Xterm sends ^[[H for <Home> and ^[[F for <End> in some mode. Also + recognize these keys? Mostly useful for xterm simulators, like gnometerm. + See http://dickey.his.com/xterm/xterm.faq.html#xterm_pc_style. +8 For xterm also recognize keypad up/down/left/right and insert. +8 '[ and '] should be set to start/end of line when using a linewise operator + (e.g., ":w"). +8 CTRL-A can't handle big "long" numbers, they become negative. Check for + "-" character, if not present, use unsigned long. +8 Make it possible to disable the special meaning of "#" in the first column + for ">>". +8 Add suspending with CTRL-Z at the "more" prompt, and when executing a long + script in do_cmdline(). +8 When using 'hidden', many swap files will be open. When Vim runs into the + maximum number of open files, error messages will appear. Detect that + this problem is present, and close any hidden files that don't have + changes. +8 With 'viminfo' set such that the ".viminfo" file is written on a FAT + filesystem, an illegal file name may be created: ".vim". +8 For each buffer that is opened, the viminfo file is opened and read to + check for file marks. This can be slow. +7 In xterm, recognize both vt100 and vt220 cursor keys. Change + add_termcode() to not remove an existing entry for a name, when it's + needed. + Need a generic solution to recognize different codes for the same key. +8 Core dump within signal function: gdb doesn't show stack backtrace! Option + to skip catch_signals()? +9 Repeating a "cw" with "." doesn't work if the text was pasted from the + clipboard. (Thomas Jones) It's because the menu/toolbar item exits Insert + mode and uses "gP". How to fix this without breaking inserting a block of + text? +8 In Replace mode pasting from the clipboard (using menu or toolbar) inserts + all the text. Add ":rmenu"? +8 Pasting with the mouse in Replace mode inserts the text, instead of + overwriting, when it is more than one line. Same for using <C-R>. +9 CTRL-E and CTRL-Y don't work in small window when 'so' is 4 and lines are + wrapping (Acevedo/in.226). E.g., when using CTRL-E, window height 7, + window might actually scroll down when last line of buffer is displayed. + --> Remember if the previous command was "cursor follows screen" or + "screen follow cursor" and use this in cursupdate(). +7 tilde_replace() can only handle "~/", should also do "~user/". + Get the list of home directories (from /etc/passwd? Use getpwent()) and + use some clever algorithm to match a path with that. Find common strings + in the list? +8 When dragging status line with mouse, sometimes a jump when first clicking + on the status line (caused by 'winheight'). Select window on button up, + instead of on button down. +8 Dragging the status line doesn't scroll but redraw. +9 Evaluating 'statusline' in build_stl_str_hl() does not properly check for + reaching the end of the available buffer. +8 When performing incremental search, should abort searching as soon as a + character is typed. +8 When the value of $MAKE contains a path, configure can't handle this. + It's an autoconf bug. Remove the path from $MAKE to work around it. +8 How to set VIMRC_FILE to \"something\" for configure? Why does this not + work: CFLAGS='-DVIMRC_FILE=\"/mydir/myfile\"' ./configure +8 The temporary file is sometimes not writable. Check for this, and use an + alternate name when it isn't. Or add the 'temptemplate' option: template + for the temp file name ":set temptemplate=/usr/tmp/?????.tmp". + Also: Win32 version uses Windows temp directory, which might not work for + cygwin bash. +7 Get error "*, \+ or \( operand could be empty" for pattern "\(.\)\1\{3}". + Remember flags for backreferences. +7 When switching to Daylight Saving Time, Vim complains that a file has been + changed since last read. Can we use a function that uses GMT? +7 When completing an environment variable after a '$', check for file names + that contain a '$' after all have been found. +8 When "cm" termcap entry is missing, starting gvim shouldn't complain about + it. (Lohner) Try out with "vt100" entry, cm replaced with cX. +7 When an include file starts with "../", the check for already visiting + this file doesn't work. Need to simplify the file name. +7 The names and comments for the arguments of do_browse() are confusing. + "dflt" isn't the default file name when "initdir" is not NULL and + "initdir" is the default path to be used. +7 When 'scrolloff' is exactly half the window height, "j" causes a scroll of + two lines at a time. "k" doesn't do this. (Cory T. Echols) +8 When write_viminfo() is used while there are many orphaned viminfo + tempfiles writing the viminfo file fails. Give a clear error message so + that the user knows he has to delete the files. +7 It's possible to redefine a script-local function with ":func + <SNR>123_Test()". (Krishna) Disallow this. + + +I can't reproduce these (if you can, let me know how!): +9 NT 4.0 on NTFS file system: Editing ".bashrc" (drag and drop), file + disappears. Editing ".xyz" is OK. Also, drag&drop only works for three + files. (McCollister) + + +Problems that will (probably) not be solved: +- GTK: when using the popup menu with spelling suggestions and releasing the + right mouse button before the menu appears selecting an item with the + right mouse button has no effect. GTK does not produce an event for this. +- xterm title: The following scenario may occur (esp. when running the Vim + test script): Vim 1 sets the title to "file1", then restores the title to + "xterm" with an ESC sequence when exiting. Vim 2 obtains the old title + with an X library call, this may result in "file1", because the window + manager hasn't processed the "xterm" title yet. Can apparently only be + worked around with a delay. +- In a terminal with 'mouse' set such that the mouse is active when entering + a command line, after executing a shell command that scrolls up the + display and then pressing ":": Selecting text with the mouse works like + the display wasn't scrolled. Vim doesn't know how much the external + command scrolled up the display. Use Shift to select text. +- X windows: When $DISPLAY points to a X server where there is no access + permission, trying to connect to the X server causes an error message. + XtOpenDisplay() prints this directly, there is no way to avoid it. +- X windows: Setting 'guifontset' to an illegal value sometimes crashes Vim. + This is caused by a fault in a X library function, can't be solved in Vim. +- Motif: When adding a menu item "Find this &Symbol", the "s" in "this" will + be underlined, instead of in "Symbol". Motif doesn't let us specify which + character gets the highlighting. +- Moving the cursor removes color in color-xterm. This is a color-xterm + problem! color-xterm ver. 6.1 beta 3 and later work properly. +- In zsh, "gvim&" changes the terminal settings. This is a zsh problem. + (Jennings) +- Problem with HPterm under X: old contents of window is lost (Cosentino). +- Amiga: When using quickfix with the Manx compiler we only get the first 25 + errors. How do we get the rest? +- Amiga: The ":cq" command does not always abort the Manx compiler. Why? +- Linux: A file with protection r--rw-rw- is seen readonly for others. The + access() function in GNU libc is probably wrong. +- MSDOS: When using smartdrive with write-back buffering, writing to a + readonly floppy will cause problems. How to test for a writable floppy + first? +- MSDOS: Both 16 and 32 bit versions: File name expansion doesn't work for + names that start with a dot. These used to be illegal file names. +- When doing a CTRL-Z and typing a command for the shell, while Vim is busy + (e.g. writing a file), the command for the shell is sometimes eaten by Vim, + because the terminal mode is changed from RAW to CBREAK. +- An old version of GNU tgoto can't handle the terminfo code for "AF". The + "%p1" is interpreted as "%p" and "1", causing color not to be working. + Fix: Change the "%p1" in the "AF" and "AB" terminfo entries to "%p". + (Benzinger). +- When running an external command from the GUI, typeahead is going to that + program, not to Vim. It looks like the shell eats the characters, Vim + can't get back what the external command didn't use. +- Win32 GUI: Error code from external command not returned in shell_error. + It appears that cmd.exe and command.com don't return an error code. +- Win32 GUI: The Toolbar is a bit too high when the flat style is being + used. We don't have control over the height of the Toolbar. +- Win32: All files created on the day of switching from winter to summer + time cause "changed since editing started" messages. It goes away when + the file is written again the next day, or the timezone is adjusted. + DJGPP version is OK. (Zaimi) Looks like a problem with the Win32 library. + Rebooting doesn't help. Time stamps look OK in directory. (Penn) + Is this on FAT (stores wall clock time) or NTFS (stores UTS)? +- Win32, MS-Windows XP: $HOME uses the wrong drive when the user profiles + are not on the boot disk. This is caused by a wrong value of $HOMEDRIVE. + This is a bug in XP, see MSKB article 818134. +- SunOS 5.5.1 with Motif: The file open dialog does not have a horizontal + scroll bar for the "files" selection. This is a problem in the Motif + libraries, get a patch from Sun. +- Solaris 2.6 with GTK and Perl: gvim crashes when started. Problem with X + input method called from GDK code. Without Perl it doesn't crash. +- VMS: Vimdiff doesn't work with the VMS diff, because the output looks + different. This makes test 47 fail. Install a Unix-compatible diff. +- VMS v7.1 and older: Tests 21 and 32 fail. From VMS v7.1-2 and newer Vim + does not have this behavior. (Zoltan Arpadffy) +- Win32 GUI: mouse wheel always scrolls rightmost window. The events arrive + in Vim as if the rightmost scrollbar was used. +- GTK with Gnome: Produces an error message when starting up: + Gdk-WARNING **: locale not supported by C library + This is caused by the gnome library gnome_init() setting $LC_CTYPE to + "en_US". Not all systems support this locale name, thus causing the + error. Hopefully a newer version of GTK/Gnome fixes this problem. +- GTK 2: With this mapping the hit-enter prompt is _sometimes_ below the + screen, at other times there is a grey area below the command line: + :nmap <F11> :if &guioptions=~'m' \| set guioptions-=m \| else \| set guioptions+=m \| endif<cr> +- GTK: When pasting a selection from Vim to xclipboard gvim crashes with a + ABRT signal. Probably an error in the file gdkselection.c, the assert + always fails when XmbTextListToTextProperty() fails. (Tom Allard) +- GTK 2: gives an assertion error for every non-builtin icon in the toolbar. + This is a GTK 2.4.x bug, fixed in GTK 2.4.2. (Thomas de Grenier de Latour) +- When using an xterm that supports the termresponse feature, and the 't_Co' + termcap option was wrong when Vim started, it will be corrected when the + termresponse is received. Since the number of colors changes, the + highlighting needs to be initialized again. This may cause colors defined + in the vimrc file to be lost. +- On Windows NT 4.0 the number of files passed to Vim with drag&drop and + "Edit with Vim" is limited. The maximum command line length is 255 chars. + +--------------------- extensions and improvements ---------------------- + *extensions-improvements* + +Didn't make it into Vim 7.0: +- Add COLUMN NUMBERS to ":" commands ":line1,line2[col1,col2]cmd". Block + can be selected with CTRL-V. Allow '$' (end of line) for col2. +- Add DEBUGGER INTERFACE. Implementation for gdb by Xavier de Gaye. + Should work like an IDE. Try to keep it generic. Now found here: + http://clewn.sf.net. + And the idevim plugin/script. + To be able to start the debugger from inside Vim: For GUI run a program + with a netbeans connection; for console: start a program that splits the + terminal, runs the debugger in one window and reconnect Vim I/O to the + other window. + Wishes for NetBeans commands: + - make it possible to have 'defineAnnoType' also handle terminal colors. + - send 'balloonText' events for the cursor position (using CursorHold ?) + in terminal mode. +- ECLIPSE plugin. Problem is: the interface is very complicated. Need to + implement part in Java and then connect to Vim. Some hints from Alexandru + Roman, 2004 Dec 15. Should then also work with Oracle Jdeveloper, see JSR + 198 standard http://www.jcp.org/en/jsr/detail?id=198. + Eclim does it: http://eclim.sourceforge.net/ (Eric Van Dewoestine) + Plugin that uses a terminal emulator: http://vimplugin.sf.net +- STICKY CURSOR: Add a way of scrolling that leaves the cursor where it is. + Especially when using the scrollbar. Typing a cursor-movement command + scrolls back to where the cursor is. +- Running a shell command from the GUI still has limitations. Look into how + the terminal emulator of the Vim shell project can help: + http://vimshell.wana.at +- Add Lua interface? (Wolfgang Oertl) +8 Add a command to jump to a certain kind of tag. Allow the user to specify + values for the optional fields. E.g., ":tag size type=m". + Also allow specifying the file and command, so that the result of + taglist() can be used. +- X11: Make it possible to run Vim inside a window of another program. + This can be done with XReparentWindow(). But how exactly? + + +Documentation: +8 The GUI help should explain the Find and Find/Replace dialogs. Add a link + to it from ":promptrepl" and ":promptfind". +8 List of options should mention whether environment variables are expanded + or not. +8 Extend usr_27.txt a bit. (Adam Seyfarth) +7 Add a section on debugging scripts in the user manual. +9 Make the Reference Manual more precise. For each command mention: + - change to cursor position and curswant + - if it can be undone (u/CTRL-R) and redone (.) + - how it works for folded lines + - how it works with multi-byte characters +9 In change.txt, remark about Javadoc isn't right. Right alignment would + work too. +8 Spread the windows commands over the other files. For example, ":stag" + should be with ":tag". Cross-link with tags to avoid too much double + text. +8 Add tags for all features, e.g. "gui_running". +7 MS-Windows: When a wrong command is typed with an ALT key, give a hint to + look at the help for 'winaltkeys'. +7 Add a help.vim plugin that maps <Tab> to jump to the next tag in || and + <C-Tab> (and <S-Tab>) to the previous tag. +- Check text editor compendium for vi and Vim remarks. + + +Help: +- First try using the ":help" argument literally, before using it as a + pattern. And then match it as part of a tag. +- When a help item has multiple matches make it possible to use ":tn" to go + to the other matches. +- Support a way to view (and edit) .info files. +- Default mapping for help files: <Tab> to position cursor on next |:tag|. +- Implement a "sticky" help window, some help text lines that are always + displayed in a window with fixed height. (Guckes) Use "~/.vimhelp" file, + user can edit it to insert his favorite commands, new account can contain a + default contents. +- Make 'winminheight' a local option, so that the user can set a minimal + height for the help window (and other windows). +- ":help :s^I" should expand to ":help :substitute". +- Make the help key (<F1>) context sensitive? +- Learn mode: show short help while typing commands. + + +User Friendlier: +8 Windows install with NSIS: make it possible to do a silent install, see + http://nsis.sourceforge.net/Docs/Chapter4.html#4.12 +8 Windows install with install.exe: Use .exe instead of .bat files for + links, so that command line arguments are passed on unmodified? (Walter + Briscoe) +8 Windows install: Be able to associate Vim with a selection of file types? +8 Windows uninstall: Have uninstal.c delete the vimfiles directories that + dosinst.c creates. List the contents of the directory (recursively) if + the user asks for it. Requires an implementation of "rm -rf". +8 Remember the name of the vimrc file that was used (~/.vimrc, $VIM/_vimrc, + $HOME/_vimrc, etc.) and add "edit vimrc" to the File menu. +- Add a way to save local settings and mappings into a new plugin file. + ":mkplugin <file>"? +8 Add ":plugininstall" command. Can be used to install a plugin file that + includes documentation. Let the user select a directory from + 'runtimepath'. + " Vim plugin + <main plugin code> + " >>> plugin help start <<< + <plugin docs> +- Add mappings local to a window: ":map <window> ..."? +9 Add buffer-local menu. Should offer a choice between removing the menu or + disabling it. Be careful that tear-offs don't disappear (keep one empty + item?). + Alternative: use BufEnter and BufLeave autocommands. +8 make a vimtutor script for Amiga and other systems. +7 Add the arguments for configure to the ":version" output? +7 When Vim detects a file is being edited elsewhere and it's a gvim session + of the same user it should offer a "Raise" button, so that the other gvim + window can be displayed. (Eduard) +8 Support saving and restoring session for X windows? It should work to do + ":mksession" and use "-S fname" for the restart command. The + gui_x11_wm_protocol_handler() already takes care of the rest. + global_event_filter() for GTK. + + +Tab pages: +9 GUI implementation for the tab pages line for other systems. +8 Make GUI menu in tab pages line configurable. Like the popup menu. +8 balloons for the tab page labels that are shortened to show the full path. +8 :tabmove +N move tab page N pages forward +8 :tabmove -N move tab page N pages backward +7 :tabdup duplicate the tab with all its windows. +7 Option to put tab line at the left or right? Need an option to specify + its witdh. It's like a separate window with ":tabs" output. +7 Add local variables for each tab page? +8 Add local options for each tab page? E.g., 'diffopt' could differ between + tab pages. +7 Add local highlighting for each tab page? + + +Spell checking: +- The Hungarian spell file uses four extra characters in the FOL/UPP/LOW + items than other spell files with the ISO-8859-2 encoding, that causes + problem when changing 'spelllang'. There is no obvious way to fix this. +- Considering Hunspell 1.1.4: + What does MAXNGRAMSUGS do? + Is COMPLEXPREFIXES necessary when we have flags for affixes? +8 ":mkspell" still takes much too long in Hungarian dictionary from + hunspell. Only solution appears to be to postpone secondary suffixes. +8 Handle postponed prefix with COMPOUNDPERMITFLAG or COMPOUNDFORBIDFLAG. + WFP_COMPPERMIT and WFP_COMPFORBID +8 implement use of <compoptions> in .spl file: + implement CHECKCOMPOUNDREP: when a compound word seems to be OK apply REP + items and theck if the result is a valid word. + implement CHECKCOMPOUNDDUP + implement CHECKCOMPOUNDTRIPLE + Add CHECKCOMPOUNDCASE: when compounding make leading capital lower case. + How is it supposed to work? +8 implement using CHECKCOMPOUNDPATTERN: match words with sl_comppat[]. +- Add a command the repeats ]s and z=, showing the misspelled word in its + context. Thus to spell-check a whole file. +- suggestion for "KG" to "kg" when it's keepcase. +- For flags on affixes: Use a "AFFCOMPSET" flag; means the compound flags of + the word are not used. +- Support breakpoint character ? 0xb7 and ignore it? Makes it possible to + use same wordlist for hyphenation. +- Compound word is accepted if nr of words is <= COMPOUNDWORDMAX OR nr of + syllables <= COMPOUNDSYLMAX. Specify using AND in the affix file? +- NEEDCOMPOUND also used for affix? Or is this called ONLYINCOMPOUND now? + Or is ONLYINCOMPOUND only for inside a compound, not at start or end? +- Do we need a flag for the rule that when compounding is done the following + word doesn't have a capital after a word character, even for Onecap words? +- New hunspell home page: http://hunspell.sourceforge.net/ + - Version 1.1.0 is out now, look into that. + - Lots of code depends on LANG, that isn't right. Enable each mechanism + in the affix file separately. + - Example with compounding dash is bad, gets in the way of setting + COMPOUNDMIN and COMPOUNDWORDMAX to a reasonable value. + - PSEUDOROOT == NEEDAFFIX + - COMPOUNDROOT -> COMPOUNDED? For a word that already is a compound word + Or use COMPOUNDED2, COMPOUNDED3, etc. +8 Alternate Dutch word list at www.nederlandsewoorden.nl (use script to + obtain). But new Myspell wordlist will come (Hagen) +- CIRCUMFIX: when a word uses a prefix marked with the CIRCUMFIX flag, then + the word must also have a suffix marked with the CIRCUMFIX flag. It's a + bit primitive, since only one flag is used, which doesn't allow matching + specific prefixes with suffixes. + Alternative: + PSFX {flag} {pchop} {padd} {pcond} {schop} {sadd}[/flags] {scond} + We might not need this at all, you can use the NEEDAFFIX flag and the + affix which is required. +- When a suffix has more than one syllable, it may count as a word for + COMPOUNDWORDMAX. +- Add flags to count extra syllables in a word. SYLLABLEADD1 SYLLABLEADD2, + etc.? Or make it possible to specify the syllable count of a word + directly, e.g., after another slash: /abc/3 +- MORPHO item in affix file: ignore TAB and morphological field after + word/flags and affix. +- Implement multiple flags for compound words and CMP item? + Await comments from other spell checking authors. +- Also see tklspell: http://tkltrans.sourceforge.net/ +8 Charles Campbell asks for method to add "contained" groups to existing + syntax items (to add @Spell). + Add ":syntax contains {pattern} add=@Spell" command? A bit like ":syn + cluster" but change the contains list directly for matching syntax items. +- References: MySpell library (in OpenOffice.org). + http://spellchecker.mozdev.org/source.html + http://whiteboard.openoffice.org/source/browse/whiteboard/lingucomponent/source/spellcheck/myspell/ + author: Kevin Hendricks <kevin.hendricks@sympatico.ca> +8 Make "en-rare" spell file? Ask Charles Campbell. +8 The English dictionaries for different regions are not consistent in their + use of words with a dash. +7 Insert mode completion mechanism that uses the spell word lists. +8 Add hl groups to 'spelllang'? + :set spelllang=en_us,en-rare/SpellRare,en-math/SpellMath + More complicated: Regions with different languages? E.g., comments + in English, strings in German (po file). + + +Diff mode: +8 Use diff mode to show the changes made in a buffer (compared to the file). + Use an unnamed buffer, like doing: + new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis + Also show difference with the file when editing started? Should show what + can be undone. (Tom Popovich) +7 Add cursor-binding: when moving the cursor in one diff'ed buffer, also + move it in other diff'ed buffers, so that CTRL-W commands go to the same + location. + + +Folding: + (commands still available: zI zJ zK zp zP zq zQ zV zy zY; + secondary: zB zS zT zZ, z=) +8 Add "z/" and "z?" for searching in not folded text only. +8 Add different highlighting for a fold line depending on the fold level. + (Noel Henson) +7 Use "++--", "+++--" for different levels instead of "+---" "+----". +8 When a closed fold is displayed open because of 'foldminlines', the + behavior of commands is still like the fold is closed. How to make the + user aware of this? +8 Add an option 'foldskip' with values like 'foldopen' that specifies which + commands skip over a closed fold. +8 "H" and "L" count buffer lines instead of window lines. (Servatius Brandt) +8 Add a way to add fold-plugins. Johannes Zellner has one for VB. +7 When using manual folding, the undo command should also restore folds. +- Allow completely hiding a closed fold. E.g., by setting 'foldtext' to an + empty string. Require showing a character in 'foldcolumn' to avoid the + missing line goes unnoticed. + How to implement this? +- When pressing the down arrow of a scrollbar, a closed fold doesn't scroll + until after a long time. How to make scrolling with closed folds + smoother? +- When creating a session, also store folds for buffers in the buffer list, + using the wininfo in wi_folds. +- When currently editing the first file in the argument list the session + file can contain: + args version.c main.c + edit version.c + Can editing version.c twice be avoided? +- 'foldmethod' "textobject": fold on sections and paragraph text objects. +- Add 'hidecomment' option: don't display comments in /* */ and after //. + Or is the conceal patch from Vince Negri a more generic solution? +- "zuf": undo change in manual fold. "zUf" redo change in manual fold. How + to implement this? +- "zJ" command: add the line or fold below the fold in the fold under the + cursor. +- 'foldmethod' "syntax": "fold=3" argument: set fold level for a region or + match. +- Apply a new foldlevel to a range of lines. (Steve Litt) +8 Have some way to restrict commands to not folded text. Also commands like + searches. + + +Multi-byte characters: +- When editing a file with both utf-8 and latin1 text Vim always falls back + to latin1. Add a command to convert the latin1 characters to utf-8? + :unmix utf-8,latin1 filename + Would only work when 'encoding' is utf-8. +9 When the tail byte of a double-byte character is illegal (e.g., a CR), the + display is messed up (Yasuhiro Matsumoto). Should check for illegal + double-byte characters and display them differently (display each single + byte). +8 Add an item in 'fileencodings' to check the first lines of a file for + the encoding. See Python PEP: http://www.python.org/peps/pep-0263.html. + To avoid getting a wrong encoding only accept something Emacs-like: + "-*- coding: enc-na_me.foo -*-" and "-*- coding= enc-na_me.foo -*-" + Match with "-\*-\s*coding[:=]\s*\([::word::-_.]\+\)\s*-\*-" and use first + item. +8 Add an item in 'fileencodings' to check the first line of an XML file for + the encoding. <?xml version="1.0" encoding="UTF-8"?> Or "charset=UTF-8"? + For HTML look for "charset=utf-8". +8 The quickfix file is read without conversion, thus in 'encoding'. Add an + option to specify the encoding of the errorfile and convert it. Also for + ":grep" and ":helpgrep". + More generic solution: support a filter (e.g., by calling a function). +8 When a file was converted from 'fileencoding' to 'encoding', a tag search + should also do this on the search pattern. (Andrzej M. Ostruszka) +7 When converting a file fails, mention which byte could not be converted, + so that the user can fix the problem. +8 Add configure option to be able to disable using the iconv library. (Udo + Schweigert) +9 'aleph' should be set to 1488 for Unicode. (Zvi Har'El) +8 Should add test for using various commands with multi-byte characters. +8 'infercase' doesn't work with multi-byte characters. +8 toupper() function doesn't handle byte count changes. +7 When searching, should order of composing characters be ignored? +8 Should implement 'delcombine' for command line editing. +8 Detect overlong UTF-8 sequences and handle them like illegal bytes. +8 ":s/x/\u\1/" doesn't work, making uppercase isn't done for multi-byte + characters. +8 UTF-8: "r" in Visual mode doesn't take composing characters. +8 UTF-8: When there is a precomposed character in the font, use it instead + of a character and a composing character. See xterm for an example. +7 When a character can't be displayed, display its digraph instead. + 'display' option to specify this. +7 Use ideas for nl_langinfo() from Markus Kuhn in enc_default(): + (www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c) +- GTK and Win32: Allow selecting fonts for 'guifontset' with the + fontselector somehow. +- GTK and Win32: make it possible to set the font for the menu to make it + possible to have 'encoding' different from the current locale. +- dbcs_class() only works for Japanese and Korean. Implement this for + other encodings. The "euc-jp" and "euc-kr" choices might be wrong. +- Find some way to automatically select the right GUI font or fontset, + depending on the default value of 'encoding'. + Irrelevant in the GTK+ 2 GUI so long as UTF-8 is used. + For Windows, the charset_pairs[] table could be used. But how do we know + if a font exists? +- Do keyboard conversion from 'termencoding' to 'encoding' with + convert_input() for Mac GUI and RiscOS GUI. +- Add mnemonics from RFC1345 longer than two characters. + Support CTRL-K _{mnemonic}_ +7 In "-- INSERT (lang) --" show the name of the keymap used instead of + "lang". (Ilya Dogolazky) +- Make 'langmap' accept multi-byte characters. +- Make 'breakat' accept multi-byte characters. Problem: can't use a lookup + table anymore (breakat_flags[]). + Simplistic solution: when 'formatoptions' contains "m" also break a line + at a multi-byte character >= 0x100. +- Do we need the reverse of 'keymap', like 'langmap' but with files and + multi-byte characters? E.g., when using a Russian keyboard. +- Add the possibility to enter mappings which are used whenever normal text + could be entered. E.g., for "f" command. But not in Normal mode. Sort + of opposite of 'langmap'. Use ":tmap" command? +- When breaking a line, take properties of multi-byte characters into + account. The "linebreak" program from Bruno Haible can do it: + ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz + But it's very complicated... + + +Printing: +7 Implement "undercurl" for printing. +- Add "page width" to wrap long lines. +- Win32: use a font dialog for setting 'printfont'. Can reuse the code for + the 'guifont' dialog, put the common code in a separate function. +- Add the file timestamp to the page header (with an option). (George + Reilly) +- Win32: when 'printfont' is empty use 'guifont'. +- Unix: Use some dialog box to do the obvious settings (paper size, printer + name, portrait/landscape, etc). +- PostScript: only works for 7-bit ASCII and EBCDIC. Should support + different 'encoding' values somehow. +- Allow specifying the paper size, instead of using a standard size. Same + units as for the margins. +- Support right-to-left text? +8 Make the foreground color darkening function preserve the hue of the + color. + + +Syntax highlighting: +8 Make ":syn off" use 'runtimepath' instead of $VIMRUNTIME. (Gary Johnson) + Should do the same for ":syn on" and ":syn manual". +8 Support "containedin" argument for ":syn include", so that the defined + cluster can be added to existing syntax items. +8 C syntax: Don't highlight {} as errors inside () when used like this: + "({ something })", often used in GCC code. +7 Add a "startgroup" to a region. Used like "nextgroup" inside the region, + preferred item at the start of the region. (Charles Campbell) +8 When editing a new file without a name and giving it a name (by writing + it) and 'filetype' is not set, detect the filetype. Avoid doing it for + ":wq file". +8 Make conversion to HTML faster (Write it in C or pre-compile the script). +9 There is still a redraw bug somewhere. Probably because a cached state is + used in a wrong way. I can't reproduce it... +7 Be able to change only the background highlighting. Useful for Diff* and + Search highlighting. +7 When 'number' is set highlight the number of the current line. + Must be enabled with an option, because it slows down display updating. +8 Allow the user to add items to the Syntax menu sorted, without having to + change this for each release. +8 Add a "matchcontains" for regions: items contained in the start or end + pattern, but not in the body. +8 Add a "keepend-contained" argument: Don't change the end of an item this + one is contained in. Like "keepend" but specified on the contained item, + instead of the containing item. +8 cpp.vim: In C++ it's allowed to use {} inside (). +8 Some syntax files set 'iskeyword'. When switching to another filetype + this isn't reset. Add a special keyword definition for the syntax rules? + When this is done, use vim.vim syntax highlighting for help file examples, + but without ":" in 'iskeyword' for syntax. +8 Add specific syntax item to match with parens/braces that don't have a + "%" match. :syntax nomatch cMatchError (,{,[,),},] [contained] +8 Highlight the text between two matching parens (e.g., with a grey + background) when on one of the parens or in between them. + Option for the matchparen plugin? +8 Add a command to jump to the next character highlighted with "Error". +8 When using a cterm, and no ctermfg or ctermbg are defined, use start/stop + sequences. Add remark in docs that :if 'term' == "term-name" should be + used. +8 Add @spell cluster to String and Comment groups for many languages. Will + allow spell checking. (Fleiner) +8 When listing syntax items, try to sort the keywords alphabetically. And + re-insert the [] if possible. +8 Make it possible to use color of text for Visual highlight group (like for + the Cursor). +8 It would be useful to make the highlight group name an expression. Then + when there is a match, the expression would be evaluated to find out what + highlight group to use. Could be used to check if the shell used in a + password file appears in /etc/shells. (Nikolai Weibull) + syn match =s:checkShell(v:match) contained 'pattern' +8 Make it possible to only highlight a sub-expression of a match. Like + using "\1" in a ":s" command. +8 Support for deleting syntax items: + :syn keyword cTodo remove this + :syn match cTodo remove "pattern" + :syn region cString remove start="this" end="that" +8 Add possibility to sync on something else, when the syncing in one way + doesn't find match. For HTML: When no {script} is found, try looking for + a '<'. (Fleiner) +7 Replace the synchronizing method with a state machine specification? + Should be able to start at any line in the file, search forwards or + backwards, and use the result of matching a pattern. +7 Use parsing like awk, so that e.g., a ( without a matching ) can be + detected. +8 Make it possible to use "inverted" highlighting, invert the original + character. For Visual mode. (xterm-selection already does this). +8 Highlight non-printable characters with "SpecialChar", linked to + "Special". Display them with the digraph characters, if possible. +8 Highlight the clipboard-selection with a highlight group. +8 Be able to reset highlighting to its original (default) values. +7 Be able to write current highlighting to a file as commands, similar to + ":mkvimrc". +8 Improve c.vim: + - Add check for unterminated strings, with a variable to switch it on: + "c_strict_ansi". + - Detect unbalanced "#endif". Requires looking back a long way... +8 Add an option to restrict the updating of syntax highlighting to the + current line while in Insert mode. +8 When guessing value of 'background', the syntax file has already been + loaded (from the .gvimrc). After changing 'background', load it again? +8 Add ":syn resync" command, to re-parse the whole file until the current + display position. +8 Should support "me" offset for a region start pattern. To be used to + allow searching for the end pattern inside the match of the end pattern. + Example: syn region pikeXX start="([^{]" end=")" should work on "()". +8 When using a regexp for "contains=", should delay matching with it until + redrawing happens. Set a flag when a group is added, check this flag when + highlighting starts. +7 It's possible for an item to be transparent, so that the colors of an item + lower on the stack is used. Also do this with highlighting, so that the + user can set transparent highlighting? E.g. a number in a C comment would + get the color of a comment, a number in an assignment Normal. (Nikolai + Weibull) +7 Add "semitrans": Add highlighting. E.g., make the text bold, but keep the + colors. And add colors, so that Green+Red becomes Yellow. + E.g. for this html: + <B> bold text <I> italic+bold text </B> italic text </I> +7 Wild idea: Not only set highlighting, but also change what is displayed + (e.g., remove characters, so that "<B>bold</B>" can be shown as "bold"): + :syn region boldstuff start="<B>" display="" end="</B>" display="" +7 CTRL-] checks the highlight group for finding out what the tag is. +7 Add an explanation how a list of words can be used to highlight misspelled + words. +8 Add more command line completion for :syntax. +8 Add more command line completion for :highlight. +8 Add more command line completion for :sign. +7 Should find a better way to parse the :syntax and :highlight commands. + Use tables or lists that can be shared by parsing for execution and + completion? +8 Add ColorSchemePost autocommand event, so that scripts can set up their + highlighting. (Salman Halim) +7 Add a few sets of colors (e.g. Borland Turbo C one). With a menu to + select one of the sets. +8 Add offsets to sub-matches: "\(a*\) *"he=e1-1 + 'e' is end of match 'e1' is end of sub-match 1, 's2' is start of submatch + 2, etc. +8 In Insert mode, when there are typeahead characters, postpone the + highlighting (for "." command). +8 Syncing on comments isn't 100% correct when / / lines mix with / * and * /. + For example: What about a line that starts with / / and contains * /? +8 Ignore / * and * / inside strings, when syncing. +7 Build a few more syntax files from the file "/usr/share/misc/vgrindefs": + ISP, LDL, Icon, ratfor. And check "nedit/source/highlight.c". +6 Add possibility to have background color continue until the right edge of + the window. Useful for comment blocks and function headings. (Rogall) +- Make it possible to add "contains" items for all items in a group. Useful + when extending an already existing syntax file. +- Add line-continuation pattern for non-syncing items too? +- Add possibility to highlight the whole line, including the right margin + (for comment blocks). +- Add 'hlmatch' option: List of flags: + 'c': highlight match for character under the cursor. + 'b': highlight the previous (, and its match. + 'a': highlight all text from the previous ( until its match. + Also for {}, <>, etc.? + 'e': highlight all braces without a match (slow?) + OR: add an argument "cursor" to the syntax command, which means that the + region/match/keyword is only highlighted when the cursor is on it. + (Campbell) + Or do it like Elvis: define text objects and how to highlight them around + the cursor. (Iain Truskett) +7 Make it possible to use all words in the tags files as Keyword. + Can also be done with a script (but it's slow). +7 Make it possible to call a ":" command when a match is found. Should + allow for adding keywords from the text (e.g. variables that are set). + And allows for sections with different highlighting. +7 Add highlight group for commandline: "Commandline". Make sure it + highlights the command line while typing a command, and any output from + messages. And external commands? +8 Make a version that works like less, but with highlighting: read stdin for + text, exit at end of file, don't allow editing, etc. moreim? lessim? +7 SpecialKey highlighting overrules syntax highlighting. Can't give an + unprintable char another color. Would be useful for ^M at end of line. + + +Built-in script language: +9 Autoload: Add a Vim script in $VIMRUNTIME/tools that takes a file with a + list of script names and a help file and produces a script that can be + sourced to install the scripts in the user's directories. + Use findfile(), so that only file names need to be given: + script plugin/myscript.vim + script autoload/mylib.vim + script autoload/yourlib.vim + helpfile doc/myscript.txt + For the "helpfile" item ":helptags" is run. +7 Execute a function with standard option values. No need to save and + restore option values. Especially useful for new options. Problem: how + to avoid a performance penalty (esp. for string options)? +8 Add referring to key options with "&t_xx". Both for "echo &t_xx" and + ":let &t_xx =". Useful for making portable mappings. +- Add "{range}source": execute lines from a buffer. + Alternative: Allow range for ":exec", pass it on to the executed command. + (Webb) + You can already yank lines and use :@" to execute them. +7 ":include" command: just like ":source" but doesn't start a new scriptID? + Will be tricky for the list of script names. +8 Have a look at VSEL. Would it be useful to include? (Bigham) +8 Add ":fungroup" command, to group function definitions together. When + encountered, all functions in the group are removed. Suggest using an + obscure name to avoid name clashes. Require a ":fungroup END" in the same + sourced file? Assume the group ends at the end of the file. Handle + nested packages? + Alternative: Support packages. {package-name}:{function-name}(). + Packages are loaded automatically when first used, from + $VIMRUNTIME/packages (or use a search path). +7 Pre-parse or compile Vim scripts into a bytecode. + 1. Put the bytecode with the original script, with an ":if + has('bytecode')" around it, so that it's only used with a Vim that + supports it. Update the code with a command, can be used in an + autocommand. + 2. Use a ".vic" file (like Python use .pyc). Create it when writing a + .vim file. Problem: distribution. + 3. Use a cache directory for each user. How to recognize which cached + file belongs to a sourced script? +7 Add argument to winwidth() to subtract the space taken by 'foldcolumn', + signs and/or 'number'. +8 Add functions: + realname() Get user name (first, last, full) + user_fullname() patch by Nikolai Weibull, Nov + 3 2002 + Only add this when also implemented for + non-Unix systems, otherwise a shell cmd could + be used. + get_user_name() gets login name. + menuprop({name}, {idx}, {what}) + Get menu property of menu {name} item {idx}. + menuprop("", 1, "name") returns "File". + menuprop("File", 1, "n") returns "nmenu + File.Open..." argument. + Patch by Ilya Sher, 2004 Apr 22 + Return a list of menus and/or a dictionary + with properties instead. + mapname({idx}, mode) return the name of the idx'th mapping. + Patch by Ilya Sher, 2004 Mar 4. + Return a list instead. + char2hex() convert char string to hex string. + attributes() return file protection flags "drwxrwxrwx" + filecopy(from, to) Copy a file + shorten(fname) shorten a file name, like home_replace() + perl(cmd) call Perl and return string + inputrl() like input() but right-to-left + virtualmode() add argument to obtain whether "$" was used in + Visual block mode. + getacp() Win32: get codepage (Glenn Maynard) + deletebufline() delete line in any buffer + appendbufline() append line in any buffer + libcall() Allow more than one argument. + libcallext() Like libcall(), but using a callback function + to allow the library to execute a command or + evaluate an expression. +7 Make bufname("'0") return the buffer name from mark '0. How to get the + column and line number? col("'0") currently returns zero. +8 argc() returns 0 when using "vim -t tag". How to detect that no file was + specified in any way? To be able to jump to the last edited file. +8 Pass the executable name to the Vim scripts in some way. As v:argv0? +8 Add command arguments with three dashes, passed on to Vim scripts. +7 Add optional arguments to user functions: + :func myFunc(arg1, arg2, arg3 = "blah", arg4 = 17) +6 User functions: Functions local to buffer "b:func()"? +8 For Strings add ":let var[{expr}] = {expr}". When past the end of "var" + just ignore. +8 The "= register should be writable, if followed by the name of a variable, + option or environment variable. +8 ":let &option" should list the value of the option. +7 Add synIDlist(), making the whole list of syntax items on the syntax stack + available as a List. +8 Add autocommand-event for when a variable is changed: + :au VarChanged {varname} {commands} +8 Add "has("gui_capable")", to check if the GUI can be started. +8 Add possibility to use variables like registers: characterwise (default), + linewise (when ending in '\n'), blockwise (when ending in '\001'). reg0, + rega, reg%, etc. Add functions linewise({expr}), blockwise({expr}) and + charwise({expr}). +7 Make it possible to do any command on a string variable (make a buffer + with one line, containing the string). Maybe add an (invisible) scratch + buffer for this? + result = scratch(string, command) + result = apply(string, command) + result = execute(string, command) + "command" would use <> notation. + Does scratch buffer have a number? Or re-use same number? +7 Add function to generate unique number (date in milliseconds). +7 Automatically load a function from a file when it is called. Need an + option for the search path. (Sekera) + + +Robustness: +6 Add file locking. Lock a file when starting to edit it with flock() or + fcntl(). This patch has advisory file locking while reading/writing + the file for Vim 5.4: ~/vim/patches/kahn_file_locking . + The patch is incomplete (needs support for more systems, autoconf). + Andy doesn't have time to work on it. + Disadvantage: Need to find ways to gracefully handle failure to obtain a + lock. When to release a lock: When buffer is unloaded? + + +Performance: +7 For strings up to 3 bytes don't allocate memory, use v_list itself as a + character array. Use VAR_SSTRING (short string). +8 Turn b_syn_ic and b_syn_containedin into b_syn_flags. +9 Loading menu.vim still takes quite a bit of time. How to make it faster? +8 in_id_list() takes much time for syntax highlighting. Cache the result? +7 setpcmark() shifts the jumplist, this takes quite a bit of time when + jumping around. Instead use an index for the start? +8 When displaying a space with only foreground highlighting, it's the same + as a space without attributes. Avoid displaying spaces for the "~" lines + when starting up in a color terminal. +8 Avoid alloc() for scratch buffer use, esp. in syntax.c. It's very slow on + Win16. +9 Setting GUI options in the console (e.g., 'guifont') should not cause a + redraw. +8 Profiling shows that in_id_list() is used very often for C code. Can this + function be improved? +8 For an existing file, the page size of the swap file is always the + default, instead of using the block size of the device, because the swap + file is created only after setting the block size in mf_open(). How can + this be improved? +8 Set default for 'ttyscroll' to half a screen height? Should speed up + MS-DOS version. (Negri) +7 C syntax highlighting gets a lot slower after ":set foldmethod=syntax". + (Charles Campbell) Inserting a "{" is very slow. (dman) +7 HTML syntax highlighting is slow for long lines. Try displaying + http://www.theregister.co.uk/content/4/22908.html. (Andre Pang) +7 Check how performance of loading the wordlist can be improved (adding a + lot of abbreviations). +7 DOS console: Add t_DL support, to make scrolling faster. +7 Compile Ex commands to byte codes. Store byte codes in a vim script file + at the end, after "compiled:. Make it look like a single comment line + for old Vim versions. Insert first line "Vim script compiled <timestamp>. + Only used compiled code when timestamp matches the file stat. + Add command to compile a vim script and add it to the file in-place. + Split Ex command executing into a parsing and executing phase. + Use compiled code for functions, while loops, etc. +8 When editing a file with extremely long lines (e.g., an executable), the + "linerest" in readfile() is allocated twice to be able to copy what was + read so far. Use realloc() instead? Or split the line when allocating + memory fails and "linerest" is big (> 100000)? +8 When defining autocommands (e.g., from $VIMRUNTIME/filetype.vim), need to + compare each pattern with all existing patterns. Use a hash code to avoid + using strcmp() too often? +7 Include turbo_loader patches, speeding up reading a file? + Speed up reading a file by reading it into a fixed-size buffer, creating + the list of indexes in another buffer, and then copying the result into a + memfile block with two copies. Then read the next block into another + fixed-size buffer, create the second list of indexes and copy text from + the two blocks to the memfile block. +7 do_cmdline(): Avoid that the command line is copied to allocated memory + and freed again later all the time. For while loops, and for when called + with an argument that can be messed with. + Generic solution: Make a struct that contains a pointer and a flag that + indicates if the pointer should be freed when replaced. +7 Check that the file size is not more than "sizeof(long)". +- Further improve finding mappings in maphash[] in vgetorpeek() +8 Syntax highlighting is slow when deleting lines. Try in + $VIMRUNTIME/filetype.vim. +- "out of memory" after deleting (1,$d) and changing (:%s/^/> /) a lot of + lines (27000) a few times. Memory fragmentation? +- Have a look at how pdksh does memory allocation (alloc.c). (Dalecki) +- Do profiling on: + - :g/pat/normal cmd + - 1000ii<Esc> + - deleting 10Mbyte worth of lines (netscape binary) + - "[i" and "[d" (Yegappan Lakshmanan) + - ":g/^/m0" on a 450Kbyte file. And the "u". + - highlighting "~/vim/test/longline.tex", "~/vim/test/scwoop.tcl" and + "~/vim/test/lockup.pl". + - loading a syntax file to highlight all words not from a dictionary. + - editing a Vim script with syntax highlighting on (loading vim.vim). +7 Screen updating can be further improved by only redrawing lines that were + changed (and lines after them, when syntax highlighting was used, and it + changed). + - On each change, remember start and end of the change. + - When inserting/deleting lines, remember begin, end, and line count. +- Use macros/duarte/capicua for profiling. Nvi 1.71 is the fastest! +- When using a file with one long line (1Mbyte), then do "$hhhh", is still + very slow. Avoid calling getvcol() for each "h"? +- Executing a register, e.g. "10000@@" is slow, because ins_typebuf has to + move the previous commands forward each time. Pass count from + normal_cmd() down to do_execreg(). +- Repeating insert "1000i-<Esc>" displays --INSERT-- all the time, because of + the <Esc> at the end. Make this work faster (disable redrawing). +- Avoid calls to plines() for cursor line, use w_cline_height. +- After ":set nowrap" remove superfluous redraw with wrong hor. offset if + cursor is right of the screen. +8 Make CTRL-C on Unix generate a signal, avoid using select() to check for a + CTRL-C (it's slow). + + +Code size: +8 GUI: When NO_CONSOLE is defined, more code can be excluded. +- Put getline() and cookie in a struct, so only one argument has to be + passed to do_cmdline() and other functions. +8 Make a GUI-only version for Unix? +8 In buf_write _() isn't needed when setting errmsg, do it once when using + it. +7 When compiling with a GUI-only version, the code for cterm colors can be + left out. +8 When compiled with a GUI-only version, the termcap entries for terminals + can be removed. +8 Can the check for libelf in configure.in be removed? + + +Messages: +8 When using ":q" in a changed file, the error says to "add !". Add the + command so that beginners understand it: "use :q!". +8 For 'verbose' level 12 prints commands from source'ed files. How to skip + lines that aren't executed? Perhaps move the echoing to do_cmdline()? +8 Use 'report' for ":bdel"? (Krishna) To avoid these messages when using a + script. +- Delete message after new command has been entered and have waited for key. + Perhaps after ten seconds? +- Make message history available in "msg" variables: msg1, msg2, .. msg9. +9 Check handling of overwriting of messages and delays: + Very wrong: errors while redrawing cause endless loop. + When switching to another file and screen scrolls because of the long + message and return must be typed, don't scroll the screen back before + redrawing. +7 Add an option, which is a regexp, that disables warning messages which + match that regexp (Tsirkin). +8 When address range is wrong you only get "Invalid range". Be a bit more + specific: Negative, beyond last line, reverse range? Include the text. +8 Make it possible to ignore errors for a moment ('errorignore'?). Another + option to switch off giving error messages ('errorquiet'?). Also an option + not to give any messages ('quiet')? Or ":quiet on", ":quiet off". + Careful: For a severe error (out of memory), and when the user starts + typing, error messages must be switched back on. + Also a flag to ignore error messages for shell commands (for mappings). +- Option to set time for emsg() sleep. Interrupt sleep when key is typed? + Sleep before second message? +8 In Ex silent mode or when reading commands from a file, what exactly is + not printed and what is? Check ":print", ":set all", ":args", ":vers", + etc. At least there should be no prompt. (Smulders) And don't clear the + screen when reading commands from stdin. (Kendall) + --> Make a difference between informative messages, prompts, etc. and + error messages, printing text, etc. +8 Window should be redrawn when resizing at the hit-enter prompt. + Also at the ":tselect" prompt. Find a generic solution for redrawing when + a prompt is present (with a callback function?). + + +Screen updating: +7 Add a string to the 'display' option to make CTRL-E and CTRL-Y scroll one + screen line, also if this means the first line doesn't start with the + first character (like what happens with a single line that doesn't fit). +- screen_line(): + - insert/delete character stuff. + - improve delete rest of line (spaces at end of line). +- When moving or resizing window, try to avoid a complete redraw (esp. when + dragging the status line with the mouse). +- When 'lazyredraw' set, don't echo :ex commands? Need a flag to redraw when + waiting for a character. +8 Add a ":refresh [winnr]" command, to force updating a window. Useful from + an event handler where ":normal" can't be used. Also useful when + 'lazyredraw' is set in a mapping. +7 Make 'list' and 'linebreak' work together. + + +Scrolling: +8 Add "zm" command: scroll horizontally to put the cursor in the middle. +6 Add option to set the overlap for CTRL-F and CTRL-B. (Garhi) +- extend 'scrollbind' option: 'scrollopt' words "search", "relative", etc.. + Also 'e'xecute some commands (search, vertical movements) in all bound + windows. +7 Add 'scrollbind' feature to make the offset of one window with the next + one equal to the window height. When editing one file in both windows it + looks like each window displays a page of the buffer. +- Allow scrolling by dragging with the mouse (grab a character and move it + up/down). Like the "hand" in Acrobat reader. Use Alt-LeftMouse for this? + (Goldfarb) +- Add command to execute some commands (search, vertical movements) in all + bound windows. +- Add 'search' option to 'scrollopt' to allow 'scrollbind' windows to + be bound by regexp searches +- Add "z>" and "z<": scroll sideways one screenful. (Campbell) +- Add option to set the number of lines when not to scroll, instead of the + fixed number used now (for terminals that scroll slow with a large number + of lines but not with a single line). + + +Autoconf: +8 Should use acconfig.h to define prototypes that are used by autoheader. +8 Some compilers don't give an error for "-OPT:Olimit" but a warning. (Webb) + Add a check for the warning, so that "Olimit" can be added automatically? +- Autoconf: Use @datadir@ for the system independent files. Make sure the + system dependent and system independent files are separated. (Leitner). +- Add autoconf check for waitpid()/wait4(). +- Remove fcntl() from autoconf, all systems have it? +- Set default for 'dictionary', add search for dictionary to autoconf. + + +Perl interface: +8 Rename typemap file to something else? +7 Make buffers accessed as Perl arrays. (Clark) +7 Make it possible to compile with non-ANSI C? +6 Tcl/Tk has the "load" command: load a shared library (.so or .dll). + + +Shared libraries: +6 Add support for loading shared libraries, and calling functions in it. + :libload internal-name libname + :libunload internal-name + :liblist + :libcall internal-name function(arg1, arg2, ...) + :libcall function(arg1, arg2, ...) + libcall() can have only one integer or String argument at the moment. +6 Have a look on how Perl handles loading dynamic libraries. + + +Tags: +9 With ":set tags=./tags,../tags" and a tag appears in both tags files it is + added twice. Requires figuring out the actual file name for each found + match. Remove tag_fname from the match and combine it with the fname in + the match (without expanding or other things that take time). When + 'tagrelative' is off tag_fname isn't needed at all. +8 Use a mechanism similar to omni completion to figure out the kind of tab + for CTRL-] and jump to the appropriate matching tag (if there are + several). +7 Can CTRL-] (jump to tag) include a following "." and "->" to restrict the + number of possible matches? Check tags file for an item that has members. + (Flemming Madsen) +8 Scope arguments for ":tag", e.g.: ":tag class:cPage open", like Elvis. +8 When output of ":tselect" is long, getting the more-prompt, should be able + to type the tag number directly. +7 Add the possibility to use the "-t {tag}" argument multiple times. Open a + window for each tag. +7 Make output of ":tselect" a bit nicer. Use highlighting? +7 Highlight the "tag 1 of >2" message. New highlight group, or same as "hit + bottom" search message. +7 When using ":tag" at the top of the tag stack, should add another entry, + so CTRL-T can bring you back to where you are now AND to where you were + before the previous ":tag" command. (Webb) +- When doing "[^I" or "[^D" add position to tag stack. +- Add command to put current position to tag stack: ":tpush". +7 When using CTRL-] on someClass::someMethod, separate class from method and + use ":ta class:someClass someMethod". + Include C++ tags changes (Bertin). Change "class::func" tag into "func" + with "class=class"? Docs in oldmail/bertin/in.xxx. +7 Add ":tagargs", to set values for fields: + :tagargs class:someclass file:version.c + :tagargs clear + These are then the default values (changes the order of priority in tag + matching). +7 Support for "gtags" and "global"? With ":rtag" command? + There is an example for how to do this in Nvi. + Or do it like Elvis: 'tagprg' and 'tagprgonce' options. (Yamaguchi) + The Elvis method is far more flexible, do it that way. +7 Support "col:99" extra field, to position the cursor in that column. With + a flag in 'cpoptions' to switch it off again. +7 Better support for jumping to where a function or variable is used. Use + the id-utils, with a connection to "gid" (Emacs can do it too). Add + ":idselect", which uses an "ID" database (made by "mkid") like "tselect". + + +Win32 GUI: +8 Make debug mode work while starting up (vim -D). Open console window for + the message and input? +7 The Python interface only works with one version of Python, selected at + compile time. Can this be made to work with version 2.1 and 2.2 + dynamically? +7 GvimExt: when there are several existing Vims, move the list to a submenu. + (Mike McCollister) +8 When using "Edit with Vim" for one file it changes directory, when several + files are selected and using "Edit with single Vim" the directory isn't + changed. At least change directory when the path is the same for all + files. Perhaps just use the path of the first file or use the longest + common part of the path. +8 Add font argument to set the lfCharSet. (Bobcik) +8 Somehow automatically detect the system language and set $LANG, so that + gettext and menus work. +8 Could keep console open to run multiple commands, to avoid the need to hit + return in every console. + Also: Look at how Emacs does runs external commands: + http://www.cs.washington.edu/homes/voelker/ntemacs.html. +8 Need a separate PopUp menu for modeless selection. Need two new commands: + Copy selection to clipboard, Paste selection (as typed text). +8 Support copy/paste for other file formats. At least HTML, perhaps RTF. + Add "copy special" and "paste special" commands? +7 Use different default colors, to match the current Windows color scheme. + Sys_WindowText, Sys_Window, etc. (Lionel Schaffhauser) +7 Use <C-Tab> to cycle through open windows (e.g., the find dialog). +7 <Esc> should close a dialog. +7 Keep the console for external commands open. Don't wait for a key to be + hit. Re-open it when the user has closed it anyway. Or use a prepended + command: ":nowait {cmd}", or ":quiet", which executes {cmd} without any + prompts. +7 Should be able to set an option so that when you double click a file that + is associated with Vim, you can either get a new instance of Vim, or have + the file added into an already running Vim. +7 The "-P" argument only works for the current codepage. Use wide + functions to find the window title. + + +GUI: +8 Make inputdialog() work for Photon, Amiga, RiscOS. +- <C--> cannot be mapped. Should be possible to recognize this as a + normal "-" with the Ctrl modifier. +7 Implement ":popup" for other systems than Windows. +8 Implement ":tearoff" for other systems than Win32 GUI. +6 Implement ":untearoff": hide a torn-off menu. +8 When using the scrollbar to scroll, don't move the cursor position. When + moving the cursor: scroll to the cursor position. +9 Make <S-Insert> paste from the clipboard by default. (Kunze) +7 Menu local to a buffer, like mappings. Or local to a filetype? +8 In Buffers menu, add a choice whether selecting a buffer opens it in the + current window, splits the window or uses ":hide". +8 Dragging the mouse pointer outside of a Vim Window should make the text + scroll. Return a value from gui_send_mouse_event() to the machine + specific code to indicate the time in which the event should be repeated. +8 Make it possible to ignore a mouse click when it's used to give Vim (gvim) + window focus. Also when a mouse click is used to bring a window to front. +8 Make the split into system independent code and system specific code more + explicit. There are too many #ifdefs in gui.c. + If possible, separate the Vim code completely from the GUI code, to allow + running them in separate processes. +7 X11: Support cursorColor resource and "-cr" argument. +8 X11 (and others): CTRL-; is not different from ';'. Set the modifier mask + to include CTRL for keys where CTRL produces the same ASCII code. +7 Add some code to handle proportional fonts on more systems? Need to draw + each character separately (like xterm). Also for when a double-width font + is not exactly double-width. (Maeda) +8 Should take font from xterm where gvim was started (if no other default). +8 Selecting font names in X11 is difficult, make a script or something to + select one. +8 Visual highlighting should keep the same font (bold, italic, etc.). +8 Add flag to 'guioptions' to not put anything in the clipboard at all? +8 Should support a way to use keys that we don't recognize yet. Add a + command that adds entries to special_keys somehow. How do we make this + portable (X11, Win32, ..)? +7 Add a flag to 'guioptions' that tells not to remove inactive menu items. + For systems where greying-out or removing menu items is very slow. The + menu items would remain visibly normally, but not do anything. +7 Add ":minimize" and ":maximize", which iconize the window and back. + Useful when using gvim to run a script (e.g. 2html.vim). +7 X11: Is it possible to free allocated colors, so that other programs can + use them again? Otherwise, allow disabling allocating the default colors. + Or allocate an own colormap (check UAE). With an option to use it. For + the commandline, "-install" is mostly used for X11 programs. +7 Add command line argument for "gvim" not to start the GUI. Sort of the + inverse of "vim -g". (Vikas) +7 Should support multi-column menus. +- Should add option for where to put the "Help" menu: like Motif at the far + right, or with the other menus (but still at the right). +- Add menu item to "Keep Insert mode". +8 ":mkgvimrc" command, that includes menus. +6 Big change: Move GUI to separate program "vimgui", to make startup of vim a + lot faster, but still be able to do "vim -g" or ":gui". +7 More explicit mouse button binding instead of 'mousemodel'? +7 Add option to set the position of the window on the screen. 'windowpos', + which has a value of "123,456": <x>,<y>. + Or add a command, like ":winsize"? +7 Add toolbar for more GUIs. +8 Make it possible to use "amenu icon=BuiltIn##", so that the toolbar item + name can be chosen free. +7 Make it possible to put the toolbar on top, left, right and/or bottom of + the window? Allows for softkey-like use. +6 Separate the part of Vim that does the editing from the part that runs the + GUI. Communicate through a pseudo-tty. Vim starts up, creates a + pty that is connected to the terminal. When the GUI starts, the pty is + reconnected to the GUI process. When the GUI stops, it is connected to + the terminal again. Also use the pty for external processes, it looks + like a vt100 terminal to them. Vim uses extra commands to communicate GUI + things. +7 Motif: For a confirm() dialog <Enter> should be ignored when no default + button selected, <Esc> should close the dialog. +7 When using a pseudo-tty Vim should behave like some terminal (vt52 looks + simple enough). Terminal codes to/from shell should be translated. +- Would it be useful to be able to quit the GUI and go back to the terminal + where it was started from? +7 Support "-visual <type>" command line argument. + + +Autocommands: +- Put autocommand event names in a hashtable for faster lookup? +7 For autocommand events that trigger multiple times per buffer (e.g., + CursorHold), go through the list once and cache the result for a specific + buffer. Invalidate the cache when adding/deleting autocommands or + changing the buffer name. +8 Add ScriptReadCmd event: used to load remote Vim scripts, e.g. + "vim -u http://mach/path/vimrc". +7 Add TagJump event: do something after jumping to a tag. +8 Add "TagJumpFile" autocommand: When jumping to another file for a tag. + Can be used to open "main.c.gz" when "main.c" isn't found. +8 Use another option than 'updatetime' for the CursorHold event. The two + things are unrelated for the user (but the implementation is more + difficult). +8 Add an event like CursorHold that is triggered repeatedly, not just once + after typing something. +7 Add autocommand event for when a buffer cannot be abandoned. So that the + user can define the action taking (autowrite, dialog, fail) based on the + kind of file. (Yakov Lerner) Or is BufLeave sufficient? +8 Autocommand for when modified files have been found, when getting input + focus again (e.g., FileChangedFocus). + Check when: getting focus, jumping to another buffer, ... +8 Autocommands should not change registers. And marks? And the jumplist? + And anything else? Add a command to save and restore these things. +8 Add autocommands, user functions and user commands to ":mkvimrc". +6 Add KeymapChanged event, so that the effects of a different keymap can be + handled (e.g., other font) (Ron Aaron) +7 When trying to open a directory, trigger an OpenDirectory event. +7 Add file type in front of file pattern: <d> for directory, <l> for link, + <x> for executable, etc. <&xxx> for Risc OS. With commas to separate + alternatives. The autocommand is only executed when both the file type + AND the file pattern match. (Leonard) +5 Add option that specifies extensions which are to be discarded from the + file name. E.g. 'ausuffix', with ".gz,.orig". Such that file.c.gz will + trigger the "*.c" autocommands. (Belabas) +7 Add something to break the autocommands for the current event, and for + what follows. Useful for a "BufWritePre" that wants to avoid writing the + file. +8 When editing "tt.gz", which is in DOS format, 'fileformat' stays at + "unix", thus writing the file changes it. Somehow detect that the read + command used dos fileformat. Same for 'fileencoding'. +- Add events to autocommands: + Error - When an error happens + NormalEnter - Entering Normal mode + ReplaceEnter - Entering Replace mode + CmdEnter - Entering Cmdline mode (with type of cmdline to allow + different mapping) + VisualEnter - Entering Visual mode + *Leave - Leaving a mode (in pair with the above *Enter) + VimLeaveCheck - Before Vim decides to exit, so that it can be cancelled + when exiting isn't a good idea. + WinMoved - when windows have been moved around, e.g, ":wincmd J" + CmdUndefined - Like FuncUndefined but for user commands. + SearchPost - After doing a search command (e.g. to do "M") + PreDirChanged/PostDirChanged + - Before/after ":cd" has been used (for changing the + window title) + BufReadAction - replaces reading a file + BufWriteAction - replaces writing a file + ShutDown - when the system is about to shut down + InsertCharPre - user typed character Insert mode, before inserting the + char. Pattern is matched with text before the cursor. + Set v:char to the character, can be changed. + (not triggered when 'paste' is set). + InsertCharPost - user typed a character in Insert mode, after inserting + the char. + BufModified - When a buffer becomes modified, or unmodified (for + putting a [+] in the window title or checking out the + file from CVS). + BufFirstChange - When making a change, when 'modified' is set. Can be + used to do a :preserve for remote files. + BufChange - after a change was made. Set some variables to indicate + the position and number of inserted/deleted lines, so + that marks can be updated. HierAssist has patch to add + BufChangePre, BufChangePost and RevertBuf. (Shah) + WinResized - When a window has been resized +- Write the file now and then ('autosave'): + *'autosave'* *'as'* *'noautosave'* *'noas'* + 'autosave' 'aw' number (default 0) + Automatically write the current buffer to file N seconds after the + last change has been made and when |'modified'| is still set. + Default: 0 = do not autosave the buffer. + Alternative: have 'autosave' use 'updatetime' and 'updatecount' but make + them save the file itself besides the swapfile. + + +Omni completion: +- Ideas from the Vim 7 BOF at SANE: + - For interpreted languages, use the interpreter to obtain information. + Should work for Java (Eclipse does this), Python, Tcl, etc. + Richard Emberson mentioned working on an interface to Java. + - Check Readline for its completion interface. + - Use ctags for other languages. Writing a file could trigger running + ctags, merging the tags of the changed file. +- Ideas from others: + http://www.wholetomato.com/ + http://www.vim.org/scripts/script.php?script_id=747 + http://sourceforge.net/projects/insenvim + or http://insenvim.sourceforge.net + Java, XML, HTML, C++, JSP, SQL, C# + MS-Windows only, lots of dependencies (e.g. Perl, Internet + explorer), uses .dll shared libraries. + For C++ uses $INCLUDE environment var. + Uses Perl for C++. + Uses ctags to find the info: + ctags -f $allTagsFile --fields=+aiKmnsSz --language-force=C++ --C++-kinds=+cefgmnpsut-dlux -u $files + www.vim.org script 1213 (Java Development Environment) (Fuchuan Wang) + IComplete: http://www.vim.org/scripts/script.php?script_id=1265 + and http://stud4.tuwien.ac.at/~e0125672/icomplete/ + http://cedet.sourceforge.net/intellisense.shtml (for Emacs) + Ivan Villanueva has something for Java. + Emads: http://www.xref-tech.com/xrefactory/more_c_completion.html + Completion in .NET framework SharpDevelop: http://www.icsharpcode.net +- Pre-expand abbreviations, show which abbrevs would match? + + +Insert mode completion/expansion: +- GUI implementation of the popup menu. +7 When searching in other files the name flash by, too fast to read. Only + display a name every second or so, like with ":vimgrep". +8 When there is no word before the cursor but something like "sys." complete + with "sys.". Works well for C and similar languages. +9 ^X^L completion doesn't repeat correctly. It uses the first match with + the last added line, instead of continuing where the last match ended. + (Webb) +8 Add option to set different behavior for Insert mode completion: + - ignore/match case + - different characters than 'iskeyword' +8 Add a command to undo the completion, go back to the original text. +7 Completion of an abbreviation: Can leave letters out, like what Instant + text does: www.textware.com +8 Use the class information in the tags file to do context-sensitive + completion. After "foo." complete all member functions/variables of + "foo". Need to search backwards for the class definition of foo. + Should work for C++ and Java. + Even more context would be nice: "import java.^N" -> "io", "lang", etc. +7 When expanding $HOME/dir with ^X^F keep the $HOME (with an option?). +7 Add CTRL-X command in Insert mode like CTRL-X CTRL-N, that completes WORDS + instead of words. +8 Add CTRL-X CTRL-R: complete words from register contents. +8 Add completion of previously inserted texts (like what CTRL-A does). + Requires remembering a number of insertions. +8 Add 'f' flag to 'complete': Expand file names. + Also apply 'complete' to whole line completion. +- Make it possible to search include files in several places. Use the + 'path' option? Can this be done with the dictionary completion (use + wildcards in the file name)? +- Make CTRL-X CTRL-K do a binary search in the dictionary (if it's sorted). +- Speed up CTRL-X CTRL-K dictionary searching (don't use a regexp?). +- Set a mark at the position where the match was found (file mark, could + be in another file). +- Add CTRL-A command in CTRL-X mode: show all matches. +- Make CTRL-X CTRL-L use the 'complete' option? +- Add command in CTRL-X mode to add following words to the completed string + (e.g. to complete "Pointer->element" with CTRL-X CTRL-P CTRL-W CTRL-W) +- CTRL-X CTRL-F: Use 'path' to find completions. +- CTRL-X CTRL-F: Option to use forward slashes on MS-Windows? +- CTRL-X CTRL-F: Don't replace "$VIM" with the actual value. (Kelly) +8 Add option 'isexpand', containing characters when doing expansion (so that + "." and "\" can be included, without changing 'iskeyword'). (Goldfarb) + Also: 'istagword': characters used for CTRL-]. + When 'isexpand' or 'istagword' are empty, use 'iskeyword'. +- Allow listing all matches in some way (and picking one from the list). + + +Command line editing: +7 Add commands (keys) to delete from the cursor to the end of the command + line. +8 Custom completion of user commands can't use the standard completion + functions. Add a hook to invoke a user function that returns the type of + completion to be done: "file", "tag", "custom", etc. +- Add flags to 'whichwrap' for command line editing (cursor right at end of + lines wraps to start of line). +- Make editing the command line work like Insert mode in a single-line view + on a buffer that contains the command line history. But this has many + disadvantages, only implement it when these can be solved. Elvis has run + into these, see remarks from Steve (~/Mail/oldmail/kirkendall/in.00012). + - Going back in history and editing a line there would change the history. + Would still need to keep a copy of the history elsewhere. Like the + cmdwin does now already. + - Use CTRL-O to execute one Normal mode command. How to switch to normal + mode for more commands? <Esc> should cancel the command line. CTRL-T? + - To allow "/" and "= need to recursively call getcmdline(), overwrite the + cmdline. But then we are editing a command-line again. How to avoid + that the user gets confused by the stack of command lines? + - Use edit() for normal cmdline editing? Would have to integrate + getcmdline() into edit(). Need to solve conflicts between Insert mode + and Command-line mode commands. Make it work like Korn shell and tcsh. + Problems: + - Insert: completion with 'wildchar' + - Insert: use cmdline abbreviations + - Insert: CTRL-D deletes indent instead of listing matches + - Normal: no CTRL-W commands + - Normal: no ":" commands? + - Normal: allow Visual mode only within one line. + - where to show insert/normal mode message? Change highlighting of + character in first column? + - Implementation ideas: + - Set "curwin" and "curbuf" to the command line window and buffer. + - curwin->w_topline is always equal to curwin->w_cursor.lnum. + - never set 'number', no folding, etc. No status line. + - sync undo after entering a command line? + - use NV_NOCL flag for commands that are not allowed in Command-line + Mode. + + +Command line completion: +8 Change expand_interactively into a flag that is passed as an argument. +8 With command line completion after '%' and '#', expand current/alternate + file name, so it can be edited. Also with modifiers, such as "%:h". +8 When completing command names, either sort them on the long name, or list + them with the optional part inside []. +7 Completion of ":map x ": fill in the current mapping, so that it can be + edited. (Sven Guckes) +- For 'wildmenu': Simplify "../bar" when possible. +- When using <Up> in wildmenu mode for a submenu, should go back to the + current menu, not the first one. E.g., ":emenu File.Save<Up>". +8 For ":find" and ":sfind" expand files found in 'path'. +8 When using backtick expansion, the external command may write a greeting + message. Add an option or commands to remove lines that match a regexp? +7 When listing matches of files, display the common path separately from the + file names, if this makes the listing shorter. (Webb) +- Add command line completion for ":ilist" and friends, show matching + identifiers (Webb). +8 Add command line completion for "old value" of a command. ":args <key>" + would result in the current list of arguments, which you can then edit. +7 Add command line completion with CTRL-X, just like Insert mode completion. + Useful for ":s/word/xx/". +- Add command to go back to the text as it was before completion started. + Also to be used for <Up> in the command line. +- Add 'wildlongest' option: Key to use to find longest common match for + command line completion (default CTRL-L), like 'wildchar'. (Cregut) + Also: when there are several matches, show them line a CTRL-D. + + +Command line history: +9 Remember which command lines were actually typed and were not loaded from + viminfo. When writing viminfo append only these lines, so that lines from + other Vim's are not overwritten. +- Add "KeyWasTyped" flag: It's reset before each command and set when a + character from the keyboard is consumed. Value is used to decide to put a + command line in history or not. Put line in history if it didn't + completely resulted from one mapping. +- When using ":browse", also put the resulting edit command in the history, + so that it can be repeated. (Demirel) + + +Insert mode: +9 When 'autoindent' is set, hitting <CR> twice, while there is text after + the cursor, doesn't delete the autoindent in the resulting blank line. + (Rich Wales) This is Vi compatible, but it looks like a bug. +8 When using CTRL-O in Insert mode, then executing an insert command + "a" or "i", should we return to Insert mode after <Esc>? (Eggink) + Perhaps it can be allowed a single time, to be able to do + "<C-O>10axyz<Esc>". Nesting this further is confusing. + ":map <F2> 5aabc<Esc>" works only once from Insert mode. +7 Use CTRL-G <count> to repeat what follows. Useful for inserting a + character multiple times or repeating CTRL-Y. +7 Use 'matchpairs' for 'showmatch': When inserting a character check if it + appears in the rhs of 'matchpairs'. +- In Insert mode (and command line editing?): Allow undo of the last typed + character. This is useful for CTRL-U, CTRL-W, delete and backspace, and + also for characters that wrap to the next line. + Also: be able to undo CTRL-R (insert register). + Possibly use 'backspace'="whole" for a mode where at least a <CR> that + inserts autoindent is undone by a single <BS>. +- Use CTRL-G in Insert mode for an extra range of commands, like "g" in + Normal mode. +- Make 'paste' work without resetting other options, but override their + value. Avoids problems when changing files and modelines or autocommands + are used. +- When typing CTRL-V and a digit higher than 2, only expect two digits. +- Insert binary numbers with CTRL-V b. +- Make it possible to undo <BS>, <C-W> and <C-U>. Bash uses CTRL-Y. + + +'cindent', 'smartindent': +8 Java: Inside an anonymous class, after an "else" or "try" the indent is + too small. (Vincent Bergbauer) + Problem of using {} inside (), 'cindent' doesn't work then. +8 In C++ it's possible to have {} inside (): (Kirshna) + func( + new String[] { + "asdf", + "asdf" + } + ); +7 Add separate "(0" option into inside/outside a function (Zellner): + func( + int x) // indent like "(4" + { + if (a + && b) // indent like "(0" +9 Using "{" in a comment: (Helmut Stiegler) + if (a) + { + if (b) + { + // { + } + } <-- this is indented incorrect + Problem is that find_start_brace() checks for the matching brace to be in + a comment, but not braces in between. Requires adding a comment check to + findmatchlimit(). +- Make smartindenting configurable. Add 'sioptions', e.g. '#' setting the + indent to 0 should be switched on/off. +7 Support ANSI style function header, with each argument on its own line. +- "[p" and "]p" should use 'cindent' code if it's on (only for the first + line). +- Add option to 'cindent' to set indent for comments outside of {}? +- Make a command to line up a comment after a code line with a previous + comment after a code line. Can 'cindent' do this automatically? +7 Add 'j' flag to 'formatoptions': Remove comment leader when joining lines. +- When 'cindent'ing a '}', showmatch is done before fixing the indent. It + looks better when the indent is fixed before the showmatch. (Webb) +- Add option to make indenting work in comments too (for commented-out + code), unless the line starts with "*". +- Don't use 'cindent' when doing formatting with "gq"? +- When formatting a comment after some text, insert the '*' for the new line + (indent is correct if 'cindent' is set, but '*' doesn't get inserted). +8 When 'comments' has both "s1:/*,mb:*,ex:*/" and "s1:(*,mb:*,ex:*)", the + 'x' flag always uses the first match. Need to continue looking for more + matches of "*" and remember all characters that could end the comment. +- For smartindent: When typing 'else' line it up with matching 'if'. +- 'smartindent': allow patterns in 'cinwords', for e.g. TeX files, where + lines start with "\item". +- Support this style of comments (with an option): (Brown) + /* here is a comment that + is just autoindented, and + nothing else */ +- Add words to 'cinwords' to reduce the indent, e.g., "end" or "fi". +7 Use Tabs for the indent of starting lines, pad with spaces for + continuation lines. Allows changing 'tabstop' without messing up the + indents. + 'keeptabs': when set don't change the tabs and spaces used for indent, + when the indent remains the same or increases. + + +Java: +8 Can have {} constructs inside parens. Include changes from Steve + Odendahl? +8 Recognize "import java.util.Vector" and use $CLASSPATH to find files for + "[i" commands and friends. +- For files found with 'include': handle "*" in included name, for Java. + (Jason) +- How to make a "package java.util" cause all classes in the package to be + searched? Also for "import java.util.*". (Mark Brophy) + + +'comments': +8 When formatting C comments that are after code, the "*" isn't repeated + like it's done when there is no code. And there is no automatic wrapping. + Recognize comments that come after code. Should insert the comment leader + when it's "#" or "//". + Other way around: when a C command starts with "* 4" the "*" is repeated + while it should not. Use syntax HL comment recognition? +7 When using "comments=fg:--", Vim inserts three spaces for a new line. + When hitting a TAB, these spaces could be removed. +7 The 'n'esting flag doesn't do the indenting of the last (rightmost) item. +6 Make strings in 'comments' option a RE, to be able to match more + complicated things. (Phillipps) Use a special flag to indicate that a + regexp is used. +8 Make the 'comments' option with "/* * */" lines only repeat the "*" line + when there is a "/*" before it? Or include this in 'cindent'? + + +Virtual edit: +8 Make the horizontal scrollbar work to move the text further left. +7 Add a mode where the cursor is only allowed to go one character after the + end of the line? +7 Allow specifying it separately for Tabs and beyond end-of-line? + + +Text objects: +8 Add test script for text object commands "aw", "iW", etc. +8 Add text object for part of a CamelHumedWord and under_scored_word. + (Scott Graham) "ac" and "au"? +8 Add a text object for any kind of quoting, also with multi-byte + characters. Option to specify what quotes are recognized (default: all) + use "aq" and "iq". Use 'quotepairs' to define pairs of quotes, like + 'matchpairs'? +8 Add text object for any kind of parens, also multi-byte ones. +7 Add text object for current search pattern: "a/" and "i/". Makes it + possible to turn text highlighted for 'hlsearch' into a Visual area. +8 Add a way to make an ":omap" for a user-defined text object. +8 Add "gp" and "gP" commands: insert text and make sure there is a single + space before it, unless at the start of the line, and after it, unless at + the end of the line or before a ".". +7 Add objects with backwards extension? Use "I" and "A". Thus "2dAs" + deletes the current and previous sentence. (Jens Paulus) +7 Add "g{" and "g}" to move to the first/last character of a paragraph + (instead of the line just before/after a paragraph as with "{" and "}"). +6 Ignore comment leaders for objects. Make "das" work in reply-email. +5 Make it possible to use syntax group matches as a text object. For + example, define a "ccItem" group, then do "da<ccItem>" to delete one. + Or, maybe just define "dai", delete-an-item, to delete the syntax item the + cursor is on. + + +Select mode: +8 In blockwise mode, typed characters are inserted in front of the block, + backspace deletes a column before the block. (Steve Hall) +7 Alt-leftmouse starts block mode selection in MS Word. + See http://www.vim.org/tips/tip.php?tip_id=743 +7 Add Cmdline-select mode. Like Select mode, but used on the command line. + - Change gui_send_mouse_event() to pass on mouse events when 'mouse' + contains 'C' or 'A'. + - Catch mouse events in ex_getln.c. Also shift-cursor, etc., like in + normal_cmd(). + - remember start and end of selection in cmdline_info. + - Typing text replaces the selection. + + +Visual mode: +- When dragging the Visual selection with the mouse and 'scrolloff' is zero, + behave like 'scrolloff' is one, so that the text scrolls when the pointer + is in the top line. +- Displaying size of Visual area: use 24-33 column display. + When selecting multiple lines, up to about a screenful, also count the + characters. +8 When using "I" or "A" in Visual block mode, short lines do not get the new + text. Make it possible to add the text to short lines too, with padding + where needed. +7 With a Visual block selected, "2x" deletes a block of double the width, + "3y" yanks a block of triple width, etc. +7 When selecting linewise, using "itext" should insert "text" at the start + of each selected line. +8 What is "R" supposed to do in Visual mode? +8 Make Visual mode local to the buffer. Allow changing to another buffer. + When starting a new Visual selection, remove the Visual selection in any + other buffer. (Ron Aaron) +8 Support dragging the Visual area to drop it somewhere else. (Ron Aaron, + Ben Godfrey) +7 Support dragging the Visual area to drop it in another program, and + receive dropped text from another program. (Ben Godfrey) +7 With blockwise Visual mode and "c", "C", "I", "A", etc., allow the use of + a <CR>. The entered lines are repeated over the Visual area. +7 CTRL-V :s should substitute only in the block, not to whole lines. (David + Young is working on this) +7 Filtering a block should only apply to the block, not to the whole lines. + When the number of lines is increased, add lines. When decreased, pad with + spaces or delete? Use ":`<,`>" on the command line. +8 After filtering the Visual area, make "gv" select the filtered text? + Currently "gv" only selects a single line, not useful. +7 Don't move the cursor when scrolling? Needed when the selection should + stay the same. Scroll to the cursor at any movement command. With an + option! +7 In Visual block mode, need to be able to define a corner on a position + that doesn't have text? Also: when using the mouse, be able to select + part of a TAB. Even more: Add a mode where the cursor can be on a screen + position where there is no text. When typing, add spaces to fill the gap. + Other solution: Always use curswant, so that you can move the cursor to + the right column, and then use up/down movements to select the line, + without changing the column. +6 ":left" and ":right" should work in Visual block mode. +7 CTRL-I and CTRL-O should work in Visual mode, but only jump to marks in the + current buffer. +7 CTRL-A and CTRL-X should increase/decrease all numbers in the Visual area. +6 In non-Block mode, "I" should insert the same text in front of each line, + before the first non-blank, "gI" in column 1. +6 In non-Block mode, "A" should append the same text after each line. +6 ":'<,'>source" should read the selected lines and ":source" them. +6 When in blockwise visual selection (CTRL-V), allow cursor to be placed + right of the line. Could also allow cursor to be placed anywhere on a TAB + or other special character. +6 Add commands to move selected text, without deselecting. + + +More advanced repeating commands: +- Add "." command for visual mode: redo last visual command (e.g. ":fmt"). +7 Repeating "d:{cmd}" with "." doesn't work. (Benji Fisher) Somehow remember + the command line so that it can be repeated? +- Add "." command after operator: repeat last command of same operator. E.g. + "c." will repeat last change, also when "x" used since then (Webb). + "y." will repeat last yank. + "c2." will repeat the last but one change? + Also: keep history of Normal mode commands, add command to list the history + and/or pick an older command. +- History stack for . command? Use "g." command. + + +Mappings and Abbreviations: +8 When "0" is mapped (it is a movement command) this mapping should not be + used after typing another number, e.g. "20l". (Charles Campbell) + Is this possible without disabling the mapping of the following command? +8 Should mapping <C-A> and <C-S-A> both work? +7 ":abbr b byte", append "b " to an existing word still expands to "byte". + This is Vi compatible, but can we avoid it anyway? +8 To make a mapping work with a prepended "x to select a register, store the + last _typed_ register name and access it with "&. +8 Add ":amap", like ":amenu". +7 Add a mapping that works always, for remapping the keyboard. +8 Add ":cab!", abbreviations that only apply to Command-line mode and not to + entering search strings. +8 Add a flag to ":abbrev" to eat the character that triggers the + abbreviation. Thus "abb ab xxx" and typing "ab<Space>" inserts "xxx" and + not the <Space>. +8 Allow mapping of CTRL-@ (anywhere in the LHS). +8 Give a warning when using CTRL-C in the lhs of a mapping. It will never + (?) work. +8 Add a way to save a current mapping and restore it later. Use a function + that returns the mapping command to restore it: mapcmd()? mapcheck() is + not fool proof. How to handle ambiguous mappings? +7 Add <0x8f> (hex), <033> (octal) and <123> (decimal) to <> notation? +7 Allow mapping "Q" and "Q}" at the same time. Need to put a flag with "Q", + that it needs an extra character before it can match. See Vile 'maplonger' + option. +7 When someone tries to unmap with a trailing space, and it fails, try + unmapping without the trailing space. Helps for ":unmap xx | unmap yy". +7 Make it possible to map 'wildchar', but only when it's a special character + (like CTRL-E). Currently it's only recognized when typed. Useful for + mapping a key to do something and then completion. +6 Context-sensitive abbreviations: Specify syntax group(s) in which the + abbreviations are to be used. +- Add mappings that take arguments. Could work like the ":s" command. For + example, for a mouse escape sequence: + :mapexp <Esc>{\([0-9]*\),\([0-9]*\); H\1j\2l +- Add optional <Number> argument for mappings: + :map <Number>q ^W^W<Number>G + :map <Number>q<Number>t ^W^W<Number1-1>G<Number2>l + :map q<Char> :s/<Char>/\u\0/g + Or implicit: + :map q <Register>d<Number>$ +- Make it possible to include a <Nul> in the lhs and rhs of a mapping. +- Add command to repeat a whole mapping ("." only repeats the last change in + a mapping). Also: Repeat a whole insert command, including any mappings + that it included. Sort-of automatic recording? +- Add an option to ":map" that makes it display the special keys in + <> notation (e.g. <CR> instead of ^M). Or just always do this? +- Include an option (or flag to 'cpoptions') that makes errors in mappings + not flush the rest of the mapping (like nvi does). +- Use context sensitiveness of completion to switch abbreviations and + mappings off for :unab and :unmap. +6 When using mappings in Insert mode, insert characters for incomplete + mappings first, then remove them again when a mapping matches. Avoids + that characters that are the start of some mapping are not shown until you + hit another character. +- Add mappings for replace mode: ":rmap". How do we then enter mappings for + non-replace Insert mode? +- Add separate mappings for Visual-character/block/line mode? +- Add 'mapstop' command, to stop recursive mappings. +- List mappings that have a raw escape sequence both with the name of the key + for that escape sequence (if there is one) and the sequence itself. +- List mappings: Once with special keys listed as <>, once with meta chars as + <M-a>, once with the byte values (octal?). Sort of "spell mapping" command? +- When entering mappings: Add the possibility to enter meta keys like they + are displayed, within <>: <M-a>, <~@> or <|a>. +- Allow multiple arguments to :unmap. +- Command to show keys that are not used and available for mapping + ":freekeys". +- Allow any character except white space in abbreviations lhs (Riehm). + + +Incsearch: +- Add a limit to the number of lines that are searched for 'incsearch'? +- When no match is found and the user types more, the screen is redrawn + anyway. Could skip that. Esp. if the line wraps and the text is scrolled + up every time. +- Temporarily open folds to show where the search ends up. Restore the + folds when going to another line. +- When incsearch used and hitting return, no need to search again in many + cases, saves a lot of time in big files. (Slootman wants to work on this?) + When not using special characters, can continue search from the last match + (or not at all, when there was no match). See oldmail/webb/in.872. +- With incsearch, use CTRL-N/CTRL-P to go to next/previous match, some other + key to copy matched word to search pattern (Alexander Schmid). + + +Searching: +8 Add "g/" and "gb" to search for a pattern in the Visually selected text? + "g?" is already used for rot13. + Can use "g/" in Normal mode, uses the '< to '> area. +8 Add a mechanism for recursiveness: "\@(([^()]*\@g[^()]*)\)". \@g stands + for "go recursive here" and \@( \) marks the recursive part. + Perl does it this way: + $paren = qr/ \(( [^()] | (??{ $paren }) )* \) /x; + Here $paren is evaluated when it's encountered. This is like a regexp + inside a regexp. In the above terms it would be: + \@((\([^()]\|\@g\)*)\) +7 Support for approximate-regexps to find similar words (agrep + http://www.tgries.de/agrep/ tre: http://laurikari.net/tre/index.html). +8 Add an item for a big character range, so that one can search for a + chinese character: \z[234-1234] or \z[XX-YY] or \z[0x23-0x234]. +7 Add an item stack to allow matching (). One side is "push X on + the stack if previous atom matched". Other side is "match with top of + stack, pop it when it matches". Use "\@pX" and "\@m"? + Example: \((\@p).\{-}\@m\)* +7 Add an option to accept a match at the cursor position. Also for + search(). (Brett) +7 Add a flag to "/pat/" to discard an error. Useful to continue a mapping + when a search fails. Could be "/pat/E" (e is already used for an offset). +7 Add pattern item to use properties of Unicode characters. In Perl it's + "\p{L}" for a letter. See Regular Expression Pocket Reference. +8 Would it be possible to allow ":23,45/pat/flags" to search for "pat" in + lines 23 to 45? Or does this conflict with Ex range syntax? +8 Allow identical pairs in 'matchpairs'. Restrict the search to the current + line. +7 Allow longer pairs in 'matchpairs'. Use ~/vim/macros/matchit.vim as an + example. +8 Make it possible to define the character that "%" checks for in + #if/#endif. For nmake it's !if/!endif. +- For "%" command: set hierarchy for which things include other things that + should be ignored (like "*/" or "#endif" inside /* */). + Also: use "%" to jump from start to end of syntax region and back. + Alternative: use matchit.vim +8 "/:/e+1" gets stuck on a match at the end of the line. Do we care? +8 A pattern like "\([^a]\+\)\+" takes an awful long time. Recognize that + the recursive "\+" is meaningless and optimize for it. + This one is also very slow on "/* some comment */": "^\/\*\(.*[^/]\)*$". +7 Recognize "[a-z]", "[0-9]", etc. and replace them with the faster "\l" and + "\d". +7 Add a way to specify characters in <C-M> or <Key> form. Could be + \%<C-M>. +8 Flags that apply to the whole pattern. + This works for all places where a regexp is used. + Add "\q" to not store this pattern as the last search pattern? +8 Add an argument after ":s/pat/str/" for a range of matches. For example, + ":s/pat/str/#3-4" to replace only the third and fourth "pat" in a line. +8 Add an option not to use 'hlsearch' highlighting for ":s" and ":g" + commands. (Kahn) It would work like ":noh" is used after that command. + Also: An extra flag to do this once, and a flag to keep the existing + search pattern. +- Add \%h{group-name}; to search for a specific highlight group. + Add \%s{syntax-group}; to search for a specific syntax group. +- Support Perl regexp. Use PCRE (Perl Compatible RE) package. (Shade) + Or translate the pattern to a Vim one. + Don't switch on with an option for typed commands/mappings/functions, it's + too confusing. Use "\@@" in the pattern, to avoid incompatibilities. +7 Add POSIX regexp, like Nvi, with 'extended' option? It's like very-magic. +- Remember flags for backreferenced items, so that "*" can be used after it. + Check with "\(\S\)\1\{3}". (Hemmerling) +- Add flags to search command (also for ":s"?): + i ignore case + I use case + p use Perl regexp syntax (or POSIX?) + v use Vi regexp syntax + f forget pattern, don't keep it for "n" command + F remember pattern, keep it for "n" command + Perl uses these too: + e evaluate the right side as an expression (Perl only) + m multiple line expression (we don't need it) + o compile only once (Perl only) + s single line expression (we don't need it) + x extended regexp (we don't need it) + When used after ":g" command, backslash needed to avoid confusion with the + following command. + Add 'searchflags' for default flags (replaces 'gdefault'). +- Add command to display the last used substitute pattern and last used + pattern. (Margo) Maybe make it accessible through a register (like "/ + for search string)? +7 Use T-search algorithm, to speed up searching for strings without special + characters. See C't article, August 1997. +- Add 'fuzzycase' option, so that case doesn't matter, and '-' and '_' are + equivalent (for Unix filenames). +- Add 'v' flag to search command: enter Visual mode, with the matching text + as Visual area. (variation on idea from Bertin) +- Searching: "/this//that/" should find "that" after "this". +- Add global search commands: Instead of wrapping at the end of the buffer, + they continue in another buffer. Use flag after search pattern: + a for the next file in the argument list + f for file in the buffer list + w for file edited in a window. + e.g. "/pat/f". Then "n" and "N" work through files too. "f" flag also for + ":s/pat/foo/f"??? Then when 'autowrite' and 'hidden' are both not set, ask + before saving files: "Save modified buffer "/path/file"? (Yes/Hide/No + Save-all/hide-All/Quit) ". +- ":s/pat/foo/3": find 3rd match of "pat", like sed. (Thomas Koehler) +7 When searching with 'n' give message when getting back where the search + first started. Remember start of search in '/ mark. +7 Add option that scrolls screen to put cursor in middle of screen after + search always/when off-screen/never. And after a ":tag" command. Maybe + specify how many lines below the screen causes a redraw with the cursor in + the middle (default would be half a screen, zero means always). +6 Support multiple search buffers, so macros can be made without side + effects. +7 From xvim: Allow a newline in search patterns (also for :s, can delete + newline). Add BOW, EOW, NEWL, NLORANY, NLBUTANY, magic 'n' and 'r', etc. + [not in xvim:] Add option to switch on matches crossing ONE line boundary. +7 Add ":iselect", a combination of ":ilist" and ":tselect". (Aaron) (Zellner) + Also ":dselect". + + +Undo: +- Persistent undo: store undo in a file. + Use timestamps, so that a version a certain time ago can be found and info + before some time/date can be flushed. 'undopersist' gives maximum time to + keep undo: "3h", "1d", "2w", "1y", etc. For the file use dot and + extension: ".filename.un~" (like swapfile but "un~" instead of "swp"). +8 See ":e" as a change operation, find the changes and add them to the + undo info. Needed for when an external tool changes the file. +- Make it possible to undo all the commands from a mapping, including a + trailing unfinished command, e.g. for ":map K iX^[r". +- When accidentally hitting "R" instead of Ctrl-R, further Ctrl-R is not + possible, even when typing <Esc> immediately. (Grahn) Also for "i", "a", + etc. Postpone saving for undo until something is really inserted? +8 When Inserting a lot of text, it can only be undone as a whole. Make undo + sync points at every line or word. Could recognize the start of a new + word (white space and then non-white space) and backspacing. + Can already use CTRL-G u, but that requires remapping a lot of things. +8 Make undo more memory-efficient: Compare text before and after change, + only remember the lines that really changed. +7 Add undo for a range of lines. Can change these back to a previous + version without changing the rest of the file. Stop doing this when a + change includes only some of these lines and changes the line count. Need + to store these undo actions as a separate change that can be undone. +- For u_save() include the column number. This can be used to set '[ and ']. + And in the future the undo can be made more efficient (Webb). +- In out-of-memory situations: Free allocated space in undo, and reduce the + number of undo levels (with confirmation). +- Instead of [+], give the number of changes since the last write: [+123]. + When undoing to before the last write, change this to a negative number: + [-99]. +- With undo with simple line delete/insert: optimize screen updating. +- When executing macro's: Save each line for undo only once. +- When doing a global substitute, causing almost all lines to be changed, + undo info becomes very big. Put undo info in swap file?? + + +Buffer list: +7 Command to execute a command in another buffer: ":inbuf {bufname} {cmd}". + Also for other windows: ":inwin {winnr} {cmd}". How to make sure that + this works properly for all commands, and still be able to return to the + current buffer/window? E.g.: ":inbuf xxx only". +8 Add File.{recent_files} menu entries: Recently edited files. + Ron Aaron has a plugin for this: mru.vim. +8 Unix: Check all uses of fnamecmp() and fnamencmp() if they should check + inode too. +7 Add another number for a buffer, which is visible for the user. When + creating a new buffer, use the lowest number not in use (or the highest + number in use plus one?). +7 Offer some buffer selection from the command line? Like using ":ls" and + asking for a buffer number. (Zachmann) +- When starting to edit a file that is already in the buffer list, use the + file name argument for the new short file name. (Webb) +- Add an option to make ":bnext" and ":bprev" wrap around the end of the + buffer list. Also for ":next" and ":prev"? +7 Add argument to ":ls" which is a pattern for buffers to list. + E.g. ":ls *.c". (Thompson) +7 Add expansion of buffer names, so that "*.c" is expanded to all buffer + names. Needed for ":bdel *.c", ":bunload *.c", etc. +8 Support for <afile> where a buffer name is expected. +8 Some commands don't use line numbers, but buffer numbers. '$' + should then mean the number of the last buffer. E.g.: "4,$bdel". +7 Add an option to mostly use slashes in file names. Separately for + internal use and for when executing an external program? + + +Swap (.swp) files: +8 If writing to the swap file fails, should try to open one in another + directory from 'dir'. Useful in case the file system is full and when + there are short file name problems. +8 Also use the code to try using a short file name for the backup and swap + file for the Win32 and Dos 32 bit versions. +8 When a file is edited by root, add $LOGNAME to know who did su. +8 When the edited file is a symlink, try to put the swap file in the same + dir as the actual file. Adjust FullName(). Avoids editing the same file + twice (e.g. when using quickfix). Also try to make the name of the backup + file the same as the actual file? + Use the code for resolve()? +7 When using 64 bit inode numbers, also store the top 32 bits. Add another + field for this, using part of bo_fname[], to keep it compatible. +7 When editing a file on removable media, should put swap file somewhere + else. Use something like 'r' flag in 'viminfo'. 'diravoid'? + Also: Be able to specify minimum disk space, skip directory when not + enough room. +7 Add a configure check for which directory should be used: /tmp, /var/tmp + or /var/preserve. +- Add an option to create a swap file only when making the first change to + the buffer. (Liang) Or only when the buffer is not read-only. +- Add option to set "umask" for backup files and swap files (Antwerpen). + 'backupumask' and 'swapumask'? Or 'umaskback' and 'umaskswap'? +- When editing a readonly file, don't use a swap file but read parts from the + original file. Also do this when the file is huge (>'maxmem'). We do + need to load the file once to count the number of lines? Perhaps keep a + cached list of which line is where. + + +Viminfo: +7 Can probably remove the code that checks for a writable viminfo file, + because we now do the chown() for root, and others can't overwrite someone + else's viminfo file. +8 Add argument to keep the list of buffers when Vim is started with a file + name. (Schild) +8 Keep the last used directory of the file browser (File/Open menu). +8 Remember the last used register for "@@". +8 Remember a list of last accessed files. To be used in the + "File.Open Recent" menu. Default is to remember 10 files or so. + Also remember which files have been read and written. How to display + this? +7 Also store the ". register (last inserted text). +7 Make it possible to store buffer names in viminfo file relative to some + directory, to make them portable over a network. (Aaron) +6 Store a snapshot of the currently opened windows. So that when quitting + Vim, and then starting again (without a file name argument), you see the + same files in the windows. Use ":mksession" code? +- Make marks present in .viminfo usable as file marks: Display a list of + "last visited files" and select one to jump to. + + +Modelines: +8 Before trying to execute a modeline, check that it looks like one (valid + option names). If it's very wrong, silently ignore it. + Ignore a line that starts with "Subject: ". +- When an option value is coming from a modeline, do not carry it over to + another edited file? Would need to remember the value from before the + modeline setting. +- Allow setting a variable from a modeline? Only allow using fixed strings, + no function calls, to avoid a security problem. +- Allow ":doauto BufRead x.cpp" in modelines, to execute autocommands for + .cpp files. +- Support the "abbreviate" command in modelines (Kearns). Careful for + characters after <Esc>, that is a security leak. +- Add option setting to ask user if he wants to have the modelines executed + or not. Same for .exrc in local dir. + + +Sessions: +8 DOS/Windows: ":mksession" generates a "cd" command where "aa\#bb" means + directory "#bb" in "aa", but it's used as "aa#bb". (Ronald Hoellwarth) +7 When there is a "help.txt" window in a session file, restoring that + session will not get the "LOCAL ADDITIONS" back. +8 With ":mksession" always store the 'sessionoptions' option, even when + "options" isn't in it. (St-Amant) +8 When using ":mksession", also store a command to reset all options to + their default value, before setting the options that are not at their + default value. +7 With ":mksession" also store the tag stack and jump history. (Michal + Malecki) +7 Persistent variables: "p:var"; stored in viminfo file and sessions files. + + +Options: +7 ":with option=value | command": temporarily set an option value and + restore it after the command has executed. +7 Setting an option always sets "w_set_curswant", while this is only + required for a few options. Only do it for those options to avoid the + side effect. +8 Make "old" number options that really give a number of effects into string + options that are a comma separated list. The old number values should + also be supported. +8 Add commands to save and restore an option, which also preserves the flag + that marks if the option was set. Useful to keep the effect of setting + 'compatible' after ":syntax on" has been used. +7 There is 'titleold', why is there no 'iconold'? (Chazelas) +7 Make 'scrolloff' a global-local option, so that it can be different in the + quickfix window, for example. (Gary Holloway) + + +External commands: +8 When filtering text, redirect stderr so that it can't mess up the screen + and Vim doesn't need to redraw it. Also for ":r !cmd". +4 Set separate shell for ":sh", piping "range!filter", reading text "r !ls" + and writing text "w !wc". (Deutsche) Allow arguments for fast start (e.g. + -f). +4 Allow direct execution, without using a shell. +4 Run an external command in the background. But how about I/O in the GUI? + Careful: don't turn Vim into a shell! +4 Add feature to disable using a shell or external commands. + + +Multiple Windows: +7 "vim -oO file ..." use both horizontal and vertical splits. +8 Add CTRL-W T: go to the top window in the column of the current window. + And CTRL-W B: go to bottom window. +7 Use CTRL-W <Tab>, like alt-tab, to switch between buffers. Repeat <Tab> + to select another buffer (only loaded ones?), <BS> to go back, <Enter> to + select buffer, <Esc> to go back to original buffer. +7 Add a 'tool' window: behaves like a preview window but there can be + several. Don't count it in only_one_window(). (Alexei Alexandrov) +6 Add an option to resize the shell when splitting and/or closing a window. + ":vsp" would make the shell wider by as many columns as needed for the new + window. Specify a maximum size (or use the screen size). ":close" would + shrink the shell by as many columns as come available. (Demirel) +7 When starting Vim several times, instantiate a Vim server, that allows + communication between the different Vims. Feels like one Vim running with + multiple top-level windows. Esp. useful when Vim is started from an IDE + too. Requires some form of inter process communication. +- Support a connection to an external viewer. Could call the viewer + automatically after some seconds of non-activity, or with a command. + Allow some way of reporting scrolling and cursor positioning in the viewer + to Vim, so that the link between the viewed and edited text can be made. + + +Marks: +8 When cursor is first moved because of scrolling, set a mark at this + position. (Rimon Barr) Use '-. +8 Add a command to jump to a mark and make the motion inclusive. g'm and g`m? +8 The '" mark is set to the first line, even when doing ":next" a few times. + Only set the '" mark when the cursor was really moved in a file. +8 Make `` and '', which would position the new cursor position in the middle + of the window, restore the old topline (or relative position) from when + the mark was set. +7 Make a list of file marks in a separate window. For listing all buffers, + matching tags, errors, etc. Normal commands to move around. Add commands + to jump to the mark (in current window or new window). Start it with + ":browse marks"? +6 Add a menu that lists the Marks like ":marks". (Amerige) +7 For ":jumps", ":tags" and ":marks", for not loaded buffers, remember the + text at the mark. Highlight the column with the mark. +7 Highlight each mark in some way (With "Mark" highlight group). + Or display marks in a separate column, like 'number' does. +7 Use d"m to delete rectangular area from cursor to mark m (like Vile's \m + command). +7 Try to keep marks in the same position when: + - replacing with a line break, like in ":s/pat/^M/", move marks after the + line break column to the next line. (Acevedo) + - inserting/deleting characters in a line. +5 Include marks for start/end of the current word and section. Useful in + mappings. +6 Add "unnamed mark" feature: Like marks for the ":g" command, but place and + unplace them with commands before doing something with the lines. + Highlight the marked lines somehow. + + +Digraphs: +7 Make "ga" show the digraph for a character, if it exists. + Also the keymap? +- Make it possible to enter "r<C-E>" and "r<C-Y>" (get character from line + below/above). +- Use digraph table to tell Vim about the collating sequence of special + characters? +8 Add command to remove one or more (all) digraphs. (Brown) +7 Support different sets of digraphs (depending on the character set?). At + least Latin1/Unicode, Latin-2, MS-DOS (esp. for Win32). + + +Writing files: +- In vim_rename(), should lock "from" file when deleting "to" file for + systems other than Amiga. Avoids problems with unexpected longname to + shortname conversion. +8 write mch_isdevice() for Amiga, Mac, VMS, etc. +8 When appending to a file, Vim should also make a backup and a 'patchmode' + file. +8 'backupskip' doesn't write a backup file at all, a bit dangerous for some + applications. Add 'backupelsewhere' to write a backup file in another + directory? Or add a flag to 'backupdir'? +7 The 'directory' option supports changing path separators to "%" to make + file names unique, also support this for 'backupdir'. (Mikolaj Machowski) +6 Add an option to write a new, numbered, backup file each time. Like + 'patchmode', e.g., 'backupmode'. +6 Make it possible to write 'patchmode' files to a different directory. + E.g., ":set patchmode=~/backups/*.orig". (Thomas) +6 Add an option to prepend something to the backup file name. E.g., "#". + Or maybe allow a function to modify the backup file name? +8 Only make a backup when overwriting a file for the first time. Avoids + losing the original when writing twice. (Slootman) +7 On non-Unix machines, also overwrite the original file in some situations + (file system full, it's a link on an NFS partition). +7 When editing a file, check that it has been change outside of Vim more + often, not only when writing over it. E.g., at the time the swap file is + flushed. Or every ten seconds or so (use the time of day, check it before + waiting for a character to be typed). +8 When a file was changed since editing started, show this in the status + line of the window, like "[time]". + Make it easier to reload all outdated files that don't have changes. + Automatic and/or with a command. + + +Substitute: +8 Substitute with hex/unicode number "\%xff" and "\%uabcd". Just like + "\%uabcd" in search pattern. +8 Make it easier to replace in all files in the argument list. E.g.: + ":argsub/oldword/newword/". Works like ":argdo %s/oldword/newword/g|w". +- :s///p prints the line after a substitution. +- With :s///c replace \&, ~, etc. when showing the replacement pattern. +8 With :s///c allow scrolling horizontally when 'nowrap' is effective. + Also allow a count before the scrolling keys. +- Add number option to ":s//2": replace second occurrence of string? Or: + :s///N substitutes N times. +- Add answers to ":substitute" with 'c' flag, used in a ":global", e.g.: + ":g/pat1/s/pat2/pat3/cg": 'A' do all remaining replacements, 'Q' don't do + any replacements, 'u' undo last substitution. +7 Substitute in a block of text. Use {line}.{column} notation in an Ex + range, e.g.: ":1.3,$.5s" means to substitute from line 1 column 3 to the + last line column 5. +5 Add commands to bookmark lines, display bookmarks, remove bookmarks, + operate on lines with bookmarks, etc. Like ":global" but with the + possibility to keep the bookmarks and use them with several commands. + (Stanislav Sitar) + + +Mouse support: +8 Add 'o' flag to 'mouse'? +7 Be able to set a 'mouseshape' for the popup menu. +8 Add 'mouse' flag, which sets a behavior like Visual mode, but automatic + yanking at the button-up event. Or like Select mode, but typing gets you + out of Select mode, instead of replacing the text. (Bhaskar) +7 Checkout sysmouse() for FreeBSD console mouse support. +- Implement mouse support for the Amiga console. +- Using right mouse button to extend a blockwise selection should attach to + the nearest corner of the rectangle (four possible corners). +- Precede mouse click by a number to simulate double clicks?!? +- When mouse click after 'r' command, get character that was pointed to. + + +Crypt and security: +8 Also crypt the swapfile, each block separately. Change mf_write() and + mf_read(). How to get b_p_key to these functions? + + +Argument list: +6 Add command to put all filenames from the tag files in the argument list. + When given an argument, only use the files where that argument matches + (like `grep -l ident`) and jump to the first match. +6 Add command to form an args list from all the buffers? + + +Registers: +8 Don't display empty registers with ":display". (Etienne) +8 Make the # register writable, so that it can be restored after jumping + around in windows. +8 Add put command that overwrites existing text. Should also work for + blocks. Useful to move text around in a table. Works like using "R ^R r" + for every line. +6 When yanking into the unnamed registers several times, somehow make the + previous contents also available (like it's done for deleting). What + register names to use? g"1, g"2, etc.? +- When appending to a register, also report the total resulting number of + lines. Or just say "99 more lines yanked", add the "more". +- When inserting a register in Insert mode with CTRL-R, don't insert comment + leader when line wraps? +- The ":@r" commands should take a range and execute the register for each + line in the range. +- Add "P" command to insert contents of unnamed register, move selected text + to position of previous deleted (to swap foo and bar in " + foo") +8 Should be able to yank and delete into the "/ register. + How to take care of the flags (offset, magic)? + + +Debug mode: +7 Add something to enable debugging when a remote message is received. +8 Add breakpoints for setting an option +8 Add breakpoints for assigning to a variable. +7 Add a watchpoint in the debug mode: An expression that breaks execution + when evaluating to non-zero. Add the "watchadd expr" command, stop when + the value of the expression changes. ":watchdel" deletes an item, + ":watchlist" lists the items. (Charles Campbell) +7 Store the history from debug mode in viminfo. +7 Make the debug mode history available with histget() et al. + + +Various improvements: +7 Add plugins for formatting? Should be able to make a choice depending on + the language of a file (English/Korean/Japanese/etc.). + Setting the 'langformat' option to "chinese" would load the + "format/chinese.vim" plugin. + The plugin would set 'formatexpr' and define the function being called. + Edward L. Fox explains how it should be done for most Asian languages. + (2005 Nov 24) +7 [t to move to previous xml/html tag (like "vatov"), ]t to move to next + ("vatv"). +7 [< to move to previous xml/html tag, e.g., previous <li>. ]< to move to + next <li>, ]< to next </li>, [< to previous </li>. +8 Add ":rename" command: rename the file of the current buffer and rename + the buffer. Buffer may be modified. +- Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh + Govindachar) +6 In the quickfix window statusline add the command used to get the list of + errors, e.g. ":make foo", ":grep something *.c". +6 Python interface: add vim.message() function. (Michal Vitecek, 2002 Nov 5) +7 Support using ":vert" with User commands. Add expandable items <vert>. + Do the same for ":browse" and ":confirm"? + For ":silent" and ":debug" apply to the whole user command. +7 Allow a window not to have a statusline. Makes it possible to use a + window as a buffer-tab selection. +7 Add an invisible buffer which can be edited. For use in scripts that want + to manipulate text without changing the window layout. +8 Add a command to revert to the saved version of file; undo or redo until + all changes are gone. +7 Add a ":cpfile", go in the other direction as ":cnfile". +6 "vim -q -" should read the list of errors from stdin. (Gautam Mudunuri) +8 Add "--remote-fail": When contacting the server fails, exit Vim. + Add "--remote-self": When contacting the server fails, do it in this Vim. + Overrules the default of "--remote-send" to fail and "--remote" to do it + in this Vim. +8 When Vim was started without a server, make it possible to start one, as + if the "--servername" argument was given. ":startserver <name>"? +8 No address range can be used before the command modifiers. This makes + them difficult to use in a menu for Visual mode. Accept the range and + have it apply to the following command. +8 Add the possibility to set 'fileformats' to force a format and strip other + CR characters. For example, for "dos" files remove CR characters at the + end of the line, so that a file with mixed line endings is cleaned up. + To just not display the CR characters: Add a flag to 'display'? +7 Some compilers give error messages in which the file name does not have a + path. Be able to specify that 'path' is used for these files. +7 Xterm sends <Esc>O3F for <M-End>. Similarly for other <M-Home>, <M-Left>, + etc. Combinations of Alt, Ctrl and Shift are also possible. Recognize + these to avoid inserting the raw byte sequence, handle like the key + without modifier (unless mapped). +8 Add ":breakdel *": delete all breakpoints. +7 Support ":browse edit" in console, using explorer.vim? +6 Add "gG": like what "gj" is to "j": go to the N'th window line. +8 Add command like ":normal" that accepts <Key> notation like ":map". +9 Support ACLs on more systems. +7 Add ModeMsgVisual, ModeMsgInsert, etc. so that each mode message can be + highlighted differently. +7 Add a message area for the user. Set some option to reserve space (above + the command line?). Use an ":echouser" command to display the message + (truncated to fit in the space). +7 Add %s to 'keywordprg': replace with word under the cursor. (Zellner) +8 Support printing on Unix. Can use "lpansi.c" as an example. (Bookout) +8 Add put command that replaces the text under it. Esp. for blockwise + Visual mode. +7 Enhance termresponse stuff: Add t_CV(?): pattern of term response, use + regexp: "\e\[[>?][0-9;]*c", but only check just after sending t_RV. +7 Add "g|" command: move to N'th column from the left margin (after wrapping + and applying 'leftcol'). Works as "|" like what "g0" is to "0". +7 Support setting 'equalprg' to a user function name. +7 Highlight the characters after the end-of-line differently. +7 When 'whichwrap' contains "l", "$dl" should join lines? +8 Add an argument to configure to use $CFLAGS and not modify it? (Mooney) +8 Enabling features is a mix of configure arguments and defines in + feature.h. How to make this consistent? Feature.h is required for + non-unix systems. Perhaps let configure define CONF_XXX, and use #ifdef + CONF_XXX in feature.h? Then what should min-features and max-features do? +8 Add "g^E" and "g^Y", to scroll a screen-full line up and down. +6 Add ":timer" command, to set a command to be executed at a certain + interval, or once after some time has elapsed. (Aaron) + Perhaps an autocommand event like CursorHold is better? +8 Add ":confirm" handling in open_exfile(), for when file already exists. +8 When quitting with changed files, make the dialog list the changed file + and allow "write all", "discard all", "write some". The last one would + then ask "write" or "discard" for each changed file. Patch in HierAssist + does something like this. (Shah) +7 Use growarray for replace stack. +7 Have a look at viH (Hellenic or Greek version of Vim). But a solution + outside of Vim might be satisfactory (Haritsis). +3 Make "2d%" work like "d%d%" instead of "d2%"? +8 Make "more" prompt accept command characters, like "hit-enter" prompt? + Or extend it with more commands, like "less": 'b' for back, 'j' for one + line down, etc. +8 For the "--more--" prompt, support the 'b'ack command for more commands. + Possible implementation: Do it at a very low level, caching the lines that + are on the screen (with highlight attributes). Avoids that changes have + to be made for all functions that list something. +7 "g CTRL-O" jumps back to last used buffer. Skip CTRL-O jumps in the same + buffer. Make jumplist remember the last ten accessed buffers? +- Keep a list of most recently used files for each window, use "[o" to go + back (older file) and "]n" to go forward (newer file) (like ^O and ^I for + jumps). (Webb) Use ":files" and ":ls" to list the files in history order. +7 Add a history of recently accessed buffer. Maybe make "2 CTRL-^" jump to + the 2nd previously visited buffer, "3 CTRL-^" to the third, etc. Or use + "3 g CTRL-^" for this? +- Add code to disable the CAPS key when going from Insert to Normal mode. +- Set date/protection/etc. of the patchfile the same as the original file. +- Use growarray for termcodes[] in term.c +- Add <window-99>, like <cword> but use filename of 99'th window. +7 Add a way to change an operator to always work characterwise-inclusive + (like "v" makes the operator characterwise-exclusive). "x" could be used. +- Make a set of operations on list of names: expand wildcards, replace home + dir, append a string, delete a string, etc. +- Remove mktemp() and use tmpname() only? Ctags does this. +- When replacing environment variables, and there is one that is not set, + turn it into an empty string? Only when expanding options? (Hiebert) +- Option to set command to be executed instead of producing a beep (e.g. to + call "play newbeep.au"). +- Add option to show the current function name in the status line. More or + less what you find with "[[k", like how 'cindent' recognizes a function. + (Bhatt). +- "[r" and "]r": like "p" and "P", but replace instead of insert (esp. for + blockwise registers). +- Add 'timecheck' option, on by default. Makes it possible to switch off the + timestamp warning and question. (Dodt). +- Add an option to set the time after which Vim should check the timestamps + of the files. Only check when an event occurs (e.g., character typed, + mouse moved). Useful for non-GUI versions where keyboard focus isn't + noticeable. +9 When using ":w <fname>" it's possible that this file is loaded in another + buffer. Give a warning right away, don't wait for a shell command. +- Make 'smartcase' work even though 'ic' isn't set (Webb). +7 When formatting text, allow to break the line at a number of characters. + Use an option for this: 'breakchars'? Useful for formatting Fortran code. +- Add flag to 'formatoptions' to be able to format book-style paragraphs + (first line of paragraph has larger indent, no empty lines between + paragraphs). Complements the '2' flag. Use '>' flag when larger indent + starts a new paragraph, use '<' flag when smaller indent starts a new + paragraph. Both start a new paragraph on any indent change. +7 Add a way to define an item list with a pattern in 'formatoptions'. The + 'n' flag doesn't work for "6.3" or "6a.". +8 Allow using a trailing space to signal a paragraph that continues on the + next line (MIME text/plain; format=flowed, RFC 2646). Can be used for + continuous formatting. Could use 'autoformat' option, which specifies a + regexp which triggers auto-formatting (for one line). + ":set autoformat=\\s$". +- Be able to redefine where a sentence stops. Use a regexp pattern? +- Support multi-byte characters for sentences. Example from Ben Peterson. +7 Add command "g)" to go to the end of a sentence, "g(" to go back to the + end of a sentence. (Servatius Brandt) +- Be able to redefine where a paragraph starts. For "[[" where the '{' is + not in column 1. +6 Add ":cdprev": go back to the previous directory. Need to remember a + stack of previous directories. We also need ":cdnext". +7 Should ":cd" for MS-DOS go to $HOME, when it's defined? +- Make "gq<CR>" work on the last line in the file. Maybe for every operator? +- Add more redirecting of Ex commands: + :redir #> bufname + :redir #>> bufname (append) +- Give error message when starting :redir: twice or using END when no + redirection was active. +- Setting of options, specifically for a buffer or window, with + ":set window.option" or ":set buffer.option=val". Or use ":buffer.set". + Also: "buffer.map <F1> quit". +6 Would it be possible to change the color of the cursor in the Win32 + console? (Klaus Hast) +- Add :delcr command: + *:delcr* + :[range]delcr[!] Check [range] lines (default: whole buffer) for lines + ending in <CR>. If all lines end in <CR>, or [!] is + used, remove the <CR> at the end of lines in [range]. + A CTRL-Z at the end of the file is removed. If + [range] is omitted, or it is the whole file, and all + lines end in <CR> 'textmode' is set. {not in Vi} +- Should integrate addstar() and file_pat_to_reg_pat(). +- When working over a serial line with 7 bit characters, remove meta + characters from 'isprint'. +- Use fchdir() in init_homedir(), like in FullName(). +- In win_update(), when the GUI is active, always use the scrolling area. + Avoid that the last status line is deleted and needs to be redrawn. +- That "cTx" fails when the cursor is just after 'x' is Vi compatible, but + may not be what you expect. Add a flag in 'cpoptions' for this? More + general: Add an option to allow "c" to work with a null motion. +- Give better error messages by using errno (strerror()). +- Give "Usage:" error message when command used with wrong arguments (like + Nvi). +- Make 'restorescreen' option also work for xterm (and others), replaces the + SAVE_XTERM_SCREEN define. +7 Support for ":winpos" In xterm: report the current window position. +- Give warning message when using ":set t_xx=asdf" for a termcap code that + Vim doesn't know about. Add flag in 'shortmess'? +6 Add ":che <file>", list all the include paths which lead to this file. +- For a commandline that has several commands (:s, :d, etc.) summarize the + changes all together instead of for each command (e.g. for the rot13 + macro). +- Add command like "[I" that also shows the tree of included files. +- ":set sm^L" results in ":set s", because short names of options are also + expanded. Is there a better way to do this? +- Add ":@!" command, to ":@" like what ":source!" is to ":source". +8 Add ":@:!": repeat last command with forceit set. +- Should be possible to write to a device, e.g. ":w! /dev/null". +- Add 't_normal': Used whenever t_me, t_se, t_ue or t_Zr is empty. +- ":cab map test ^V| je", ":cunab map" doesn't work. This is vi compatible! +- CTRL-W CTRL-E and CTRL-W CTRL-Y should move the current window up or down + if it is not the first or last window. +- Include-file-search commands should look in the loaded buffer of a file (if + there is one) instead of the file itself. +7 Change 'nrformats' to include the leader for each format. Example: + nrformats=hex:$,binary:b,octal:0 + Add setting of 'nrformats' to syntax files. +- 'path' can become very long, don't use NameBuff for expansion. +- When unhiding a hidden buffer, put the same line at top of the window as + the one before hiding it. Or: keep the same relative cursor position (so + many percent down the windows). +- Make it possible for the 'showbreak' to be displayed at the end of the + line. Use a comma to separate the part at the end and the start of the + line? Highlight the linebreak characters, add flag in 'highlight'. +- Some string options should be expanded if they have wildcards, e.g. + 'dictionary' when it is "*.h". +- Use a specific type for number and boolean options, making it possible to + change it for specific machines (e.g. when a long is 64 bit). +- Add option for <Insert> in replace mode going to normal mode. (Nugent) +- Add a next/previous possibility to "[^I" and friends. +- Add possibility to change the HOME directory. Use the directory from the + passwd file? (Antwerpen) +8 Add commands to push and pop all or individual options. ":setpush tw", + ":setpop tw", ":setpush all". Maybe pushing/popping all options is + sufficient. ":setflush" resets the option stack? + How to handle an aborted mapping? Remember position in tag stack when + mapping starts, restore it when an error aborts the mapping? +- Change ":fixdel" into option 'fixdel', t_del will be adjusted each time + t_bs is set? (Webb) +- "gc": goto character, move absolute character positions forward, also + counting newlines. "gC" goes backwards (Weigert). +- When doing CTRL-^, redraw buffer with the same topline. (Demirel) Store + cursor row and window height to redraw cursor at same percentage of window + (Webb). +- Besides remembering the last used line number of a file, also remember the + column. Use it with CTRL-^ et. al. +- Check for non-digits when setting a number option (careful when entering + hex codes like 0xff). +- Add option to make "." redo the "@r" command, instead of the last command + executed by it. Also to make "." redo the whole mapping. Basically: redo + the last TYPED command. +- Support URL links for ^X^F in Insert mode, like for "gf". +- Support %name% expansion for "gf" on Windows. +- Make "gf" work on "file://c:/path/name". "file:/c:/" and "file:///c:/" + should also work? +- Add 'urlpath', used like 'path' for when "gf" used on an URL? +8 When using "gf" on an absolute file name, while editing a remote file + (starts with scp:// or http://) should prepend the method and machine + name. +- When finding an URL or file name, and it doesn't exist, try removing a + trailing '.'. +- Add ":path" command modifier. Should work for every command that takes a + file name argument, to search for the file name in 'path'. Use + find_file_in_path(). +- Highlight control characters on the screen: Shows the difference between + CTRL-X and "^" followed by "X" (Colon). +- Integrate parsing of cmdline command and parsing for expansion. +- Create a program that can translate a .swp file from any machine into a + form usable by Vim on the current machine. +- Add ":noro" command: Reset 'ro' flag for all buffers, except ones that have + a readonly file. ":noro!" will reset all 'ro' flags. +- Add a variant of CTRL-V that stops interpretation of more than one + character. For entering mappings on the command line where a key contains + several special characters, e.g. a trailing newline. +- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine + the two into a regex for searching. (Ned Konz) +- Make '2' option in 'formatoptions' also work inside comments. +- Add 's' flag to 'formatoptions': Do not break when inside a string. (Dodt) +- When window size changed (with the mouse) and made too small, set it back + to the minimal size. +- Add "]>" and "[<", shift comment at end of line (command; /* comment */). +- Should not call cursorcmd() for each vgetc() in getcmdline(). +- ":split file1 file2" adds two more windows (Webb). +- Don't give message "Incomplete last line" when editing binary file. +- Add ":a", ":i" for preloading of named buffers. +- Allow autowrite when doing ":e file" (with an option 'eaw'). +- Allow a "+command" argument before each file name in the Vim command line: + "vim +123 file1 +234 file2 +345 file3". ??? +- When entering text, keep other windows on same buffer updated (when a line + entered)? +- Check out how screen does output optimizing. Apparently this is possible + as an output filter. +- In dosub() regexec is called twice for the same line. Try to avoid this. +- Window updating from memline.c: insert/delete/replace line. +- Optimize ml_append() for speed, esp. for reading a file. +- V..c should keep indent when 'ai' is set, just like [count]cc. +- Updatescript() can be done faster with a string instead of a char. +- Screen updating is inefficient with CTRL-F and CTRL-B when there are long + lines. +- Uppercase characters in ex commands can be made lowercase? +8 Add option to show characters in text not as "|A" but as decimal ("^129"), + hex ("\x81") or octal ("\201") or meta (M-x). Nvi has the 'octal' option + to switch from hex to octal. Vile can show unprintable characters in hex + or in octal. +7 Tighter integration with xxd to edit binary files. Make it more + easy/obvious to use. Command line argument? +- How does vi detect whether a filter has messed up the screen? Check source. + After ":w !command" a wait_return? +- Improve screen updating code for doput() (use s_ins()). +- With 'p' command on last line: scroll screen up (also for terminals without + insert line command). +- Use insert/delete char when terminal supports it. +- Optimize screen redraw for slow terminals. +- Optimize "dw" for long row of spaces (say, 30000). +- Add "-d null" for editing from a script file without displaying. +- In Insert mode: Remember the characters that were removed with backspace + and re-insert them one at a time with <key1>, all together with <key2>. +- Amiga: Add possibility to set a keymap. The code in amiga.c does not work + yet. +- Implement 'redraw' option. +- Add special code to 'sections' option to define something else but '{' or + '}' as the start of a section (e.g. one shiftwidth to the right). +7 Allow using Vim in a pipe: "ls | vim -u xxx.vim - | yyy". Only needs + implementing ":w" to stdout in the buffer that was read from stdin. + Perhaps writing to stdout will work, since stderr is used for the terminal + I/O. +8 Allow opening an unnamed buffer with ":e !cmd" and ":sp !cmd". Vile can + do it. +- Add commands like ]] and [[ that do not include the line jumped to. +- When :unab without matching "from" part and several matching "to" parts, + delete the entry that was used last, instead of the first in the list. +- Add text justification option. +- Set boolean options on/off with ":set paste=off", ":set paste=on". +- After "inv"ing an option show the value: ":set invpaste" gives "paste is + off". +- Check handling of CTRL-V and '\' for ":" commands that do not have TRLBAR. +- When a file cannot be opened but does exist, give error message. +- Amiga: When 'r' protection bit is not set, file can still be opened but + gives read errors. Check protection before opening. +- When writing check for file exists but no permission, "Permission denied". +- If file does not exists, check if directory exists. +- MSDOS: although t_cv and t_ci are not set, do invert char under cursor. +- Settings edit mode: make file with ":set opt=xx", edit it, parse it as ex + commands. +- ":set -w all": list one option per line. +- Amiga: test for 'w' flag when reading a file. +- :table command (Webb) +- Add new operator: clear, make area white (replace with spaces): "g ". +- Make it possible for a user to define a new operator. Implementation with + internal scripting language or Perl? +- Add command to ":read" a file at a certain column (blockwise read?). +- Add sort of replace mode where case is taken from the old text (Goldfarb). +- Allow multiple arguments for ":read", read all the files. +- Support for tabs in specific columns: ":set tabcol=8,20,34,56" (Demirel). +- Add 'searchdir' option: Directories to search for file name being edited + (Demirel). +- Modifier for the put command: Change to linewise, charwise, blockwise, etc. +- Add commands for saving and restoring options ":set save" "set restore", + for use in macro's and the like. +- Keep output from listings in a window, so you can have a look at it while + working in another window. Put cmdline in a separate window? +- Add possibility to put output of ex commands in a buffer or file, e.g. for + ":set all". ":r :set all"? +- 'edit' option: When off changing the buffer is not possible (Really + read-only mode). +- When the 'equalalways' option is set, creating a new window should not + result in windows to become bigger. Deleting a window should not result in + a window to become smaller (Webb). +- When resizing the whole Vim window, the windows inside should be resized + proportionally (Webb). +- Include options directly in option table, no indirect pointers. Use + mkopttab to make option table? +- When doing ":w dir", where "dir" is a directory name, write the current + file into that directory, with the current file name (without the path)? +- Support for 'dictionary's that are sorted, makes access a lot faster + (Haritsis). +- Add "^Vrx" on the command line, replace with contents of register x. Used + instead of CTRL-R to make repeating possible. (Marinichev) +- Add "^Vb" on the command line, replace with word before or under the + cursor? +- Option to make a .swp file only when a change is made (Templeton). +- Support mapping for replace mode and "r" command (Vi doesn't do this)? +5 Add 'ignorefilecase' option: Ignore case when expanding file names. + ":e ma<Tab>" would also find "Makefile" on Unix. +8 Sorting of filenames for completion is wrong on systems that ignore + case of filenames. Add 'ignorefncase' option. When set, case in + filenames is ignored for sorting them. Patch by Mike Williams: + ~/vim/patches/ignorefncase. Also change what matches? Or use another + option name. +8 Should be able to compile Vim in another directory, with $(srcdir) set to + where the sources are. Add $(srcdir) in the Makefile in a lot of places. + (Netherton) +6 Make it configurable when "J" inserts a space or not. Should not add a + space after "(", for example. +5 When inserting spaces after the end-of-line for 'virtualedit', use tabs + when the user wants this (e.g., add a "tab" field to 'virtualedit'). + (Servatius Brandt) + + +From Elvis: +- Use "instman.sh" to install manpages? +- Add ":alias" command. +- fontchanges recognized "\\fB" etc. +- Search patterns: + \@ match word under cursor. + but do: + \@w match the word under the cursor? + \@W match the WORD under the cursor? +8 ":window" command: + :win + next window (up) + :win ++ idem, wrapping + :win - previous window (down) + :win -- idem, wrapping + :win nr to window number "nr" + :win name to window editing buffer "name" +7 ":cc" compiles a single file (default: current one). 'ccprg' option is + program to use with ":cc". Use ":compile" instead of ":cc"? + + +From Nvi: +- 'searchincr' option, alias for 'incsearch'? +- 'leftright' option, alias for 'nowrap'? +- Have a look at "vi/doc/vi.chart", for Nvi specialties. +8 Add 'keytime', time in 1/10 sec for mapping timeout? +- Add 'filec' option as an alternative for 'wildchar'. +6 Support Nvi command names as an alias: + :bg :hide + :fg fname :buf fname (with 'hidden' set?) + :dis b :ls + :Edit fname :split fname + :Fg fname :sbuf fname (with 'hidden' set?) + :Next :snext (can't do this, already use :Next) + :Previous :sprevious + :Tag :stag + + +From xvi: +- CTRL-_ : swap 8th bit of character. +- Add egrep-like regex type, like xvi (Ned Konz) or Perl (Emmanuel Mogenet) + + +From vile: +- When horizontal scrolling, use '>' for lines continuing right of a window. +- Support putting .swp files in /tmp: Command in rc.local to move .swp files + from /tmp to some directory before deleting files. + + +Far future and "big" extensions: +- Instead of using a Makefile and autoconf, use a simple shell script to + find the C compiler and do everything with C code. Translate something + like an Aap recipe and configure.in to C. Avoids depending on Python, + thus will work everywhere. With batch file to find the C compiler it + would also work on MS-Windows. +- Make it easy to setup Vim for groups of users: novice vi users, novice + Vim users, C programmers, xterm users, GUI users,... +- Change layout of blocks in swap file: Text at the start, with '\n' in + between lines (just load the file without changes, except for Mac). + Indexes for lines are from the end of the block backwards. It's the + current layout mirrored. +- Make it possible to edit a register, in a window, like a buffer. +- Add stuff to syntax highlighting to change the text (upper-case keywords, + set indent, define other highlighting, etc.). +- Mode to keep C-code formatted all the time (sort of on-line indent). +- Several top-level windows in one Vim session. Be able to use a different + font in each top-level window. +- Allow editing above start and below end of buffer (flag in 'virtualedit'). +- Smart cut/paste: recognize words and adjust spaces before/after them. +- Add open mode, use it when terminal has no cursor positioning. +- Special "drawing mode": a line is drawn where the cursor is moved to. + Backspace deletes along the line (from jvim). +- Implement ":Bset", set option in all buffers. Also ":Wset", set in all + windows, ":Aset, set in all arguments and ":Tset", set in all files + mentioned in the tags file. + Add buffer/arg range, like in ":2,5B%s/..." (do we really need this???) + Add search string: "B/*.c/%s/.."? Or ":F/*.c/%s/.."? +- Support for underlining (underscore-BS-char), bold (char-BS-char) and other + standout modes switched on/off with , 'overstrike' option (Reiter). +- Add vertical mode (Paul Jury, Demirel): "5vdw" deletes a word in five + lines, "3vitextESC" will insert "text" in three lines, etc.. +4 Recognize l, #, p as 'flags' to EX commands: + :g/RE/#l shall print lines with line numbers and in list format. + :g/RE/dp shall print lines that are deleted. + POSIX: Commands where flags shall apply to all lines written: list, + number, open, print, substitute, visual, &, z. For other commands, flags + shall apply to the current line after the command completes. Examples: + :7,10j #l Join the lines 7-10 and print the result in list +- Allow two or more users to edit the same file at the same time. Changes + are reflected in each Vim immediately. Could work with local files but + also over the internet. See http://www.codingmonkeys.de/subethaedit/. + +When using "do" or ":diffget" in a buffer with changes in every line an extra +empty line would appear. + +vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl: +vim: set fo+=n : diff --git a/Aufgabe5/doc.lang/uganda.txt b/Aufgabe5/doc.lang/uganda.txt new file mode 100644 index 0000000..a1258b7 --- /dev/null +++ b/Aufgabe5/doc.lang/uganda.txt @@ -0,0 +1,296 @@ +*uganda.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + + *uganda* *Uganda* *copying* *copyright* *license* +SUMMARY + *iccf* *ICCF* +Vim is Charityware. You can use and copy it as much as you like, but you are +encouraged to make a donation for needy children in Uganda. Please see |kcc| +below or visit the ICCF web site, available at these URLs: + + http://iccf-holland.org/ + http://www.vim.org/iccf/ + +You can also sponsor the development of Vim. Vim sponsors can vote for +features. See |sponsor|. The money goes to Uganda anyway. + +The Open Publication License applies to the Vim documentation, see +|manual-copyright|. + +=== begin of license === + +VIM LICENSE + +I) There are no restrictions on distributing unmodified copies of Vim except + that they must include this license text. You can also distribute + unmodified parts of Vim, likewise unrestricted except that they must + include this license text. You are also allowed to include executables + that you made from the unmodified Vim sources, plus your own usage + examples and Vim scripts. + +II) It is allowed to distribute a modified (or extended) version of Vim, + including executables and/or source code, when the following four + conditions are met: + 1) This license text must be included unmodified. + 2) The modified Vim must be distributed in one of the following five ways: + a) If you make changes to Vim yourself, you must clearly describe in + the distribution how to contact you. When the maintainer asks you + (in any way) for a copy of the modified Vim you distributed, you + must make your changes, including source code, available to the + maintainer without fee. The maintainer reserves the right to + include your changes in the official version of Vim. What the + maintainer will do with your changes and under what license they + will be distributed is negotiable. If there has been no negotiation + then this license, or a later version, also applies to your changes. + The current maintainer is Bram Moolenaar <Bram@vim.org>. If this + changes it will be announced in appropriate places (most likely + vim.sf.net, www.vim.org and/or comp.editors). When it is completely + impossible to contact the maintainer, the obligation to send him + your changes ceases. Once the maintainer has confirmed that he has + received your changes they will not have to be sent again. + b) If you have received a modified Vim that was distributed as + mentioned under a) you are allowed to further distribute it + unmodified, as mentioned at I). If you make additional changes the + text under a) applies to those changes. + c) Provide all the changes, including source code, with every copy of + the modified Vim you distribute. This may be done in the form of a + context diff. You can choose what license to use for new code you + add. The changes and their license must not restrict others from + making their own changes to the official version of Vim. + d) When you have a modified Vim which includes changes as mentioned + under c), you can distribute it without the source code for the + changes if the following three conditions are met: + - The license that applies to the changes permits you to distribute + the changes to the Vim maintainer without fee or restriction, and + permits the Vim maintainer to include the changes in the official + version of Vim without fee or restriction. + - You keep the changes for at least three years after last + distributing the corresponding modified Vim. When the maintainer + or someone who you distributed the modified Vim to asks you (in + any way) for the changes within this period, you must make them + available to him. + - You clearly describe in the distribution how to contact you. This + contact information must remain valid for at least three years + after last distributing the corresponding modified Vim, or as long + as possible. + e) When the GNU General Public License (GPL) applies to the changes, + you can distribute the modified Vim under the GNU GPL version 2 or + any later version. + 3) A message must be added, at least in the output of the ":version" + command and in the intro screen, such that the user of the modified Vim + is able to see that it was modified. When distributing as mentioned + under 2)e) adding the message is only required for as far as this does + not conflict with the license used for the changes. + 4) The contact information as required under 2)a) and 2)d) must not be + removed or changed, except that the person himself can make + corrections. + +III) If you distribute a modified version of Vim, you are encouraged to use + the Vim license for your changes and make them available to the + maintainer, including the source code. The preferred way to do this is + by e-mail or by uploading the files to a server and e-mailing the URL. + If the number of changes is small (e.g., a modified Makefile) e-mailing a + context diff will do. The e-mail address to be used is + <maintainer@vim.org> + +IV) It is not allowed to remove this license from the distribution of the Vim + sources, parts of it or from a modified version. You may use this + license for previous Vim releases instead of the license that they came + with, at your option. + +=== end of license === + +Note: + +- If you are happy with Vim, please express that by reading the rest of this + file and consider helping needy children in Uganda. + +- If you want to support further Vim development consider becoming a + |sponsor|. The money goes to Uganda anyway. + +- According to Richard Stallman the Vim license is GNU GPL compatible. + A few minor changes have been made since he checked it, but that should not + make a difference. + +- If you link Vim with a library that goes under the GNU GPL, this limits + further distribution to the GNU GPL. Also when you didn't actually change + anything in Vim. + +- Once a change is included that goes under the GNU GPL, this forces all + further changes to also be made under the GNU GPL or a compatible license. + +- If you distribute a modified version of Vim, you can include your name and + contact information with the "--with-modified-by" configure argument or the + MODIFIED_BY define. + +============================================================================== +Kibaale Children's Centre *kcc* + +Kibaale Children's Centre (KCC) is located in Kibaale, a small town in the +south of Uganda, near Tanzania, in East Africa. The area is known as Rakai +District. The population is mostly farmers. Although people are poor, there +is enough food. But this district is suffering from AIDS more than any other +part of the world. Some say that it started there. Estimations are that 10 +to 30% of the Ugandans are infected with HIV. Because parents die, there are +many orphans. In this district about 60,000 children have lost one or both +parents, out of a population of 350,000. And this is still continuing. + +The children need a lot of help. The KCC is working hard to provide the needy +with food, medical care and education. Food and medical care to keep them +healthy now, and education so that they can take care of themselves in the +future. KCC works on a Christian base, but help is given to children of any +religion. + +The key to solving the problems in this area is education. This has been +neglected in the past years with president Idi Amin and the following civil +wars. Now that the government is stable again, the children and parents have +to learn how to take care of themselves and how to avoid infections. There is +also help for people who are ill and hungry, but the primary goal is to +prevent people from getting ill and to teach them how to grow healthy food. + +Most of the orphans are living in an extended family. An uncle or older +sister is taking care of them. Because these families are big and the income +(if any) is low, a child is lucky if it gets healthy food. Clothes, medical +care and schooling is beyond its reach. To help these needy children, a +sponsorship program was put into place. A child can be financially adopted. +For a few dollars a month KCC sees to it that the child gets indispensable +items, is healthy, goes to school and KCC takes care of anything else that +needs to be done for the child and the family that supports it. + +Besides helping the child directly, the environment where the child grows up +needs to be improved. KCC helps schools to improve their teaching methods. +There is a demonstration school at the centre and teacher trainings are given. +Health workers are being trained, hygiene education is carried out and +households are stimulated to build a proper latrine. I helped setting up a +production site for cement slabs. These are used to build a good latrine. +They are sold below cost price. + +There is a small clinic at the project, which provides children and their +family with medical help. When needed, transport to a hospital is offered. +Immunization programs are carried out and help is provided when an epidemic is +breaking out (measles and cholera have been a problem). + *donate* +Summer 1994 to summer 1995 I spent a whole year at the centre, working as a +volunteer. I have helped to expand the centre and worked in the area of water +and sanitation. I learned that the help that the KCC provides really helps. +Now that I'm back in Holland, I would like to continue supporting KCC. To do +this I'm raising funds and organizing the sponsorship program. Please +consider one of these possibilities: + +1. Sponsor a child in primary school: 17 euro a month (or more). +2. Sponsor a child in secondary school: 25 euro a month (or more). +3. Sponsor the clinic: Any amount a month or quarter +4. A one-time donation + +Compared with other organizations that do child sponsorship the amounts are +very low. This is because the money goes directly to the centre. Less than +5% is used for administration. This is possible because this is a small +organization that works with volunteers. If you would like to sponsor a +child, you should have the intention to do this for at least one year. + +How do you know that the money will be spent right? First of all you have my +personal guarantee as the author of Vim. I trust the people that are working +at the centre, I know them personally. Further more, the centre is +co-sponsored and inspected by World Vision, Save the Children Fund and +International Child Care Fund. The centre is visited about once a year to +check the progress (at our own cost). I have visited the centre myself in +1996, 1998, 2000, 2001 and 2003. The visit reports are on the ICCF web site. + +If you have any further questions, send me e-mail: <Bram@vim.org>. + +The address of the centre is: + Kibaale Children's Centre + p.o. box 1658 + Masaka, Uganda, East Africa + +Sending money: *iccf-donations* + +Check the ICCF web site for the latest information! See |iccf| for the URL. + + +USA: The methods mentioned below can be used. Alternatively, you + can send a check to the Nehemiah Group Outreach Society + (NGOS). This will reduce banking costs and you can get an IRS + tax receipt. The NGOS forwards the funds directly to the + Kibaale project in Uganda. Checks must be made payable to + NGOS but please note on the check "donation Kibaale". Mail + checks to: + NGOS + P.O. Box 50862 + Indianapolis, IN 45250 + Questions regarding the Nehemiah Group Outreach Society (NGOS) + should be directed to: Ross deMerchant, Executive Director - + r.demerchant AT sbcglobal DOT net. + For sponsoring a child contact KCF in Canada (see below) and + send the check to NGOS in Indianapolis. + +Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They + take care of the Canadian sponsors for the children in + Kibaale. KCF forwards 100% of the money to the project in + Uganda. You can send them a one time donation directly. + Please send me a note so that I know what has been donated + because of Vim. Ask KCF for information about sponsorship. + Kibaale Children's Fund c/o Pacific Academy + 10238-168 Street + Surrey, B.C. V4N 1Z4 + Canada + Phone: 604-581-5353 + If you make a donation to Kibaale Children's Fund (KCF) you + will receive a tax receipt which can be submitted with your + tax return. + +Holland: Transfer to the account of "Stichting ICCF Holland" in Venlo. + This will allow for tax deduction if you live in Holland. + Postbank, nr. 4548774 + +Germany: It is possible to make donations that allow for a tax return. + Check the ICCF web site for the latest information: + http://iccf-holland.org/germany.html + +World: Use a postal money order. That should be possible from any + country, mostly from the post office. Use this name (which is + in my passport): "Abraham Moolenaar". Use Euro for the + currency if possible. + +Europe: Use a bank transfer if possible. Your bank should have a form + that you can use for this. See "Others" below for the swift + code and IBAN number. + Any other method should work. Ask for information about + sponsorship. + +Credit Card: You can use PayPal to send money with a Credit card. This is + the most widely used Internet based payment system. It's + really simple to use. Use this link to find more info: + https://www.paypal.com/affil/pal=Bram%40iccf-holland.org + The e-mail address for sending the money to is: + Bram@iccf-holland.org + For amounts above 400 Euro ($500) sending a check is + preferred. + +Others: Transfer to one of these accounts if possible: + Postbank, account 4548774 + Swift code: INGB NL 2A + IBAN: NL47 PSTB 0004 5487 74 + under the name "stichting ICCF Holland", Venlo + If that doesn't work: + Rabobank Venlo, account 3765.05.117 + Swift code: RABO NL 2U + under the name "Bram Moolenaar", Venlo + Otherwise, send a check in euro or US dollars to the address + below. Minimal amount: $70 (my bank does not accept smaller + amounts for foreign check, sorry) + +Address to send checks to: + stichting ICCF Holland + Bram Moolenaar + Molenstraat 2 + 2161 HP Lisse + The Netherlands + +This address is expected to be valid for a long time. The address in Venlo +will not be valid after June 2006. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/undo.txt b/Aufgabe5/doc.lang/undo.txt new file mode 100644 index 0000000..fde879d --- /dev/null +++ b/Aufgabe5/doc.lang/undo.txt @@ -0,0 +1,242 @@ +*undo.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Undo and redo *undo-redo* + +The basics are explained in section |02.5| of the user manual. + +1. Undo and redo commands |undo-commands| +2. Two ways of undo |undo-two-ways| +3. Undo blocks |undo-blocks| +4. Undo branches |undo-branches| +5. Remarks about undo |undo-remarks| + +============================================================================== +1. Undo and redo commands *undo-commands* + +<Undo> or *undo* *<Undo>* *u* +u Undo [count] changes. {Vi: only one level} + + *:u* *:un* *:undo* +:u[ndo] Undo one change. {Vi: only one level} + +:u[ndo] {N} Jump to after change number {N}. See |undo-branches| + for the meaning of {N}. {not in Vi} + + *CTRL-R* +CTRL-R Redo [count] changes which were undone. {Vi: redraw + screen} + + *:red* *:redo* *redo* +:red[o] Redo one change which was undone. {Vi: no redo} + + *U* +U Undo all latest changes on one line. {Vi: while not + moved off of it} + +The last changes are remembered. You can use the undo and redo commands above +to revert the text to how it was before each change. You can also apply the +changes again, getting back the text before the undo. + +The "U" command is treated by undo/redo just like any other command. Thus a +"u" command undoes a "U" command and a 'CTRL-R' command redoes it again. When +mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will +restore the situation of a line to before the previous "U" command. This may +be confusing. Try it out to get used to it. +The "U" command will always mark the buffer as changed. When "U" changes the +buffer back to how it was without changes, it is still considered changed. +Use "u" to undo changes until the buffer becomes unchanged. + +============================================================================== +2. Two ways of undo *undo-two-ways* + +How undo and redo commands work depends on the 'u' flag in 'cpoptions'. +There is the Vim way ('u' excluded) and the vi-compatible way ('u' included). +In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does +nothing (undoes an undo). + +'u' excluded, the Vim way: +You can go back in time with the undo command. You can then go forward again +with the redo command. If you make a new change after the undo command, +the redo will not be possible anymore. + +'u' included, the Vi-compatible way: +The undo command undoes the previous change, and also the previous undo command. +The redo command repeats the previous undo command. It does NOT repeat a +change command, use "." for that. + +Examples Vim way Vi-compatible way ~ +"uu" two times undo no-op +"u CTRL-R" no-op two times undo + +Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this + is not Vi compatible. For example "dwdwu." in Vi deletes two + words, in Nvi it does nothing. + +============================================================================== +3. Undo blocks *undo-blocks* + +One undo command normally undoes a typed command, no matter how many changes +that command makes. This sequence of undo-able changes forms an undo block. +Thus if the typed key(s) call a function, all the commands in the function are +undone together. + +If you want to write a function or script that doesn't create a new undoable +change but joins in with the previous change use this command: + + *:undoj* *:undojoin* *E790* +:undoj[oin] Join further changes with the previous undo block. + Warning: Use with care, it may prevent the user from + properly undoing changes. Don't use this after undo + or redo. + {not in Vi} + +This is most useful when you need to prompt the user halfway a change. For +example in a function that calls |getchar()|. Do make sure that there was a +related change before this that you must join with. + +This doesn't work by itself, because the next key press will start a new +change again. But you can do something like this: > + + :undojoin | delete + +After this an "u" command will undo the delete command and the previous +change. + +============================================================================== +4. Undo branches *undo-branches* *undo-tree* + +Above we only discussed one line of undo/redo. But it is also possible to +branch off. This happens when you undo a few changes and then make a new +change. The undone changes become a branch. You can go to that branch with +the following commands. + +This is explained in the user manual: |usr_32.txt|. + + *:undol* *:undolist* +:undol[ist] List the leafs in the tree of changes. Example: + number changes time ~ + 4 10 10:34:11 + 18 4 11:01:46 + + The "number" column is the change number. This number + continuously increases and can be used to identify a + specific undo-able change, see |:undo|. + The "changes" column is the number of changes to this + leaf from the root of the tree. + The "time" column is the time this change was made. + + *g-* +g- Go to older text state. With a count repeat that many + times. {not in Vi} + *:ea* *:earlier* +:earlier {count} Go to older text state {count} times. +:earlier {N}s Go to older text state about {N} seconds before. +:earlier {N}m Go to older text state about {N} minutes before. +:earlier {N}h Go to older text state about {N} hours before. + + *g+* +g+ Go to newer text state. With a count repeat that many + times. {not in Vi} + *:lat* *:later* +:later {count} Go to newer text state {count} times. +:later {N}s Go to newer text state about {N} seconds later. +:later {N}m Go to newer text state about {N} minutes later. +:later {N}h Go to newer text state about {N} hours later. + + +Note that text states will become unreachable when undo information is cleared +for 'undolevels'. + +Don't be surprised when moving through time shows multiple changes to take +place at a time. This happens when moving through the undo tree and then +making a new change. + +EXAMPLE + +Start with this text: + one two three ~ + +Delete the first word by pressing "x" three times: + ne two three ~ + e two three ~ + two three ~ + +Now undo that by pressing "u" three times: + e two three ~ + ne two three ~ + one two three ~ + +Delete the second word by pressing "x" three times: + one wo three ~ + one o three ~ + one three ~ + +Now undo that by using "g-" three times: + one o three ~ + one wo three ~ + two three ~ + +You are now back in the first undo branch, after deleting "one". Repeating +"g-" will now bring you back to the original text: + e two three ~ + ne two three ~ + one two three ~ + +Jump to the last change with ":later 1h": + one three ~ + +And back to the start again with ":earlier 1h": + one two three ~ + + +Note that using "u" and CTRL-R will not get you to all possible text states +while repeating "g-" and "g+" does. + +============================================================================== +5. Remarks about undo *undo-remarks* + +The number of changes that are remembered is set with the 'undolevels' option. +If it is zero, the Vi-compatible way is always used. If it is negative no +undo is possible. Use this if you are running out of memory. + +Marks for the buffer ('a to 'z) are also saved and restored, together with the +text. {Vi does this a little bit different} + +When all changes have been undone, the buffer is not considered to be changed. +It is then possible to exit Vim with ":q" instead of ":q!" {not in Vi}. Note +that this is relative to the last write of the file. Typing "u" after ":w" +actually changes the buffer, compared to what was written, so the buffer is +considered changed then. + +When manual |folding| is being used, the folds are not saved and restored. +Only changes completely within a fold will keep the fold as it was, because +the first and last line of the fold don't change. + +The numbered registers can also be used for undoing deletes. Each time you +delete text, it is put into register "1. The contents of register "1 are +shifted to "2, etc. The contents of register "9 are lost. You can now get +back the most recent deleted text with the put command: '"1P'. (also, if the +deleted text was the result of the last delete or copy operation, 'P' or 'p' +also works as this puts the contents of the unnamed register). You can get +back the text of three deletes ago with '"3P'. + + *redo-register* +If you want to get back more than one part of deleted text, you can use a +special feature of the repeat command ".". It will increase the number of the +register used. So if you first do ""1P", the following "." will result in a +'"2P'. Repeating this will result in all numbered registers being inserted. + +Example: If you deleted text with 'dd....' it can be restored with + '"1P....'. + +If you don't know in which register the deleted text is, you can use the +:display command. An alternative is to try the first register with '"1P', and +if it is not what you want do 'u.'. This will remove the contents of the +first put, and repeat the put command for the second register. Repeat the +'u.' until you got what you want. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_01.txt b/Aufgabe5/doc.lang/usr_01.txt new file mode 100644 index 0000000..fc3b3ee --- /dev/null +++ b/Aufgabe5/doc.lang/usr_01.txt @@ -0,0 +1,182 @@ +*usr_01.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + About the manuals + + +This chapter introduces the manuals available with Vim. Read this to know the +conditions under which the commands are explained. + +|01.1| Two manuals +|01.2| Vim installed +|01.3| Using the Vim tutor +|01.4| Copyright + + Next chapter: |usr_02.txt| The first steps in Vim +Table of contents: |usr_toc.txt| + +============================================================================== +*01.1* Two manuals + +The Vim documentation consists of two parts: + +1. The User manual + Task oriented explanations, from simple to complex. Reads from start to + end like a book. + +2. The Reference manual + Precise description of how everything in Vim works. + +The notation used in these manuals is explained here: |notation| + + +JUMPING AROUND + +The text contains hyperlinks between the two parts, allowing you to quickly +jump between the description of an editing task and a precise explanation of +the commands and options used for it. Use these two commands: + + Press CTRL-] to jump to a subject under the cursor. + Press CTRL-O to jump back (repeat to go further back). + +Many links are in vertical bars, like this: |bars|. An option name, like +'number', a command in double quotes like ":write" and any other word can also +be used as a link. Try it out: Move the cursor to CTRL-] and press CTRL-] +on it. + +Other subjects can be found with the ":help" command, see |help.txt|. + +============================================================================== +*01.2* Vim installed + +Most of the manuals assume that Vim has been properly installed. If you +didn't do that yet, or if Vim doesn't run properly (e.g., files can't be found +or in the GUI the menus do not show up) first read the chapter on +installation: |usr_90.txt|. + *not-compatible* +The manuals often assume you are using Vim with Vi-compatibility switched +off. For most commands this doesn't matter, but sometimes it is important, +e.g., for multi-level undo. An easy way to make sure you are using the right +setup, copy the example vimrc file. By doing this inside Vim you don't have +to check out where it is located. How to do this depends on the system you +are using: + +Unix: > + :!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc +MS-DOS, MS-Windows, OS/2: > + :!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc +Amiga: > + :!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc + +If the file already exists you probably want to keep it. + +If you start Vim now, the 'compatible' option should be off. You can check it +with this command: > + + :set compatible? + +If it responds with "nocompatible" you are doing well. If the response is +"compatible" you are in trouble. You will have to find out why the option is +still set. Perhaps the file you wrote above is not found. Use this command +to find out: > + + :scriptnames + +If your file is not in the list, check its location and name. If it is in the +list, there must be some other place where the 'compatible' option is switched +back on. + +For more info see |vimrc| and |compatible-default|. + + Note: + This manual is about using Vim in the normal way. There is an + alternative called "evim" (easy Vim). This is still Vim, but used in + a way that resembles a click-and-type editor like Notepad. It always + stays in Insert mode, thus it feels very different. It is not + explained in the user manual, since it should be mostly self + explanatory. See |evim-keys| for details. + +============================================================================== +*01.3* Using the Vim tutor *tutor* *vimtutor* + +Instead of reading the text (boring!) you can use the vimtutor to learn your +first Vim commands. This is a 30 minute tutorial that teaches the most basic +Vim functionality hands-on. + +On Unix, if Vim has been properly installed, you can start it from the shell: +> + vimtutor + +On MS-Windows you can find it in the Program/Vim menu. Or execute +vimtutor.bat in the $VIMRUNTIME directory. + +This will make a copy of the tutor file, so that you can edit it without +the risk of damaging the original. + There are a few translated versions of the tutor. To find out if yours is +available, use the two-letter language code. For French: > + + vimtutor fr + +For OpenVMS, if Vim has been properly installed, you can start vimtutor from a +VMS prompt with: > + + @VIM:vimtutor + +Optionally add the two-letter language code as above. + + +On other systems, you have to do a little work: + +1. Copy the tutor file. You can do this with Vim (it knows where to find it): +> + vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q' +< + This will write the file "TUTORCOPY" in the current directory. To use a +translated version of the tutor, append the two-letter language code to the +filename. For French: +> + vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q' +< +2. Edit the copied file with Vim: +> + vim -u NONE -c "set nocp" TUTORCOPY +< + The extra arguments make sure Vim is started in a good mood. + +3. Delete the copied file when you are finished with it: +> + del TUTORCOPY +< +============================================================================== +*01.4* Copyright *manual-copyright* + +The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram +Moolenaar. This material may be distributed only subject to the terms and +conditions set forth in the Open Publication License, v1.0 or later. The +latest version is presently available at: + http://www.opencontent.org/opl.shtml + +People who contribute to the manuals must agree with the above copyright +notice. + *frombook* +Parts of the user manual come from the book "Vi IMproved - Vim" by Steve +Oualline (published by New Riders Publishing, ISBN: 0735710015). The Open +Publication License applies to this book. Only selected parts are included +and these have been modified (e.g., by removing the pictures, updating the +text for Vim 6.0 and fixing mistakes). The omission of the |frombook| tag +does not mean that the text does not come from the book. + +Many thanks to Steve Oualline and New Riders for creating this book and +publishing it under the OPL! It has been a great help while writing the user +manual. Not only by providing literal text, but also by setting the tone and +style. + +If you make money through selling the manuals, you are strongly encouraged to +donate part of the profit to help AIDS victims in Uganda. See |iccf|. + +============================================================================== + +Next chapter: |usr_02.txt| The first steps in Vim + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_02.txt b/Aufgabe5/doc.lang/usr_02.txt new file mode 100644 index 0000000..2b3dd78 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_02.txt @@ -0,0 +1,504 @@ +*usr_02.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + The first steps in Vim + + +This chapter provides just enough information to edit a file with Vim. Not +well or fast, but you can edit. Take some time to practice with these +commands, they form the base for what follows. + +|02.1| Running Vim for the First Time +|02.2| Inserting text +|02.3| Moving around +|02.4| Deleting characters +|02.5| Undo and Redo +|02.6| Other editing commands +|02.7| Getting out +|02.8| Finding help + + Next chapter: |usr_03.txt| Moving around + Previous chapter: |usr_01.txt| About the manuals +Table of contents: |usr_toc.txt| + +============================================================================== +*02.1* Running Vim for the First Time + +To start Vim, enter this command: > + + gvim file.txt + +In UNIX you can type this at any command prompt. If you are running Microsoft +Windows, open an MS-DOS prompt window and enter the command. + In either case, Vim starts editing a file called file.txt. Because this +is a new file, you get a blank window. This is what your screen will look +like: + + +---------------------------------------+ + |# | + |~ | + |~ | + |~ | + |~ | + |"file.txt" [New file] | + +---------------------------------------+ + ('#" is the cursor position.) + +The tilde (~) lines indicate lines not in the file. In other words, when Vim +runs out of file to display, it displays tilde lines. At the bottom of the +screen, a message line indicates the file is named file.txt and shows that you +are creating a new file. The message information is temporary and other +information overwrites it. + + +THE VIM COMMAND + +The gvim command causes the editor to create a new window for editing. If you +use this command: > + + vim file.txt + +the editing occurs inside your command window. In other words, if you are +running inside an xterm, the editor uses your xterm window. If you are using +an MS-DOS command prompt window under Microsoft Windows, the editing occurs +inside this window. The text in the window will look the same for both +versions, but with gvim you have extra features, like a menu bar. More about +that later. + +============================================================================== +*02.2* Inserting text + +The Vim editor is a modal editor. That means that the editor behaves +differently, depending on which mode you are in. The two basic modes are +called Normal mode and Insert mode. In Normal mode the characters you type +are commands. In Insert mode the characters are inserted as text. + Since you have just started Vim it will be in Normal mode. To start Insert +mode you type the "i" command (i for Insert). Then you can enter +the text. It will be inserted into the file. Do not worry if you make +mistakes; you can correct them later. To enter the following programmer's +limerick, this is what you type: > + + iA very intelligent turtle + Found programming UNIX a hurdle + +After typing "turtle" you press the <Enter> key to start a new line. Finally +you press the <Esc> key to stop Insert mode and go back to Normal mode. You +now have two lines of text in your Vim window: + + +---------------------------------------+ + |A very intelligent turtle | + |Found programming UNIX a hurdle | + |~ | + |~ | + | | + +---------------------------------------+ + + +WHAT IS THE MODE? + +To be able to see what mode you are in, type this command: > + + :set showmode + +You will notice that when typing the colon Vim moves the cursor to the last +line of the window. That's where you type colon commands (commands that start +with a colon). Finish this command by pressing the <Enter> key (all commands +that start with a colon are finished this way). + Now, if you type the "i" command Vim will display --INSERT-- at the bottom +of the window. This indicates you are in Insert mode. + + +---------------------------------------+ + |A very intelligent turtle | + |Found programming UNIX a hurdle | + |~ | + |~ | + |-- INSERT -- | + +---------------------------------------+ + +If you press <Esc> to go back to Normal mode the last line will be made blank. + + +GETTING OUT OF TROUBLE + +One of the problems for Vim novices is mode confusion, which is caused by +forgetting which mode you are in or by accidentally typing a command that +switches modes. To get back to Normal mode, no matter what mode you are in, +press the <Esc> key. Sometimes you have to press it twice. If Vim beeps back +at you, you already are in Normal mode. + +============================================================================== +*02.3* Moving around + +After you return to Normal mode, you can move around by using these keys: + + h left *hjkl* + j down + k up + l right + +At first, it may appear that these commands were chosen at random. After all, +who ever heard of using l for right? But actually, there is a very good +reason for these choices: Moving the cursor is the most common thing you do in +an editor, and these keys are on the home row of your right hand. In other +words, these commands are placed where you can type them the fastest +(especially when you type with ten fingers). + + Note: + You can also move the cursor by using the arrow keys. If you do, + however, you greatly slow down your editing because to press the arrow + keys, you must move your hand from the text keys to the arrow keys. + Considering that you might be doing it hundreds of times an hour, this + can take a significant amount of time. + Also, there are keyboards which do not have arrow keys, or which + locate them in unusual places; therefore, knowing the use of the hjkl + keys helps in those situations. + +One way to remember these commands is that h is on the left, l is on the +right and j points down. In a picture: > + + k + h l + j + +The best way to learn these commands is by using them. Use the "i" command to +insert some more lines of text. Then use the hjkl keys to move around and +insert a word somewhere. Don't forget to press <Esc> to go back to Normal +mode. The |vimtutor| is also a nice way to learn by doing. + +For Japanese users, Hiroshi Iwatani suggested using this: + + Komsomolsk + ^ + | + Huan Ho <--- ---> Los Angeles + (Yellow river) | + v + Java (the island, not the programming language) + +============================================================================== +*02.4* Deleting characters + +To delete a character, move the cursor over it and type "x". (This is a +throwback to the old days of the typewriter, when you deleted things by typing +xxxx over them.) Move the cursor to the beginning of the first line, for +example, and type xxxxxxx (seven x's) to delete "A very ". The result should +look like this: + + +---------------------------------------+ + |intelligent turtle | + |Found programming UNIX a hurdle | + |~ | + |~ | + | | + +---------------------------------------+ + +Now you can insert new text, for example by typing: > + + iA young <Esc> + +This begins an insert (the i), inserts the words "A young", and then exits +insert mode (the final <Esc>). The result: + + +---------------------------------------+ + |A young intelligent turtle | + |Found programming UNIX a hurdle | + |~ | + |~ | + | | + +---------------------------------------+ + + +DELETING A LINE + +To delete a whole line use the "dd" command. The following line will +then move up to fill the gap: + + +---------------------------------------+ + |Found programming UNIX a hurdle | + |~ | + |~ | + |~ | + | | + +---------------------------------------+ + + +DELETING A LINE BREAK + +In Vim you can join two lines together, which means that the line break +between them is deleted. The "J" command does this. + Take these two lines: + + A young intelligent ~ + turtle ~ + +Move the cursor to the first line and press "J": + + A young intelligent turtle ~ + +============================================================================== +*02.5* Undo and Redo + +Suppose you delete too much. Well, you can type it in again, but an easier +way exists. The "u" command undoes the last edit. Take a look at this in +action: After using "dd" to delete the first line, "u" brings it back. + Another one: Move the cursor to the A in the first line: + + A young intelligent turtle ~ + +Now type xxxxxxx to delete "A young". The result is as follows: + + intelligent turtle ~ + +Type "u" to undo the last delete. That delete removed the g, so the undo +restores the character. + + g intelligent turtle ~ + +The next u command restores the next-to-last character deleted: + + ng intelligent turtle ~ + +The next u command gives you the u, and so on: + + ung intelligent turtle ~ + oung intelligent turtle ~ + young intelligent turtle ~ + young intelligent turtle ~ + A young intelligent turtle ~ + + Note: + If you type "u" twice, and the result is that you get the same text + back, you have Vim configured to work Vi compatible. Look here to fix + this: |not-compatible|. + This text assumes you work "The Vim Way". You might prefer to use + the good old Vi way, but you will have to watch out for small + differences in the text then. + + +REDO + +If you undo too many times, you can press CTRL-R (redo) to reverse the +preceding command. In other words, it undoes the undo. To see this in +action, press CTRL-R twice. The character A and the space after it disappear: + + young intelligent turtle ~ + +There's a special version of the undo command, the "U" (undo line) command. +The undo line command undoes all the changes made on the last line that was +edited. Typing this command twice cancels the preceding "U". + + A very intelligent turtle ~ + xxxx Delete very + + A intelligent turtle ~ + xxxxxx Delete turtle + + A intelligent ~ + Restore line with "U" + A very intelligent turtle ~ + Undo "U" with "u" + A intelligent ~ + +The "U" command is a change by itself, which the "u" command undoes and CTRL-R +redoes. This might be a bit confusing. Don't worry, with "u" and CTRL-R you +can go to any of the situations you had. More about that in section ||. + +============================================================================== +*02.6* Other editing commands + +Vim has a large number of commands to change the text. See |Q_in| and below. +Here are a few often used ones. + + +APPENDING + +The "i" command inserts a character before the character under the cursor. +That works fine; but what happens if you want to add stuff to the end of the +line? For that you need to insert text after the cursor. This is done with +the "a" (append) command. + For example, to change the line + + and that's not saying much for the turtle. ~ +to + and that's not saying much for the turtle!!! ~ + +move the cursor over to the dot at the end of the line. Then type "x" to +delete the period. The cursor is now positioned at the end of the line on the +e in turtle. Now type > + + a!!!<Esc> + +to append three exclamation points after the e in turtle: + + and that's not saying much for the turtle!!! ~ + + +OPENING UP A NEW LINE + +The "o" command creates a new, empty line below the cursor and puts Vim in +Insert mode. Then you can type the text for the new line. + Suppose the cursor is somewhere in the first of these two lines: + + A very intelligent turtle ~ + Found programming UNIX a hurdle ~ + +If you now use the "o" command and type new text: > + + oThat liked using Vim<Esc> + +The result is: + + A very intelligent turtle ~ + That liked using Vim ~ + Found programming UNIX a hurdle ~ + +The "O" command (uppercase) opens a line above the cursor. + + +USING A COUNT + +Suppose you want to move up nine lines. You can type "kkkkkkkkk" or you can +enter the command "9k". In fact, you can precede many commands with a number. +Earlier in this chapter, for instance, you added three exclamation points to +the end of a line by typing "a!!!<Esc>". Another way to do this is to use the +command "3a!<Esc>". The count of 3 tells the command that follows to triple +its effect. Similarly, to delete three characters, use the command "3x". The +count always comes before the command it applies to. + +============================================================================== +*02.7* Getting out + +To exit, use the "ZZ" command. This command writes the file and exits. + + Note: + Unlike many other editors, Vim does not automatically make a backup + file. If you type "ZZ", your changes are committed and there's no + turning back. You can configure the Vim editor to produce backup + files, see |07.4|. + + +DISCARDING CHANGES + +Sometimes you will make a sequence of changes and suddenly realize you were +better off before you started. Not to worry; Vim has a +quit-and-throw-things-away command. It is: > + + :q! + +Don't forget to press <Enter> to finish the command. + +For those of you interested in the details, the three parts of this command +are the colon (:), which enters Command-line mode; the q command, which tells +the editor to quit; and the override command modifier (!). + The override command modifier is needed because Vim is reluctant to throw +away changes. If you were to just type ":q", Vim would display an error +message and refuse to exit: + + E37: No write since last change (use ! to override) ~ + +By specifying the override, you are in effect telling Vim, "I know that what +I'm doing looks stupid, but I'm a big boy and really want to do this." + +If you want to continue editing with Vim: The ":e!" command reloads the +original version of the file. + +============================================================================== +*02.8* Finding help + +Everything you always wanted to know can be found in the Vim help files. +Don't be afraid to ask! + To get generic help use this command: > + + :help + +You could also use the first function key <F1>. If your keyboard has a <Help> +key it might work as well. + If you don't supply a subject, ":help" displays the general help window. +The creators of Vim did something very clever (or very lazy) with the help +system: They made the help window a normal editing window. You can use all +the normal Vim commands to move through the help information. Therefore h, j, +k, and l move left, down, up and right. + To get out of the help window, use the same command you use to get out of +the editor: "ZZ". This will only close the help window, not exit Vim. + +As you read the help text, you will notice some text enclosed in vertical bars +(for example, |help|). This indicates a hyperlink. If you position the +cursor anywhere between the bars and press CTRL-] (jump to tag), the help +system takes you to the indicated subject. (For reasons not discussed here, +the Vim terminology for a hyperlink is tag. So CTRL-] jumps to the location +of the tag given by the word under the cursor.) + After a few jumps, you might want to go back. CTRL-T (pop tag) takes you +back to the preceding position. CTRL-O (jump to older position) also works +nicely here. + At the top of the help screen, there is the notation *help.txt*. This name +between "*" characters is used by the help system to define a tag (hyperlink +destination). + See |29.1| for details about using tags. + +To get help on a given subject, use the following command: > + + :help {subject} + +To get help on the "x" command, for example, enter the following: > + + :help x + +To find out how to delete text, use this command: > + + :help deleting + +To get a complete index of all Vim commands, use the following command: > + + :help index + +When you need to get help for a control character command (for example, +CTRL-A), you need to spell it with the prefix "CTRL-". > + + :help CTRL-A + +The Vim editor has many different modes. By default, the help system displays +the normal-mode commands. For example, the following command displays help +for the normal-mode CTRL-H command: > + + :help CTRL-H + +To identify other modes, use a mode prefix. If you want the help for the +insert-mode version of a command, use "i_". For CTRL-H this gives you the +following command: > + + :help i_CTRL-H + +When you start the Vim editor, you can use several command-line arguments. +These all begin with a dash (-). To find what the -t argument does, for +example, use the command: > + + :help -t + +The Vim editor has a number of options that enable you to configure and +customize the editor. If you want help for an option, you need to enclose it +in single quotation marks. To find out what the 'number' option does, for +example, use the following command: > + + :help 'number' + +The table with all mode prefixes can be found here: |help-context|. + +Special keys are enclosed in angle brackets. To find help on the up-arrow key +in Insert mode, for instance, use this command: > + + :help i_<Up> + +If you see an error message that you don't understand, for example: + + E37: No write since last change (use ! to override) ~ + +You can use the error ID at the start to find help about it: > + + :help E37 + +============================================================================== + +Next chapter: |usr_03.txt| Moving around + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_03.txt b/Aufgabe5/doc.lang/usr_03.txt new file mode 100644 index 0000000..9f15540 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_03.txt @@ -0,0 +1,654 @@ +*usr_03.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Moving around + + +Before you can insert or delete text the cursor has to be moved to the right +place. Vim has a large number of commands to position the cursor. This +chapter shows you how to use the most important ones. You can find a list of +these commands below |Q_lr|. + +|03.1| Word movement +|03.2| Moving to the start or end of a line +|03.3| Moving to a character +|03.4| Matching a parenthesis +|03.5| Moving to a specific line +|03.6| Telling where you are +|03.7| Scrolling around +|03.8| Simple searches +|03.9| Simple search patterns +|03.10| Using marks + + Next chapter: |usr_04.txt| Making small changes + Previous chapter: |usr_02.txt| The first steps in Vim +Table of contents: |usr_toc.txt| + +============================================================================== +*03.1* Word movement + +To move the cursor forward one word, use the "w" command. Like most Vim +commands, you can use a numeric prefix to move past multiple words. For +example, "3w" moves three words. This figure shows how it works: + + This is a line with example text ~ + --->-->->-----------------> + w w w 3w + +Notice that "w" moves to the start of the next word if it already is at the +start of a word. + The "b" command moves backward to the start of the previous word: + + This is a line with example text ~ + <----<--<-<---------<--- + b b b 2b b + +There is also the "e" command that moves to the next end of a word and "ge", +which moves to the previous end of a word: + + This is a line with example text ~ + <- <--- -----> ----> + ge ge e e + +If you are at the last word of a line, the "w" command will take you to the +first word in the next line. Thus you can use this to move through a +paragraph, much faster than using "l". "b" does the same in the other +direction. + +A word ends at a non-word character, such as a ".", "-" or ")". To change +what Vim considers to be a word, see the 'iskeyword' option. + It is also possible to move by white-space separated WORDs. This is not a +word in the normal sense, that's why the uppercase is used. The commands for +moving by WORDs are also uppercase, as this figure shows: + + ge b w e + <- <- ---> ---> + This is-a line, with special/separated/words (and some more). ~ + <----- <----- --------------------> -----> + gE B W E + +With this mix of lowercase and uppercase commands, you can quickly move +forward and backward through a paragraph. + +============================================================================== +*03.2* Moving to the start or end of a line + +The "$" command moves the cursor to the end of a line. If your keyboard has +an <End> key it will do the same thing. + +The "^" command moves to the first non-blank character of the line. The "0" +command (zero) moves to the very first character of the line. The <Home> key +does the same thing. In a picture: + + ^ + <------------ + .....This is a line with example text ~ + <----------------- ---------------> + 0 $ + +(the "....." indicates blanks here) + + The "$" command takes a count, like most movement commands. But moving to +the end of the line several times doesn't make sense. Therefore it causes the +editor to move to the end of another line. For example, "1$" moves you to +the end of the first line (the one you're on), "2$" to the end of the next +line, and so on. + The "0" command doesn't take a count argument, because the "0" would be +part of the count. Unexpectedly, using a count with "^" doesn't have any +effect. + +============================================================================== +*03.3* Moving to a character + +One of the most useful movement commands is the single-character search +command. The command "fx" searches forward in the line for the single +character x. Hint: "f" stands for "Find". + For example, you are at the beginning of the following line. Suppose you +want to go to the h of human. Just execute the command "fh" and the cursor +will be positioned over the h: + + To err is human. To really foul up you need a computer. ~ + ---------->---------------> + fh fy + +This also shows that the command "fy" moves to the end of the word really. + You can specify a count; therefore, you can go to the "l" of "foul" with +"3fl": + + To err is human. To really foul up you need a computer. ~ + ---------------------> + 3fl + +The "F" command searches to the left: + + To err is human. To really foul up you need a computer. ~ + <--------------------- + Fh + +The "tx" command works like the "fx" command, except it stops one character +before the searched character. Hint: "t" stands for "To". The backward +version of this command is "Tx". + + To err is human. To really foul up you need a computer. ~ + <------------ -------------> + Th tn + +These four commands can be repeated with ";". "," repeats in the other +direction. The cursor is never moved to another line. Not even when the +sentence continues. + +Sometimes you will start a search, only to realize that you have typed the +wrong command. You type "f" to search backward, for example, only to realize +that you really meant "F". To abort a search, press <Esc>. So "f<Esc>" is an +aborted forward search and doesn't do anything. Note: <Esc> cancels most +operations, not just searches. + +============================================================================== +*03.4* Matching a parenthesis + +When writing a program you often end up with nested () constructs. Then the +"%" command is very handy: It moves to the matching paren. If the cursor is +on a "(" it will move to the matching ")". If it's on a ")" it will move to +the matching "(". + + % + <-----> + if (a == (b * c) / d) ~ + <----------------> + % + +This also works for [] and {} pairs. (This can be defined with the +'matchpairs' option.) + +When the cursor is not on a useful character, "%" will search forward to find +one. Thus if the cursor is at the start of the line of the previous example, +"%" will search forward and find the first "(". Then it moves to its match: + + if (a == (b * c) / d) ~ + ---+----------------> + % + +============================================================================== +*03.5* Moving to a specific line + +If you are a C or C++ programmer, you are familiar with error messages such as +the following: + + prog.c:33: j undeclared (first use in this function) ~ + +This tells you that you might want to fix something on line 33. So how do you +find line 33? One way is to do "9999k" to go to the top of the file and "32j" +to go down thirty two lines. It is not a good way, but it works. A much +better way of doing things is to use the "G" command. With a count, this +command positions you at the given line number. For example, "33G" puts you +on line 33. (For a better way of going through a compiler's error list, see +|usr_30.txt|, for information on the :make command.) + With no argument, "G" positions you at the end of the file. A quick way to +go to the start of a file use "gg". "1G" will do the same, but is a tiny bit +more typing. + + | first line of a file ^ + | text text text text | + | text text text text | gg + 7G | text text text text | + | text text text text + | text text text text + V text text text text | + text text text text | G + text text text text | + last line of a file V + +Another way to move to a line is using the "%" command with a count. For +example "50%" moves you to halfway the file. "90%" goes to near the end. + +The previous assumes that you want to move to a line in the file, no matter if +it's currently visible or not. What if you want to move to one of the lines +you can see? This figure shows the three commands you can use: + + +---------------------------+ + H --> | text sample text | + | sample text | + | text sample text | + | sample text | + M --> | text sample text | + | sample text | + | text sample text | + | sample text | + L --> | text sample text | + +---------------------------+ + +Hints: "H" stands for Home, "M" for Middle and "L" for Last. + +============================================================================== +*03.6* Telling where you are + +To see where you are in a file, there are three ways: + +1. Use the CTRL-G command. You get a message like this (assuming the 'ruler' + option is off): + + "usr_03.txt" line 233 of 650 --35%-- col 45-52 ~ + + This shows the name of the file you are editing, the line number where the + cursor is, the total number of lines, the percentage of the way through + the file and the column of the cursor. + Sometimes you will see a split column number. For example, "col 2-9". + This indicates that the cursor is positioned on the second character, but + because character one is a tab, occupying eight spaces worth of columns, + the screen column is 9. + +2. Set the 'number' option. This will display a line number in front of + every line: > + + :set number +< + To switch this off again: > + + :set nonumber +< + Since 'number' is a boolean option, prepending "no" to its name has the + effect of switching it off. A boolean option has only these two values, + it is either on or off. + Vim has many options. Besides the boolean ones there are options with + a numerical value and string options. You will see examples of this where + they are used. + +3. Set the 'ruler' option. This will display the cursor position in the + lower right corner of the Vim window: > + + :set ruler + +Using the 'ruler' option has the advantage that it doesn't take much room, +thus there is more space for your text. + +============================================================================== +*03.7* Scrolling around + +The CTRL-U command scrolls down half a screen of text. Think of looking +through a viewing window at the text and moving this window up by half the +height of the window. Thus the window moves up over the text, which is +backward in the file. Don't worry if you have a little trouble remembering +which end is up. Most users have the same problem. + The CTRL-D command moves the viewing window down half a screen in the file, +thus scrolls the text up half a screen. + + +----------------+ + | some text | + | some text | + | some text | + +---------------+ | some text | + | some text | CTRL-U --> | | + | | | 123456 | + | 123456 | +----------------+ + | 7890 | + | | +----------------+ + | example | CTRL-D --> | 7890 | + +---------------+ | | + | example | + | example | + | example | + | example | + +----------------+ + +To scroll one line at a time use CTRL-E (scroll up) and CTRL-Y (scroll down). +Think of CTRL-E to give you one line Extra. (If you use MS-Windows compatible +key mappings CTRL-Y will redo a change instead of scroll.) + +To scroll forward by a whole screen (except for two lines) use CTRL-F. The +other way is backward, CTRL-B is the command to use. Fortunately CTRL-F is +Forward and CTRL-B is Backward, that's easy to remember. + +A common issue is that after moving down many lines with "j" your cursor is at +the bottom of the screen. You would like to see the context of the line with +the cursor. That's done with the "zz" command. + + +------------------+ +------------------+ + | some text | | some text | + | some text | | some text | + | some text | | some text | + | some text | zz --> | line with cursor | + | some text | | some text | + | some text | | some text | + | line with cursor | | some text | + +------------------+ +------------------+ + +The "zt" command puts the cursor line at the top, "zb" at the bottom. There +are a few more scrolling commands, see |Q_sc|. To always keep a few lines of +context around the cursor, use the 'scrolloff' option. + +============================================================================== +*03.8* Simple searches + +To search for a string, use the "/string" command. To find the word include, +for example, use the command: > + + /include + +You will notice that when you type the "/" the cursor jumps to the last line +of the Vim window, like with colon commands. That is where you type the word. +You can press the backspace key (backarrow or <BS>) to make corrections. Use +the <Left> and <Right> cursor keys when necessary. + Pressing <Enter> executes the command. + + Note: + The characters .*[]^%/\?~$ have special meanings. If you want to use + them in a search you must put a \ in front of them. See below. + +To find the next occurrence of the same string use the "n" command. Use this +to find the first #include after the cursor: > + + /#include + +And then type "n" several times. You will move to each #include in the text. +You can also use a count if you know which match you want. Thus "3n" finds +the third match. Using a count with "/" doesn't work. + +The "?" command works like "/" but searches backwards: > + + ?word + +The "N" command repeats the last search the opposite direction. Thus using +"N" after a "/" command search backwards, using "N" after "?" searches +forward. + + +IGNORING CASE + +Normally you have to type exactly what you want to find. If you don't care +about upper or lowercase in a word, set the 'ignorecase' option: > + + :set ignorecase + +If you now search for "word", it will also match "Word" and "WORD". To match +case again: > + + :set noignorecase + + +HISTORY + +Suppose you do three searches: > + + /one + /two + /three + +Now let's start searching by typing a simple "/" without pressing <Enter>. If +you press <Up> (the cursor key), Vim puts "/three" on the command line. +Pressing <Enter> at this point searches for three. If you do not press +<Enter>, but press <Up> instead, Vim changes the prompt to "/two". Another +press of <Up> moves you to "/one". + You can also use the <Down> cursor key to move through the history of +search commands in the other direction. + +If you know what a previously used pattern starts with, and you want to use it +again, type that character before pressing <Up>. With the previous example, +you can type "/o<Up>" and Vim will put "/one" on the command line. + +The commands starting with ":" also have a history. That allows you to recall +a previous command and execute it again. These two histories are separate. + + +SEARCHING FOR A WORD IN THE TEXT + +Suppose you see the word "TheLongFunctionName" in the text and you want to +find the next occurrence of it. You could type "/TheLongFunctionName", but +that's a lot of typing. And when you make a mistake Vim won't find it. + There is an easier way: Position the cursor on the word and use the "*" +command. Vim will grab the word under the cursor and use it as the search +string. + The "#" command does the same in the other direction. You can prepend a +count: "3*" searches for the third occurrence of the word under the cursor. + + +SEARCHING FOR WHOLE WORDS + +If you type "/the" it will also match "there". To only find words that end +in "the" use: > + + /the\> + +The "\>" item is a special marker that only matches at the end of a word. +Similarly "\<" only matches at the begin of a word. Thus to search for the +word "the" only: > + + /\<the\> + +This does not match "there" or "soothe". Notice that the "*" and "#" commands +use these start-of-word and end-of-word markers to only find whole words (you +can use "g*" and "g#" to match partial words). + + +HIGHLIGHTING MATCHES + +While editing a program you see a variable called "nr". You want to check +where it's used. You could move the cursor to "nr" and use the "*" command +and press "n" to go along all the matches. + There is another way. Type this command: > + + :set hlsearch + +If you now search for "nr", Vim will highlight all matches. That is a very +good way to see where the variable is used, without the need to type commands. + To switch this off: > + + :set nohlsearch + +Then you need to switch it on again if you want to use it for the next search +command. If you only want to remove the highlighting, use this command: > + + :nohlsearch + +This doesn't reset the option. Instead, it disables the highlighting. As +soon as you execute a search command, the highlighting will be used again. +Also for the "n" and "N" commands. + + +TUNING SEARCHES + +There are a few options that change how searching works. These are the +essential ones: +> + :set incsearch + +This makes Vim display the match for the string while you are still typing it. +Use this to check if the right match will be found. Then press <Enter> to +really jump to that location. Or type more to change the search string. +> + :set nowrapscan + +This stops the search at the end of the file. Or, when you are searching +backwards, at the start of the file. The 'wrapscan' option is on by default, +thus searching wraps around the end of the file. + + +INTERMEZZO + +If you like one of the options mentioned before, and set it each time you use +Vim, you can put the command in your Vim startup file. + Edit the file, as mentioned at |not-compatible|. Or use this command to +find out where it is: > + + :scriptnames + +Edit the file, for example with: > + + :edit ~/.vimrc + +Then add a line with the command to set the option, just like you typed it in +Vim. Example: > + + Go:set hlsearch<Esc> + +"G" moves to the end of the file. "o" starts a new line, where you type the +":set" command. You end insert mode with <Esc>. Then write the file: > + + ZZ + +If you now start Vim again, the 'hlsearch' option will already be set. + +============================================================================== +*03.9* Simple search patterns + +The Vim editor uses regular expressions to specify what to search for. +Regular expressions are an extremely powerful and compact way to specify a +search pattern. Unfortunately, this power comes at a price, because regular +expressions are a bit tricky to specify. + In this section we mention only a few essential ones. More about search +patterns and commands in chapter 27 |usr_27.txt|. You can find the full +explanation here: |pattern|. + + +BEGINNING AND END OF A LINE + +The ^ character matches the beginning of a line. On an English-US keyboard +you find it above the 6. The pattern "include" matches the word include +anywhere on the line. But the pattern "^include" matches the word include +only if it is at the beginning of a line. + The $ character matches the end of a line. Therefore, "was$" matches the +word was only if it is at the end of a line. + +Let's mark the places where "the" matches in this example line with "x"s: + + the solder holding one of the chips melted and the ~ + xxx xxx xxx + +Using "/the$" we find this match: + + the solder holding one of the chips melted and the ~ + xxx + +And with "/^the" we find this one: + the solder holding one of the chips melted and the ~ + xxx + +You can try searching with "/^the$", it will only match a single line +consisting of "the". White space does matter here, thus if a line contains a +space after the word, like "the ", the pattern will not match. + + +MATCHING ANY SINGLE CHARACTER + +The . (dot) character matches any existing character. For example, the +pattern "c.m" matches a string whose first character is a c, whose second +character is anything, and whose the third character is m. Example: + + We use a computer that became the cummin winter. ~ + xxx xxx xxx + + +MATCHING SPECIAL CHARACTERS + +If you really want to match a dot, you must avoid its special meaning by +putting a backslash before it. + If you search for "ter.", you will find these matches: + + We use a computer that became the cummin winter. ~ + xxxx xxxx + +Searching for "ter\." only finds the second match. + +============================================================================== +*03.10* Using marks + +When you make a jump to a position with the "G" command, Vim remembers the +position from before this jump. This position is called a mark. To go back +where you came from, use this command: > + + `` + +This ` is a backtick or open single-quote character. + If you use the same command a second time you will jump back again. That's +because the ` command is a jump itself, and the position from before this jump +is remembered. + +Generally, every time you do a command that can move the cursor further than +within the same line, this is called a jump. This includes the search +commands "/" and "n" (it doesn't matter how far away the match is). But not +the character searches with "fx" and "tx" or the word movements "w" and "e". + Also, "j" and "k" are not considered to be a jump. Even when you use a +count to make them move the cursor quite a long way away. + +The `` command jumps back and forth, between two points. The CTRL-O command +jumps to older positions (Hint: O for older). CTRL-I then jumps back to newer +positions (Hint: I is just next to O on the keyboard). Consider this sequence +of commands: > + + 33G + /^The + CTRL-O + +You first jump to line 33, then search for a line that starts with "The". +Then with CTRL-O you jump back to line 33. Another CTRL-O takes you back to +where you started. If you now use CTRL-I you jump to line 33 again. And +to the match for "The" with another CTRL-I. + + + | example text ^ | + 33G | example text | CTRL-O | CTRL-I + | example text | | + V line 33 text ^ V + | example text | | + /^The | example text | CTRL-O | CTRL-I + V There you are | V + example text + + Note: + CTRL-I is the same as <Tab>. + +The ":jumps" command gives a list of positions you jumped to. The entry which +you used last is marked with a ">". + + +NAMED MARKS *bookmark* + +Vim enables you to place your own marks in the text. The command "ma" marks +the place under the cursor as mark a. You can place 26 marks (a through z) in +your text. You can't see them, it's just a position that Vim remembers. + To go to a mark, use the command `{mark}, where "{mark} is the mark letter. +Thus to move to the a mark: +> + `a + +The command 'mark (single quotation mark, or apostrophe) moves you to the +beginning of the line containing the mark. This differs from the `mark +command, which moves you to marked column. + +The marks can be very useful when working on two related parts in a file. +Suppose you have some text near the start of the file you need to look at, +while working on some text near the end of the file. + Move to the text at the start and place the s (start) mark there: > + + ms + +The move to the text you want to work on and put the e (end) mark there: > + + me + +Now you can move around, and when you want to look at the start of the file, +you use this to jump there: > + + 's + +Then you can use '' to jump back to where you were, or 'e to jump to the text +you were working on at the end. + There is nothing special about using s for start and e for end, they are +just easy to remember. + +You can use this command to get a list of marks: > + + :marks + +You will notice a few special marks. These include: + + ' The cursor position before doing a jump + " The cursor position when last editing the file + [ Start of the last change + ] End of the last change + +============================================================================== + +Next chapter: |usr_04.txt| Making small changes + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_04.txt b/Aufgabe5/doc.lang/usr_04.txt new file mode 100644 index 0000000..403a861 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_04.txt @@ -0,0 +1,514 @@ +*usr_04.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Making small changes + + +This chapter shows you several ways of making corrections and moving text +around. It teaches you the three basic ways to change text: operator-motion, +Visual mode and text objects. + +|04.1| Operators and motions +|04.2| Changing text +|04.3| Repeating a change +|04.4| Visual mode +|04.5| Moving text +|04.6| Copying text +|04.7| Using the clipboard +|04.8| Text objects +|04.9| Replace mode +|04.10| Conclusion + + Next chapter: |usr_05.txt| Set your settings + Previous chapter: |usr_03.txt| Moving around +Table of contents: |usr_toc.txt| + +============================================================================== +*04.1* Operators and motions + +In chapter 2 you learned the "x" command to delete a single character. And +using a count: "4x" deletes four characters. + The "dw" command deletes a word. You may recognize the "w" command as the +move word command. In fact, the "d" command may be followed by any motion +command, and it deletes from the current location to the place where the +cursor winds up. + The "4w" command, for example, moves the cursor over four words. The d4w +command deletes four words. + + To err is human. To really foul up you need a computer. ~ + ------------------> + d4w + + To err is human. you need a computer. ~ + +Vim only deletes up to the position where the motion takes the cursor. That's +because Vim knows that you probably don't want to delete the first character +of a word. If you use the "e" command to move to the end of a word, Vim +guesses that you do want to include that last character: + + To err is human. you need a computer. ~ + --------> + d2e + + To err is human. a computer. ~ + +Whether the character under the cursor is included depends on the command you +used to move to that character. The reference manual calls this "exclusive" +when the character isn't included and "inclusive" when it is. + +The "$" command moves to the end of a line. The "d$" command deletes from the +cursor to the end of the line. This is an inclusive motion, thus the last +character of the line is included in the delete operation: + + To err is human. a computer. ~ + ------------> + d$ + + To err is human ~ + +There is a pattern here: operator-motion. You first type an operator command. +For example, "d" is the delete operator. Then you type a motion command like +"4l" or "w". This way you can operate on any text you can move over. + +============================================================================== +*04.2* Changing text + +Another operator is "c", change. It acts just like the "d" operator, except +it leaves you in Insert mode. For example, "cw" changes a word. Or more +specifically, it deletes a word and then puts you in Insert mode. + + To err is human ~ + -------> + c2wbe<Esc> + + To be human ~ + +This "c2wbe<Esc>" contains these bits: + + c the change operator + 2w move two words (they are deleted and Insert mode started) + be insert this text + <Esc> back to Normal mode + +If you have paid attention, you will have noticed something strange: The space +before "human" isn't deleted. There is a saying that for every problem there +is an answer that is simple, clear, and wrong. That is the case with the +example used here for the "cw" command. The c operator works just like the +d operator, with one exception: "cw". It actually works like "ce", change to +end of word. Thus the space after the word isn't included. This is an +exception that dates back to the old Vi. Since many people are used to it +now, the inconsistency has remained in Vim. + + +MORE CHANGES + +Like "dd" deletes a whole line, "cc" changes a whole line. It keeps the +existing indent (leading white space) though. + +Just like "d$" deletes until the end of the line, "c$" changes until the end +of the line. It's like doing "d$" to delete the text and then "a" to start +Insert mode and append new text. + + +SHORTCUTS + +Some operator-motion commands are used so often that they have been given a +single letter command: + + x stands for dl (delete character under the cursor) + X stands for dh (delete character left of the cursor) + D stands for d$ (delete to end of the line) + C stands for c$ (change to end of the line) + s stands for cl (change one character) + S stands for cc (change a whole line) + + +WHERE TO PUT THE COUNT + +The commands "3dw" and "d3w" delete three words. If you want to get really +picky about things, the first command, "3dw", deletes one word three times; +the command "d3w" deletes three words once. This is a difference without a +distinction. You can actually put in two counts, however. For example, +"3d2w" deletes two words, repeated three times, for a total of six words. + + +REPLACING WITH ONE CHARACTER + +The "r" command is not an operator. It waits for you to type a character, and +will replace the character under the cursor with it. You could do the same +with "cl" or with the "s" command, but with "r" you don't have to press <Esc> + + there is somerhing grong here ~ + rT rt rw + + There is something wrong here ~ + +Using a count with "r" causes that many characters to be replaced with the +same character. Example: + + There is something wrong here ~ + 5rx + + There is something xxxxx here ~ + +To replace a character with a line break use "r<Enter>". This deletes one +character and inserts a line break. Using a count here only applies to the +number of characters deleted: "4r<Enter>" replaces four characters with one +line break. + +============================================================================== +*04.3* Repeating a change + +The "." command is one of the most simple yet powerful commands in Vim. It +repeats the last change. For instance, suppose you are editing an HTML file +and want to delete all the <B> tags. You position the cursor on the first < +and delete the <B> with the command "df>". You then go to the < of the next +</B> and kill it using the "." command. The "." command executes the last +change command (in this case, "df>"). To delete another tag, position the +cursor on the < and use the "." command. + + To <B>generate</B> a table of <B>contents ~ + f< find first < ---> + df> delete to > --> + f< find next < ---------> + . repeat df> ---> + f< find next < -------------> + . repeat df> --> + +The "." command works for all changes you make, except for the "u" (undo), +CTRL-R (redo) and commands that start with a colon (:). + +Another example: You want to change the word "four" to "five". It appears +several times in your text. You can do this quickly with this sequence of +commands: + + /four<Enter> find the first string "four" + cwfive<Esc> change the word to "five" + n find the next "four" + . repeat the change to "five' + n find the next "four" + . repeat the change + etc. + +============================================================================== +*04.4* Visual mode + +To delete simple items the operator-motion changes work quite well. But often +it's not so easy to decide which command will move over the text you want to +change. Then you can use Visual mode. + +You start Visual mode by pressing "v". You move the cursor over the text you +want to work on. While you do this, the text is highlighted. Finally type +the operator command. + For example, to delete from halfway one word to halfway another word: + + This is an examination sample of visual mode ~ + ----------> + velllld + + This is an example of visual mode ~ + +When doing this you don't really have to count how many times you have to +press "l" to end up in the right position. You can immediately see what text +will be deleted when you press "d". + +If at any time you decide you don't want to do anything with the highlighted +text, just press <Esc> and Visual mode will stop without doing anything. + + +SELECTING LINES + +If you want to work on whole lines, use "V" to start Visual mode. You will +see right away that the whole line is highlighted, without moving around. +When you move left or right nothing changes. When you move up or down the +selection is extended whole lines at a time. + For example, select three lines with "Vjj": + + +------------------------+ + | text more text | + >> | more text more text | | + selected lines >> | text text text | | Vjj + >> | text more | V + | more text more | + +------------------------+ + + +SELECTING BLOCKS + +If you want to work on a rectangular block of characters, use CTRL-V to start +Visual mode. This is very useful when working on tables. + + name Q1 Q2 Q3 + pierre 123 455 234 + john 0 90 39 + steve 392 63 334 + +To delete the middle "Q2" column, move the cursor to the "Q" of "Q2". Press +CTRL-V to start blockwise Visual mode. Now move the cursor three lines down +with "3j" and to the next word with "w". You can see the first character of +the last column is included. To exclude it, use "h". Now press "d" and the +middle column is gone. + + +GOING TO THE OTHER SIDE + +If you have selected some text in Visual mode, and discover that you need to +change the other end of the selection, use the "o" command (Hint: o for other +end). The cursor will go to the other end, and you can move the cursor to +change where the selection starts. Pressing "o" again brings you back to the +other end. + +When using blockwise selection, you have four corners. "o" only takes you to +one of the other corners, diagonally. Use "O" to move to the other corner in +the same line. + +Note that "o" and "O" in Visual mode work very different from Normal mode, +where they open a new line below or above the cursor. + +============================================================================== +*04.5* Moving text + +When you delete something with the "d", "x", or another command, the text is +saved. You can paste it back by using the p command. (The Vim name for +this is put). + Take a look at how this works. First you will delete an entire line, by +putting the cursor on the line you want to delete and typing "dd". Now you +move the cursor to where you want to put the line and use the "p" (put) +command. The line is inserted on the line below the cursor. + + a line a line a line + line 2 dd line 3 p line 3 + line 3 line 2 + +Because you deleted an entire line, the "p" command placed the text line below +the cursor. If you delete part of a line (a word, for instance), the "p" +command puts it just after the cursor. + + Some more boring try text to out commands. ~ + ----> + dw + + Some more boring text to out commands. ~ + -------> + welp + + Some more boring text to try out commands. ~ + + +MORE ON PUTTING + +The "P" command puts text like "p", but before the cursor. When you deleted a +whole line with "dd", "P" will put it back above the cursor. When you deleted +a word with "dw", "P" will put it back just before the cursor. + +You can repeat putting as many times as you like. The same text will be used. + +You can use a count with "p" and "P". The text will be repeated as many times +as specified with the count. Thus "dd" and then "3p" puts three copies of the +same deleted line. + + +SWAPPING TWO CHARACTERS + +Frequently when you are typing, your fingers get ahead of your brain (or the +other way around?). The result is a typo such as "teh" for "the". Vim +makes it easy to correct such problems. Just put the cursor on the e of "teh" +and execute the command "xp". This works as follows: "x" deletes the +character e and places it in a register. "p" puts the text after the cursor, +which is after the h. + + teh th the ~ + x p + +============================================================================== +*04.6* Copying text + +To copy text from one place to another, you could delete it, use "u" to undo +the deletion and then "p" to put it somewhere else. There is an easier way: +yanking. The "y" operator copies text into a register. Then a "p" command +can be used to put it. + Yanking is just a Vim name for copying. The "c" letter was already used +for the change operator, and "y" was still available. Calling this +operator "yank" made it easier to remember to use the "y" key. + +Since "y" is an operator, you use "yw" to yank a word. A count is possible as +usual. To yank two words use "y2w". Example: + + let sqr = LongVariable * ~ + --------------> + y2w + + let sqr = LongVariable * ~ + p + + let sqr = LongVariable * LongVariable ~ + +Notice that "yw" includes the white space after a word. If you don't want +this, use "ye". + +The "yy" command yanks a whole line, just like "dd" deletes a whole line. +Unexpectedly, while "D" deletes from the cursor to the end of the line, "Y" +works like "yy", it yanks the whole line. Watch out for this inconsistency! +Use "y$" to yank to the end of the line. + + a text line yy a text line a text line + line 2 line 2 p line 2 + last line last line a text line + last line + +============================================================================== +*04.7* Using the clipboard + +If you are using the GUI version of Vim (gvim), you can find the "Copy" item +in the "Edit" menu. First select some text with Visual mode, then use the +Edit/Copy menu. The selected text is now copied to the clipboard. You can +paste the text in other programs. In Vim itself too. + +If you have copied text to the clipboard in another application, you can paste +it in Vim with the Edit/Paste menu. This works in Normal mode and Insert +mode. In Visual mode the selected text is replaced with the pasted text. + +The "Cut" menu item deletes the text before it's put on the clipboard. The +"Copy", "Cut" and "Paste" items are also available in the popup menu (only +when there is a popup menu, of course). If your Vim has a toolbar, you can +also find these items there. + +If you are not using the GUI, or if you don't like using a menu, you have to +use another way. You use the normal "y" (yank) and "p" (put) commands, but +prepend "* (double-quote star) before it. To copy a line to the clipboard: > + + "*yy + +To put text from the clipboard back into the text: > + + "*p + +This only works on versions of Vim that include clipboard support. More about +the clipboard in section |09.3| and here: |clipboard|. + +============================================================================== +*04.8* Text objects + +If the cursor is in the middle of a word and want to delete that word, you +need to move back to its start before you can do "dw". There is a simpler way +to do this: "daw". + + this is some example text. ~ + daw + + this is some text. ~ + +The "d" of "daw" is the delete operator. "aw" is a text object. Hint: "aw" +stands for "A Word". Thus "daw" is "Delete A Word". To be precise, the white +space after the word is also deleted (the white space before the word at the +end of the line). + +Using text objects is the third way to make changes in Vim. We already had +operator-motion and Visual mode. Now we add operator-text object. + It is very similar to operator-motion, but instead of operating on the text +between the cursor position before and after a movement command, the text +object is used as a whole. It doesn't matter where in the object the cursor +was. + +To change a whole sentence use "cis". Take this text: + + Hello there. This ~ + is an example. Just ~ + some text. ~ + +Move to the start of the second line, on "is an". Now use "cis": + + Hello there. Just ~ + some text. ~ + +The cursor is in between the blanks in the first line. Now you type the new +sentence "Another line.": + + Hello there. Another line. Just ~ + some text. ~ + +"cis" consists of the "c" (change) operator and the "is" text object. This +stands for "Inner Sentence". There is also the "as" (a sentence) object. The +difference is that "as" includes the white space after the sentence and "is" +doesn't. If you would delete a sentence, you want to delete the white space +at the same time, thus use "das". If you want to type new text the white +space can remain, thus you use "cis". + +You can also use text objects in Visual mode. It will include the text object +in the Visual selection. Visual mode continues, thus you can do this several +times. For example, start Visual mode with "v" and select a sentence with +"as". Now you can repeat "as" to include more sentences. Finally you use an +operator to do something with the selected sentences. + +You can find a long list of text objects here: |text-objects|. + +============================================================================== +*04.9* Replace mode + +The "R" command causes Vim to enter replace mode. In this mode, each +character you type replaces the one under the cursor. This continues until +you type <Esc>. + In this example you start Replace mode on the first "t" of "text": + + This is text. ~ + Rinteresting.<Esc> + + This is interesting. ~ + +You may have noticed that this command replaced 5 characters in the line with +twelve others. The "R" command automatically extends the line if it runs out +of characters to replace. It will not continue on the next line. + +You can switch between Insert mode and Replace mode with the <Insert> key. + +When you use <BS> (backspace) to make correction, you will notice that the +old text is put back. Thus it works like an undo command for the last typed +character. + +============================================================================== +*04.10* Conclusion + +The operators, movement commands and text objects give you the possibility to +make lots of combinations. Now that you know how it works, you can use N +operators with M movement commands to make N * M commands! + +You can find a list of operators here: |operator| + +For example, there are many other ways to delete pieces of text. Here are a +few often used ones: + +x delete character under the cursor (short for "dl") +X delete character before the cursor (short for "dh") +D delete from cursor to end of line (short for "d$") +dw delete from cursor to next start of word +db delete from cursor to previous start of word +diw delete word under the cursor (excluding white space) +daw delete word under the cursor (including white space) +dG delete until the end of the file +dgg delete until the start of the file + +If you use "c" instead of "d" they become change commands. And with "y" you +yank the text. And so forth. + + +There are a few often used commands to make changes that didn't fit somewhere +else: + + ~ change case of the character under the cursor, and move the + cursor to the next character. This is not an operator (unless + 'tildeop' is set), thus you can't use it with a motion + command. It does works in Visual mode and changes case for + all the selected text then. + + I Start Insert mode after moving the cursor to the first + non-blank in the line. + + A Start Insert mode after moving the cursor to the end of the + line. + +============================================================================== + +Next chapter: |usr_05.txt| Set your settings + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_05.txt b/Aufgabe5/doc.lang/usr_05.txt new file mode 100644 index 0000000..8d2b88e --- /dev/null +++ b/Aufgabe5/doc.lang/usr_05.txt @@ -0,0 +1,625 @@ +*usr_05.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Set your settings + + +Vim can be tuned to work like you want it to. This chapter shows you how to +make Vim start with options set to different values. Add plugins to extend +Vim's capabilities. Or define your own macros. + +|05.1| The vimrc file +|05.2| The example vimrc file explained +|05.3| Simple mappings +|05.4| Adding a plugin +|05.5| Adding a help file +|05.6| The option window +|05.7| Often used options + + Next chapter: |usr_06.txt| Using syntax highlighting + Previous chapter: |usr_04.txt| Making small changes +Table of contents: |usr_toc.txt| + +============================================================================== +*05.1* The vimrc file *vimrc-intro* + +You probably got tired of typing commands that you use very often. To start +Vim with all your favorite option settings and mappings, you write them in +what is called the vimrc file. Vim executes the commands in this file when it +starts up. + +If you already have a vimrc file (e.g., when your sysadmin has one setup for +you), you can edit it this way: > + + :edit $MYVIMRC + +If you don't have a vimrc file yet, see |vimrc| to find out where you can +create a vimrc file. Also, the ":version" command mentions the name of the +"user vimrc file" Vim looks for. + +For Unix and Macintosh this file is always used and is recommended: + + ~/.vimrc ~ + +For MS-DOS and MS-Windows you can use one of these: + + $HOME/_vimrc ~ + $VIM/_vimrc ~ + +The vimrc file can contain all the commands that you type after a colon. The +most simple ones are for setting options. For example, if you want Vim to +always start with the 'incsearch' option on, add this line you your vimrc +file: > + + set incsearch + +For this new line to take effect you need to exit Vim and start it again. +Later you will learn how to do this without exiting Vim. + +This chapter only explains the most basic items. For more information on how +to write a Vim script file: |usr_41.txt|. + +============================================================================== +*05.2* The example vimrc file explained *vimrc_example.vim* + +In the first chapter was explained how the example vimrc (included in the +Vim distribution) file can be used to make Vim startup in not-compatible mode +(see |not-compatible|). The file can be found here: + + $VIMRUNTIME/vimrc_example.vim ~ + +In this section we will explain the various commands used in this file. This +will give you hints about how to set up your own preferences. Not everything +will be explained though. Use the ":help" command to find out more. + +> + set nocompatible + +As mentioned in the first chapter, these manuals explain Vim working in an +improved way, thus not completely Vi compatible. Setting the 'compatible' +option off, thus 'nocompatible' takes care of this. + +> + set backspace=indent,eol,start + +This specifies where in Insert mode the <BS> is allowed to delete the +character in front of the cursor. The three items, separated by commas, tell +Vim to delete the white space at the start of the line, a line break and the +character before where Insert mode started. +> + + set autoindent + +This makes Vim use the indent of the previous line for a newly created line. +Thus there is the same amount of white space before the new line. For example +when pressing <Enter> in Insert mode, and when using the "o" command to open a +new line. +> + + if has("vms") + set nobackup + else + set backup + endif + +This tells Vim to keep a backup copy of a file when overwriting it. But not +on the VMS system, since it keeps old versions of files already. The backup +file will have the same name as the original file with "~" added. See |07.4| +> + + set history=50 + +Keep 50 commands and 50 search patterns in the history. Use another number if +you want to remember fewer or more lines. +> + + set ruler + +Always display the current cursor position in the lower right corner of the +Vim window. + +> + set showcmd + +Display an incomplete command in the lower right corner of the Vim window, +left of the ruler. For example, when you type "2f", Vim is waiting for you to +type the character to find and "2f" is displayed. When you press "w" next, +the "2fw" command is executed and the displayed "2f" is removed. + + +-------------------------------------------------+ + |text in the Vim window | + |~ | + |~ | + |-- VISUAL -- 2f 43,8 17% | + +-------------------------------------------------+ + ^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^ + 'showmode' 'showcmd' 'ruler' + +> + set incsearch + +Display the match for a search pattern when halfway typing it. + +> + map Q gq + +This defines a key mapping. More about that in the next section. This +defines the "Q" command to do formatting with the "gq" operator. This is how +it worked before Vim 5.0. Otherwise the "Q" command starts Ex mode, but you +will not need it. + +> + vnoremap _g y:exe "grep /" . escape(@", '\\/') . "/ *.c *.h"<CR> + +This mapping yanks the visually selected text and searches for it in C files. +This is a complicated mapping. You can see that mappings can be used to do +quite complicated things. Still, it is just a sequence of commands that are +executed like you typed them. + +> + if &t_Co > 2 || has("gui_running") + syntax on + set hlsearch + endif + +This switches on syntax highlighting, but only if colors are available. And +the 'hlsearch' option tells Vim to highlight matches with the last used search +pattern. The "if" command is very useful to set options only when some +condition is met. More about that in |usr_41.txt|. + + *vimrc-filetype* > + filetype plugin indent on + +This switches on three very clever mechanisms: +1. Filetype detection. + Whenever you start editing a file, Vim will try to figure out what kind of + file this is. When you edit "main.c", Vim will see the ".c" extension and + recognize this as a "c" filetype. When you edit a file that starts with + "#!/bin/sh", Vim will recognize it as a "sh" filetype. + The filetype detection is used for syntax highlighting and the other two + items below. + See |filetypes|. + +2. Using filetype plugin files + Many different filetypes are edited with different options. For example, + when you edit a "c" file, it's very useful to set the 'cindent' option to + automatically indent the lines. These commonly useful option settings are + included with Vim in filetype plugins. You can also add your own, see + |write-filetype-plugin|. + +3. Using indent files + When editing programs, the indent of a line can often be computed + automatically. Vim comes with these indent rules for a number of + filetypes. See |:filetype-indent-on| and 'indentexpr'. + +> + autocmd FileType text setlocal textwidth=78 + +This makes Vim break text to avoid lines getting longer than 78 characters. +But only for files that have been detected to be plain text. There are +actually two parts here. "autocmd FileType text" is an autocommand. This +defines that when the file type is set to "text" the following command is +automatically executed. "setlocal textwidth=78" sets the 'textwidth' option +to 78, but only locally in one file. +> + + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | + \ endif + +Another autocommand. This time it is used after reading any file. The +complicated stuff after it checks if the '" mark is defined, and jumps to it +if so. The backslash at the start of a line is used to continue the command +from the previous line. That avoids a line getting very long. +See |line-continuation|. This only works in a Vim script file, not when +typing commands at the command-line. + +============================================================================== +*05.3* Simple mappings + +A mapping enables you to bind a set of Vim commands to a single key. Suppose, +for example, that you need to surround certain words with curly braces. In +other words, you need to change a word such as "amount" into "{amount}". With +the :map command, you can tell Vim that the F5 key does this job. The command +is as follows: > + + :map <F5> i{<Esc>ea}<Esc> +< + Note: + When entering this command, you must enter <F5> by typing four + characters. Similarly, <Esc> is not entered by pressing the <Esc> + key, but by typing five characters. Watch out for this difference + when reading the manual! + +Let's break this down: + <F5> The F5 function key. This is the trigger key that causes the + command to be executed as the key is pressed. + + i{<Esc> Insert the { character. The <Esc> key ends Insert mode. + + e Move to the end of the word. + + a}<Esc> Append the } to the word. + +After you execute the ":map" command, all you have to do to put {} around a +word is to put the cursor on the first character and press F5. + +In this example, the trigger is a single key; it can be any string. But when +you use an existing Vim command, that command will no longer be available. +You better avoid that. + One key that can be used with mappings is the backslash. Since you +probably want to define more than one mapping, add another character. You +could map "\p" to add parentheses around a word, and "\c" to add curly braces, +for example: > + + :map \p i(<Esc>ea)<Esc> + :map \c i{<Esc>ea}<Esc> + +You need to type the \ and the p quickly after another, so that Vim knows they +belong together. + +The ":map" command (with no arguments) lists your current mappings. At +least the ones for Normal mode. More about mappings in section |40.1|. + +============================================================================== +*05.4* Adding a plugin *add-plugin* *plugin* + +Vim's functionality can be extended by adding plugins. A plugin is nothing +more than a Vim script file that is loaded automatically when Vim starts. You +can add a plugin very easily by dropping it in your plugin directory. +{not available when Vim was compiled without the |+eval| feature} + +There are two types of plugins: + + global plugin: Used for all kinds of files + filetype plugin: Only used for a specific type of file + +The global plugins will be discussed first, then the filetype ones +|add-filetype-plugin|. + + +GLOBAL PLUGINS *standard-plugin* + +When you start Vim, it will automatically load a number of global plugins. +You don't have to do anything for this. They add functionality that most +people will want to use, but which was implemented as a Vim script instead of +being compiled into Vim. You can find them listed in the help index +|standard-plugin-list|. Also see |load-plugins|. + + *add-global-plugin* +You can add a global plugin to add functionality that will always be present +when you use Vim. There are only two steps for adding a global plugin: +1. Get a copy of the plugin. +2. Drop it in the right directory. + + +GETTING A GLOBAL PLUGIN + +Where can you find plugins? +- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros + and its sub-directories. +- Download from the net. There is a large collection on http://www.vim.org. +- They are sometimes posted in a Vim |maillist|. +- You could write one yourself, see |write-plugin|. + +Some plugins come as a vimball archive, see |vimball|. +Some plugins can be updated automatically, see |getscript|. + + +USING A GLOBAL PLUGIN + +First read the text in the plugin itself to check for any special conditions. +Then copy the file to your plugin directory: + + system plugin directory ~ + Unix ~/.vim/plugin/ + PC and OS/2 $HOME/vimfiles/plugin or $VIM/vimfiles/plugin + Amiga s:vimfiles/plugin + Macintosh $VIM:vimfiles:plugin + Mac OS X ~/.vim/plugin/ + RISC-OS Choices:vimfiles.plugin + +Example for Unix (assuming you didn't have a plugin directory yet): > + + mkdir ~/.vim + mkdir ~/.vim/plugin + cp /usr/local/share/vim/vim60/macros/justify.vim ~/.vim/plugin + +That's all! Now you can use the commands defined in this plugin to justify +text. + +Instead of putting plugins directly into the plugin/ directory, you may +better organize them by putting them into subdirectories under plugin/. +As an example, consider using "~/.vim/plugin/perl/*.vim" for all your Perl +plugins. + + +FILETYPE PLUGINS *add-filetype-plugin* *ftplugins* + +The Vim distribution comes with a set of plugins for different filetypes that +you can start using with this command: > + + :filetype plugin on + +That's all! See |vimrc-filetype|. + +If you are missing a plugin for a filetype you are using, or you found a +better one, you can add it. There are two steps for adding a filetype plugin: +1. Get a copy of the plugin. +2. Drop it in the right directory. + + +GETTING A FILETYPE PLUGIN + +You can find them in the same places as the global plugins. Watch out if the +type of file is mentioned, then you know if the plugin is a global or a +filetype one. The scripts in $VIMRUNTIME/macros are global ones, the filetype +plugins are in $VIMRUNTIME/ftplugin. + + +USING A FILETYPE PLUGIN *ftplugin-name* + +You can add a filetype plugin by dropping it in the right directory. The +name of this directory is in the same directory mentioned above for global +plugins, but the last part is "ftplugin". Suppose you have found a plugin for +the "stuff" filetype, and you are on Unix. Then you can move this file to the +ftplugin directory: > + + mv thefile ~/.vim/ftplugin/stuff.vim + +If that file already exists you already have a plugin for "stuff". You might +want to check if the existing plugin doesn't conflict with the one you are +adding. If it's OK, you can give the new one another name: > + + mv thefile ~/.vim/ftplugin/stuff_too.vim + +The underscore is used to separate the name of the filetype from the rest, +which can be anything. If you use "otherstuff.vim" it wouldn't work, it would +be loaded for the "otherstuff" filetype. + +On MS-DOS you cannot use long filenames. You would run into trouble if you +add a second plugin and the filetype has more than six characters. You can +use an extra directory to get around this: > + + mkdir $VIM/vimfiles/ftplugin/fortran + copy thefile $VIM/vimfiles/ftplugin/fortran/too.vim + +The generic names for the filetype plugins are: > + + ftplugin/<filetype>.vim + ftplugin/<filetype>_<name>.vim + ftplugin/<filetype>/<name>.vim + +Here "<name>" can be any name that you prefer. +Examples for the "stuff" filetype on Unix: > + + ~/.vim/ftplugin/stuff.vim + ~/.vim/ftplugin/stuff_def.vim + ~/.vim/ftplugin/stuff/header.vim + +The <filetype> part is the name of the filetype the plugin is to be used for. +Only files of this filetype will use the settings from the plugin. The <name> +part of the plugin file doesn't matter, you can use it to have several plugins +for the same filetype. Note that it must end in ".vim". + + +Further reading: +|filetype-plugins| Documentation for the filetype plugins and information + about how to avoid that mappings cause problems. +|load-plugins| When the global plugins are loaded during startup. +|ftplugin-overrule| Overruling the settings from a global plugin. +|write-plugin| How to write a plugin script. +|plugin-details| For more information about using plugins or when your + plugin doesn't work. +|new-filetype| How to detect a new file type. + +============================================================================== +*05.5* Adding a help file *add-local-help* *matchit-install* + +If you are lucky, the plugin you installed also comes with a help file. We +will explain how to install the help file, so that you can easily find help +for your new plugin. + Let us use the "matchit.vim" plugin as an example (it is included with +Vim). This plugin makes the "%" command jump to matching HTML tags, +if/else/endif in Vim scripts, etc. Very useful, although it's not backwards +compatible (that's why it is not enabled by default). + This plugin comes with documentation: "matchit.txt". Let's first copy the +plugin to the right directory. This time we will do it from inside Vim, so +that we can use $VIMRUNTIME. (You may skip some of the "mkdir" commands if +you already have the directory.) > + + :!mkdir ~/.vim + :!mkdir ~/.vim/plugin + :!cp $VIMRUNTIME/macros/matchit.vim ~/.vim/plugin + +The "cp" command is for Unix, on MS-DOS you can use "copy". + +Now create a "doc" directory in one of the directories in 'runtimepath'. > + + :!mkdir ~/.vim/doc + +Copy the help file to the "doc" directory. > + + :!cp $VIMRUNTIME/macros/matchit.txt ~/.vim/doc + +Now comes the trick, which allows you to jump to the subjects in the new help +file: Generate the local tags file with the |:helptags| command. > + + :helptags ~/.vim/doc + +Now you can use the > + + :help g% + +command to find help for "g%" in the help file you just added. You can see an +entry for the local help file when you do: > + + :help local-additions + +The title lines from the local help files are automagically added to this +section. There you can see which local help files have been added and jump to +them through the tag. + +For writing a local help file, see |write-local-help|. + +============================================================================== +*05.6* The option window + +If you are looking for an option that does what you want, you can search in +the help files here: |options|. Another way is by using this command: > + + :options + +This opens a new window, with a list of options with a one-line explanation. +The options are grouped by subject. Move the cursor to a subject and press +<Enter> to jump there. Press <Enter> again to jump back. Or use CTRL-O. + +You can change the value of an option. For example, move to the "displaying +text" subject. Then move the cursor down to this line: + + set wrap nowrap ~ + +When you hit <Enter>, the line will change to: + + set nowrap wrap ~ + +The option has now been switched off. + +Just above this line is a short description of the 'wrap' option. Move the +cursor one line up to place it in this line. Now hit <Enter> and you jump to +the full help on the 'wrap' option. + +For options that take a number or string argument you can edit the value. +Then press <Enter> to apply the new value. For example, move the cursor a few +lines up to this line: + + set so=0 ~ + +Position the cursor on the zero with "$". Change it into a five with "r5". +Then press <Enter> to apply the new value. When you now move the cursor +around you will notice that the text starts scrolling before you reach the +border. This is what the 'scrolloff' option does, it specifies an offset +from the window border where scrolling starts. + +============================================================================== +*05.7* Often used options + +There are an awful lot of options. Most of them you will hardly ever use. +Some of the more useful ones will be mentioned here. Don't forget you can +find more help on these options with the ":help" command, with single quotes +before and after the option name. For example: > + + :help 'wrap' + +In case you have messed up an option value, you can set it back to the +default by putting an ampersand (&) after the option name. Example: > + + :set iskeyword& + + +NOT WRAPPING LINES + +Vim normally wraps long lines, so that you can see all of the text. Sometimes +it's better to let the text continue right of the window. Then you need to +scroll the text left-right to see all of a long line. Switch wrapping off +with this command: > + + :set nowrap + +Vim will automatically scroll the text when you move to text that is not +displayed. To see a context of ten characters, do this: > + + :set sidescroll=10 + +This doesn't change the text in the file, only the way it is displayed. + + +WRAPPING MOVEMENT COMMANDS + +Most commands for moving around will stop moving at the start and end of a +line. You can change that with the 'whichwrap' option. This sets it to the +default value: > + + :set whichwrap=b,s + +This allows the <BS> key, when used in the first position of a line, to move +the cursor to the end of the previous line. And the <Space> key moves from +the end of a line to the start of the next one. + +To allow the cursor keys <Left> and <Right> to also wrap, use this command: > + + :set whichwrap=b,s,<,> + +This is still only for Normal mode. To let <Left> and <Right> do this in +Insert mode as well: > + + :set whichwrap=b,s,<,>,[,] + +There are a few other flags that can be added, see 'whichwrap'. + + +VIEWING TABS + +When there are tabs in a file, you cannot see where they are. To make them +visible: > + + :set list + +Now every Tab is displayed as ^I. And a $ is displayed at the end of each +line, so that you can spot trailing spaces that would otherwise go unnoticed. + A disadvantage is that this looks ugly when there are many Tabs in a file. +If you have a color terminal, or are using the GUI, Vim can show the spaces +and tabs as highlighted characters. Use the 'listchars' option: > + + :set listchars=tab:>-,trail:- + +Now every tab will be displayed as ">---" (with more or less "-") and trailing +white space as "-". Looks a lot better, doesn't it? + + +KEYWORDS + +The 'iskeyword' option specifies which characters can appear in a word: > + + :set iskeyword +< iskeyword=@,48-57,_,192-255 ~ + +The "@" stands for all alphabetic letters. "48-57" stands for ASCII +characters 48 to 57, which are the numbers 0 to 9. "192-255" are the +printable latin characters. + Sometimes you will want to include a dash in keywords, so that commands +like "w" consider "upper-case" to be one word. You can do it like this: > + + :set iskeyword+=- + :set iskeyword +< iskeyword=@,48-57,_,192-255,- ~ + +If you look at the new value, you will see that Vim has added a comma for you. + To remove a character use "-=". For example, to remove the underscore: > + + :set iskeyword-=_ + :set iskeyword +< iskeyword=@,48-57,192-255,- ~ + +This time a comma is automatically deleted. + + +ROOM FOR MESSAGES + +When Vim starts there is one line at the bottom that is used for messages. +When a message is long, it is either truncated, thus you can only see part of +it, or the text scrolls and you have to press <Enter> to continue. + You can set the 'cmdheight' option to the number of lines used for +messages. Example: > + + :set cmdheight=3 + +This does mean there is less room to edit text, thus it's a compromise. + +============================================================================== + +Next chapter: |usr_06.txt| Using syntax highlighting + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_06.txt b/Aufgabe5/doc.lang/usr_06.txt new file mode 100644 index 0000000..cd40be4 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_06.txt @@ -0,0 +1,276 @@ +*usr_06.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Using syntax highlighting + + +Black and white text is boring. With colors your file comes to life. This +not only looks nice, it also speeds up your work. Change the colors used for +the different sorts of text. Print your text, with the colors you see on the +screen. + +|06.1| Switching it on +|06.2| No or wrong colors? +|06.3| Different colors +|06.4| With colors or without colors +|06.5| Printing with colors +|06.6| Further reading + + Next chapter: |usr_07.txt| Editing more than one file + Previous chapter: |usr_05.txt| Set your settings +Table of contents: |usr_toc.txt| + +============================================================================== +*06.1* Switching it on + +It all starts with one simple command: > + + :syntax enable + +That should work in most situations to get color in your files. Vim will +automagically detect the type of file and load the right syntax highlighting. +Suddenly comments are blue, keywords brown and strings red. This makes it +easy to overview the file. After a while you will find that black&white text +slows you down! + +If you always want to use syntax highlighting, put the ":syntax enable" +command in your |vimrc| file. + +If you want syntax highlighting only when the terminal supports colors, you +can put this in your |vimrc| file: > + + if &t_Co > 1 + syntax enable + endif + +If you want syntax highlighting only in the GUI version, put the ":syntax +enable" command in your |gvimrc| file. + +============================================================================== +*06.2* No or wrong colors? + +There can be a number of reasons why you don't see colors: + +- Your terminal does not support colors. + Vim will use bold, italic and underlined text, but this doesn't look + very nice. You probably will want to try to get a terminal with + colors. For Unix, I recommend the xterm from the XFree86 project: + |xfree-xterm|. + +- Your terminal does support colors, but Vim doesn't know this. + Make sure your $TERM setting is correct. For example, when using an + xterm that supports colors: > + + setenv TERM xterm-color +< + or (depending on your shell): > + + TERM=xterm-color; export TERM + +< The terminal name must match the terminal you are using. If it + still doesn't work, have a look at |xterm-color|, which shows a few + ways to make Vim display colors (not only for an xterm). + +- The file type is not recognized. + Vim doesn't know all file types, and sometimes it's near to impossible + to tell what language a file uses. Try this command: > + + :set filetype +< + If the result is "filetype=" then the problem is indeed that Vim + doesn't know what type of file this is. You can set the type + manually: > + + :set filetype=fortran + +< To see which types are available, look in the directory + $VIMRUNTIME/syntax. For the GUI you can use the Syntax menu. + Setting the filetype can also be done with a |modeline|, so that the + file will be highlighted each time you edit it. For example, this + line can be used in a Makefile (put it near the start or end of the + file): > + + # vim: syntax=make + +< You might know how to detect the file type yourself. Often the file + name extension (after the dot) can be used. + See |new-filetype| for how to tell Vim to detect that file type. + +- There is no highlighting for your file type. + You could try using a similar file type by manually setting it as + mentioned above. If that isn't good enough, you can write your own + syntax file, see |mysyntaxfile|. + + +Or the colors could be wrong: + +- The colored text is very hard to read. + Vim guesses the background color that you are using. If it is black + (or another dark color) it will use light colors for text. If it is + white (or another light color) it will use dark colors for text. If + Vim guessed wrong the text will be hard to read. To solve this, set + the 'background' option. For a dark background: > + + :set background=dark + +< And for a light background: > + + :set background=light + +< Make sure you put this _before_ the ":syntax enable" command, + otherwise the colors will already have been set. You could do + ":syntax reset" after setting 'background' to make Vim set the default + colors again. + +- The colors are wrong when scrolling bottom to top. + Vim doesn't read the whole file to parse the text. It starts parsing + wherever you are viewing the file. That saves a lot of time, but + sometimes the colors are wrong. A simple fix is hitting CTRL-L. Or + scroll back a bit and then forward again. + For a real fix, see |:syn-sync|. Some syntax files have a way to make + it look further back, see the help for the specific syntax file. For + example, |tex.vim| for the TeX syntax. + +============================================================================== +*06.3* Different colors *:syn-default-override* + +If you don't like the default colors, you can select another color scheme. In +the GUI use the Edit/Color Scheme menu. You can also type the command: > + + :colorscheme evening + +"evening" is the name of the color scheme. There are several others you might +want to try out. Look in the directory $VIMRUNTIME/colors. + +When you found the color scheme that you like, add the ":colorscheme" command +to your |vimrc| file. + +You could also write your own color scheme. This is how you do it: + +1. Select a color scheme that comes close. Copy this file to your own Vim + directory. For Unix, this should work: > + + !mkdir ~/.vim/colors + !cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim +< + This is done from Vim, because it knows the value of $VIMRUNTIME. + +2. Edit the color scheme file. These entries are useful: + + term attributes in a B&W terminal + cterm attributes in a color terminal + ctermfg foreground color in a color terminal + ctermbg background color in a color terminal + gui attributes in the GUI + guifg foreground color in the GUI + guibg background color in the GUI + + For example, to make comments green: > + + :highlight Comment ctermfg=green guifg=green +< + Attributes you can use for "cterm" and "gui" are "bold" and "underline". + If you want both, use "bold,underline". For details see the |:highlight| + command. + +3. Tell Vim to always use your color scheme. Put this line in your |vimrc|: > + + colorscheme mine + +If you want to see what the most often used color combinations look like, use +this command: > + + :runtime syntax/colortest.vim + +You will see text in various color combinations. You can check which ones are +readable and look nice. + +============================================================================== +*06.4* With colors or without colors + +Displaying text in color takes a lot of effort. If you find the displaying +too slow, you might want to disable syntax highlighting for a moment: > + + :syntax clear + +When editing another file (or the same one) the colors will come back. + + *:syn-off* +If you want to stop highlighting completely use: > + + :syntax off + +This will completely disable syntax highlighting and remove it immediately for +all buffers. + + *:syn-manual* +If you want syntax highlighting only for specific files, use this: > + + :syntax manual + +This will enable the syntax highlighting, but not switch it on automatically +when starting to edit a buffer. To switch highlighting on for the current +buffer, set the 'syntax' option: > + + :set syntax=ON +< +============================================================================== +*06.5* Printing with colors *syntax-printing* + +In the MS-Windows version you can print the current file with this command: > + + :hardcopy + +You will get the usual printer dialog, where you can select the printer and a +few settings. If you have a color printer, the paper output should look the +same as what you see inside Vim. But when you use a dark background the +colors will be adjusted to look good on white paper. + +There are several options that change the way Vim prints: + 'printdevice' + 'printheader' + 'printfont' + 'printoptions' + +To print only a range of lines, use Visual mode to select the lines and then +type the command: > + + v100j:hardcopy + +"v" starts Visual mode. "100j" moves a hundred lines down, they will be +highlighted. Then ":hardcopy" will print those lines. You can use other +commands to move in Visual mode, of course. + +This also works on Unix, if you have a PostScript printer. Otherwise, you +will have to do a bit more work. You need to convert the text to HTML first, +and then print it from a web browser such as Netscape. + +Convert the current file to HTML with this command: > + + :source $VIMRUNTIME/syntax/2html.vim + +You will see it crunching away, this can take quite a while for a large file. +Some time later another window shows the HTML code. Now write this somewhere +(doesn't matter where, you throw it away later): +> + :write main.c.html + +Open this file in your favorite browser and print it from there. If all goes +well, the output should look exactly as it does in Vim. See |2html.vim| for +details. Don't forget to delete the HTML file when you are done with it. + +Instead of printing, you could also put the HTML file on a web server, and let +others look at the colored text. + +============================================================================== +*06.6* Further reading + +|usr_44.txt| Your own syntax highlighted. +|syntax| All the details. + +============================================================================== + +Next chapter: |usr_07.txt| Editing more than one file + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_07.txt b/Aufgabe5/doc.lang/usr_07.txt new file mode 100644 index 0000000..1fb7b5f --- /dev/null +++ b/Aufgabe5/doc.lang/usr_07.txt @@ -0,0 +1,479 @@ +*usr_07.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Editing more than one file + + +No matter how many files you have, you can edit them without leaving Vim. +Define a list of files to work on and jump from one to the other. Copy text +from one file and put it in another one. + +|07.1| Edit another file +|07.2| A list of files +|07.3| Jumping from file to file +|07.4| Backup files +|07.5| Copy text between files +|07.6| Viewing a file +|07.7| Changing the file name + + Next chapter: |usr_08.txt| Splitting windows + Previous chapter: |usr_06.txt| Using syntax highlighting +Table of contents: |usr_toc.txt| + +============================================================================== +*07.1* Edit another file + +So far you had to start Vim for every file you wanted to edit. There is a +simpler way. To start editing another file, use this command: > + + :edit foo.txt + +You can use any file name instead of "foo.txt". Vim will close the current +file and open the new one. If the current file has unsaved changes, however, +Vim displays an error message and does not open the new file: + + E37: No write since last change (use ! to override) ~ + + Note: + Vim puts an error ID at the start of each error message. If you do + not understand the message or what caused it, look in the help system + for this ID. In this case: > + + :help E37 + +At this point, you have a number of alternatives. You can write the file +using this command: > + + :write + +Or you can force Vim to discard your changes and edit the new file, using the +force (!) character: > + + :edit! foo.txt + +If you want to edit another file, but not write the changes in the current +file yet, you can make it hidden: > + + :hide edit foo.txt + +The text with changes is still there, but you can't see it. This is further +explained in section |22.4|: The buffer list. + +============================================================================== +*07.2* A list of files + +You can start Vim to edit a sequence of files. For example: > + + vim one.c two.c three.c + +This command starts Vim and tells it that you will be editing three files. +Vim displays just the first file. After you have done your thing in this +file, to edit the next file you use this command: > + + :next + +If you have unsaved changes in the current file, you will get an error +message and the ":next" will not work. This is the same problem as with +":edit" mentioned in the previous section. To abandon the changes: > + + :next! + +But mostly you want to save the changes and move on to the next file. There +is a special command for this: > + + :wnext + +This does the same as using two separate commands: > + + :write + :next + + +WHERE AM I? + +To see which file in the argument list you are editing, look in the window +title. It should show something like "(2 of 3)". This means you are editing +the second file out of three files. + If you want to see the list of files, use this command: > + + :args + +This is short for "arguments". The output might look like this: + + one.c [two.c] three.c ~ + +These are the files you started Vim with. The one you are currently editing, +"two.c", is in square brackets. + + +MOVING TO OTHER ARGUMENTS + +To go back one file: > + + :previous + +This is just like the ":next" command, except that it moves in the other +direction. Again, there is a shortcut command for when you want to write the +file first: > + + :wprevious + +To move to the very last file in the list: > + + :last + +And to move back to the first one again: > + + :first + +There is no ":wlast" or ":wfirst" command though! + +You can use a count for ":next" and ":previous". To skip two files forward: > + + :2next + + +AUTOMATIC WRITING + +When moving around the files and making changes, you have to remember to use +":write". Otherwise you will get an error message. If you are sure you +always want to write modified files, you can tell Vim to automatically write +them: > + + :set autowrite + +When you are editing a file which you may not want to write, switch it off +again: > + + :set noautowrite + + +EDITING ANOTHER LIST OF FILES + +You can redefine the list of files without the need to exit Vim and start it +again. Use this command to edit three other files: > + + :args five.c six.c seven.h + +Or use a wildcard, like it's used in the shell: > + + :args *.txt + +Vim will take you to the first file in the list. Again, if the current file +has changes, you can either write the file first, or use ":args!" (with ! +added) to abandon the changes. + + +DID YOU EDIT THE LAST FILE? + *arglist-quit* +When you use a list of files, Vim assumes you want to edit them all. To +protect you from exiting too early, you will get this error when you didn't +edit the last file in the list yet: + + E173: 46 more files to edit ~ + +If you really want to exit, just do it again. Then it will work (but not when +you did other commands in between). + +============================================================================== +*07.3* Jumping from file to file + +To quickly jump between two files, press CTRL-^ (on English-US keyboards the ^ +is above the 6 key). Example: > + + :args one.c two.c three.c + +You are now in one.c. > + + :next + +Now you are in two.c. Now use CTRL-^ to go back to one.c. Another CTRL-^ and +you are back in two.c. Another CTRL-^ and you are in one.c again. If you now +do: > + + :next + +You are in three.c. Notice that the CTRL-^ command does not change the idea +of where you are in the list of files. Only commands like ":next" and +":previous" do that. + +The file you were previously editing is called the "alternate" file. When you +just started Vim CTRL-^ will not work, since there isn't a previous file. + + +PREDEFINED MARKS + +After jumping to another file, you can use two predefined marks which are very +useful: > + + `" + +This takes you to the position where the cursor was when you left the file. +Another mark that is remembered is the position where you made the last +change: > + + `. + +Suppose you are editing the file "one.txt". Somewhere halfway the file you +use "x" to delete a character. Then you go to the last line with "G" and +write the file with ":w". You edit several other files, and then use ":edit +one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last +line of the file. Using `. takes you to the position where you deleted the +character. Even when you move around in the file `" and `. will take you to +the remembered position. At least until you make another change or leave the +file. + + +FILE MARKS + +In chapter 4 was explained how you can place a mark in a file with "mx" and +jump to that position with "`x". That works within one file. If you edit +another file and place marks there, these are specific for that file. Thus +each file has its own set of marks, they are local to the file. + So far we were using marks with a lowercase letter. There are also marks +with an uppercase letter. These are global, they can be used from any file. +For example suppose that we are editing the file "foo.txt". Go to halfway the +file ("50%") and place the F mark there (F for foo): > + + 50%mF + +Now edit the file "bar.txt" and place the B mark (B for bar) at its last line: +> + GmB + +Now you can use the "'F" command to jump back to halfway foo.txt. Or edit yet +another file, type "'B" and you are at the end of bar.txt again. + +The file marks are remembered until they are placed somewhere else. Thus you +can place the mark, do hours of editing and still be able to jump back to that +mark. + It's often useful to think of a simple connection between the mark letter +and where it is placed. For example, use the H mark in a header file, M in +a Makefile and C in a C code file. + +To see where a specific mark is, give an argument to the ":marks" command: > + + :marks M + +You can also give several arguments: > + + :marks MCP + +Don't forget that you can use CTRL-O and CTRL-I to jump to older and newer +positions without placing marks there. + +============================================================================== +*07.4* Backup files + +Usually Vim does not produce a backup file. If you want to have one, all you +need to do is execute the following command: > + + :set backup + +The name of the backup file is the original file with a ~ added to the end. +If your file is named data.txt, for example, the backup file name is +data.txt~. + If you do not like the fact that the backup files end with ~, you can +change the extension: > + + :set backupext=.bak + +This will use data.txt.bak instead of data.txt~. + Another option that matters here is 'backupdir'. It specifies where the +backup file is written. The default, to write the backup in the same +directory as the original file, will mostly be the right thing. + + Note: + When the 'backup' option isn't set but the 'writebackup' is, Vim will + still create a backup file. However, it is deleted as soon as writing + the file was completed successfully. This functions as a safety + against losing your original file when writing fails in some way (disk + full is the most common cause; being hit by lightning might be + another, although less common). + + +KEEPING THE ORIGINAL FILE + +If you are editing source files, you might want to keep the file before you +make any changes. But the backup file will be overwritten each time you write +the file. Thus it only contains the previous version, not the first one. + To make Vim keep the original file, set the 'patchmode' option. This +specifies the extension used for the first backup of a changed file. Usually +you would do this: > + + :set patchmode=.orig + +When you now edit the file data.txt for the first time, make changes and write +the file, Vim will keep a copy of the unchanged file under the name +"data.txt.orig". + If you make further changes to the file, Vim will notice that +"data.txt.orig" already exists and leave it alone. Further backup files will +then be called "data.txt~" (or whatever you specified with 'backupext'). + If you leave 'patchmode' empty (that is the default), the original file +will not be kept. + +============================================================================== +*07.5* Copy text between files + +This explains how to copy text from one file to another. Let's start with a +simple example. Edit the file that contains the text you want to copy. Move +the cursor to the start of the text and press "v". This starts Visual mode. +Now move the cursor to the end of the text and press "y". This yanks (copies) +the selected text. + To copy the above paragraph, you would do: > + + :edit thisfile + /This + vjjjj$y + +Now edit the file you want to put the text in. Move the cursor to the +character where you want the text to appear after. Use "p" to put the text +there. > + :edit otherfile + /There + p + +Of course you can use many other commands to yank the text. For example, to +select whole lines start Visual mode with "V". Or use CTRL-V to select a +rectangular block. Or use "Y" to yank a single line, "yaw" to yank-a-word, +etc. + The "p" command puts the text after the cursor. Use "P" to put the text +before the cursor. Notice that Vim remembers if you yanked a whole line or a +block, and puts it back that way. + + +USING REGISTERS + +When you want to copy several pieces of text from one file to another, having +to switch between the files and writing the target file takes a lot of time. +To avoid this, copy each piece of text to its own register. + A register is a place where Vim stores text. Here we will use the +registers named a to z (later you will find out there are others). Let's copy +a sentence to the f register (f for First): > + + "fyas + +The "yas" command yanks a sentence like before. It's the "f that tells Vim +the text should be place in the f register. This must come just before the +yank command. + Now yank three whole lines to the l register (l for line): > + + "l3Y + +The count could be before the "l just as well. To yank a block of text to the +b (for block) register: > + + CTRL-Vjjww"by + +Notice that the register specification "b is just before the "y" command. +This is required. If you would have put it before the "w" command, it would +not have worked. + Now you have three pieces of text in the f, l and b registers. Edit +another file, move around and place the text where you want it: > + + "fp + +Again, the register specification "f comes before the "p" command. + You can put the registers in any order. And the text stays in the register +until you yank something else into it. Thus you can put it as many times as +you like. + +When you delete text, you can also specify a register. Use this to move +several pieces of text around. For example, to delete-a-word and write it in +the w register: > + + "wdaw + +Again, the register specification comes before the delete command "d". + + +APPENDING TO A FILE + +When collecting lines of text into one file, you can use this command: > + + :write >> logfile + +This will write the text of the current file to the end of "logfile". Thus it +is appended. This avoids that you have to copy the lines, edit the log file +and put them there. Thus you save two steps. But you can only append to the +end of a file. + To append only a few lines, select them in Visual mode before typing +":write". In chapter 10 you will learn other ways to select a range of lines. + +============================================================================== +*07.6* Viewing a file + +Sometimes you only want to see what a file contains, without the intention to +ever write it back. There is the risk that you type ":w" without thinking and +overwrite the original file anyway. To avoid this, edit the file read-only. + To start Vim in readonly mode, use this command: > + + vim -R file + +On Unix this command should do the same thing: > + + view file + +You are now editing "file" in read-only mode. When you try using ":w" you +will get an error message and the file won't be written. + When you try to make a change to the file Vim will give you a warning: + + W10: Warning: Changing a readonly file ~ + +The change will be done though. This allows for formatting the file, for +example, to be able to read it easily. + If you make changes to a file and forgot that it was read-only, you can +still write it. Add the ! to the write command to force writing. + +If you really want to forbid making changes in a file, do this: > + + vim -M file + +Now every attempt to change the text will fail. The help files are like this, +for example. If you try to make a change you get this error message: + + E21: Cannot make changes, 'modifiable' is off ~ + +You could use the -M argument to setup Vim to work in a viewer mode. This is +only voluntary though, since these commands will remove the protection: > + + :set modifiable + :set write + +============================================================================== +*07.7* Changing the file name + +A clever way to start editing a new file is by using an existing file that +contains most of what you need. For example, you start writing a new program +to move a file. You know that you already have a program that copies a file, +thus you start with: > + + :edit copy.c + +You can delete the stuff you don't need. Now you need to save the file under +a new name. The ":saveas" command can be used for this: > + + :saveas move.c + +Vim will write the file under the given name, and edit that file. Thus the +next time you do ":write", it will write "move.c". "copy.c" remains +unmodified. + When you want to change the name of the file you are editing, but don't +want to write the file, you can use this command: > + + :file move.c + +Vim will mark the file as "not edited". This means that Vim knows this is not +the file you started editing. When you try to write the file, you might get +this message: + + E13: File exists (use ! to override) ~ + +This protects you from accidentally overwriting another file. + +============================================================================== + +Next chapter: |usr_08.txt| Splitting windows + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_08.txt b/Aufgabe5/doc.lang/usr_08.txt new file mode 100644 index 0000000..cdb157e --- /dev/null +++ b/Aufgabe5/doc.lang/usr_08.txt @@ -0,0 +1,601 @@ +*usr_08.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + VIM USER MANUAL - by Bram Moolenaar + + Splitting windows + + +Display two different files above each other. Or view two locations in the +file at the same time. See the difference between two files by putting them +side by side. All this is possible with split windows. + +|08.1| Split a window +|08.2| Split a window on another file +|08.3| Window size +|08.4| Vertical splits +|08.5| Moving windows +|08.6| Commands for all windows +|08.7| Viewing differences with vimdiff +|08.8| Various +|08.9| Tab pages + + Next chapter: |usr_09.txt| Using the GUI + Previous chapter: |usr_07.txt| Editing more than one file +Table of contents: |usr_toc.txt| + +============================================================================== +*08.1* Split a window + +The easiest way to open a new window is to use the following command: > + + :split + +This command splits the screen into two windows and leaves the cursor in the +top one: + + +----------------------------------+ + |/* file one.c */ | + |~ | + |~ | + |one.c=============================| + |/* file one.c */ | + |~ | + |one.c=============================| + | | + +----------------------------------+ + +What you see here is two windows on the same file. The line with "====" is +that status line. It displays information about the window above it. (In +practice the status line will be in reverse video.) + The two windows allow you to view two parts of the same file. For example, +you could make the top window show the variable declarations of a program, and +the bottom one the code that uses these variables. + +The CTRL-W w command can be used to jump between the windows. If you are in +the top window, CTRL-W w jumps to the window below it. If you are in the +bottom window it will jump to the first window. (CTRL-W CTRL-W does the same +thing, in case you let go of the CTRL key a bit later.) + + +CLOSE THE WINDOW + +To close a window, use the command: > + + :close + +Actually, any command that quits editing a file works, like ":quit" and "ZZ". +But ":close" prevents you from accidentally exiting Vim when you close the +last window. + + +CLOSING ALL OTHER WINDOWS + +If you have opened a whole bunch of windows, but now want to concentrate on +one of them, this command will be useful: > + + :only + +This closes all windows, except for the current one. If any of the other +windows has changes, you will get an error message and that window won't be +closed. + +============================================================================== +*08.2* Split a window on another file + +The following command opens a second window and starts editing the given file: +> + :split two.c + +If you were editing one.c, then the result looks like this: + + +----------------------------------+ + |/* file two.c */ | + |~ | + |~ | + |two.c=============================| + |/* file one.c */ | + |~ | + |one.c=============================| + | | + +----------------------------------+ + +To open a window on a new, empty file, use this: > + + :new + +You can repeat the ":split" and ":new" commands to create as many windows as +you like. + +============================================================================== +*08.3* Window size + +The ":split" command can take a number argument. If specified, this will be +the height of the new window. For example, the following opens a new window +three lines high and starts editing the file alpha.c: > + + :3split alpha.c + +For existing windows you can change the size in several ways. When you have a +working mouse, it is easy: Move the mouse pointer to the status line that +separates two windows, and drag it up or down. + +To increase the size of a window: > + + CTRL-W + + +To decrease it: > + + CTRL-W - + +Both of these commands take a count and increase or decrease the window size +by that many lines. Thus "4 CTRL-W +" make the window four lines higher. + +To set the window height to a specified number of lines: > + + {height}CTRL-W _ + +That's: a number {height}, CTRL-W and then an underscore (the - key with Shift +on English-US keyboards). + To make a window as high as it can be, use the CTRL-W _ command without a +count. + + +USING THE MOUSE + +In Vim you can do many things very quickly from the keyboard. Unfortunately, +the window resizing commands require quite a bit of typing. In this case, +using the mouse is faster. Position the mouse pointer on a status line. Now +press the left mouse button and drag. The status line will move, thus making +the window on one side higher and the other smaller. + + +OPTIONS + +The 'winheight' option can be set to a minimal desired height of a window and +'winminheight' to a hard minimum height. + Likewise, there is 'winwidth' for the minimal desired width and +'winminwidth' for the hard minimum width. + The 'equalalways' option, when set, makes Vim equalize the windows sizes +when a window is closed or opened. + +============================================================================== +*08.4* Vertical splits + +The ":split" command creates the new window above the current one. To make +the window appear at the left side, use: > + + :vsplit + +or: > + :vsplit two.c + +The result looks something like this: + + +--------------------------------------+ + |/* file two.c */ |/* file one.c */ | + |~ |~ | + |~ |~ | + |~ |~ | + |two.c===============one.c=============| + | | + +--------------------------------------+ + +Actually, the | lines in the middle will be in reverse video. This is called +the vertical separator. It separates the two windows left and right of it. + +There is also the ":vnew" command, to open a vertically split window on a new, +empty file. Another way to do this: > + + :vertical new + +The ":vertical" command can be inserted before another command that splits a +window. This will cause that command to split the window vertically instead +of horizontally. (If the command doesn't split a window, it works +unmodified.) + + +MOVING BETWEEN WINDOWS + +Since you can split windows horizontally and vertically as much as you like, +you can create any layout of windows. Then you can use these commands to move +between them: + + CTRL-W h move to the window on the left + CTRL-W j move to the window below + CTRL-W k move to the window above + CTRL-W l move to the window on the right + + CTRL-W t move to the TOP window + CTRL-W b move to the BOTTOM window + +You will notice the same letters as used for moving the cursor. And the +cursor keys can also be used, if you like. + More commands to move to other windows: |Q_wi|. + +============================================================================== +*08.5* Moving windows + +You have split a few windows, but now they are in the wrong place. Then you +need a command to move the window somewhere else. For example, you have three +windows like this: + + +----------------------------------+ + |/* file two.c */ | + |~ | + |~ | + |two.c=============================| + |/* file three.c */ | + |~ | + |~ | + |three.c===========================| + |/* file one.c */ | + |~ | + |one.c=============================| + | | + +----------------------------------+ + +Clearly the last one should be at the top. Go to that window (using CTRL-W w) +and the type this command: > + + CTRL-W K + +This uses the uppercase letter K. What happens is that the window is moved to +the very top. You will notice that K is again used for moving upwards. + When you have vertical splits, CTRL-W K will move the current window to the +top and make it occupy the full with of the Vim window. If this is your +layout: + + +-------------------------------------------+ + |/* two.c */ |/* three.c */ |/* one.c */ | + |~ |~ |~ | + |~ |~ |~ | + |~ |~ |~ | + |~ |~ |~ | + |~ |~ |~ | + |two.c=========three.c=========one.c========| + | | + +-------------------------------------------+ + +Then using CTRL-W K in the middle window (three.c) will result in: + + +-------------------------------------------+ + |/* three.c */ | + |~ | + |~ | + |three.c====================================| + |/* two.c */ |/* one.c */ | + |~ |~ | + |two.c==================one.c===============| + | | + +-------------------------------------------+ + +The other three similar commands (you can probably guess these now): + + CTRL-W H move window to the far left + CTRL-W J move window to the bottom + CTRL-W L move window to the far right + +============================================================================== +*08.6* Commands for all windows + +When you have several windows open and you want to quit Vim, you can close +each window separately. A quicker way is using this command: > + + :qall + +This stands for "quit all". If any of the windows contain changes, Vim will +not exit. The cursor will automatically be positioned in a window with +changes. You can then either use ":write" to save the changes, or ":quit!" to +throw them away. + +If you know there are windows with changes, and you want to save all these +changes, use this command: > + + :wall + +This stands for "write all". But actually, it only writes files with +changes. Vim knows it doesn't make sense to write files that were not +changed. + And then there is the combination of ":qall" and ":wall": the "write and +quit all" command: > + + :wqall + +This writes all modified files and quits Vim. + Finally, there is a command that quits Vim and throws away all changes: > + + :qall! + +Be careful, there is no way to undo this command! + + +OPENING A WINDOW FOR ALL ARGUMENTS + +To make Vim open a window for each file, start it with the "-o" argument: > + + vim -o one.txt two.txt three.txt + +This results in: + + +-------------------------------+ + |file one.txt | + |~ | + |one.txt========================| + |file two.txt | + |~ | + |two.txt========================| + |file three.txt | + |~ | + |three.txt======================| + | | + +-------------------------------+ + +The "-O" argument is used to get vertically split windows. + When Vim is already running, the ":all" command opens a window for each +file in the argument list. ":vertical all" does it with vertical splits. + +============================================================================== +*08.7* Viewing differences with vimdiff + +There is a special way to start Vim, which shows the differences between two +files. Let's take a file "main.c" and insert a few characters in one line. +Write this file with the 'backup' option set, so that the backup file +"main.c~" will contain the previous version of the file. + Type this command in a shell (not in Vim): > + + vimdiff main.c~ main.c + +Vim will start, with two windows side by side. You will only see the line +in which you added characters, and a few lines above and below it. + + VV VV + +-----------------------------------------+ + |+ +--123 lines: /* a|+ +--123 lines: /* a| <- fold + | text | text | + | text | text | + | text | text | + | text | changed text | <- changed line + | text | text | + | text | ------------------| <- deleted line + | text | text | + | text | text | + | text | text | + |+ +--432 lines: text|+ +--432 lines: text| <- fold + | ~ | ~ | + | ~ | ~ | + |main.c~==============main.c==============| + | | + +-----------------------------------------+ + +(This picture doesn't show the highlighting, use the vimdiff command for a +better look.) + +The lines that were not modified have been collapsed into one line. This is +called a closed fold. They are indicated in the picture with "<- fold". Thus +the single fold line at the top stands for 123 text lines. These lines are +equal in both files. + The line marked with "<- changed line" is highlighted, and the inserted +text is displayed with another color. This clearly shows what the difference +is between the two files. + The line that was deleted is displayed with "---" in the main.c window. +See the "<- deleted line" marker in the picture. These characters are not +really there. They just fill up main.c, so that it displays the same number +of lines as the other window. + + +THE FOLD COLUMN + +Each window has a column on the left with a slightly different background. In +the picture above these are indicated with "VV". You notice there is a plus +character there, in front of each closed fold. Move the mouse pointer to that +plus and click the left button. The fold will open, and you can see the text +that it contains. + The fold column contains a minus sign for an open fold. If you click on +this -, the fold will close. + Obviously, this only works when you have a working mouse. You can also use +"zo" to open a fold and "zc" to close it. + + +DIFFING IN VIM + +Another way to start in diff mode can be done from inside Vim. Edit the +"main.c" file, then make a split and show the differences: > + + :edit main.c + :vertical diffsplit main.c~ + +The ":vertical" command is used to make the window split vertically. If you +omit this, you will get a horizontal split. + +If you have a patch or diff file, you can use the third way to start diff +mode. First edit the file to which the patch applies. Then tell Vim the name +of the patch file: > + + :edit main.c + :vertical diffpatch main.c.diff + +WARNING: The patch file must contain only one patch, for the file you are +editing. Otherwise you will get a lot of error messages, and some files might +be patched unexpectedly. + The patching will only be done to the copy of the file in Vim. The file on +your harddisk will remain unmodified (until you decide to write the file). + + +SCROLL BINDING + +When the files have more changes, you can scroll in the usual way. Vim will +try to keep both the windows start at the same position, so you can easily see +the differences side by side. + When you don't want this for a moment, use this command: > + + :set noscrollbind + + +JUMPING TO CHANGES + +When you have disabled folding in some way, it may be difficult to find the +changes. Use this command to jump forward to the next change: > + + ]c + +To go the other way use: > + + [c + +Prepended a count to jump further away. + + +REMOVING CHANGES + +You can move text from one window to the other. This either removes +differences or adds new ones. Vim doesn't keep the highlighting updated in +all situations. To update it use this command: > + + :diffupdate + +To remove a difference, you can move the text in a highlighted block from one +window to another. Take the "main.c" and "main.c~" example above. Move the +cursor to the left window, on the line that was deleted in the other window. +Now type this command: > + + dp + +The change will be removed by putting the text of the current window in the +other window. "dp" stands for "diff put". + You can also do it the other way around. Move the cursor to the right +window, to the line where "changed" was inserted. Now type this command: > + + do + +The change will now be removed by getting the text from the other window. +Since there are no changes left now, Vim puts all text in a closed fold. +"do" stands for "diff obtain". "dg" would have been better, but that already +has a different meaning ("dgg" deletes from the cursor until the first line). + +For details about diff mode, see |vimdiff|. + +============================================================================== +*08.8* Various + +The 'laststatus' option can be used to specify when the last window has a +statusline: + + 0 never + 1 only when there are split windows (the default) + 2 always + +Many commands that edit another file have a variant that splits the window. +For Command-line commands this is done by prepending an "s". For example: +":tag" jumps to a tag, ":stag" splits the window and jumps to a +tag. + For Normal mode commands a CTRL-W is prepended. CTRL-^ jumps to the +alternate file, CTRL-W CTRL-^ splits the window and edits the alternate file. + +The 'splitbelow' option can be set to make a new window appear below the +current window. The 'splitright' option can be set to make a vertically split +window appear right of the current window. + +When splitting a window you can prepend a modifier command to tell where the +window is to appear: + + :leftabove {cmd} left or above the current window + :aboveleft {cmd} idem + :rightbelow {cmd} right or below the current window + :belowright {cmd} idem + :topleft {cmd} at the top or left of the Vim window + :botright {cmd} at the bottom or right of the Vim window + + +============================================================================== +*08.9* Tab pages + +You will have noticed that windows never overlap. That means you quickly run +out of screen space. The solution for this is called Tab pages. + +Assume you are editing "thisfile". To create a new tab page use this command: > + + :tabedit thatfile + +This will edit the file "thatfile" in a window that occupies the whole Vim +window. And you will notice a bar at the top with the two file names: + + +----------------------------------+ + | thisfile | /thatfile/ __________X| (thatfile is bold) + |/* thatfile */ | + |that | + |that | + |~ | + |~ | + |~ | + | | + +----------------------------------+ + +You now have two tab pages. The first one has a window for "thisfile" and the +second one a window for "thatfile". It's like two pages that are on top of +eachother, with a tab sticking out of each page showing the file name. + +Now use the mouse to click on "thisfile" in the top line. The result is + + +----------------------------------+ + | /thisfile/ | thatfile __________X| (thisfile is bold) + |/* thisfile */ | + |this | + |this | + |~ | + |~ | + |~ | + | | + +----------------------------------+ + +Thus you can switch between tab pages by clicking on the label in the top +line. If you don't have a mouse or don't want to use it, you can use the "gt" +command. Mnemonic: Goto Tab. + +Now let's create another tab page with the command: > + + :tab split + +This makes a new tab page with one window that is editing the same buffer as +the window we were in: + + +-------------------------------------+ + | thisfile | /thisfile/ | thatfile __X| (thisfile is bold) + |/* thisfile */ | + |this | + |this | + |~ | + |~ | + |~ | + | | + +-------------------------------------+ + +You can put ":tab" before any Ex command that opens a window. The window will +be opened in a new tab page. Another example: > + + :tab help gt + +Will show the help text for "gt" in a new tab page. + +A few more things you can do with tab pages: + +- click with the mouse in the space after the last label + The next tab page will be selected, like with "gt". + +- click with the mouse on the "X" in the top right corner + The current tab page will be closed. Unless there are unsaved + changes in the current tab page. + +- double click with the mouse in the top line + A new tab page will be created. + +- the "tabonly" command + Closes all tab pages except the current one. Unless there are unsaved + changes in other tab pages. + +For more information about tab pages see |tab-page|. + +============================================================================== + +Next chapter: |usr_09.txt| Using the GUI + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_09.txt b/Aufgabe5/doc.lang/usr_09.txt new file mode 100644 index 0000000..fcfbcb6 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_09.txt @@ -0,0 +1,289 @@ +*usr_09.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Using the GUI + + +Vim works in an ordinary terminal. GVim can do the same things and a few +more. The GUI offers menus, a toolbar, scrollbars and other items. This +chapter is about these extra things that the GUI offers. + +|09.1| Parts of the GUI +|09.2| Using the mouse +|09.3| The clipboard +|09.4| Select mode + + Next chapter: |usr_10.txt| Making big changes + Previous chapter: |usr_08.txt| Splitting windows +Table of contents: |usr_toc.txt| + +============================================================================== +*09.1* Parts of the GUI + +You might have an icon on your desktop that starts gVim. Otherwise, one of +these commands should do it: > + + gvim file.txt + vim -g file.txt + +If this doesn't work you don't have a version of Vim with GUI support. You +will have to install one first. + Vim will open a window and display "file.txt" in it. What the window looks +like depends on the version of Vim. It should resemble the following picture +(for as far as this can be shown in ASCII!). + + +----------------------------------------------------+ + | file.txt + (~/dir) - VIM X | <- window title + +----------------------------------------------------+ + | File Edit Tools Syntax Buffers Window Help | <- menubar + +----------------------------------------------------+ + | aaa bbb ccc ddd eee fff ggg hhh iii jjj | <- toolbar + | aaa bbb ccc ddd eee fff ggg hhh iii jjj | + +----------------------------------------------------+ + | file text | ^ | + | ~ | # | + | ~ | # | <- scrollbar + | ~ | # | + | ~ | # | + | ~ | # | + | | V | + +----------------------------------------------------+ + +The largest space is occupied by the file text. This shows the file in the +same way as in a terminal. With some different colors and another font +perhaps. + + +THE WINDOW TITLE + +At the very top is the window title. This is drawn by your window system. +Vim will set the title to show the name of the current file. First comes the +name of the file. Then some special characters and the directory of the file +in parens. These special character can be present: + + - The file cannot be modified (e.g., a help file) + + The file contains changes + = The file is read-only + =+ The file is read-only, contains changes anyway + +If nothing is shown you have an ordinary, unchanged file. + + +THE MENUBAR + +You know how menus work, right? Vim has the usual items, plus a few more. +Browse them to get an idea of what you can use them for. A relevant submenu +is Edit/Global Settings. You will find these entries: + + Toggle Toolbar make the toolbar appear/disappear + Toggle Bottom Scrollbar make a scrollbar appear/disappear at the bottom + Toggle Left Scrollbar make a scrollbar appear/disappear at the left + Toggle Right Scrollbar make a scrollbar appear/disappear at the right + +On most systems you can tear-off the menus. Select the top item of the menu, +the one that looks like a dashed line. You will get a separate window with +the items of the menu. It will hang around until you close the window. + + +THE TOOLBAR + +This contains icons for the most often used actions. Hopefully the icons are +self-explanatory. There are tooltips to get an extra hint (move the mouse +pointer to the icon without clicking and don't move it for a second). + +The "Edit/Global Settings/Toggle Toolbar" menu item can be used to make the +toolbar disappear. If you never want a toolbar, use this command in your +vimrc file: > + + :set guioptions-=T + +This removes the 'T' flag from the 'guioptions' option. Other parts of the +GUI can also be enabled or disabled with this option. See the help for it. + + +THE SCROLLBARS + +By default there is one scrollbar on the right. It does the obvious thing. +When you split the window, each window will get its own scrollbar. + You can make a horizontal scrollbar appear with the menu item +Edit/Global Settings/Toggle Bottom Scrollbar. This is useful in diff mode, or +when the 'wrap' option has been reset (more about that later). + +When there are vertically split windows, only the windows on the right side +will have a scrollbar. However, when you move the cursor to a window on the +left, it will be this one the that scrollbar controls. This takes a bit of +time to get used to. + When you work with vertically split windows, consider adding a scrollbar on +the left. This can be done with a menu item, or with the 'guioptions' option: +> + :set guioptions+=l + +This adds the 'l' flag to 'guioptions'. + +============================================================================== +*09.2* Using the mouse + +Standards are wonderful. In Microsoft Windows, you can use the mouse to +select text in a standard manner. The X Window system also has a standard +system for using the mouse. Unfortunately, these two standards are not the +same. + Fortunately, you can customize Vim. You can make the behavior of the mouse +work like an X Window system mouse or a Microsoft Windows mouse. The following +command makes the mouse behave like an X Window mouse: > + + :behave xterm + +The following command makes the mouse work like a Microsoft Windows mouse: > + + :behave mswin + +The default behavior of the mouse on UNIX systems is xterm. The default +behavior on a Microsoft Windows system is selected during the installation +process. For details about what the two behaviors are, see |:behave|. Here +follows a summary. + + +XTERM MOUSE BEHAVIOR + +Left mouse click position the cursor +Left mouse drag select text in Visual mode +Middle mouse click paste text from the clipboard +Right mouse click extend the selected text until the mouse + pointer + + +MSWIN MOUSE BEHAVIOR + +Left mouse click position the cursor +Left mouse drag select text in Select mode (see |09.4|) +Left mouse click, with Shift extend the selected text until the mouse + pointer +Middle mouse click paste text from the clipboard +Right mouse click display a pop-up menu + + +The mouse can be further tuned. Check out these options if you want to change +the way how the mouse works: + + 'mouse' in which mode the mouse is used by Vim + 'mousemodel' what effect a mouse click has + 'mousetime' time between clicks for a double-click + 'mousehide' hide the mouse while typing + 'selectmode' whether the mouse starts Visual or Select mode + +============================================================================== +*09.3* The clipboard + +In section |04.7| the basic use of the clipboard was explained. There is one +essential thing to explain about X-windows: There are actually two places to +exchange text between programs. MS-Windows doesn't have this. + +In X-Windows there is the "current selection". This is the text that is +currently highlighted. In Vim this is the Visual area (this assumes you are +using the default option settings). You can paste this selection in another +application without any further action. + For example, in this text select a few words with the mouse. Vim will +switch to Visual mode and highlight the text. Now start another gVim, without +a file name argument, so that it displays an empty window. Click the middle +mouse button. The selected text will be inserted. + +The "current selection" will only remain valid until some other text is +selected. After doing the paste in the other gVim, now select some characters +in that window. You will notice that the words that were previously selected +in the other gVim window are displayed differently. This means that it no +longer is the current selection. + +You don't need to select text with the mouse, using the keyboard commands for +Visual mode works just as well. + + +THE REAL CLIPBOARD + +Now for the other place with which text can be exchanged. We call this the +"real clipboard", to avoid confusion. Often both the "current selection" and +the "real clipboard" are called clipboard, you'll have to get used to that. + To put text on the real clipboard, select a few different words in one of +the gVims you have running. Then use the Edit/Copy menu entry. Now the text +has been copied to the real clipboard. You can't see this, unless you have +some application that shows the clipboard contents (e.g., KDE's klipper). + Now select the other gVim, position the cursor somewhere and use the +Edit/Paste menu. You will see the text from the real clipboard is inserted. + + +USING BOTH + +This use of both the "current selection" and the "real clipboard" might sound +a bit confusing. But it is very useful. Let's show this with an example. +Use one gVim with a text file and perform these actions: + +- Select two words in Visual mode. +- Use the Edit/Copy menu to get these words onto the clipboard. +- Select one other word in Visual mode. +- Use the Edit/Paste menu item. What will happen is that the single selected + word is replaced with the two words from the clipboard. +- Move the mouse pointer somewhere else and click the middle button. You + will see that the word you just overwrote with the clipboard is inserted + here. + +If you use the "current selection" and the "real clipboard" with care, you can +do a lot of useful editing with them. + + +USING THE KEYBOARD + +If you don't like using the mouse, you can access the current selection and +the real clipboard with two registers. The "* register is for the current +selection. + To make text become the current selection, use Visual mode. For example, +to select a whole line just press "V". + To insert the current selection before the cursor: > + + "*P + +Notice the uppercase "P". The lowercase "p" puts the text after the cursor. + +The "+ register is used for the real clipboard. For example, to copy the text +from the cursor position until the end of the line to the clipboard: > + + "+y$ + +Remember, "y" is yank, which is Vim's copy command. + To insert the contents of the real clipboard before the cursor: > + + "+P + +It's the same as for the current selection, but uses the plus (+) register +instead of the star (*) register. + +============================================================================== +*09.4* Select mode + +And now something that is used more often on MS-Windows than on X-Windows. +But both can do it. You already know about Visual mode. Select mode is like +Visual mode, because it is also used to select text. But there is an obvious +difference: When typing text, the selected text is deleted and the typed text +replaces it. + +To start working with Select mode, you must first enable it (for MS-Windows +it is probably already enabled, but you can do this anyway): > + + :set selectmode+=mouse + +Now use the mouse to select some text. It is highlighted like in Visual mode. +Now press a letter. The selected text is deleted, and the single letter +replaces it. You are in Insert mode now, thus you can continue typing. + +Since typing normal text causes the selected text to be deleted, you can not +use the normal movement commands "hjkl", "w", etc. Instead, use the shifted +function keys. <S-Left> (shifted cursor left key) moves the cursor left. The +selected text is changed like in Visual mode. The other shifted cursor keys +do what you expect. <S-End> and <S-Home> also work. + +You can tune the way Select mode works with the 'selectmode' option. + +============================================================================== + +Next chapter: |usr_10.txt| Making big changes + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_10.txt b/Aufgabe5/doc.lang/usr_10.txt new file mode 100644 index 0000000..b094a72 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_10.txt @@ -0,0 +1,823 @@ +*usr_10.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Making big changes + + +In chapter 4 several ways to make small changes were explained. This chapter +goes into making changes that are repeated or can affect a large amount of +text. The Visual mode allows doing various things with blocks of text. Use +an external program to do really complicated things. + +|10.1| Record and playback commands +|10.2| Substitution +|10.3| Command ranges +|10.4| The global command +|10.5| Visual block mode +|10.6| Reading and writing part of a file +|10.7| Formatting text +|10.8| Changing case +|10.9| Using an external program + + Next chapter: |usr_11.txt| Recovering from a crash + Previous chapter: |usr_09.txt| Using the GUI +Table of contents: |usr_toc.txt| + +============================================================================== +*10.1* Record and playback commands + +The "." command repeats the preceding change. But what if you want to do +something more complex than a single change? That's where command recording +comes in. There are three steps: + +1. The "q{register}" command starts recording keystrokes into the register + named {register}. The register name must be between a and z. +2. Type your commands. +3. To finish recording, press q (without any extra character). + +You can now execute the macro by typing the command "@{register}". + +Take a look at how to use these commands in practice. You have a list of +filenames that look like this: + + stdio.h ~ + fcntl.h ~ + unistd.h ~ + stdlib.h ~ + +And what you want is the following: + + #include "stdio.h" ~ + #include "fcntl.h" ~ + #include "unistd.h" ~ + #include "stdlib.h" ~ + +You start by moving to the first character of the first line. Next you +execute the following commands: + + qa Start recording a macro in register a. + ^ Move to the beginning of the line. + i#include "<Esc> Insert the string #include " at the beginning + of the line. + $ Move to the end of the line. + a"<Esc> Append the character double quotation mark (") + to the end of the line. + j Go to the next line. + q Stop recording the macro. + +Now that you have done the work once, you can repeat the change by typing the +command "@a" three times. + The "@a" command can be preceded by a count, which will cause the macro to +be executed that number of times. In this case you would type: > + + 3@a + + +MOVE AND EXECUTE + +You might have the lines you want to change in various places. Just move the +cursor to each location and use the "@a" command. If you have done that once, +you can do it again with "@@". That's a bit easier to type. If you now +execute register b with "@b", the next "@@" will use register b. + If you compare the playback method with using ".", there are several +differences. First of all, "." can only repeat one change. As seen in the +example above, "@a" can do several changes, and move around as well. +Secondly, "." can only remember the last change. Executing a register allows +you to make any changes and then still use "@a" to replay the recorded +commands. Finally, you can use 26 different registers. Thus you can remember +26 different command sequences to execute. + + +USING REGISTERS + +The registers used for recording are the same ones you used for yank and +delete commands. This allows you to mix recording with other commands to +manipulate the registers. + Suppose you have recorded a few commands in register n. When you execute +this with "@n" you notice you did something wrong. You could try recording +again, but perhaps you will make another mistake. Instead, use this trick: + + G Go to the end of the file. + o<Esc> Create an empty line. + "np Put the text from the n register. You now see + the commands you typed as text in the file. + {edits} Change the commands that were wrong. This is + just like editing text. + 0 Go to the start of the line. + "ny$ Yank the corrected commands into the n + register. + dd Delete the scratch line. + +Now you can execute the corrected commands with "@n". (If your recorded +commands include line breaks, adjust the last two items in the example to +include all the lines.) + + +APPENDING TO A REGISTER + +So far we have used a lowercase letter for the register name. To append to a +register, use an uppercase letter. + Suppose you have recorded a command to change a word to register c. It +works properly, but you would like to add a search for the next word to +change. This can be done with: > + + qC/word<Enter>q + +You start with "qC", which records to the c register and appends. Thus +writing to an uppercase register name means to append to the register with +the same letter, but lowercase. + +This works both with recording and with yank and delete commands. For +example, you want to collect a sequence of lines into the a register. Yank +the first line with: > + + "aY + +Now move to the second line, and type: > + + "AY + +Repeat this command for all lines. The a register now contains all those +lines, in the order you yanked them. + +============================================================================== +*10.2* Substitution *find-replace* + +The ":substitute" command enables you to perform string replacements on a +whole range of lines. The general form of this command is as follows: > + + :[range]substitute/from/to/[flags] + +This command changes the "from" string to the "to" string in the lines +specified with [range]. For example, you can change "Professor" to "Teacher" +in all lines with the following command: > + + :%substitute/Professor/Teacher/ +< + Note: + The ":substitute" command is almost never spelled out completely. + Most of the time, people use the abbreviated version ":s". From here + on the abbreviation will be used. + +The "%" before the command specifies the command works on all lines. Without +a range, ":s" only works on the current line. More about ranges in the next +section |10.3|. + +By default, the ":substitute" command changes only the first occurrence on +each line. For example, the preceding command changes the line: + + Professor Smith criticized Professor Johnson today. ~ + +to: + + Teacher Smith criticized Professor Johnson today. ~ + +To change every occurrence on the line, you need to add the g (global) flag. +The command: > + + :%s/Professor/Teacher/g + +results in (starting with the original line): + + Teacher Smith criticized Teacher Johnson today. ~ + +Other flags include p (print), which causes the ":substitute" command to print +out each line it changes. The c (confirm) flag tells ":substitute" to ask you +for confirmation before it performs each substitution. Enter the following: > + + :%s/Professor/Teacher/c + +Vim finds the first occurrence of "Professor" and displays the text it is +about to change. You get the following prompt: > + + replace with Teacher (y/n/a/q/l/^E/^Y)? + +At this point, you must enter one of the following answers: + + y Yes; make this change. + n No; skip this match. + a All; make this change and all remaining ones without + further confirmation. + q Quit; don't make any more changes. + l Last; make this change and then quit. + CTRL-E Scroll the text one line up. + CTRL-Y Scroll the text one line down. + + +The "from" part of the substitute command is actually a pattern. The same +kind as used for the search command. For example, this command only +substitutes "the" when it appears at the start of a line: > + + :s/^the/these/ + +If you are substituting with a "from" or "to" part that includes a slash, you +need to put a backslash before it. A simpler way is to use another character +instead of the slash. A plus, for example: > + + :s+one/two+one or two+ + +============================================================================== +*10.3* Command ranges + +The ":substitute" command, and many other : commands, can be applied to a +selection of lines. This is called a range. + The simple form of a range is {number},{number}. For example: > + + :1,5s/this/that/g + +Executes the substitute command on the lines 1 to 5. Line 5 is included. +The range is always placed before the command. + +A single number can be used to address one specific line: > + + :54s/President/Fool/ + +Some commands work on the whole file when you do not specify a range. To make +them work on the current line the "." address is used. The ":write" command +works like that. Without a range, it writes the whole file. To make it write +only the current line into a file: > + + :.write otherfile + +The first line always has number one. How about the last line? The "$" +character is used for this. For example, to substitute in the lines from the +cursor to the end: > + + :.,$s/yes/no/ + +The "%" range that we used before, is actually a short way to say "1,$", from +the first to the last line. + + +USING A PATTERN IN A RANGE + +Suppose you are editing a chapter in a book, and want to replace all +occurrences of "grey" with "gray". But only in this chapter, not in the next +one. You know that only chapter boundaries have the word "Chapter" in the +first column. This command will work then: > + + :?^Chapter?,/^Chapter/s=grey=gray=g + +You can see a search pattern is used twice. The first "?^Chapter?" finds the +line above the current position that matches this pattern. Thus the ?pattern? +range is used to search backwards. Similarly, "/^Chapter/" is used to search +forward for the start of the next chapter. + To avoid confusion with the slashes, the "=" character was used in the +substitute command here. A slash or another character would have worked as +well. + + +ADD AND SUBTRACT + +There is a slight error in the above command: If the title of the next chapter +had included "grey" it would be replaced as well. Maybe that's what you +wanted, but what if you didn't? Then you can specify an offset. + To search for a pattern and then use the line above it: > + + /Chapter/-1 + +You can use any number instead of the 1. To address the second line below the +match: > + + /Chapter/+2 + +The offsets can also be used with the other items in a range. Look at this +one: > + + :.+3,$-5 + +This specifies the range that starts three lines below the cursor and ends +five lines before the last line in the file. + + +USING MARKS + +Instead of figuring out the line numbers of certain positions, remembering them +and typing them in a range, you can use marks. + Place the marks as mentioned in chapter 3. For example, use "mt" to mark +the top of an area and "mb" to mark the bottom. Then you can use this range +to specify the lines between the marks (including the lines with the marks): > + + :'t,'b + + +VISUAL MODE AND RANGES + +You can select text with Visual mode. If you then press ":" to start a colon +command, you will see this: > + + :'<,'> + +Now you can type the command and it will be applied to the range of lines that +was visually selected. + + Note: + When using Visual mode to select part of a line, or using CTRL-V to + select a block of text, the colon commands will still apply to whole + lines. This might change in a future version of Vim. + +The '< and '> are actually marks, placed at the start and end of the Visual +selection. The marks remain at their position until another Visual selection +is made. Thus you can use the "'<" command to jump to position where the +Visual area started. And you can mix the marks with other items: > + + :'>,$ + +This addresses the lines from the end of the Visual area to the end of the +file. + + +A NUMBER OF LINES + +When you know how many lines you want to change, you can type the number and +then ":". For example, when you type "5:", you will get: > + + :.,.+4 + +Now you can type the command you want to use. It will use the range "." +(current line) until ".+4" (four lines down). Thus it spans five lines. + +============================================================================== +*10.4* The global command + +The ":global" command is one of the more powerful features of Vim. It allows +you to find a match for a pattern and execute a command there. The general +form is: > + + :[range]global/{pattern}/{command} + +This is similar to the ":substitute" command. But, instead of replacing the +matched text with other text, the command {command} is executed. + + Note: + The command executed for ":global" must be one that starts with a + colon. Normal mode commands can not be used directly. The |:normal| + command can do this for you. + +Suppose you want to change "foobar" to "barfoo", but only in C++ style +comments. These comments start with "//". Use this command: > + + :g+//+s/foobar/barfoo/g + +This starts with ":g". That is short for ":global", just like ":s" is short +for ":substitute". Then the pattern, enclosed in plus characters. Since the +pattern we are looking for contains a slash, this uses the plus character to +separate the pattern. Next comes the substitute command that changes "foobar" +into "barfoo". + The default range for the global command is the whole file. Thus no range +was specified in this example. This is different from ":substitute", which +works on one line without a range. + The command isn't perfect, since it also matches lines where "//" appears +halfway a line, and the substitution will also take place before the "//". + +Just like with ":substitute", any pattern can be used. When you learn more +complicated patterns later, you can use them here. + +============================================================================== +*10.5* Visual block mode + +With CTRL-V you can start selection of a rectangular area of text. There are +a few commands that do something special with the text block. + +There is something special about using the "$" command in Visual block mode. +When the last motion command used was "$", all lines in the Visual selection +will extend until the end of the line, also when the line with the cursor is +shorter. This remains effective until you use a motion command that moves the +cursor horizontally. Thus using "j" keeps it, "h" stops it. + + +INSERTING TEXT + +The command "I{string}<Esc>" inserts the text {string} in each line, just +left of the visual block. You start by pressing CTRL-V to enter visual block +mode. Now you move the cursor to define your block. Next you type I to enter +Insert mode, followed by the text to insert. As you type, the text appears on +the first line only. + After you press <Esc> to end the insert, the text will magically be +inserted in the rest of the lines contained in the visual selection. Example: + + include one ~ + include two ~ + include three ~ + include four ~ + +Move the cursor to the "o" of "one" and press CTRL-V. Move it down with "3j" +to "four". You now have a block selection that spans four lines. Now type: > + + Imain.<Esc> + +The result: + + include main.one ~ + include main.two ~ + include main.three ~ + include main.four ~ + +If the block spans short lines that do not extend into the block, the text is +not inserted in that line. For example, make a Visual block selection that +includes the word "long" in the first and last line of this text, and thus has +no text selected in the second line: + + This is a long line ~ + short ~ + Any other long line ~ + + ^^^^ selected block + +Now use the command "Ivery <Esc>". The result is: + + This is a very long line ~ + short ~ + Any other very long line ~ + +In the short line no text was inserted. + +If the string you insert contains a newline, the "I" acts just like a Normal +insert command and affects only the first line of the block. + +The "A" command works the same way, except that it appends after the right +side of the block. And it does insert text in a short line. Thus you can +make a choice whether you do or don't want to append text to a short line. + There is one special case for "A": Select a Visual block and then use "$" +to make the block extend to the end of each line. Using "A" now will append +the text to the end of each line. + Using the same example from above, and then typing "$A XXX<Esc>, you get +this result: + + This is a long line XXX ~ + short XXX ~ + Any other long line XXX ~ + +This really requires using the "$" command. Vim remembers that it was used. +Making the same selection by moving the cursor to the end of the longest line +with other movement commands will not have the same result. + + +CHANGING TEXT + +The Visual block "c" command deletes the block and then throws you into Insert +mode to enable you to type in a string. The string will be inserted in each +line in the block. + Starting with the same selection of the "long" words as above, then typing +"c_LONG_<Esc>", you get this: + + This is a _LONG_ line ~ + short ~ + Any other _LONG_ line ~ + +Just like with "I" the short line is not changed. Also, you can't enter a +newline in the new text. + +The "C" command deletes text from the left edge of the block to the end of +line. It then puts you in Insert mode so that you can type in a string, +which is added to the end of each line. + Starting with the same text again, and typing "Cnew text<Esc>" you get: + + This is a new text ~ + short ~ + Any other new text ~ + +Notice that, even though only the "long" word was selected, the text after it +is deleted as well. Thus only the location of the left edge of the visual +block really matters. + Again, short lines that do not reach into the block are excluded. + +Other commands that change the characters in the block: + + ~ swap case (a -> A and A -> a) + U make uppercase (a -> A and A -> A) + u make lowercase (a -> a and A -> a) + + +FILLING WITH A CHARACTER + +To fill the whole block with one character, use the "r" command. Again, +starting with the same example text from above, and then typing "rx": + + This is a xxxx line ~ + short ~ + Any other xxxx line ~ + + + Note: + If you want to include characters beyond the end of the line in the + block, check out the 'virtualedit' feature in chapter 25. + + +SHIFTING + +The command ">" shifts the selected text to the right one shift amount, +inserting whitespace. The starting point for this shift is the left edge of +the visual block. + With the same example again, ">" gives this result: + + This is a long line ~ + short ~ + Any other long line ~ + +The shift amount is specified with the 'shiftwidth' option. To change it to +use 4 spaces: > + + :set shiftwidth=4 + +The "<" command removes one shift amount of whitespace at the left +edge of the block. This command is limited by the amount of text that is +there; so if there is less than a shift amount of whitespace available, it +removes what it can. + + +JOINING LINES + +The "J" command joins all selected lines together into one line. Thus it +removes the line breaks. Actually, the line break, leading white space and +trailing white space is replaced by one space. Two spaces are used after a +line ending (that can be changed with the 'joinspaces' option). + Let's use the example that we got so familiar with now. The result of +using the "J" command: + + This is a long line short Any other long line ~ + +The "J" command doesn't require a blockwise selection. It works with "v" and +"V" selection in exactly the same way. + +If you don't want the white space to be changed, use the "gJ" command. + +============================================================================== +*10.6* Reading and writing part of a file + +When you are writing an e-mail message, you may want to include another file. +This can be done with the ":read {filename}" command. The text of the file is +put below the cursor line. + Starting with this text: + + Hi John, ~ + Here is the diff that fixes the bug: ~ + Bye, Pierre. ~ + +Move the cursor to the second line and type: > + + :read patch + +The file named "patch" will be inserted, with this result: + + Hi John, ~ + Here is the diff that fixes the bug: ~ + 2c2 ~ + < for (i = 0; i <= length; ++i) ~ + --- ~ + > for (i = 0; i < length; ++i) ~ + Bye, Pierre. ~ + +The ":read" command accepts a range. The file will be put below the last line +number of this range. Thus ":$r patch" appends the file "patch" at the end of +the file. + What if you want to read the file above the first line? This can be done +with the line number zero. This line doesn't really exist, you will get an +error message when using it with most commands. But this command is allowed: +> + :0read patch + +The file "patch" will be put above the first line of the file. + + +WRITING A RANGE OF LINES + +To write a range of lines to a file, the ":write" command can be used. +Without a range it writes the whole file. With a range only the specified +lines are written: > + + :.,$write tempo + +This writes the lines from the cursor until the end of the file into the file +"tempo". If this file already exists you will get an error message. Vim +protects you from accidentally overwriting an existing file. If you know what +you are doing and want to overwrite the file, append !: > + + :.,$write! tempo + +CAREFUL: The ! must follow the ":write" command immediately, without white +space. Otherwise it becomes a filter command, which is explained later in +this chapter. + + +APPENDING TO A FILE + +In the first section of this chapter was explained how to collect a number of +lines into a register. The same can be done to collect lines in a file. +Write the first line with this command: > + + :.write collection + +Now move the cursor to the second line you want to collect, and type this: > + + :.write >>collection + +The ">>" tells Vim the "collection" file is not to be written as a new file, +but the line must be appended at the end. You can repeat this as many times +as you like. + +============================================================================== +*10.7* Formatting text + +When you are typing plain text, it's nice if the length of each line is +automatically trimmed to fit in the window. To make this happen while +inserting text, set the 'textwidth' option: > + + :set textwidth=72 + +You might remember that in the example vimrc file this command was used for +every text file. Thus if you are using that vimrc file, you were already +using it. To check the current value of 'textwidth': > + + :set textwidth + +Now lines will be broken to take only up to 72 characters. But when you +insert text halfway a line, or when you delete a few words, the lines will get +too long or too short. Vim doesn't automatically reformat the text. + To tell Vim to format the current paragraph: > + + gqap + +This starts with the "gq" command, which is an operator. Following is "ap", +the text object that stands for "a paragraph". A paragraph is separated from +the next paragraph by an empty line. + + Note: + A blank line, which contains white space, does NOT separate + paragraphs. This is hard to notice! + +Instead of "ap" you could use any motion or text object. If your paragraphs +are properly separated, you can use this command to format the whole file: > + + gggqG + +"gg" takes you to the first line, "gq" is the format operator and "G" the +motion that jumps to the last line. + +In case your paragraphs aren't clearly defined, you can format just the lines +you manually select. Move the cursor to the first line you want to format. +Start with the command "gqj". This formats the current line and the one below +it. If the first line was short, words from the next line will be appended. +If it was too long, words will be moved to the next line. The cursor moves to +the second line. Now you can use "." to repeat the command. Keep doing this +until you are at the end of the text you want to format. + +============================================================================== +*10.8* Changing case + +You have text with section headers in lowercase. You want to make the word +"section" all uppercase. Do this with the "gU" operator. Start with the +cursor in the first column: > + + gUw +< section header ----> SECTION header + +The "gu" operator does exactly the opposite: > + + guw +< SECTION header ----> section header + +You can also use "g~" to swap case. All these are operators, thus they work +with any motion command, with text objects and in Visual mode. + To make an operator work on lines you double it. The delete operator is +"d", thus to delete a line you use "dd". Similarly, "gugu" makes a whole line +lowercase. This can be shortened to "guu". "gUgU" is shortened to "gUU" and +"g~g~" to "g~~". Example: > + + g~~ +< Some GIRLS have Fun ----> sOME girls HAVE fUN ~ + +============================================================================== +*10.9* Using an external program + +Vim has a very powerful set of commands, it can do anything. But there may +still be something that an external command can do better or faster. + The command "!{motion}{program}" takes a block of text and filters it +through an external program. In other words, it runs the system command +represented by {program}, giving it the block of text represented by {motion} +as input. The output of this command then replaces the selected block. + Because this summarizes badly if you are unfamiliar with UNIX filters, take +a look at an example. The sort command sorts a file. If you execute the +following command, the unsorted file input.txt will be sorted and written to +output.txt. (This works on both UNIX and Microsoft Windows.) > + + sort <input.txt >output.txt + +Now do the same thing in Vim. You want to sort lines 1 through 5 of a file. +You start by putting the cursor on line 1. Next you execute the following +command: > + + !5G + +The "!" tells Vim that you are performing a filter operation. The Vim editor +expects a motion command to follow, indicating which part of the file to +filter. The "5G" command tells Vim to go to line 5, so it now knows that it +is to filter lines 1 (the current line) through 5. + In anticipation of the filtering, the cursor drops to the bottom of the +screen and a ! prompt displays. You can now type in the name of the filter +program, in this case "sort". Therefore, your full command is as follows: > + + !5Gsort<Enter> + +The result is that the sort program is run on the first 5 lines. The output +of the program replaces these lines. + + line 55 line 11 + line 33 line 22 + line 11 --> line 33 + line 22 line 44 + line 44 line 55 + last line last line + +The "!!" command filters the current line through a filter. In Unix the "date" +command prints the current time and date. "!!date<Enter>" replaces the current +line with the output of "date". This is useful to add a timestamp to a file. + + +WHEN IT DOESN'T WORK + +Starting a shell, sending it text and capturing the output requires that Vim +knows how the shell works exactly. When you have problems with filtering, +check the values of these options: + + 'shell' specifies the program that Vim uses to execute + external programs. + 'shellcmdflag' argument to pass a command to the shell + 'shellquote' quote to be used around the command + 'shellxquote' quote to be used around the command and redirection + 'shelltype' kind of shell (only for the Amiga) + 'shellslash' use forward slashes in the command (only for + MS-Windows and alikes) + 'shellredir' string used to write the command output into a file + +On Unix this is hardly ever a problem, because there are two kinds of shells: +"sh" like and "csh" like. Vim checks the 'shell' option and sets related +options automatically, depending on whether it sees "csh" somewhere in +'shell'. + On MS-Windows, however, there are many different shells and you might have +to tune the options to make filtering work. Check the help for the options +for more information. + + +READING COMMAND OUTPUT + +To read the contents of the current directory into the file, use this: + +on Unix: > + :read !ls +on MS-Windows: > + :read !dir + +The output of the "ls" or "dir" command is captured and inserted in the text, +below the cursor. This is similar to reading a file, except that the "!" is +used to tell Vim that a command follows. + The command may have arguments. And a range can be used to tell where Vim +should put the lines: > + + :0read !date -u + +This inserts the current time and date in UTC format at the top of the file. +(Well, if you have a date command that accepts the "-u" argument.) Note the +difference with using "!!date": that replaced a line, while ":read !date" will +insert a line. + + +WRITING TEXT TO A COMMAND + +The Unix command "wc" counts words. To count the words in the current file: > + + :write !wc + +This is the same write command as before, but instead of a file name the "!" +character is used and the name of an external command. The written text will +be passed to the specified command as its standard input. The output could +look like this: + + 4 47 249 ~ + +The "wc" command isn't verbose. This means you have 4 lines, 47 words and 249 +characters. + +Watch out for this mistake: > + + :write! wc + +This will write the file "wc" in the current directory, with force. White +space is important here! + + +REDRAWING THE SCREEN + +If the external command produced an error message, the display may have been +messed up. Vim is very efficient and only redraws those parts of the screen +that it knows need redrawing. But it can't know about what another program +has written. To tell Vim to redraw the screen: > + + CTRL-L + +============================================================================== + +Next chapter: |usr_11.txt| Recovering from a crash + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_11.txt b/Aufgabe5/doc.lang/usr_11.txt new file mode 100644 index 0000000..01e3155 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_11.txt @@ -0,0 +1,287 @@ +*usr_11.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Recovering from a crash + + +Did your computer crash? And you just spent hours editing? Don't panic! Vim +keeps enough information on harddisk to be able to restore most of your work. +This chapter shows you how to get your work back and explains how the swap +file is used. + +|11.1| Basic recovery +|11.2| Where is the swap file? +|11.3| Crashed or not? +|11.4| Further reading + + Next chapter: |usr_12.txt| Clever tricks + Previous chapter: |usr_10.txt| Making big changes +Table of contents: |usr_toc.txt| + +============================================================================== +*11.1* Basic recovery + +In most cases recovering a file is quite simple, assuming you know which file +you were editing (and the harddisk is still working). Start Vim on the file, +with the "-r" argument added: > + + vim -r help.txt + +Vim will read the swap file (used to store text you were editing) and may read +bits and pieces of the original file. If all is well, you will see these +messages (with different file names, of course): + + Using swap file ".help.txt.swp" ~ + Original file "~/vim/runtime/doc/help.txt" ~ + Recovery completed. You should check if everything is OK. ~ + (You might want to write out this file under another name ~ + and run diff with the original file to check for changes) ~ + Delete the .swp file afterwards. ~ + +To be on the safe side, write this file under another name: > + + :write help.txt.recovered + +Compare the file with the original file to check if you ended up with what you +expected. Vimdiff is very useful for this |08.7|. Watch out for the original +file to contain a more recent version (you saved the file just before the +computer crashed). And check that no lines are missing (something went wrong +that Vim could not recover). + If Vim produces warning messages when recovering, read them carefully. +This is rare though. + +It's normal that the last few changes can not be recovered. Vim flushes the +changes to disk when you don't type for about four seconds, or after typing +about two hundred characters. This is set with the 'updatetime' and +'updatecount' options. Thus when Vim didn't get a chance to save itself when +the system went down, the changes after the last flush will be lost. + +If you were editing without a file name, give an empty string as argument: > + + vim -r "" + +You must be in the right directory, otherwise Vim can't find the swap file. + +============================================================================== +*11.2* Where is the swap file? + +Vim can store the swap file in several places. Normally it is in the same +directory as the original file. To find it, change to the directory of the +file, and use: > + + vim -r + +Vim will list the swap files that it can find. It will also look in other +directories where the swap file for files in the current directory may be +located. It will not find swap files in any other directories though, it +doesn't search the directory tree. + The output could look like this: + + Swap files found: ~ + In current directory: ~ + 1. .main.c.swp ~ + owned by: mool dated: Tue May 29 21:00:25 2001 ~ + file name: ~mool/vim/vim6/src/main.c ~ + modified: YES ~ + user name: mool host name: masaka.moolenaar.net ~ + process ID: 12525 ~ + In directory ~/tmp: ~ + -- none -- ~ + In directory /var/tmp: ~ + -- none -- ~ + In directory /tmp: ~ + -- none -- ~ + +If there are several swap files that look like they may be the one you want to +use, a list is given of these swap files and you are requested to enter the +number of the one you want to use. Carefully look at the dates to decide +which one you want to use. + In case you don't know which one to use, just try them one by one and check +the resulting files if they are what you expected. + + +USING A SPECIFIC SWAP FILE + +If you know which swap file needs to be used, you can recover by giving the +swap file name. Vim will then finds out the name of the original file from +the swap file. + +Example: > + vim -r .help.txt.swo + +This is also handy when the swap file is in another directory than expected. +If this still does not work, see what file names Vim reports and rename the +files accordingly. Check the 'directory' option to see where Vim may have +put the swap file. + + Note: + Vim tries to find the swap file by searching the directories in the + 'dir' option, looking for files that match "filename.sw?". If + wildcard expansion doesn't work (e.g., when the 'shell' option is + invalid), Vim does a desperate try to find the file "filename.swp". + If that fails too, you will have to give the name of the swapfile + itself to be able to recover the file. + +============================================================================== +*11.3* Crashed or not? *ATTENTION* *E325* + +Vim tries to protect you from doing stupid things. Suppose you innocently +start editing a file, expecting the contents of the file to show up. Instead, +Vim produces a very long message: + + E325: ATTENTION ~ + Found a swap file by the name ".main.c.swp" ~ + owned by: mool dated: Tue May 29 21:09:28 2001 ~ + file name: ~mool/vim/vim6/src/main.c ~ + modified: no ~ + user name: mool host name: masaka.moolenaar.net ~ + process ID: 12559 (still running) ~ + While opening file "main.c" ~ + dated: Tue May 29 19:46:12 2001 ~ + ~ + (1) Another program may be editing the same file. ~ + If this is the case, be careful not to end up with two ~ + different instances of the same file when making changes. ~ + Quit, or continue with caution. ~ + ~ + (2) An edit session for this file crashed. ~ + If this is the case, use ":recover" or "vim -r main.c" ~ + to recover the changes (see ":help recovery"). ~ + If you did this already, delete the swap file ".main.c.swp" ~ + to avoid this message. ~ + +You get this message, because, when starting to edit a file, Vim checks if a +swap file already exists for that file. If there is one, there must be +something wrong. It may be one of these two situations. + +1. Another edit session is active on this file. Look in the message for the + line with "process ID". It might look like this: + + process ID: 12559 (still running) ~ + + The text "(still running)" indicates that the process editing this file + runs on the same computer. When working on a non-Unix system you will not + get this extra hint. When editing a file over a network, you may not see + the hint, because the process might be running on another computer. In + those two cases you must find out what the situation is yourself. + If there is another Vim editing the same file, continuing to edit will + result in two versions of the same file. The one that is written last will + overwrite the other one, resulting in loss of changes. You better quit + this Vim. + +2. The swap file might be the result from a previous crash of Vim or the + computer. Check the dates mentioned in the message. If the date of the + swap file is newer than the file you were editing, and this line appears: + + modified: YES ~ + + Then you very likely have a crashed edit session that is worth recovering. + If the date of the file is newer than the date of the swap file, then + either it was changed after the crash (perhaps you recovered it earlier, + but didn't delete the swap file?), or else the file was saved before the + crash but after the last write of the swap file (then you're lucky: you + don't even need that old swap file). Vim will warn you for this with this + extra line: + + NEWER than swap file! ~ + + +UNREADABLE SWAP FILE + +Sometimes the line + + [cannot be read] ~ + +will appear under the name of the swap file. This can be good or bad, +depending on circumstances. + +It is good if a previous editing session crashed without having made any +changes to the file. Then a directory listing of the swap file will show +that it has zero bytes. You may delete it and proceed. + +It is slightly bad if you don't have read permission for the swap file. You +may want to view the file read-only, or quit. On multi-user systems, if you +yourself did the last changes under a different login name, a logout +followed by a login under that other name might cure the "read error". Or +else you might want to find out who last edited (or is editing) the file and +have a talk with them. + +It is very bad if it means there is a physical read error on the disk +containing the swap file. Fortunately, this almost never happens. +You may want to view the file read-only at first (if you can), to see the +extent of the changes that were "forgotten". If you are the one in charge of +that file, be prepared to redo your last changes. + + +WHAT TO DO? + +If dialogs are supported you will be asked to select one of five choices: + + Swap file ".main.c.swp" already exists! ~ + [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort, (D)elete it: ~ + +O Open the file readonly. Use this when you just want to view the file and + don't need to recover it. You might want to use this when you know someone + else is editing the file, but you just want to look in it and not make + changes. + +E Edit the file anyway. Use this with caution! If the file is being edited + in another Vim, you might end up with two versions of the file. Vim will + try to warn you when this happens, but better be safe then sorry. + +R Recover the file from the swap file. Use this if you know that the swap + file contains changes that you want to recover. + +Q Quit. This avoids starting to edit the file. Use this if there is another + Vim editing the same file. + When you just started Vim, this will exit Vim. When starting Vim with + files in several windows, Vim quits only if there is a swap file for the + first one. When using an edit command, the file will not be loaded and you + are taken back to the previously edited file. + +A Abort. Like Quit, but also abort further commands. This is useful when + loading a script that edits several files, such as a session with multiple + windows. + +D Delete the swap file. Use this when you are sure you no longer need it. + For example, when it doesn't contain changes, or when the file itself is + newer than the swap file. + On Unix this choice is only offered when the process that created the + swap file does not appear to be running. + +If you do not get the dialog (you are running a version of Vim that does not +support it), you will have to do it manually. To recover the file, use this +command: > + + :recover + + +Vim cannot always detect that a swap file already exists for a file. This is +the case when the other edit session puts the swap files in another directory +or when the path name for the file is different when editing it on different +machines. Therefore, don't rely on Vim always warning you. + +If you really don't want to see this message, you can add the 'A' flag to the +'shortmess' option. But it's very unusual that you need this. + +============================================================================== +*11.4* Further reading + +|swap-file| An explanation about where the swap file will be created and + what its name is. +|:preserve| Manually flushing the swap file to disk. +|:swapname| See the name of the swap file for the current file. +'updatecount' Number of key strokes after which the swap file is flushed to + disk. +'updatetime' Timeout after which the swap file is flushed to disk. +'swapsync' Whether the disk is synced when the swap file is flushed. +'directory' List of directory names where to store the swap file. +'maxmem' Limit for memory usage before writing text to the swap file. +'maxmemtot' Same, but for all files in total. + +============================================================================== + +Next chapter: |usr_12.txt| Clever tricks + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_12.txt b/Aufgabe5/doc.lang/usr_12.txt new file mode 100644 index 0000000..1e2ee24 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_12.txt @@ -0,0 +1,358 @@ +*usr_12.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Clever tricks + + +By combining several commands you can make Vim do nearly everything. In this +chapter a number of useful combinations will be presented. This uses the +commands introduced in the previous chapters and a few more. + +|12.1| Replace a word +|12.2| Change "Last, First" to "First Last" +|12.3| Sort a list +|12.4| Reverse line order +|12.5| Count words +|12.6| Find a man page +|12.7| Trim blanks +|12.8| Find where a word is used + + Next chapter: |usr_20.txt| Typing command-line commands quickly + Previous chapter: |usr_11.txt| Recovering from a crash +Table of contents: |usr_toc.txt| + +============================================================================== +*12.1* Replace a word + +The substitute command can be used to replace all occurrences of a word with +another word: > + + :%s/four/4/g + +The "%" range means to replace in all lines. The "g" flag at the end causes +all words in a line to be replaced. + This will not do the right thing if your file also contains "thirtyfour". +It would be replaced with "thirty4". To avoid this, use the "\<" item to +match the start of a word: > + + :%s/\<four/4/g + +Obviously, this still goes wrong on "fourty". Use "\>" to match the end of a +word: > + + :%s/\<four\>/4/g + +If you are programming, you might want to replace "four" in comments, but not +in the code. Since this is difficult to specify, add the "c" flag to have the +substitute command prompt you for each replacement: > + + + :%s/\<four\>/4/gc + + +REPLACING IN SEVERAL FILES + +Suppose you want to replace a word in more than one file. You could edit each +file and type the command manually. It's a lot faster to use record and +playback. + Let's assume you have a directory with C++ files, all ending in ".cpp". +There is a function called "GetResp" that you want to rename to "GetAnswer". + + vim *.cpp Start Vim, defining the argument list to + contain all the C++ files. You are now in the + first file. + qq Start recording into the q register + :%s/\<GetResp\>/GetAnswer/g + Do the replacements in the first file. + :wnext Write this file and move to the next one. + q Stop recording. + @q Execute the q register. This will replay the + substitution and ":wnext". You can verify + that this doesn't produce an error message. + 999@q Execute the q register on the remaining files. + +At the last file you will get an error message, because ":wnext" cannot move +to the next file. This stops the execution, and everything is done. + + Note: + When playing back a recorded sequence, an error stops the execution. + Therefore, make sure you don't get an error message when recording. + +There is one catch: If one of the .cpp files does not contain the word +"GetResp", you will get an error and replacing will stop. To avoid this, add +the "e" flag to the substitute command: > + + :%s/\<GetResp\>/GetAnswer/ge + +The "e" flag tells ":substitute" that not finding a match is not an error. + +============================================================================== +*12.2* Change "Last, First" to "First Last" + +You have a list of names in this form: + + Doe, John ~ + Smith, Peter ~ + +You want to change that to: + + John Doe ~ + Peter Smith ~ + +This can be done with just one command: > + + :%s/\([^,]*\), \(.*\)/\2 \1/ + +Let's break this down in parts. Obviously it starts with a substitute +command. The "%" is the line range, which stands for the whole file. Thus +the substitution is done in every line in the file. + The arguments for the substitute command are "/from/to/". The slashes +separate the "from" pattern and the "to" string. This is what the "from" +pattern contains: + \([^,]*\), \(.*\) ~ + + The first part between \( \) matches "Last" \( \) + match anything but a comma [^,] + any number of times * + matches ", " literally , + The second part between \( \) matches "First" \( \) + any character . + any number of times * + +In the "to" part we have "\2" and "\1". These are called backreferences. +They refer to the text matched by the "\( \)" parts in the pattern. "\2" +refers to the text matched by the second "\( \)", which is the "First" name. +"\1" refers to the first "\( \)", which is the "Last" name. + You can use up to nine backreferences in the "to" part of a substitute +command. "\0" stands for the whole matched pattern. There are a few more +special items in a substitute command, see |sub-replace-special|. + +============================================================================== +*12.3* Sort a list + +In a Makefile you often have a list of files. For example: + + OBJS = \ ~ + version.o \ ~ + pch.o \ ~ + getopt.o \ ~ + util.o \ ~ + getopt1.o \ ~ + inp.o \ ~ + patch.o \ ~ + backup.o ~ + +To sort this list, filter the text through the external sort command: > + + /^OBJS + j + :.,/^$/-1!sort + +This goes to the first line, where "OBJS" is the first thing in the line. +Then it goes one line down and filters the lines until the next empty line. +You could also select the lines in Visual mode and then use "!sort". That's +easier to type, but more work when there are many lines. + The result is this: + + OBJS = \ ~ + backup.o ~ + getopt.o \ ~ + getopt1.o \ ~ + inp.o \ ~ + patch.o \ ~ + pch.o \ ~ + util.o \ ~ + version.o \ ~ + + +Notice that a backslash at the end of each line is used to indicate the line +continues. After sorting, this is wrong! The "backup.o" line that was at +the end didn't have a backslash. Now that it sorts to another place, it +must have a backslash. + The simplest solution is to add the backslash with "A \<Esc>". You can +keep the backslash in the last line, if you make sure an empty line comes +after it. That way you don't have this problem again. + +============================================================================== +*12.4* Reverse line order + +The |:global| command can be combined with the |:move| command to move all the +lines before the first line, resulting in a reversed file. The command is: > + + :global/^/m 0 + +Abbreviated: > + + :g/^/m 0 + +The "^" regular expression matches the beginning of the line (even if the line +is blank). The |:move| command moves the matching line to after the mythical +zeroth line, so the current matching line becomes the first line of the file. +As the |:global| command is not confused by the changing line numbering, +|:global| proceeds to match all remaining lines of the file and puts each as +the first. + +This also works on a range of lines. First move to above the first line and +mark it with "mt". Then move the cursor to the last line in the range and +type: > + + :'t+1,.g/^/m 't + +============================================================================== +*12.5* Count words + +Sometimes you have to write a text with a maximum number of words. Vim can +count the words for you. + When the whole file is what you want to count the words in, use this +command: > + + g CTRL-G + +Do not type a space after the g, this is just used here to make the command +easy to read. + The output looks like this: + + Col 1 of 0; Line 141 of 157; Word 748 of 774; Byte 4489 of 4976 ~ + +You can see on which word you are (748), and the total number of words in the +file (774). + +When the text is only part of a file, you could move to the start of the text, +type "g CTRL-G", move to the end of the text, type "g CTRL-G" again, and then +use your brain to compute the difference in the word position. That's a good +exercise, but there is an easier way. With Visual mode, select the text you +want to count words in. Then type g CTRL-G. The result: + + Selected 5 of 293 Lines; 70 of 1884 Words; 359 of 10928 Bytes ~ + +For other ways to count words, lines and other items, see |count-items|. + +============================================================================== +*12.6* Find a man page *find-manpage* + +While editing a shell script or C program, you are using a command or function +that you want to find the man page for (this is on Unix). Let's first use a +simple way: Move the cursor to the word you want to find help on and press > + + K + +Vim will run the external "man" program on the word. If the man page is +found, it is displayed. This uses the normal pager to scroll through the text +(mostly the "more" program). When you get to the end pressing <Enter> will +get you back into Vim. + +A disadvantage is that you can't see the man page and the text you are working +on at the same time. There is a trick to make the man page appear in a Vim +window. First, load the man filetype plugin: > + + :runtime! ftplugin/man.vim + +Put this command in your vimrc file if you intend to do this often. Now you +can use the ":Man" command to open a window on a man page: > + + :Man csh + +You can scroll around and the text is highlighted. This allows you to find +the help you were looking for. Use CTRL-W w to jump to the window with the +text you were working on. + To find a man page in a specific section, put the section number first. +For example, to look in section 3 for "echo": > + + :Man 3 echo + +To jump to another man page, which is in the text with the typical form +"word(1)", press CTRL-] on it. Further ":Man" commands will use the same +window. + +To display a man page for the word under the cursor, use this: > + + \K + +(If you redefined the <Leader>, use it instead of the backslash). +For example, you want to know the return value of "strstr()" while editing +this line: + + if ( strstr (input, "aap") == ) ~ + +Move the cursor to somewhere on "strstr" and type "\K". A window will open +to display the man page for strstr(). + +============================================================================== +*12.7* Trim blanks + +Some people find spaces and tabs at the end of a line useless, wasteful, and +ugly. To remove whitespace at the end of every line, execute the following +command: > + + :%s/\s\+$// + +The line range "%" is used, thus this works on the whole file. The pattern +that the ":substitute" command matches with is "\s\+$". This finds white +space characters (\s), 1 or more of them (\+), before the end-of-line ($). +Later will be explained how you write patterns like this |usr_27.txt|. + The "to" part of the substitute command is empty: "//". Thus it replaces +with nothing, effectively deleting the matched white space. + +Another wasteful use of spaces is placing them before a Tab. Often these can +be deleted without changing the amount of white space. But not always! +Therefore, you can best do this manually. Use this search command: > + + / + +You cannot see it, but there is a space before a tab in this command. Thus +it's "/<Space><Tab>". Now use "x" to delete the space and check that the +amount of white space doesn't change. You might have to insert a Tab if it +does change. Type "n" to find the next match. Repeat this until no more +matches can be found. + +============================================================================== +*12.8* Find where a word is used + +If you are a UNIX user, you can use a combination of Vim and the grep command +to edit all the files that contain a given word. This is extremely useful if +you are working on a program and want to view or edit all the files that +contain a specific variable. + For example, suppose you want to edit all the C program files that contain +the word "frame_counter". To do this you use the command: > + + vim `grep -l frame_counter *.c` + +Let's look at this command in detail. The grep command searches through a set +of files for a given word. Because the -l argument is specified, the command +will only list the files containing the word and not print the matching lines. +The word it is searching for is "frame_counter". Actually, this can be any +regular expression. (Note: What grep uses for regular expressions is not +exactly the same as what Vim uses.) + The entire command is enclosed in backticks (`). This tells the UNIX shell +to run this command and pretend that the results were typed on the command +line. So what happens is that the grep command is run and produces a list of +files, these files are put on the Vim command line. This results in Vim +editing the file list that is the output of grep. You can then use commands +like ":next" and ":first" to browse through the files. + + +FINDING EACH LINE + +The above command only finds the files in which the word is found. You still +have to find the word within the files. + Vim has a built-in command that you can use to search a set of files for a +given string. If you want to find all occurrences of "error_string" in all C +program files, for example, enter the following command: > + + :grep error_string *.c + +This causes Vim to search for the string "error_string" in all the specified +files (*.c). The editor will now open the first file where a match is found +and position the cursor on the first matching line. To go to the next +matching line (no matter in what file it is), use the ":cnext" command. To go +to the previous match, use the ":cprev" command. Use ":clist" to see all the +matches and where they are. + The ":grep" command uses the external commands grep (on Unix) or findstr +(on Windows). You can change this by setting the option 'grepprg'. + +============================================================================== + +Next chapter: |usr_20.txt| Typing command-line commands quickly + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_20.txt b/Aufgabe5/doc.lang/usr_20.txt new file mode 100644 index 0000000..78e7a56 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_20.txt @@ -0,0 +1,384 @@ +*usr_20.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Typing command-line commands quickly + + +Vim has a few generic features that makes it easier to enter commands. Colon +commands can be abbreviated, edited and repeated. Completion is available for +nearly everything. + +|20.1| Command line editing +|20.2| Command line abbreviations +|20.3| Command line completion +|20.4| Command line history +|20.5| Command line window + + Next chapter: |usr_21.txt| Go away and come back + Previous chapter: |usr_12.txt| Clever tricks +Table of contents: |usr_toc.txt| + +============================================================================== +*20.1* Command line editing + +When you use a colon (:) command or search for a string with / or ?, Vim puts +the cursor on the bottom of the screen. There you type the command or search +pattern. This is called the Command line. Also when it's used for entering a +search command. + +The most obvious way to edit the command you type is by pressing the <BS> key. +This erases the character before the cursor. To erase another character, +typed earlier, first move the cursor with the cursor keys. + For example, you have typed this: > + + :s/col/pig/ + +Before you hit <Enter>, you notice that "col" should be "cow". To correct +this, you type <Left> five times. The cursor is now just after "col". Type +<BS> and "w" to correct: > + + :s/cow/pig/ + +Now you can press <Enter> directly. You don't have to move the cursor to the +end of the line before executing the command. + +The most often used keys to move around in the command line: + + <Left> one character left + <Right> one character right + <S-Left> or <C-Left> one word left + <S-Right> or <C-Right> one word right + CTRL-B or <Home> to begin of command line + CTRL-E or <End> to end of command line + + Note: + <S-Left> (cursor left key with Shift key pressed) and <C-Left> (cursor + left key with Control pressed) will not work on all keyboards. Same + for the other Shift and Control combinations. + +You can also use the mouse to move the cursor. + + +DELETING + +As mentioned, <BS> deletes the character before the cursor. To delete a whole +word use CTRL-W. + + /the fine pig ~ + + CTRL-W + + /the fine ~ + +CTRL-U removes all text, thus allows you to start all over again. + + +OVERSTRIKE + +The <Insert> key toggles between inserting characters and replacing the +existing ones. Start with this text: + + /the fine pig ~ + +Move the cursor to the start of "fine" with <S-Left> twice (or <Left> eight +times, if <S-Left> doesn't work). Now press <Insert> to switch to overstrike +and type "great": + + /the greatpig ~ + +Oops, we lost the space. Now, don't use <BS>, because it would delete the +"t" (this is different from Replace mode). Instead, press <Insert> to switch +from overstrike to inserting, and type the space: + + /the great pig ~ + + +CANCELLING + +You thought of executing a : or / command, but changed your mind. To get rid +of what you already typed, without executing it, press CTRL-C or <Esc>. + + Note: + <Esc> is the universal "get out" key. Unfortunately, in the good old + Vi pressing <Esc> in a command line executed the command! Since that + might be considered to be a bug, Vim uses <Esc> to cancel the command. + But with the 'cpoptions' option it can be made Vi compatible. And + when using a mapping (which might be written for Vi) <Esc> also works + Vi compatible. Therefore, using CTRL-C is a method that always works. + +If you are at the start of the command line, pressing <BS> will cancel the +command. It's like deleting the ":" or "/" that the line starts with. + +============================================================================== +*20.2* Command line abbreviations + +Some of the ":" commands are really long. We already mentioned that +":substitute" can be abbreviated to ":s". This is a generic mechanism, all +":" commands can be abbreviated. + +How short can a command get? There are 26 letters, and many more commands. +For example, ":set" also starts with ":s", but ":s" doesn't start a ":set" +command. Instead ":set" can be abbreviated to ":se". + When the shorter form of a command could be used for two commands, it +stands for only one of them. There is no logic behind which one, you have to +learn them. In the help files the shortest form that works is mentioned. For +example: > + + :s[ubstitute] + +This means that the shortest form of ":substitute" is ":s". The following +characters are optional. Thus ":su" and ":sub" also work. + +In the user manual we will either use the full name of command, or a short +version that is still readable. For example, ":function" can be abbreviated +to ":fu". But since most people don't understand what that stands for, we +will use ":fun". (Vim doesn't have a ":funny" command, otherwise ":fun" would +be confusing too.) + +It is recommended that in Vim scripts you write the full command name. That +makes it easier to read back when you make later changes. Except for some +often used commands like ":w" (":write") and ":r" (":read"). + A particularly confusing one is ":end", which could stand for ":endif", +":endwhile" or ":endfunction". Therefore, always use the full name. + + +SHORT OPTION NAMES + +In the user manual the long version of the option names is used. Many options +also have a short name. Unlike ":" commands, there is only one short name +that works. For example, the short name of 'autoindent' is 'ai'. Thus these +two commands do the same thing: > + + :set autoindent + :set ai + +You can find the full list of long and short names here: |option-list|. + +============================================================================== +*20.3* Command line completion + +This is one of those Vim features that, by itself, is a reason to switch from +Vi to Vim. Once you have used this, you can't do without. + +Suppose you have a directory that contains these files: + + info.txt + intro.txt + bodyofthepaper.txt + +To edit the last one, you use the command: > + + :edit bodyofthepaper.txt + +It's easy to type this wrong. A much quicker way is: > + + :edit b<Tab> + +Which will result in the same command. What happened? The <Tab> key does +completion of the word before the cursor. In this case "b". Vim looks in the +directory and finds only one file that starts with a "b". That must be the +one you are looking for, thus Vim completes the file name for you. + +Now type: > + + :edit i<Tab> + +Vim will beep, and give you: > + + :edit info.txt + +The beep means that Vim has found more than one match. It then uses the first +match it found (alphabetically). If you press <Tab> again, you get: > + + :edit intro.txt + +Thus, if the first <Tab> doesn't give you the file you were looking for, press +it again. If there are more matches, you will see them all, one at a time. + If you press <Tab> on the last matching entry, you will go back to what you +first typed: > + + :edit i + +Then it starts all over again. Thus Vim cycles through the list of matches. +Use CTRL-P to go through the list in the other direction: + + <------------------- <Tab> -------------------------+ + | + <Tab> --> <Tab> --> + :edit i :edit info.txt :edit intro.txt + <-- CTRL-P <-- CTRL-P + | + +---------------------- CTRL-P ------------------------> + + +CONTEXT + +When you type ":set i" instead of ":edit i" and press <Tab> you get: > + + :set icon + +Hey, why didn't you get ":set info.txt"? That's because Vim has context +sensitive completion. The kind of words Vim will look for depends on the +command before it. Vim knows that you cannot use a file name just after a +":set" command, but you can use an option name. + Again, if you repeat typing the <Tab>, Vim will cycle through all matches. +There are quite a few, it's better to type more characters first: > + + :set isk<Tab> + +Gives: > + + :set iskeyword + +Now type "=" and press <Tab>: > + + :set iskeyword=@,48-57,_,192-255 + +What happens here is that Vim inserts the old value of the option. Now you +can edit it. + What is completed with <Tab> is what Vim expects in that place. Just try +it out to see how it works. In some situations you will not get what you +want. That's either because Vim doesn't know what you want, or because +completion was not implemented for that situation. In that case you will get +a <Tab> inserted (displayed as ^I). + + +LIST MATCHES + +When there are many matches, you would like to see an overview. Do this by +pressing CTRL-D. For example, pressing CTRL-D after: > + + :set is + +results in: > + + :set is + incsearch isfname isident iskeyword isprint + :set is + +Vim lists the matches and then comes back with the text you typed. You can +now check the list for the item you wanted. If it isn't there, you can use +<BS> to correct the word. If there are many matches, type a few more +characters before pressing <Tab> to complete the rest. + If you have watched carefully, you will have noticed that "incsearch" +doesn't start with "is". In this case "is" stands for the short name of +"incsearch". (Many options have a short and a long name.) Vim is clever +enough to know that you might have wanted to expand the short name of the +option into the long name. + + +THERE IS MORE + +The CTRL-L command completes the word to the longest unambiguous string. If +you type ":edit i" and there are files "info.txt" and "info_backup.txt" you +will get ":edit info". + +The 'wildmode' option can be used to change the way completion works. +The 'wildmenu' option can be used to get a menu-like list of matches. +Use the 'suffixes' option to specify files that are less important and appear +at the end of the list of files. +The 'wildignore' option specifies files that are not listed at all. + +More about all of this here: |cmdline-completion| + +============================================================================== +*20.4* Command line history + +In chapter 3 we briefly mentioned the history. The basics are that you can +use the <Up> key to recall an older command line. <Down> then takes you back +to newer commands. + +There are actually four histories. The ones we will mention here are for ":" +commands and for "/" and "?" search commands. The "/" and "?" commands share +the same history, because they are both search commands. The two other +histories are for expressions and input lines for the input() function. +|cmdline-history| + +Suppose you have done a ":set" command, typed ten more colon commands and then +want to repeat that ":set" command again. You could press ":" and then ten +times <Up>. There is a quicker way: > + + :se<Up> + +Vim will now go back to the previous command that started with "se". You have +a good chance that this is the ":set" command you were looking for. At least +you should not have to press <Up> very often (unless ":set" commands is all +you have done). + +The <Up> key will use the text typed so far and compare it with the lines in +the history. Only matching lines will be used. + If you do not find the line you were looking for, use <Down> to go back to +what you typed and correct that. Or use CTRL-U to start all over again. + +To see all the lines in the history: > + + :history + +That's the history of ":" commands. The search history is displayed with this +command: > + + :history / + +CTRL-P will work like <Up>, except that it doesn't matter what you already +typed. Similarly for CTRL-N and <Down>. CTRL-P stands for previous, CTRL-N +for next. + +============================================================================== +*20.5* Command line window + +Typing the text in the command line works different from typing text in Insert +mode. It doesn't allow many commands to change the text. For most commands +that's OK, but sometimes you have to type a complicated command. That's where +the command line window is useful. + +Open the command line window with this command: > + + q: + +Vim now opens a (small) window at the bottom. It contains the command line +history, and an empty line at the end: + + +-------------------------------------+ + |other window | + |~ | + |file.txt=============================| + |:e c | + |:e config.h.in | + |:set path=.,/usr/include,, | + |:set iskeyword=@,48-57,_,192-255 | + |:set is | + |:q | + |: | + |command-line=========================| + | | + +-------------------------------------+ + +You are now in Normal mode. You can use the "hjkl" keys to move around. For +example, move up with "5k" to the ":e config.h.in" line. Type "$h" to go to +the "i" of "in" and type "cwout". Now you have changed the line to: + + :e config.h.out ~ + +Now press <Enter> and this command will be executed. The command line window +will close. + The <Enter> command will execute the line under the cursor. It doesn't +matter whether Vim is in Insert mode or in Normal mode. + Changes in the command line window are lost. They do not result in the +history to be changed. Except that the command you execute will be added to +the end of the history, like with all executed commands. + +The command line window is very useful when you want to have overview of the +history, lookup a similar command, change it a bit and execute it. A search +command can be used to find something. + In the previous example the "?config" search command could have been used +to find the previous command that contains "config". It's a bit strange, +because you are using a command line to search in the command line window. +While typing that search command you can't open another command line window, +there can be only one. + +============================================================================== + +Next chapter: |usr_21.txt| Go away and come back + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_21.txt b/Aufgabe5/doc.lang/usr_21.txt new file mode 100644 index 0000000..53228cc --- /dev/null +++ b/Aufgabe5/doc.lang/usr_21.txt @@ -0,0 +1,456 @@ +*usr_21.txt* For Vim version 7.0. Last change: 2006 Apr 25 + + VIM USER MANUAL - by Bram Moolenaar + + Go away and come back + + +This chapter goes into mixing the use of other programs with Vim. Either by +executing program from inside Vim or by leaving Vim and coming back later. +Furthermore, this is about the ways to remember the state of Vim and restore +it later. + +|21.1| Suspend and resume +|21.2| Executing shell commands +|21.3| Remembering information; viminfo +|21.4| Sessions +|21.5| Views +|21.6| Modelines + + Next chapter: |usr_22.txt| Finding the file to edit + Previous chapter: |usr_20.txt| Typing command-line commands quickly +Table of contents: |usr_toc.txt| + +============================================================================== +*21.1* Suspend and resume + +Like most Unix programs Vim can be suspended by pressing CTRL-Z. This stops +Vim and takes you back to the shell it was started in. You can then do any +other commands until you are bored with them. Then bring back Vim with the +"fg" command. > + + CTRL-Z + {any sequence of shell commands} + fg + +You are right back where you left Vim, nothing has changed. + In case pressing CTRL-Z doesn't work, you can also use ":suspend". +Don't forget to bring Vim back to the foreground, you would lose any changes +that you made! + +Only Unix has support for this. On other systems Vim will start a shell for +you. This also has the functionality of being able to execute shell commands. +But it's a new shell, not the one that you started Vim from. + When you are running the GUI you can't go back to the shell where Vim was +started. CTRL-Z will minimize the Vim window instead. + +============================================================================== +*21.2* Executing shell commands + +To execute a single shell command from Vim use ":!{command}". For example, to +see a directory listing: > + + :!ls + :!dir + +The first one is for Unix, the second one for MS-Windows. + Vim will execute the program. When it ends you will get a prompt to hit +<Enter>. This allows you to have a look at the output from the command before +returning to the text you were editing. + The "!" is also used in other places where a program is run. Let's take +a look at an overview: + + :!{program} execute {program} + :r !{program} execute {program} and read its output + :w !{program} execute {program} and send text to its input + :[range]!{program} filter text through {program} + +Notice that the presence of a range before "!{program}" makes a big +difference. Without it executes the program normally, with the range a number +of text lines is filtered through the program. + +Executing a whole row of programs this way is possible. But a shell is much +better at it. You can start a new shell this way: > + + :shell + +This is similar to using CTRL-Z to suspend Vim. The difference is that a new +shell is started. + +When using the GUI the shell will be using the Vim window for its input and +output. Since Vim is not a terminal emulator, this will not work perfectly. +If you have trouble, try toggling the 'guipty' option. If this still doesn't +work well enough, start a new terminal to run the shell in. For example with: +> + :!xterm& + +============================================================================== +*21.3* Remembering information; viminfo + +After editing for a while you will have text in registers, marks in various +files, a command line history filled with carefully crafted commands. When +you exit Vim all of this is lost. But you can get it back! + +The viminfo file is designed to store status information: + + Command-line and Search pattern history + Text in registers + Marks for various files + The buffer list + Global variables + +Each time you exit Vim it will store this information in a file, the viminfo +file. When Vim starts again, the viminfo file is read and the information +restored. + +The 'viminfo' option is set by default to restore a limited number of items. +You might want to set it to remember more information. This is done through +the following command: > + + :set viminfo=string + +The string specifies what to save. The syntax of this string is an option +character followed by an argument. The option/argument pairs are separated by +commas. + Take a look at how you can build up your own viminfo string. First, the ' +option is used to specify how many files for which you save marks (a-z). Pick +a nice even number for this option (1000, for instance). Your command now +looks like this: > + + :set viminfo='1000 + +The f option controls whether global marks (A-Z and 0-9) are stored. If this +option is 0, none are stored. If it is 1 or you do not specify an f option, +the marks are stored. You want this feature, so now you have this: > + + :set viminfo='1000,f1 + +The < option controls how many lines are saved for each of the registers. By +default, all the lines are saved. If 0, nothing is saved. To avoid adding +thousands of lines to your viminfo file (which might never get used and makes +starting Vim slower) you use a maximum of 500 lines: > + + :set viminfo='1000,f1,<500 +< +Other options you might want to use: + : number of lines to save from the command line history + @ number of lines to save from the input line history + / number of lines to save from the search history + r removable media, for which no marks will be stored (can be + used several times) + ! global variables that start with an uppercase letter and + don't contain lowercase letters + h disable 'hlsearch' highlighting when starting + % the buffer list (only restored when starting Vim without file + arguments) + c convert the text using 'encoding' + n name used for the viminfo file (must be the last option) + +See the 'viminfo' option and |viminfo-file| for more information. + +When you run Vim multiple times, the last one exiting will store its +information. This may cause information that previously exiting Vims stored +to be lost. Each item can be remembered only once. + + +GETTING BACK TO WHERE YOU WERE + +You are halfway editing a file and it's time to leave for holidays. You exit +Vim and go enjoy yourselves, forgetting all about your work. After a couple +of weeks you start Vim, and type: +> + '0 + +And you are right back where you left Vim. So you can get on with your work. + Vim creates a mark each time you exit Vim. The last one is '0. The +position that '0 pointed to is made '1. And '1 is made to '2, and so forth. +Mark '9 is lost. + The |:marks| command is useful to find out where '0 to '9 will take you. + + +MOVE INFO FROM ONE VIM TO ANOTHER + +You can use the ":wviminfo" and ":rviminfo" commands to save and restore the +information while still running Vim. This is useful for exchanging register +contents between two instances of Vim, for example. In the first Vim do: > + + :wviminfo! ~/tmp/viminfo + +And in the second Vim do: > + + :rviminfo! ~/tmp/viminfo + +Obviously, the "w" stands for "write" and the "r" for "read". + The ! character is used by ":wviminfo" to forcefully overwrite an existing +file. When it is omitted, and the file exists, the information is merged into +the file. + The ! character used for ":rviminfo" means that all the information is +used, this may overwrite existing information. Without the ! only information +that wasn't set is used. + These commands can also be used to store info and use it again later. You +could make a directory full of viminfo files, each containing info for a +different purpose. + +============================================================================== +*21.4* Sessions + +Suppose you are editing along, and it is the end of the day. You want to quit +work and pick up where you left off the next day. You can do this by saving +your editing session and restoring it the next day. + A Vim session contains all the information about what you are editing. +This includes things such as the file list, window layout, global variables, +options and other information. (Exactly what is remembered is controlled by +the 'sessionoptions' option, described below.) + The following command creates a session file: > + + :mksession vimbook.vim + +Later if you want to restore this session, you can use this command: > + + :source vimbook.vim + +If you want to start Vim and restore a specific session, you can use the +following command: > + + vim -S vimbook.vim + +This tells Vim to read a specific file on startup. The 'S' stands for +session (actually, you can source any Vim script with -S, thus it might as +well stand for "source"). + +The windows that were open are restored, with the same position and size as +before. Mappings and option values are like before. + What exactly is restored depends on the 'sessionoptions' option. The +default value is "blank,buffers,curdir,folds,help,options,winsize". + + blank keep empty windows + buffers all buffers, not only the ones in a window + curdir the current directory + folds folds, also manually created ones + help the help window + options all options and mappings + winsize window sizes + +Change this to your liking. To also restore the size of the Vim window, for +example, use: > + + :set sessionoptions+=resize + + +SESSION HERE, SESSION THERE + +The obvious way to use sessions is when working on different projects. +Suppose you store you session files in the directory "~/.vim". You are +currently working on the "secret" project and have to switch to the "boring" +project: > + + :wall + :mksession! ~/.vim/secret.vim + :source ~/.vim/boring.vim + +This first uses ":wall" to write all modified files. Then the current session +is saved, using ":mksession!". This overwrites the previous session. The +next time you load the secret session you can continue where you were at this +point. And finally you load the new "boring" session. + +If you open help windows, split and close various window, and generally mess +up the window layout, you can go back to the last saved session: > + + :source ~/.vim/boring.vim + +Thus you have complete control over whether you want to continue next time +where you are now, by saving the current setup in a session, or keep the +session file as a starting point. + Another way of using sessions is to create a window layout that you like to +use, and save this in a session. Then you can go back to this layout whenever +you want. + For example, this is a nice layout to use: + + +----------------------------------------+ + | VIM - main help file | + | | + |Move around: Use the cursor keys, or "h| + |help.txt================================| + |explorer | | + |dir |~ | + |dir |~ | + |file |~ | + |file |~ | + |file |~ | + |file |~ | + |~/=========|[No File]===================| + | | + +----------------------------------------+ + +This has a help window at the top, so that you can read this text. The narrow +vertical window on the left contains a file explorer. This is a Vim plugin +that lists the contents of a directory. You can select files to edit there. +More about this in the next chapter. + Create this from a just started Vim with: > + + :help + CTRL-W w + :vertical split ~/ + +You can resize the windows a bit to your liking. Then save the session with: +> + :mksession ~/.vim/mine.vim + +Now you can start Vim with this layout: > + + vim -S ~/.vim/mine.vim + +Hint: To open a file you see listed in the explorer window in the empty +window, move the cursor to the filename and press "O". Double clicking with +the mouse will also do this. + + +UNIX AND MS-WINDOWS + +Some people have to do work on MS-Windows systems one day and on Unix another +day. If you are one of them, consider adding "slash" and "unix" to +'sessionoptions'. The session files will then be written in a format that can +be used on both systems. This is the command to put in your vimrc file: > + + :set sessionoptions+=unix,slash + +Vim will use the Unix format then, because the MS-Windows Vim can read and +write Unix files, but Unix Vim can't read MS-Windows format session files. +Similarly, MS-Windows Vim understands file names with / to separate names, but +Unix Vim doesn't understand \. + + +SESSIONS AND VIMINFO + +Sessions store many things, but not the position of marks, contents of +registers and the command line history. You need to use the viminfo feature +for these things. + In most situations you will want to use sessions separately from viminfo. +This can be used to switch to another session, but keep the command line +history. And yank text into registers in one session, and paste it back in +another session. + You might prefer to keep the info with the session. You will have to do +this yourself then. Example: > + + :mksession! ~/.vim/secret.vim + :wviminfo! ~/.vim/secret.viminfo + +And to restore this again: > + + :source ~/.vim/secret.vim + :rviminfo! ~/.vim/secret.viminfo + +============================================================================== +*21.5* Views + +A session stores the looks of the whole of Vim. When you want to store the +properties for one window only, use a view. + The use of a view is for when you want to edit a file in a specific way. +For example, you have line numbers enabled with the 'number' option and +defined a few folds. Just like with sessions, you can remember this view on +the file and restore it later. Actually, when you store a session, it stores +the view of each window. + There are two basic ways to use views. The first is to let Vim pick a name +for the view file. You can restore the view when you later edit the same +file. To store the view for the current window: > + + :mkview + +Vim will decide where to store the view. When you later edit the same file +you get the view back with this command: > + + :loadview + +That's easy, isn't it? + Now you want to view the file without the 'number' option on, or with all +folds open, you can set the options to make the window look that way. Then +store this view with: > + + :mkview 1 + +Obviously, you can get this back with: > + + :loadview 1 + +Now you can switch between the two views on the file by using ":loadview" with +and without the "1" argument. + You can store up to ten views for the same file this way, one unnumbered +and nine numbered 1 to 9. + + +A VIEW WITH A NAME + +The second basic way to use views is by storing the view in a file with a name +you chose. This view can be loaded while editing another file. Vim will then +switch to editing the file specified in the view. Thus you can use this to +quickly switch to editing another file, with all its options set as you saved +them. + For example, to save the view of the current file: > + + :mkview ~/.vim/main.vim + +You can restore it with: > + + :source ~/.vim/main.vim + +============================================================================== +*21.6* Modelines + +When editing a specific file, you might set options specifically for that +file. Typing these commands each time is boring. Using a session or view for +editing a file doesn't work when sharing the file between several people. + The solution for this situation is adding a modeline to the file. This is +a line of text that tells Vim the values of options, to be used in this file +only. + A typical example is a C program where you make indents by a multiple of 4 +spaces. This requires setting the 'shiftwidth' option to 4. This modeline +will do that: + + /* vim:set shiftwidth=4: */ ~ + +Put this line as one of the first or last five lines in the file. When +editing the file, you will notice that 'shiftwidth' will have been set to +four. When editing another file, it's set back to the default value of eight. + For some files the modeline fits well in the header, thus it can be put at +the top of the file. For text files and other files where the modeline gets +in the way of the normal contents, put it at the end of the file. + +The 'modelines' option specifies how many lines at the start and end of the +file are inspected for containing a modeline. To inspect ten lines: > + + :set modelines=10 + +The 'modeline' option can be used to switch this off. Do this when you are +working as root or don't trust the files you are editing: > + + :set nomodeline + +Use this format for the modeline: + + any-text vim:set {option}={value} ... : any-text ~ + +The "any-text" indicates that you can put any text before and after the part +that Vim will use. This allows making it look like a comment, like what was +done above with /* and */. + The " vim:" part is what makes Vim recognize this line. The must be white +space before "vim", or "vim" must be at the start of the line. Thus using +something like "gvim:" will not work. + The part between the colons is a ":set" command. It works the same way as +typing the ":set" command, except that you need to insert a backslash before a +colon (otherwise it would be seen as the end of the modeline). + +Another example: + + // vim:set textwidth=72 dir=c\:\tmp: use c:\tmp here ~ + +There is an extra backslash before the first colon, so that it's included in +the ":set" command. The text after the second colon is ignored, thus a remark +can be placed there. + +For more details see |modeline|. + +============================================================================== + +Next chapter: |usr_22.txt| Finding the file to edit + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_22.txt b/Aufgabe5/doc.lang/usr_22.txt new file mode 100644 index 0000000..85113ae --- /dev/null +++ b/Aufgabe5/doc.lang/usr_22.txt @@ -0,0 +1,364 @@ +*usr_22.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Finding the file to edit + + +Files can be found everywhere. So how do you find them? Vim offers various +ways to browse the directory tree. There are commands to jump to a file that +is mentioned in another. And Vim remembers which files have been edited +before. + +|22.1| The file explorer +|22.2| The current directory +|22.3| Finding a file +|22.4| The buffer list + + Next chapter: |usr_23.txt| Editing other files + Previous chapter: |usr_21.txt| Go away and come back +Table of contents: |usr_toc.txt| + +============================================================================== +*22.1* The file explorer + +Vim has a plugin that makes it possible to edit a directory. Try this: > + + :edit . + +Through the magic of autocommands and Vim scripts, the window will be filled +with the contents of the directory. It looks like this: + + " Press ? for keyboard shortcuts ~ + " Sorted by name (.bak,~,.o,.h,.info,.swp,.obj,.orig,.rej at end of list) ~ + "= /home/mool/vim/vim6/runtime/doc/ ~ + ../ ~ + check/ ~ + Makefile ~ + autocmd.txt ~ + change.txt ~ + eval.txt~ ~ + filetype.txt~ ~ + help.txt.info ~ + +You can see these items: +1. A comment about using ? to get help for the functionality of the file + explorer. +2. The second line mentions how the items in the directory are listed. They + can be sorted in several ways. +3. The third line is the name of the current directory. +4. The "../" directory item. This is the parent directory. +5. The directory names. +6. The ordinary file names. As mentioned in the second line, some are not + here but "at the end of the list". +7. The less ordinary file names. You are expected to use these less often, + therefore they have been moved to the end. + +If you have syntax highlighting enabled, the different parts are highlighted +to make it easier to spot them. + +You can use Normal mode Vim commands to move around in the text. For example, +move to a file and press <Enter>. Now you are editing that file. To go back +to the explorer use ":edit ." again. CTRL-O also works. + Try using <Enter> while the cursor is on a directory name. The result is +that the explorer moves into that directory and displays the items found +there. Pressing <Enter> on the first directory "../" moves you one level +higher. Pressing "-" does the same thing, without the need to move to the +"../" item first. + +You can press ? to get short help on the things you can do in the explorer. +This is what you get: + + " <enter> : open file or directory ~ + " o : open new window for file/directory ~ + " O : open file in previously visited window ~ + " p : preview the file ~ + " i : toggle size/date listing ~ + " s : select sort field r : reverse sort ~ + " - : go up one level c : cd to this dir ~ + " R : rename file D : delete file ~ + " :help file-explorer for detailed help ~ + +The first few commands are for selecting a file to display. Depending on what +command you use, the file appears somewhere: + + <Enter> Uses the current window. + o Opens a new window. + O Uses the previously visited window. + p Uses the preview window, and moves the cursor back + into the explorer window. |preview-window| + +The following commands are used to display other information: + + i Display the size and date for the file. Using i again + will hide the information. + s Use the field the cursor is in to sort on. First + display the size and date with i. Then Move the + cursor to the size of any file and press s. The files + will now be sorted on size. Press s while the cursor + is on a date and the items will be sorted on date. + r reverse the sorting order (either size or date) + +There are a few extra commands: + + c Change the current directory to the displayed + directory. You can then type an ":edit" command for + one of the files without prepending the path. + R Rename the file under the cursor. You will be + prompted for the new name. + D Delete the file under the cursor. You will get a + prompt to confirm this. + +============================================================================== +*22.2* The current directory + +Just like the shell, Vim has the concept of a current directory. Suppose you +are in your home directory and want to edit several files in a directory +"VeryLongFileName". You could do: > + + :edit VeryLongFileName/file1.txt + :edit VeryLongFileName/file2.txt + :edit VeryLongFileName/file3.txt + +To avoid much of the typing, do this: > + + :cd VeryLongFileName + :edit file1.txt + :edit file2.txt + :edit file3.txt + +The ":cd" command changes the current directory. You can see what the current +directory is with the ":pwd" command: > + + :pwd + /home/Bram/VeryLongFileName + +Vim remembers the last directory that you used. Use "cd -" to go back to it. +Example: > + + :pwd + /home/Bram/VeryLongFileName + :cd /etc + :pwd + /etc + :cd - + :pwd + /home/Bram/VeryLongFileName + :cd - + :pwd + /etc + + +WINDOW LOCAL DIRECTORY + +When you split a window, both windows use the same current directory. When +you want to edit a number of files somewhere else in the new window, you can +make it use a different directory, without changing the current directory in +the other window. This is called a local directory. > + + :pwd + /home/Bram/VeryLongFileName + :split + :lcd /etc + :pwd + /etc + CTRL-W w + :pwd + /home/Bram/VeryLongFileName + +So long as no ":lcd" command has been used, all windows share the same current +directory. Doing a ":cd" command in one window will also change the current +directory of the other window. + For a window where ":lcd" has been used a different current directory is +remembered. Using ":cd" or ":lcd" in other windows will not change it. + When using a ":cd" command in a window that uses a different current +directory, it will go back to using the shared directory. + +============================================================================== +*22.3* Finding a file + +You are editing a C program that contains this line: + + #include "inits.h" ~ + +You want to see what is in that "inits.h" file. Move the cursor on the name +of the file and type: > + + gf + +Vim will find the file and edit it. + What if the file is not in the current directory? Vim will use the 'path' +option to find the file. This option is a list of directory names where to +look for your file. + Suppose you have your include files located in "c:/prog/include". This +command will add it to the 'path' option: > + + :set path+=c:/prog/include + +This directory is an absolute path. No matter where you are, it will be the +same place. What if you have located files in a subdirectory, below where the +file is? Then you can specify a relative path name. This starts with a dot: +> + :set path+=./proto + +This tells Vim to look in the directory "proto", below the directory where the +file in which you use "gf" is. Thus using "gf" on "inits.h" will make Vim +look for "proto/inits.h", starting in the directory of the file. + Without the "./", thus "proto", Vim would look in the "proto" directory +below the current directory. And the current directory might not be where the +file that you are editing is located. + +The 'path' option allows specifying the directories where to search for files +in many more ways. See the help on the 'path' option. + The 'isfname' option is used to decide which characters are included in the +file name, and which ones are not (e.g., the " character in the example +above). + +When you know the file name, but it's not to be found in the file, you can +type it: > + + :find inits.h + +Vim will then use the 'path' option to try and locate the file. This is the +same as the ":edit" command, except for the use of 'path'. + +To open the found file in a new window use CTRL-W f instead of "gf", or use +":sfind" instead of ":find". + + +A nice way to directly start Vim to edit a file somewhere in the 'path': > + + vim "+find stdio.h" + +This finds the file "stdio.h" in your value of 'path'. The quotes are +necessary to have one argument |-+c|. + +============================================================================== +*22.4* The buffer list + +The Vim editor uses the term buffer to describe a file being edited. +Actually, a buffer is a copy of the file that you edit. When you finish +changing the buffer, you write the contents of the buffer to the file. +Buffers not only contain file contents, but also all the marks, settings, and +other stuff that goes with it. + + +HIDDEN BUFFERS + +Suppose you are editing the file one.txt and need to edit the file two.txt. +You could simply use ":edit two.txt", but since you made changes to one.txt +that won't work. You also don't want to write one.txt yet. Vim has a +solution for you: > + + :hide edit two.txt + +The buffer "one.txt" disappears from the screen, but Vim still knows that you +are editing this buffer, so it keeps the modified text. This is called a +hidden buffer: The buffer contains text, but you can't see it. + The ":hide" command argument is another command. It makes that command +behave like the 'hidden' option was set. You could also set this option +yourself. The effect is that when any buffer is abandoned, it becomes hidden. + Be careful! When you have hidden buffers with changes, don't exit Vim +without making sure you have saved all the buffers. + + +INACTIVE BUFFERS + + When a buffer has been used once, Vim remembers some information about it. +When it is not displayed in a window and it is not hidden, it is still in the +buffer list. This is called an inactive buffer. Overview: + + Active Appears in a window, text loaded. + Hidden Not in a window, text loaded. + Inactive Not in a window, no text loaded. + +The inactive buffers are remembered, because Vim keeps information about them, +like marks. And remembering the file name is useful too, so that you can see +which files you have edited. And edit them again. + + +LISTING BUFFERS + +View the buffer list with this command: > + + :buffers + +A command which does the same, is not so obvious to list buffers, but is much +shorter to type: > + + :ls + +The output could look like this: + + 1 #h "help.txt" line 62 ~ + 2 %a+ "usr_21.txt" line 1 ~ + 3 "usr_toc.txt" line 1 ~ + +The first column contains the buffer number. You can use this to edit the +buffer without having to type the name, see below. + After the buffer number come the flags. Then the name of the file +and the line number where the cursor was the last time. + The flags that can appear are these (from left to right): + + u Buffer is unlisted |unlisted-buffer|. + % Current buffer. + # Alternate buffer. + a Buffer is loaded and displayed. + h Buffer is loaded but hidden. + = Buffer is read-only. + - Buffer is not modifiable, the 'modifiable' option is off. + + Buffer has been modified. + + +EDITING A BUFFER + +You can edit a buffer by its number. That avoids having to type the file +name: > + + :buffer 2 + +But the only way to know the number is by looking in the buffer list. You can +use the name, or part of it, instead: > + + :buffer help + +Vim will find a best match for the name you type. If there is only one +buffer that matches the name, it will be used. In this case "help.txt". + To open a buffer in a new window: > + + :sbuffer 3 + +This works with a name as well. + + +USING THE BUFFER LIST + +You can move around in the buffer list with these commands: + + :bnext go to next buffer + :bprevious go to previous buffer + :bfirst go to the first buffer + :blast go to the last buffer + +To remove a buffer from the list, use this command: > + + :bdelete 3 + +Again, this also works with a name. + If you delete a buffer that was active (visible in a window), that window +will be closed. If you delete the current buffer, the current window will be +closed. If it was the last window, Vim will find another buffer to edit. You +can't be editing nothing! + + Note: + Even after removing the buffer with ":bdelete" Vim still remembers it. + It's actually made "unlisted", it no longer appears in the list from + ":buffers". The ":buffers!" command will list unlisted buffers (yes, + Vim can do the impossible). To really make Vim forget about a buffer, + use ":bwipe". Also see the 'buflisted' option. + +============================================================================== + +Next chapter: |usr_23.txt| Editing other files + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_23.txt b/Aufgabe5/doc.lang/usr_23.txt new file mode 100644 index 0000000..120fe73 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_23.txt @@ -0,0 +1,343 @@ +*usr_23.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Editing other files + + +This chapter is about editing files that are not ordinary files. With Vim you +can edit files that are compressed or encrypted. Some files need to be +accessed over the internet. With some restrictions, binary files can be +edited as well. + +|23.1| DOS, Mac and Unix files +|23.2| Files on the internet +|23.3| Encryption +|23.4| Binary files +|23.5| Compressed files + + Next chapter: |usr_24.txt| Inserting quickly + Previous chapter: |usr_22.txt| Finding the file to edit +Table of contents: |usr_toc.txt| + +============================================================================== +*23.1* DOS, Mac and Unix files + +Back in the early days, the old Teletype machines used two characters to +start a new line. One to move the carriage back to the first position +(carriage return, <CR>), another to move the paper up (line feed, <LF>). + When computers came out, storage was expensive. Some people decided that +they did not need two characters for end-of-line. The UNIX people decided +they could use <Line Feed> only for end-of-line. The Apple people +standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to +keep the old <CR><LF>. + This means that if you try to move a file from one system to another, you +have line-break problems. The Vim editor automatically recognizes the +different file formats and handles things properly behind your back. + The option 'fileformats' contains the various formats that will be tried +when a new file is edited. The following command, for example, tells Vim to +try UNIX format first and MS-DOS format second: > + + :set fileformats=unix,dos + +You will notice the format in the message you get when editing a file. You +don't see anything if you edit a native file format. Thus editing a Unix file +on Unix won't result in a remark. But when you edit a dos file, Vim will +notify you of this: + + "/tmp/test" [dos] 3L, 71C ~ + +For a Mac file you would see "[mac]". + The detected file format is stored in the 'fileformat' option. To see +which format you have, execute the following command: > + + :set fileformat? + +The three names that Vim uses are: + + unix <LF> + dos <CR><LF> + mac <CR> + + +USING THE MAC FORMAT + +On Unix, <LF> is used to break a line. It's not unusual to have a <CR> +character halfway a line. Incidentally, this happens quite often in Vi (and +Vim) scripts. + On the Macintosh, where <CR> is the line break character, it's possible to +have a <LF> character halfway a line. + The result is that it's not possible to be 100% sure whether a file +containing both <CR> and <LF> characters is a Mac or a Unix file. Therefore, +Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check +for this type of file. To check for this format anyway, add "mac" to +'fileformats': > + + :set fileformats+=mac + +Then Vim will take a guess at the file format. Watch out for situations where +Vim guesses wrong. + + +OVERRULING THE FORMAT + +If you use the good old Vi and try to edit an MS-DOS format file, you will +find that each line ends with a ^M character. (^M is <CR>). The automatic +detection avoids this. Suppose you do want to edit the file that way? Then +you need to overrule the format: > + + :edit ++ff=unix file.txt + +The "++" string is an item that tells Vim that an option name follows, which +overrules the default for this single command. "++ff" is used for +'fileformat'. You could also use "++ff=mac" or "++ff=dos". + This doesn't work for any option, only "++ff" and "++enc" are currently +implemented. The full names "++fileformat" and "++encoding" also work. + + +CONVERSION + +You can use the 'fileformat' option to convert from one file format to +another. Suppose, for example, that you have an MS-DOS file named README.TXT +that you want to convert to UNIX format. Start by editing the MS-DOS format +file: > + vim README.TXT + +Vim will recognize this as a dos format file. Now change the file format to +UNIX: > + + :set fileformat=unix + :write + +The file is written in Unix format. + +============================================================================== +*23.2* Files on the internet + +Someone sends you an e-mail message, which refers to a file by its URL. For +example: + + You can find the information here: ~ + ftp://ftp.vim.org/pub/vim/README ~ + +You could start a program to download the file, save it on your local disk and +then start Vim to edit it. + There is a much simpler way. Move the cursor to any character of the URL. +Then use this command: > + + gf + +With a bit of luck, Vim will figure out which program to use for downloading +the file, download it and edit the copy. To open the file in a new window use +CTRL-W f. + If something goes wrong you will get an error message. It's possible that +the URL is wrong, you don't have permission to read it, the network connection +is down, etc. Unfortunately, it's hard to tell the cause of the error. You +might want to try the manual way of downloading the file. + +Accessing files over the internet works with the netrw plugin. Currently URLs +with these formats are recognized: + + ftp:// uses ftp + rcp:// uses rcp + scp:// uses scp + http:// uses wget (reading only) + +Vim doesn't do the communication itself, it relies on the mentioned programs +to be available on your computer. On most Unix systems "ftp" and "rcp" will +be present. "scp" and "wget" might need to be installed. + +Vim detects these URLs for each command that starts editing a new file, also +with ":edit" and ":split", for example. Write commands also work, except for +http://. + +For more information, also about passwords, see |netrw|. + +============================================================================== +*23.3* Encryption + +Some information you prefer to keep to yourself. For example, when writing +a test on a computer that students also use. You don't want clever students +to figure out a way to read the questions before the exam starts. Vim can +encrypt the file for you, which gives you some protection. + To start editing a new file with encryption, use the "-x" argument to start +Vim. Example: > + + vim -x exam.txt + +Vim prompts you for a key used for encrypting and decrypting the file: + + Enter encryption key: ~ + +Carefully type the secret key now. You cannot see the characters you type, +they will be replaced by stars. To avoid the situation that a typing mistake +will cause trouble, Vim asks you to enter the key again: + + Enter same key again: ~ + +You can now edit this file normally and put in all your secrets. When you +finish editing the file and tell Vim to exit, the file is encrypted and +written. + When you edit the file with Vim, it will ask you to enter the same key +again. You don't need to use the "-x" argument. You can also use the normal +":edit" command. Vim adds a magic string to the file by which it recognizes +that the file was encrypted. + If you try to view this file using another program, all you get is garbage. +Also, if you edit the file with Vim and enter the wrong key, you get garbage. +Vim does not have a mechanism to check if the key is the right one (this makes +it much harder to break the key). + + +SWITCHING ENCRYPTION ON AND OFF + +To disable the encryption of a file, set the 'key' option to an empty string: +> + :set key= + +The next time you write the file this will be done without encryption. + Setting the 'key' option to enable encryption is not a good idea, because +the password appears in the clear. Anyone shoulder-surfing can read your +password. + To avoid this problem, the ":X" command was created. It asks you for an +encryption key, just like the "-x" argument did: > + + :X + Enter encryption key: ****** + Enter same key again: ****** + + +LIMITS ON ENCRYPTION + +The encryption algorithm used by Vim is weak. It is good enough to keep out +the casual prowler, but not good enough to keep out a cryptology expert with +lots of time on his hands. Also you should be aware that the swap file is not +encrypted; so while you are editing, people with superuser privileges can read +the unencrypted text from this file. + One way to avoid letting people read your swap file is to avoid using one. +If the -n argument is supplied on the command line, no swap file is used +(instead, Vim puts everything in memory). For example, to edit the encrypted +file "file.txt" without a swap file use the following command: > + + vim -x -n file.txt + +When already editing a file, the swapfile can be disabled with: > + + :setlocal noswapfile + +Since there is no swapfile, recovery will be impossible. Save the file a bit +more often to avoid the risk of losing your changes. + +While the file is in memory, it is in plain text. Anyone with privilege can +look in the editor's memory and discover the contents of the file. + If you use a viminfo file, be aware that the contents of text registers are +written out in the clear as well. + If you really want to secure the contents of a file, edit it only on a +portable computer not connected to a network, use good encryption tools, and +keep the computer locked up in a big safe when not in use. + +============================================================================== +*23.4* Binary files + +You can edit binary files with Vim. Vim wasn't really made for this, thus +there are a few restrictions. But you can read a file, change a character and +write it back, with the result that only that one character was changed and +the file is identical otherwise. + To make sure that Vim does not use its clever tricks in the wrong way, add +the "-b" argument when starting Vim: > + + vim -b datafile + +This sets the 'binary' option. The effect of this is that unexpected side +effects are turned off. For example, 'textwidth' is set to zero, to avoid +automatic formatting of lines. And files are always read in Unix file format. + +Binary mode can be used to change a message in a program. Be careful not to +insert or delete any characters, it would stop the program from working. Use +"R" to enter replace mode. + +Many characters in the file will be unprintable. To see them in Hex format: > + + :set display=uhex + +Otherwise, the "ga" command can be used to see the value of the character +under the cursor. The output, when the cursor is on an <Esc>, looks like +this: + + <^[> 27, Hex 1b, Octal 033 ~ + +There might not be many line breaks in the file. To get some overview switch +the 'wrap' option off: > + + :set nowrap + + +BYTE POSITION + +To see on which byte you are in the file use this command: > + + g CTRL-G + +The output is verbose: + + Col 9-16 of 9-16; Line 277 of 330; Word 1806 of 2058; Byte 10580 of 12206 ~ + +The last two numbers are the byte position in the file and the total number of +bytes. This takes into account how 'fileformat' changes the number of bytes +that a line break uses. + To move to a specific byte in the file, use the "go" command. For +example, to move to byte 2345: > + + 2345go + + +USING XXD + +A real binary editor shows the text in two ways: as it is and in hex format. +You can do this in Vim by first converting the file with the "xxd" program. +This comes with Vim. + First edit the file in binary mode: > + + vim -b datafile + +Now convert the file to a hex dump with xxd: > + + :%!xxd + +The text will look like this: + + 0000000: 1f8b 0808 39d7 173b 0203 7474 002b 4e49 ....9..;..tt.+NI ~ + 0000010: 4b2c 8660 eb9c ecac c462 eb94 345e 2e30 K,.`.....b..4^.0 ~ + 0000020: 373b 2731 0b22 0ca6 c1a2 d669 1035 39d9 7;'1.".....i.59. ~ + +You can now view and edit the text as you like. Vim treats the information as +ordinary text. Changing the hex does not cause the printable character to be +changed, or the other way around. + Finally convert it back with: +> + :%!xxd -r + +Only changes in the hex part are used. Changes in the printable text part on +the right are ignored. + +See the manual page of xxd for more information. + +============================================================================== +*23.5* Compressed files + +This is easy: You can edit a compressed file just like any other file. The +"gzip" plugin takes care of decompressing the file when you edit it. And +compressing it again when you write it. + These compression methods are currently supported: + + .Z compress + .gz gzip + .bz2 bzip2 + +Vim uses the mentioned programs to do the actual compression and +decompression. You might need to install the programs first. + +============================================================================== + +Next chapter: |usr_24.txt| Inserting quickly + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_24.txt b/Aufgabe5/doc.lang/usr_24.txt new file mode 100644 index 0000000..9a961ef --- /dev/null +++ b/Aufgabe5/doc.lang/usr_24.txt @@ -0,0 +1,599 @@ +*usr_24.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Inserting quickly + + +When entering text, Vim offers various ways to reduce the number of keystrokes +and avoid typing mistakes. Use Insert mode completion to repeat previously +typed words. Abbreviate long words to short ones. Type characters that +aren't on your keyboard. + +|24.1| Making corrections +|24.2| Showing matches +|24.3| Completion +|24.4| Repeating an insert +|24.5| Copying from another line +|24.6| Inserting a register +|24.7| Abbreviations +|24.8| Entering special characters +|24.9| Digraphs +|24.10| Normal mode commands + + Next chapter: |usr_25.txt| Editing formatted text + Previous chapter: |usr_23.txt| Editing other files +Table of contents: |usr_toc.txt| + +============================================================================== +*24.1* Making corrections + +The <BS> key was already mentioned. It deletes the character just before the +cursor. The <Del> key does the same for the character under (after) the +cursor. + When you typed a whole word wrong, use CTRL-W: + + The horse had fallen to the sky ~ + CTRL-W + The horse had fallen to the ~ + +If you really messed up a line and want to start over, use CTRL-U to delete +it. This keeps the text after the cursor and the indent. Only the text from +the first non-blank to the cursor is deleted. With the cursor on the "f" of +"fallen" in the next line pressing CTRL-U does this: + + The horse had fallen to the ~ + CTRL-U + fallen to the ~ + +When you spot a mistake a few words back, you need to move the cursor there to +correct it. For example, you typed this: + + The horse had follen to the ground ~ + +You need to change "follen" to "fallen". With the cursor at the end, you +would type this to correct it: > + + <Esc>4blraA + +< get out of Insert mode <Esc> + four words back 4b + move on top of the "o" l + replace with "a" ra + restart Insert mode A + +Another way to do this: > + + <C-Left><C-Left><C-Left><C-Left><Right><Del>a<End> + +< four words back <C-Left><C-Left><C-Left><C-Left> + move on top of the "o" <Right> + delete the "o" <Del> + insert an "a" a + go to end of the line <End> + +This uses special keys to move around, while remaining in Insert mode. This +resembles what you would do in a modeless editor. It's easier to remember, +but takes more time (you have to move your hand from the letters to the cursor +keys, and the <End> key is hard to press without looking at the keyboard). + These special keys are most useful when writing a mapping that doesn't +leave Insert mode. The extra typing doesn't matter then. + An overview of the keys you can use in Insert mode: + + <C-Home> to start of the file + <PageUp> a whole screenful up + <Home> to start of line + <S-Left> one word left + <C-Left> one word left + <S-Right> one word right + <C-Right> one word right + <End> to end of the line + <PageDown> a whole screenful down + <C-End> to end of the file + +There are a few more, see |ins-special-special|. + +============================================================================== +*24.2* Showing matches + +When you type a ) it would be nice to see with which ( it matches. To make +Vim do that use this command: > + + :set showmatch + +When you now type a text like "(example)", as soon as you type the ) Vim will +briefly move the cursor to the matching (, keep it there for half a second, +and move back to where you were typing. + In case there is no matching (, Vim will beep. Then you know that you +might have forgotten the ( somewhere, or typed a ) too many. + The match will also be shown for [] and {} pairs. You don't have to wait +with typing the next character, as soon as Vim sees it the cursor will move +back and inserting continues as before. + You can change the time Vim waits with the 'matchtime' option. For +example, to make Vim wait one and a half second: > + + :set matchtime=15 + +The time is specified in tenths of a second. + +============================================================================== +*24.3* Completion + +Vim can automatically complete words on insertion. You type the first part of +a word, press CTRL-P, and Vim guesses the rest. + Suppose, for example, that you are creating a C program and want to type in +the following: + + total = ch_array[0] + ch_array[1] + ch_array[2]; ~ + +You start by entering the following: + + total = ch_array[0] + ch_ ~ + +At this point, you tell Vim to complete the word using the command CTRL-P. +Vim searches for a word that starts with what's in front of the cursor. In +this case, it is "ch_", which matches with the word ch_array. So typing +CTRL-P gives you the following: + + total = ch_array[0] + ch_array ~ + +After a little more typing, you get this (ending in a space): + + total = ch_array[0] + ch_array[1] + ~ + +If you now type CTRL-P Vim will search again for a word that completes the +word before the cursor. Since there is nothing in front of the cursor, it +finds the first word backwards, which is "ch_array". Typing CTRL-P again +gives you the next word that matches, in this case "total". A third CTRL-P +searches further back. If there is nothing else, it causes the editor to run +out of words, so it returns to the original text, which is nothing. A fourth +CTRL-P causes the editor to start over again with "ch_array". + +To search forward, use CTRL-N. Since the search wraps around the end of the +file, CTRL-N and CTRL-P will find the same matches, but in a different +sequence. Hint: CTRL-N is Next-match and CTRL-P is Previous-match. + +The Vim editor goes through a lot of effort to find words to complete. By +default, it searches the following places: + + 1. Current file + 2. Files in other windows + 3. Other loaded files (hidden buffers) + 4. Files which are not loaded (inactive buffers) + 5. Tag files + 6. All files #included by the current file + + +OPTIONS + +You can customize the search order with the 'complete' option. + +The 'ignorecase' option is used. When it is set, case differences are ignored +when searching for matches. + +A special option for completion is 'infercase'. This is useful to find +matches while ignoring case ('ignorecase' must be set) but still using the +case of the word typed so far. Thus if you type "For" and Vim finds a match +"fortunately", it will result in "Fortunately". + + +COMPLETING SPECIFIC ITEMS + +If you know what you are looking for, you can use these commands to complete +with a certain type of item: + + CTRL-X CTRL-F file names + CTRL-X CTRL-L whole lines + CTRL-X CTRL-D macro definitions (also in included files) + CTRL-X CTRL-I current and included files + CTRL-X CTRL-K words from a dictionary + CTRL-X CTRL-T words from a thesaurus + CTRL-X CTRL-] tags + CTRL-X CTRL-V Vim command line + +After each of them CTRL-N can be used to find the next match, CTRL-P to find +the previous match. + More information for each of these commands here: |ins-completion|. + + +COMPLETING FILE NAMES + +Let's take CTRL-X CTRL-F as an example. This will find file names. It scans +the current directory for files and displays each one that matches the word in +front of the cursor. + Suppose, for example, that you have the following files in the current +directory: + + main.c sub_count.c sub_done.c sub_exit.c + +Now enter Insert mode and start typing: + + The exit code is in the file sub ~ + +At this point, you enter the command CTRL-X CTRL-F. Vim now completes the +current word "sub" by looking at the files in the current directory. The +first match is sub_count.c. This is not the one you want, so you match the +next file by typing CTRL-N. This match is sub_done.c. Typing CTRL-N again +takes you to sub_exit.c. The results: + + The exit code is in the file sub_exit.c ~ + +If the file name starts with / (Unix) or C:\ (MS-Windows) you can find all +files in the file system. For example, type "/u" and CTRL-X CTRL-F. This +will match "/usr" (this is on Unix): + + the file is found in /usr/ ~ + +If you now press CTRL-N you go back to "/u". Instead, to accept the "/usr/" +and go one directory level deeper, use CTRL-X CTRL-F again: + + the file is found in /usr/X11R6/ ~ + +The results depend on what is found in your file system, of course. The +matches are sorted alphabetically. + + +COMPLETING IN SOURCE CODE + +Source code files are well structured. That makes it possible to do +completion in an intelligent way. In Vim this is called Omni completion. In +some other editors it's called intellisense, but that is a trademark. + +The key to Omni completion is CTRL-X CTRL-O. Obviously the O stands for Omni +here, so that you can remember it easier. Let's use an example for editing C +source: + + { ~ + struct foo *p; ~ + p-> ~ + +The cursor is after "p->". Now type CTRL-X CTRL-O. Vim will offer you a list +of alternatives, which are the items that "struct foo" contains. That is +quite different from using CTRL-P, which would complete any word, while only +members of "struct foo" are valid here. + +For Omni completion to work you may need to do some setup. For C code you +need to create a tags file and set the 'tags' option. That is explained +|ft-c-omni|. For other filetypes you may need to do something similar, look +below |compl-omni-filetypes|. It only works for specific filetypes. Check +the value of the 'omnifunc' option to find out if it would work. + +============================================================================== +*24.4* Repeating an insert + +If you press CTRL-A, the editor inserts the text you typed the last time you +were in Insert mode. + Assume, for example, that you have a file that begins with the following: + + "file.h" ~ + /* Main program begins */ ~ + +You edit this file by inserting "#include " at the beginning of the first +line: + + #include "file.h" ~ + /* Main program begins */ ~ + +You go down to the beginning of the next line using the commands "j^". You +now start to insert a new "#include" line. So you type: > + + i CTRL-A + +The result is as follows: + + #include "file.h" ~ + #include /* Main program begins */ ~ + +The "#include " was inserted because CTRL-A inserts the text of the previous +insert. Now you type "main.h"<Enter> to finish the line: + + + #include "file.h" ~ + #include "main.h" ~ + /* Main program begins */ ~ + +The CTRL-@ command does a CTRL-A and then exits Insert mode. That's a quick +way of doing exactly the same insertion again. + +============================================================================== +*24.5* Copying from another line + +The CTRL-Y command inserts the character above the cursor. This is useful +when you are duplicating a previous line. For example, you have this line of +C code: + + b_array[i]->s_next = a_array[i]->s_next; ~ + +Now you need to type the same line, but with "s_prev" instead of "s_next". +Start the new line, and press CTRL-Y 14 times, until you are at the "n" of +"next": + + b_array[i]->s_next = a_array[i]->s_next; ~ + b_array[i]->s_ ~ + +Now you type "prev": + + b_array[i]->s_next = a_array[i]->s_next; ~ + b_array[i]->s_prev ~ + +Continue pressing CTRL-Y until the following "next": + + b_array[i]->s_next = a_array[i]->s_next; ~ + b_array[i]->s_prev = a_array[i]->s_ ~ + +Now type "prev;" to finish it off. + +The CTRL-E command acts like CTRL-Y except it inserts the character below the +cursor. + +============================================================================== +*24.6* Inserting a register + +The command CTRL-R {register} inserts the contents of the register. This is +useful to avoid having to type a long word. For example, you need to type +this: + + r = VeryLongFunction(a) + VeryLongFunction(b) + VeryLongFunction(c) ~ + +The function name is defined in a different file. Edit that file and move the +cursor on top of the function name there, and yank it into register v: > + + "vyiw + +"v is the register specification, "yiw" is yank-inner-word. Now edit the file +where the new line is to be inserted, and type the first letters: + + r = ~ + +Now use CTRL-R v to insert the function name: + + r = VeryLongFunction ~ + +You continue to type the characters in between the function name, and use +CTRL-R v two times more. + You could have done the same with completion. Using a register is useful +when there are many words that start with the same characters. + +If the register contains characters such as <BS> or other special characters, +they are interpreted as if they had been typed from the keyboard. If you do +not want this to happen (you really want the <BS> to be inserted in the text), +use the command CTRL-R CTRL-R {register}. + +============================================================================== +*24.7* Abbreviations + +An abbreviation is a short word that takes the place of a long one. For +example, "ad" stands for "advertisement". Vim enables you to type an +abbreviation and then will automatically expand it for you. + To tell Vim to expand "ad" into "advertisement" every time you insert it, +use the following command: > + + :iabbrev ad advertisement + +Now, when you type "ad", the whole word "advertisement" will be inserted into +the text. This is triggered by typing a character that can't be part of a +word, for example a space: + + What Is Entered What You See + I saw the a I saw the a ~ + I saw the ad I saw the ad ~ + I saw the ad<Space> I saw the advertisement<Space> ~ + +The expansion doesn't happen when typing just "ad". That allows you to type a +word like "add", which will not get expanded. Only whole words are checked +for abbreviations. + + +ABBREVIATING SEVERAL WORDS + +It is possible to define an abbreviation that results in multiple words. For +example, to define "JB" as "Jack Benny", use the following command: > + + :iabbrev JB Jack Benny + +As a programmer, I use two rather unusual abbreviations: > + + :iabbrev #b /**************************************** + :iabbrev #e <Space>****************************************/ + +These are used for creating boxed comments. The comment starts with #b, which +draws the top line. I then type the comment text and use #e to draw the +bottom line. + Notice that the #e abbreviation begins with a space. In other words, the +first two characters are space-star. Usually Vim ignores spaces between the +abbreviation and the expansion. To avoid that problem, I spell space as seven +characters: <, S, p, a, c, e, >. + + Note: + ":iabbrev" is a long word to type. ":iab" works just as well. + That's abbreviating the abbreviate command! + + +FIXING TYPING MISTAKES + +It's very common to make the same typing mistake every time. For example, +typing "teh" instead of "the". You can fix this with an abbreviation: > + + :abbreviate teh the + +You can add a whole list of these. Add one each time you discover a common +mistake. + + +LISTING ABBREVIATIONS + +The ":abbreviate" command lists the abbreviations: + + :abbreviate + i #e ****************************************/ + i #b /**************************************** + i JB Jack Benny + i ad advertisement + ! teh the + +The "i" in the first column indicates Insert mode. These abbreviations are +only active in Insert mode. Other possible characters are: + + c Command-line mode :cabbrev + ! both Insert and Command-line mode :abbreviate + +Since abbreviations are not often useful in Command-line mode, you will mostly +use the ":iabbrev" command. That avoids, for example, that "ad" gets expanded +when typing a command like: > + + :edit ad + + +DELETING ABBREVIATIONS + +To get rid of an abbreviation, use the ":unabbreviate" command. Suppose you +have the following abbreviation: > + + :abbreviate @f fresh + +You can remove it with this command: > + + :unabbreviate @f + +While you type this, you will notice that @f is expanded to "fresh". Don't +worry about this, Vim understands it anyway (except when you have an +abbreviation for "fresh", but that's very unlikely). + To remove all the abbreviations: > + + :abclear + +":unabbreviate" and ":abclear" also come in the variants for Insert mode +(":iunabbreviate and ":iabclear") and Command-line mode (":cunabbreviate" and +":cabclear"). + + +REMAPPING ABBREVIATIONS + +There is one thing to watch out for when defining an abbreviation: The +resulting string should not be mapped. For example: > + + :abbreviate @a adder + :imap dd disk-door + +When you now type @a, you will get "adisk-doorer". That's not what you want. +To avoid this, use the ":noreabbrev" command. It does the same as +":abbreviate", but avoids that the resulting string is used for mappings: > + + :noreabbrev @a adder + +Fortunately, it's unlikely that the result of an abbreviation is mapped. + +============================================================================== +*24.8* Entering special characters + +The CTRL-V command is used to insert the next character literally. In other +words, any special meaning the character has, it will be ignored. For +example: > + + CTRL-V <Esc> + +Inserts an escape character. Thus you don't leave Insert mode. (Don't type +the space after CTRL-V, it's only to make this easier to read). + + Note: + On MS-Windows CTRL-V is used to paste text. Use CTRL-Q instead of + CTRL-V. On Unix, on the other hand, CTRL-Q does not work on some + terminals, because it has a special meaning. + +You can also use the command CTRL-V {digits} to insert a character with the +decimal number {digits}. For example, the character number 127 is the <Del> +character (but not necessarily the <Del> key!). To insert <Del> type: > + + CTRL-V 127 + +You can enter characters up to 255 this way. When you type fewer than two +digits, a non-digit will terminate the command. To avoid the need of typing a +non-digit, prepend one or two zeros to make three digits. + All the next commands insert a <Tab> and then a dot: + + CTRL-V 9. + CTRL-V 09. + CTRL-V 009. + +To enter a character in hexadecimal, use an "x" after the CTRL-V: > + + CTRL-V x7f + +This also goes up to character 255 (CTRL-V xff). You can use "o" to type a +character as an octal number and two more methods allow you to type up to +a 16 bit and a 32 bit number (e.g., for a Unicode character): > + + CTRL-V o123 + CTRL-V u1234 + CTRL-V U12345678 + +============================================================================== +*24.9* Digraphs + +Some characters are not on the keyboard. For example, the copyright character +(). To type these characters in Vim, you use digraphs, where two characters +represent one. To enter a , for example, you press three keys: > + + CTRL-K Co + +To find out what digraphs are available, use the following command: > + + :digraphs + +Vim will display the digraph table. Here are three lines of it: + + AC ~_ 159 NS | 160 !I 161 Ct 162 Pd 163 Cu 164 Ye 165 ~ + BB 166 SE 167 ': 168 Co 169 -a 170 << 171 NO 172 ~ + -- 173 Rg 174 'm 175 DG 176 +- 177 2S 178 3S 179 ~ + +This shows, for example, that the digraph you get by typing CTRL-K Pd is the +character (). This is character number 163 (decimal). + Pd is short for Pound. Most digraphs are selected to give you a hint about +the character they will produce. If you look through the list you will +understand the logic. + You can exchange the first and second character, if there is no digraph for +that combination. Thus CTRL-K dP also works. Since there is no digraph for +"dP" Vim will also search for a "Pd" digraph. + + Note: + The digraphs depend on the character set that Vim assumes you are + using. On MS-DOS they are different from MS-Windows. Always use + ":digraphs" to find out which digraphs are currently available. + +You can define your own digraphs. Example: > + + :digraph a" + +This defines that CTRL-K a" inserts an character. You can also specify the +character with a decimal number. This defines the same digraph: > + + :digraph a" 228 + +More information about digraphs here: |digraphs| + Another way to insert special characters is with a keymap. More about that +here: |45.5| + +============================================================================== +*24.10* Normal mode commands + +Insert mode offers a limited number of commands. In Normal mode you have many +more. When you want to use one, you usually leave Insert mode with <Esc>, +execute the Normal mode command, and re-enter Insert mode with "i" or "a". + There is a quicker way. With CTRL-O {command} you can execute any Normal +mode command from Insert mode. For example, to delete from the cursor to the +end of the line: > + + CTRL-O D + +You can execute only one Normal mode command this way. But you can specify a +register or a count. A more complicated example: > + + CTRL-O "g3dw + +This deletes up to the third word into register g. + +============================================================================== + +Next chapter: |usr_25.txt| Editing formatted text + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_25.txt b/Aufgabe5/doc.lang/usr_25.txt new file mode 100644 index 0000000..a1e887a --- /dev/null +++ b/Aufgabe5/doc.lang/usr_25.txt @@ -0,0 +1,578 @@ +*usr_25.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Editing formatted text + + +Text hardly ever comes in one sentence per line. This chapter is about +breaking sentences to make them fit on a page and other formatting. +Vim also has useful features for editing single-line paragraphs and tables. + +|25.1| Breaking lines +|25.2| Aligning text +|25.3| Indents and tabs +|25.4| Dealing with long lines +|25.5| Editing tables + + Next chapter: |usr_26.txt| Repeating + Previous chapter: |usr_24.txt| Inserting quickly +Table of contents: |usr_toc.txt| + +============================================================================== +*25.1* Breaking lines + +Vim has a number of functions that make dealing with text easier. By default, +the editor does not perform automatic line breaks. In other words, you have +to press <Enter> yourself. This is useful when you are writing programs where +you want to decide where the line ends. It is not so good when you are +creating documentation and want the text to be at most 70 character wide. + If you set the 'textwidth' option, Vim automatically inserts line breaks. +Suppose, for example, that you want a very narrow column of only 30 +characters. You need to execute the following command: > + + :set textwidth=30 + +Now you start typing (ruler added): + + 1 2 3 + 12345678901234567890123456789012345 + I taught programming for a whi ~ + +If you type "l" next, this makes the line longer than the 30-character limit. +When Vim sees this, it inserts a line break and you get the following: + + 1 2 3 + 12345678901234567890123456789012345 + I taught programming for a ~ + whil ~ + +Continuing on, you can type in the rest of the paragraph: + + 1 2 3 + 12345678901234567890123456789012345 + I taught programming for a ~ + while. One time, I was stopped ~ + by the Fort Worth police, ~ + because my homework was too ~ + hard. True story. ~ + +You do not have to type newlines; Vim puts them in automatically. + + Note: + The 'wrap' option makes Vim display lines with a line break, but this + doesn't insert a line break in the file. + + +REFORMATTING + +The Vim editor is not a word processor. In a word processor, if you delete +something at the beginning of the paragraph, the line breaks are reworked. In +Vim they are not; so if you delete the word "programming" from the first line, +all you get is a short line: + + 1 2 3 + 12345678901234567890123456789012345 + I taught for a ~ + while. One time, I was stopped ~ + by the Fort Worth police, ~ + because my homework was too ~ + hard. True story. ~ + +This does not look good. To get the paragraph into shape you use the "gq" +operator. + Let's first use this with a Visual selection. Starting from the first +line, type: > + + v4jgq + +"v" to start Visual mode, "4j' to move to the end of the paragraph and then +the "gq" operator. The result is: + + 1 2 3 + 12345678901234567890123456789012345 + I taught for a while. One ~ + time, I was stopped by the ~ + Fort Worth police, because my ~ + homework was too hard. True ~ + story. ~ + +Note: there is a way to do automatic formatting for specific types of text +layouts, see |auto-format|. + +Since "gq" is an operator, you can use one of the three ways to select the +text it works on: With Visual mode, with a movement and with a text object. + The example above could also be done with "gq4j". That's less typing, but +you have to know the line count. A more useful motion command is "}". This +moves to the end of a paragraph. Thus "gq}" formats from the cursor to the +end of the current paragraph. + A very useful text object to use with "gq" is the paragraph. Try this: > + + gqap + +"ap" stands for "a-paragraph". This formats the text of one paragraph +(separated by empty lines). Also the part before the cursor. + If you have your paragraphs separated by empty lines, you can format the +whole file by typing this: > + + gggqG + +"gg" to move to the first line, "gqG" to format until the last line. + Warning: If your paragraphs are not properly separated, they will be joined +together. A common mistake is to have a line with a space or Tab. That's a +blank line, but not an empty line. + +Vim is able format more than just plain text. See |fo-table| for how to +change this. See the 'joinspaces' option to change the number of spaces used +after a full stop. + It is possible to use an external program for formatting. This is useful +if your text can't be properly formatted with Vim's builtin command. See the +'formatprg' option. + +============================================================================== +*25.2* Aligning text + +To center a range of lines, use the following command: > + + :{range}center [width] + +{range} is the usual command-line range. [width] is an optional line width to +use for centering. If [width] is not specified, it defaults to the value of +'textwidth'. (If 'textwidth' is 0, the default is 80.) + For example: > + + :1,5center 40 + +results in the following: + + I taught for a while. One ~ + time, I was stopped by the ~ + Fort Worth police, because my ~ + homework was too hard. True ~ + story. ~ + + +RIGHT ALIGNMENT + +Similarly, the ":right" command right-justifies the text: > + + :1,5right 37 + +gives this result: + + I taught for a while. One ~ + time, I was stopped by the ~ + Fort Worth police, because my ~ + homework was too hard. True ~ + story. ~ + +LEFT ALIGNMENT + +Finally there is this command: > + + :{range}left [margin] + +Unlike ":center" and ":right", however, the argument to ":left" is not the +length of the line. Instead it is the left margin. If it is omitted, the +text will be put against the left side of the screen (using a zero margin +would do the same). If it is 5, the text will be indented 5 spaces. For +example, use these commands: > + + :1left 5 + :2,5left + +This results in the following: + + I taught for a while. One ~ + time, I was stopped by the ~ + Fort Worth police, because my ~ + homework was too hard. True ~ + story. ~ + + +JUSTIFYING TEXT + +Vim has no built-in way of justifying text. However, there is a neat macro +package that does the job. To use this package, execute the following +command: > + + :runtime macros/justify.vim + +This Vim script file defines a new visual command "_j". To justify a block of +text, highlight the text in Visual mode and then execute "_j". + Look in the file for more explanations. To go there, do "gf" on this name: +$VIMRUNTIME/macros/justify.vim. + +An alternative is to filter the text through an external program. Example: > + + :%!fmt + +============================================================================== +*25.3* Indents and tabs + +Indents can be used to make text stand out from the rest. The example texts +in this manual, for example, are indented by eight spaces or a tab. You would +normally enter this by typing a tab at the start of each line. Take this +text: + the first line ~ + the second line ~ + +This is entered by typing a tab, some text, <Enter>, tab and more text. + The 'autoindent' option inserts indents automatically: > + + :set autoindent + +When a new line is started it gets the same indent as the previous line. In +the above example, the tab after the <Enter> is not needed anymore. + + +INCREASING INDENT + +To increase the amount of indent in a line, use the ">" operator. Often this +is used as ">>", which adds indent to the current line. + The amount of indent added is specified with the 'shiftwidth' option. The +default value is 8. To make ">>" insert four spaces worth of indent, for +example, type this: > + + :set shiftwidth=4 + +When used on the second line of the example text, this is what you get: + + the first line ~ + the second line ~ + +"4>>" will increase the indent of four lines. + + +TABSTOP + +If you want to make indents a multiple of 4, you set 'shiftwidth' to 4. But +when pressing a Tab you still get 8 spaces worth of indent. To change this, +set the 'softtabstop' option: > + + :set softtabstop=4 + +This will make the <Tab> key insert 4 spaces worth of indent. If there are +already four spaces, a <Tab> character is used (saving seven characters in the +file). (If you always want spaces and no tab characters, set the 'expandtab' +option.) + + Note: + You could set the 'tabstop' option to 4. However, if you edit the + file another time, with 'tabstop' set to the default value of 8, it + will look wrong. In other programs and when printing the indent will + also be wrong. Therefore it is recommended to keep 'tabstop' at eight + all the time. That's the standard value everywhere. + + +CHANGING TABS + +You edit a file which was written with a tabstop of 3. In Vim it looks ugly, +because it uses the normal tabstop value of 8. You can fix this by setting +'tabstop' to 3. But you have to do this every time you edit this file. + Vim can change the use of tabstops in your file. First, set 'tabstop' to +make the indents look good, then use the ":retab" command: > + + :set tabstop=3 + :retab 8 + +The ":retab" command will change 'tabstop' to 8, while changing the text such +that it looks the same. It changes spans of white space into tabs and spaces +for this. You can now write the file. Next time you edit it the indents will +be right without setting an option. + Warning: When using ":retab" on a program, it may change white space inside +a string constant. Therefore it's a good habit to use "\t" instead of a +real tab. + +============================================================================== +*25.4* Dealing with long lines + +Sometimes you will be editing a file that is wider than the number of columns +in the window. When that occurs, Vim wraps the lines so that everything fits +on the screen. + If you switch the 'wrap' option off, each line in the file shows up as one +line on the screen. Then the ends of the long lines disappear off the screen +to the right. + When you move the cursor to a character that can't be seen, Vim will scroll +the text to show it. This is like moving a viewport over the text in the +horizontal direction. + By default, Vim does not display a horizontal scrollbar in the GUI. If you +want to enable one, use the following command: > + + :set guioptions+=b + +One horizontal scrollbar will appear at the bottom of the Vim window. + +If you don't have a scrollbar or don't want to use it, use these commands to +scroll the text. The cursor will stay in the same place, but it's move back +into the visible text if necessary. + + zh scroll right + 4zh scroll four characters right + zH scroll half a window width right + ze scroll right to put the cursor at the end + zl scroll left + 4zl scroll four characters left + zL scroll half a window width left + zs scroll left to put the cursor at the start + +Let's attempt to show this with one line of text. The cursor is on the "w" of +"which". The "current window" above the line indicates the text that is +currently visible. The "window"s below the text indicate the text that is +visible after the command left of it. + + |<-- current window -->| + some long text, part of which is visible in the window ~ + ze |<-- window -->| + zH |<-- window -->| + 4zh |<-- window -->| + zh |<-- window -->| + zl |<-- window -->| + 4zl |<-- window -->| + zL |<-- window -->| + zs |<-- window -->| + + +MOVING WITH WRAP OFF + +When 'wrap' is off and the text has scrolled horizontally, you can use the +following commands to move the cursor to a character you can see. Thus text +left and right of the window is ignored. These never cause the text to +scroll: + + g0 to first visible character in this line + g^ to first non-blank visible character in this line + gm to middle of this line + g$ to last visible character in this line + + |<-- window -->| + some long text, part of which is visible ~ + g0 g^ gm g$ + + +BREAKING AT WORDS *edit-no-break* + +When preparing text for use by another program, you might have to make +paragraphs without a line break. A disadvantage of using 'nowrap' is that you +can't see the whole sentence you are working on. When 'wrap' is on, words are +broken halfway, which makes them hard to read. + A good solution for editing this kind of paragraph is setting the +'linebreak' option. Vim then breaks lines at an appropriate place when +displaying the line. The text in the file remains unchanged. + Without 'linebreak' text might look like this: + + +---------------------------------+ + |letter generation program for a b| + |ank. They wanted to send out a s| + |pecial, personalized letter to th| + |eir richest 1000 customers. Unfo| + |rtunately for the programmer, he | + +---------------------------------+ +After: > + + :set linebreak + +it looks like this: + + +---------------------------------+ + |letter generation program for a | + |bank. They wanted to send out a | + |special, personalized letter to | + |their richest 1000 customers. | + |Unfortunately for the programmer,| + +---------------------------------+ + +Related options: +'breakat' specifies the characters where a break can be inserted. +'showbreak' specifies a string to show at the start of broken line. +Set 'textwidth' to zero to avoid a paragraph to be split. + + +MOVING BY VISIBLE LINES + +The "j" and "k" commands move to the next and previous lines. When used on +a long line, this means moving a lot of screen lines at once. + To move only one screen line, use the "gj" and "gk" commands. When a line +doesn't wrap they do the same as "j" and "k". When the line does wrap, they +move to a character displayed one line below or above. + You might like to use these mappings, which bind these movement commands to +the cursor keys: > + + :map <Up> gk + :map <Down> gj + + +TURNING A PARAGRAPH INTO ONE LINE + +If you want to import text into a program like MS-Word, each paragraph should +be a single line. If your paragraphs are currently separated with empty +lines, this is how you turn each paragraph into a single line: > + + :g/./,/^$/join + +That looks complicated. Let's break it up in pieces: + + :g/./ A ":global" command that finds all lines that contain + at least one character. + ,/^$/ A range, starting from the current line (the non-empty + line) until an empty line. + join The ":join" command joins the range of lines together + into one line. + +Starting with this text, containing eight lines broken at column 30: + + +----------------------------------+ + |A letter generation program | + |for a bank. They wanted to | + |send out a special, | + |personalized letter. | + | | + |To their richest 1000 | + |customers. Unfortunately for | + |the programmer, | + +----------------------------------+ + +You end up with two lines: + + +----------------------------------+ + |A letter generation program for a | + |bank. They wanted to send out a s| + |pecial, personalized letter. | + |To their richest 1000 customers. | + |Unfortunately for the programmer, | + +----------------------------------+ + +Note that this doesn't work when the separating line is blank but not empty; +when it contains spaces and/or tabs. This command does work with blank lines: +> + :g/\S/,/^\s*$/join + +This still requires a blank or empty line at the end of the file for the last +paragraph to be joined. + +============================================================================== +*25.5* Editing tables + +Suppose you are editing a table with four columns: + + nice table test 1 test 2 test 3 ~ + input A 0.534 ~ + input B 0.913 ~ + +You need to enter numbers in the third column. You could move to the second +line, use "A", enter a lot of spaces and type the text. + For this kind of editing there is a special option: > + + set virtualedit=all + +Now you can move the cursor to positions where there isn't any text. This is +called "virtual space". Editing a table is a lot easier this way. + Move the cursor by searching for the header of the last column: > + + /test 3 + +Now press "j" and you are right where you can enter the value for "input A". +Typing "0.693" results in: + + nice table test 1 test 2 test 3 ~ + input A 0.534 0.693 ~ + input B 0.913 ~ + +Vim has automatically filled the gap in front of the new text for you. Now, +to enter the next field in this column use "Bj". "B" moves back to the start +of a white space separated word. Then "j" moves to the place where the next +field can be entered. + + Note: + You can move the cursor anywhere in the display, also beyond the end + of a line. But Vim will not insert spaces there, until you insert a + character in that position. + + +COPYING A COLUMN + +You want to add a column, which should be a copy of the third column and +placed before the "test 1" column. Do this in seven steps: +1. Move the cursor to the left upper corner of this column, e.g., with + "/test 3". +2. Press CTRL-V to start blockwise Visual mode. +3. Move the cursor down two lines with "2j". You are now in "virtual space": + the "input B" line of the "test 3" column. +4. Move the cursor right, to include the whole column in the selection, plus + the space that you want between the columns. "9l" should do it. +5. Yank the selected rectangle with "y". +6. Move the cursor to "test 1", where the new column must be placed. +7. Press "P". + +The result should be: + + nice table test 3 test 1 test 2 test 3 ~ + input A 0.693 0.534 0.693 ~ + input B 0.913 ~ + +Notice that the whole "test 1" column was shifted right, also the line where +the "test 3" column didn't have text. + +Go back to non-virtual cursor movements with: > + + :set virtualedit= + + +VIRTUAL REPLACE MODE + +The disadvantage of using 'virtualedit' is that it "feels" different. You +can't recognize tabs or spaces beyond the end of line when moving the cursor +around. Another method can be used: Virtual Replace mode. + Suppose you have a line in a table that contains both tabs and other +characters. Use "rx" on the first tab: + + inp 0.693 0.534 0.693 ~ + + | + rx | + V + + inpx0.693 0.534 0.693 ~ + +The layout is messed up. To avoid that, use the "gr" command: + + inp 0.693 0.534 0.693 ~ + + | + grx | + V + + inpx 0.693 0.534 0.693 ~ + +What happens is that the "gr" command makes sure the new character takes the +right amount of screen space. Extra spaces or tabs are inserted to fill the +gap. Thus what actually happens is that a tab is replaced by "x" and then +blanks added to make the text after it keep it's place. In this case a +tab is inserted. + When you need to replace more than one character, you use the "R" command +to go to Replace mode (see |04.9|). This messes up the layout and replaces +the wrong characters: + + inp 0 0.534 0.693 ~ + + | + R0.786 | + V + + inp 0.78634 0.693 ~ + +The "gR" command uses Virtual Replace mode. This preserves the layout: + + inp 0 0.534 0.693 ~ + + | + gR0.786 | + V + + inp 0.786 0.534 0.693 ~ + +============================================================================== + +Next chapter: |usr_26.txt| Repeating + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_26.txt b/Aufgabe5/doc.lang/usr_26.txt new file mode 100644 index 0000000..ca78681 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_26.txt @@ -0,0 +1,221 @@ +*usr_26.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Repeating + + +An editing task is hardly ever unstructured. A change often needs to be made +several times. In this chapter a number of useful ways to repeat a change +will be explained. + +|26.1| Repeating with Visual mode +|26.2| Add and subtract +|26.3| Making a change in many files +|26.4| Using Vim from a shell script + + Next chapter: |usr_27.txt| Search commands and patterns + Previous chapter: |usr_25.txt| Editing formatted text +Table of contents: |usr_toc.txt| + +============================================================================== +*26.1* Repeating with Visual mode + +Visual mode is very handy for making a change in any sequence of lines. You +can see the highlighted text, thus you can check if the correct lines are +changed. But making the selection takes some typing. The "gv" command +selects the same area again. This allows you to do another operation on the +same text. + Suppose you have some lines where you want to change "2001" to "2002" and +"2000" to "2001": + + The financial results for 2001 are better ~ + than for 2000. The income increased by 50%, ~ + even though 2001 had more rain than 2000. ~ + 2000 2001 ~ + income 45,403 66,234 ~ + +First change "2001" to "2002". Select the lines in Visual mode, and use: > + + :s/2001/2002/g + +Now use "gv" to reselect the same text. It doesn't matter where the cursor +is. Then use ":s/2000/2001/g" to make the second change. + Obviously, you can repeat these changes several times. + +============================================================================== +*26.2* Add and subtract + +When repeating the change of one number into another, you often have a fixed +offset. In the example above, one was added to each year. Instead of typing +a substitute command for each year that appears, the CTRL-A command can be +used. + Using the same text as above, search for a year: > + + /19[0-9][0-9]\|20[0-9][0-9] + +Now press CTRL-A. The year will be increased by one: + + The financial results for 2002 are better ~ + than for 2000. The income increased by 50%, ~ + even though 2001 had more rain than 2000. ~ + 2000 2001 ~ + income 45,403 66,234 ~ + +Use "n" to find the next year, and press "." to repeat the CTRL-A ("." is a +bit quicker to type). Repeat "n" and "." for all years that appear. + Hint: set the 'hlsearch' option to see the matches you are going to change, +then you can look ahead and do it faster. + +Adding more than one can be done by prepending the number to CTRL-A. Suppose +you have this list: + + 1. item four ~ + 2. item five ~ + 3. item six ~ + +Move the cursor to "1." and type: > + + 3 CTRL-A + +The "1." will change to "4.". Again, you can use "." to repeat this on the +other numbers. + +Another example: + + 006 foo bar ~ + 007 foo bar ~ + +Using CTRL-A on these numbers results in: + + 007 foo bar ~ + 010 foo bar ~ + +7 plus one is 10? What happened here is that Vim recognized "007" as an octal +number, because there is a leading zero. This notation is often used in C +programs. If you do not want a number with leading zeros to be handled as +octal, use this: > + + :set nrformats-=octal + +The CTRL-X command does subtraction in a similar way. + +============================================================================== +*26.3* Making a change in many files + +Suppose you have a variable called "x_cnt" and you want to change it to +"x_counter". This variable is used in several of your C files. You need to +change it in all files. This is how you do it. + Put all the relevant files in the argument list: > + + :args *.c +< +This finds all C files and edits the first one. Now you can perform a +substitution command on all these files: > + + :argdo %s/\<x_cnt\>/x_counter/ge | update + +The ":argdo" command takes an argument that is another command. That command +will be executed on all files in the argument list. + The "%s" substitute command that follows works on all lines. It finds the +word "x_cnt" with "\<x_cnt\>". The "\<" and "\>" are used to match the whole +word only, and not "px_cnt" or "x_cnt2". + The flags for the substitute command include "g" to replace all occurrences +of "x_cnt" in the same line. The "e" flag is used to avoid an error message +when "x_cnt" does not appear in the file. Otherwise ":argdo" would abort on +the first file where "x_cnt" was not found. + The "|" separates two commands. The following "update" command writes the +file only if it was changed. If no "x_cnt" was changed to "x_counter" nothing +happens. + +There is also the ":windo" command, which executes its argument in all +windows. And ":bufdo" executes its argument on all buffers. Be careful with +this, because you might have more files in the buffer list than you think. +Check this with the ":buffers" command (or ":ls"). + +============================================================================== +*26.4* Using Vim from a shell script + +Suppose you have a lot of files in which you need to change the string +"-person-" to "Jones" and then print it. How do you do that? One way is to +do a lot of typing. The other is to write a shell script to do the work. + The Vim editor does a superb job as a screen-oriented editor when using +Normal mode commands. For batch processing, however, Normal mode commands do +not result in clear, commented command files; so here you will use Ex mode +instead. This mode gives you a nice command-line interface that makes it easy +to put into a batch file. ("Ex command" is just another name for a +command-line (:) command.) + The Ex mode commands you need are as follows: > + + %s/-person-/Jones/g + write tempfile + quit + +You put these commands in the file "change.vim". Now to run the editor in +batch mode, use this shell script: > + + for file in *.txt; do + vim -e -s $file < change.vim + lpr -r tempfile + done + +The for-done loop is a shell construct to repeat the two lines in between, +while the $file variable is set to a different file name each time. + The second line runs the Vim editor in Ex mode (-e argument) on the file +$file and reads commands from the file "change.vim". The -s argument tells +Vim to operate in silent mode. In other words, do not keep outputting the +:prompt, or any other prompt for that matter. + The "lpr -r tempfile" command prints the resulting "tempfile" and deletes +it (that's what the -r argument does). + + +READING FROM STDIN + +Vim can read text on standard input. Since the normal way is to read commands +there, you must tell Vim to read text instead. This is done by passing the +"-" argument in place of a file. Example: > + + ls | vim - + +This allows you to edit the output of the "ls" command, without first saving +the text in a file. + If you use the standard input to read text from, you can use the "-S" +argument to read a script: > + + producer | vim -S change.vim - + + +NORMAL MODE SCRIPTS + +If you really want to use Normal mode commands in a script, you can use it +like this: > + + vim -s script file.txt ... +< + Note: + "-s" has a different meaning when it is used without "-e". Here it + means to source the "script" as Normal mode commands. When used with + "-e" it means to be silent, and doesn't use the next argument as a + file name. + +The commands in "script" are executed like you typed them. Don't forget that +a line break is interpreted as pressing <Enter>. In Normal mode that moves +the cursor to the next line. + To create the script you can edit the script file and type the commands. +You need to imagine what the result would be, which can be a bit difficult. +Another way is to record the commands while you perform them manually. This +is how you do that: > + + vim -w script file.txt ... + +All typed keys will be written to "script". If you make a small mistake you +can just continue and remember to edit the script later. + The "-w" argument appends to an existing script. That is good when you +want to record the script bit by bit. If you want to start from scratch and +start all over, use the "-W" argument. It overwrites any existing file. + +============================================================================== + +Next chapter: |usr_27.txt| Search commands and patterns + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_27.txt b/Aufgabe5/doc.lang/usr_27.txt new file mode 100644 index 0000000..1e61f93 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_27.txt @@ -0,0 +1,563 @@ +*usr_27.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Search commands and patterns + + +In chapter 3 a few simple search patterns were mentioned |03.9|. Vim can do +much more complex searches. This chapter explains the most often used ones. +A detailed specification can be found here: |pattern| + +|27.1| Ignoring case +|27.2| Wrapping around the file end +|27.3| Offsets +|27.4| Matching multiple times +|27.5| Alternatives +|27.6| Character ranges +|27.7| Character classes +|27.8| Matching a line break +|27.9| Examples + + Next chapter: |usr_28.txt| Folding + Previous chapter: |usr_26.txt| Repeating +Table of contents: |usr_toc.txt| + +============================================================================== +*27.1* Ignoring case + +By default, Vim's searches are case sensitive. Therefore, "include", +"INCLUDE", and "Include" are three different words and a search will match +only one of them. + Now switch on the 'ignorecase' option: > + + :set ignorecase + +Search for "include" again, and now it will match "Include", "INCLUDE" and +"InClUDe". (Set the 'hlsearch' option to quickly see where a pattern +matches.) + You can switch this off again with: > + + :set noignorecase + +But lets keep it set, and search for "INCLUDE". It will match exactly the +same text as "include" did. Now set the 'smartcase' option: > + + :set ignorecase smartcase + +If you have a pattern with at least one uppercase character, the search +becomes case sensitive. The idea is that you didn't have to type that +uppercase character, so you must have done it because you wanted case to +match. That's smart! + With these two options set you find the following matches: + + pattern matches ~ + word word, Word, WORD, WoRd, etc. + Word Word + WORD WORD + WoRd WoRd + + +CASE IN ONE PATTERN + +If you want to ignore case for one specific pattern, you can do this by +prepending the "\c" string. Using "\C" will make the pattern to match case. +This overrules the 'ignorecase' and 'smartcase' options, when "\c" or "\C" is +used their value doesn't matter. + + pattern matches ~ + \Cword word + \CWord Word + \cword word, Word, WORD, WoRd, etc. + \cWord word, Word, WORD, WoRd, etc. + +A big advantage of using "\c" and "\C" is that it sticks with the pattern. +Thus if you repeat a pattern from the search history, the same will happen, no +matter if 'ignorecase' or 'smartcase' was changed. + + Note: + The use of "\" items in search patterns depends on the 'magic' option. + In this chapters we will assume 'magic' is on, because that is the + standard and recommended setting. If you would change 'magic', many + search patterns would suddenly become invalid. + + Note: + If your search takes much longer than you expected, you can interrupt + it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows. + +============================================================================== +*27.2* Wrapping around the file end + +By default, a forward search starts searching for the given string at the +current cursor location. It then proceeds to the end of the file. If it has +not found the string by that time, it starts from the beginning and searches +from the start of the file to the cursor location. + Keep in mind that when repeating the "n" command to search for the next +match, you eventually get back to the first match. If you don't notice this +you keep searching forever! To give you a hint, Vim displays this message: + + search hit BOTTOM, continuing at TOP ~ + +If you use the "?" command, to search in the other direction, you get this +message: + + search hit TOP, continuing at BOTTOM ~ + +Still, you don't know when you are back at the first match. One way to see +this is by switching on the 'ruler' option: > + + :set ruler + +Vim will display the cursor position in the lower righthand corner of the +window (in the status line if there is one). It looks like this: + + 101,29 84% ~ + +The first number is the line number of the cursor. Remember the line number +where you started, so that you can check if you passed this position again. + + +NOT WRAPPING + +To turn off search wrapping, use the following command: > + + :set nowrapscan + +Now when the search hits the end of the file, an error message displays: + + E385: search hit BOTTOM without match for: forever ~ + +Thus you can find all matches by going to the start of the file with "gg" and +keep searching until you see this message. + If you search in the other direction, using "?", you get: + + E384: search hit TOP without match for: forever ~ + +============================================================================== +*27.3* Offsets + +By default, the search command leaves the cursor positioned on the beginning +of the pattern. You can tell Vim to leave it some other place by specifying +an offset. For the forward search command "/", the offset is specified by +appending a slash (/) and the offset: > + + /default/2 + +This command searches for the pattern "default" and then moves to the +beginning of the second line past the pattern. Using this command on the +paragraph above, Vim finds the word "default" in the first line. Then the +cursor is moved two lines down and lands on "an offset". + +If the offset is a simple number, the cursor will be placed at the beginning +of the line that many lines from the match. The offset number can be positive +or negative. If it is positive, the cursor moves down that many lines; if +negative, it moves up. + + +CHARACTER OFFSETS + +The "e" offset indicates an offset from the end of the match. It moves the +cursor onto the last character of the match. The command: > + + /const/e + +puts the cursor on the "t" of "const". + From that position, adding a number moves forward that many characters. +This command moves to the character just after the match: > + + /const/e+1 + +A positive number moves the cursor to the right, a negative number moves it to +the left. For example: > + + /const/e-1 + +moves the cursor to the "s" of "const". + +If the offset begins with "b", the cursor moves to the beginning of the +pattern. That's not very useful, since leaving out the "b" does the same +thing. It does get useful when a number is added or subtracted. The cursor +then goes forward or backward that many characters. For example: > + + /const/b+2 + +Moves the cursor to the beginning of the match and then two characters to the +right. Thus it lands on the "n". + + +REPEATING + +To repeat searching for the previously used search pattern, but with a +different offset, leave out the pattern: > + + /that + //e + +Is equal to: > + + /that/e + +To repeat with the same offset: > + + / + +"n" does the same thing. To repeat while removing a previously used offset: > + + // + + +SEARCHING BACKWARDS + +The "?" command uses offsets in the same way, but you must use "?" to separate +the offset from the pattern, instead of "/": > + + ?const?e-2 + +The "b" and "e" keep their meaning, they don't change direction with the use +of "?". + + +START POSITION + +When starting a search, it normally starts at the cursor position. When you +specify a line offset, this can cause trouble. For example: > + + /const/-2 + +This finds the next word "const" and then moves two lines up. If you +use "n" to search again, Vim could start at the current position and find the same +"const" match. Then using the offset again, you would be back where you started. +You would be stuck! + It could be worse: Suppose there is another match with "const" in the next +line. Then repeating the forward search would find this match and move two +lines up. Thus you would actually move the cursor back! + +When you specify a character offset, Vim will compensate for this. Thus the +search starts a few characters forward or backward, so that the same match +isn't found again. + +============================================================================== +*27.4* Matching multiple times + +The "*" item specifies that the item before it can match any number of times. +Thus: > + + /a* + +matches "a", "aa", "aaa", etc. But also "" (the empty string), because zero +times is included. + The "*" only applies to the item directly before it. Thus "ab*" matches +"a", "ab", "abb", "abbb", etc. To match a whole string multiple times, it +must be grouped into one item. This is done by putting "\(" before it and +"\)" after it. Thus this command: > + + /\(ab\)* + +Matches: "ab", "abab", "ababab", etc. And also "". + +To avoid matching the empty string, use "\+". This makes the previous item +match one or more times. > + + /ab\+ + +Matches "ab", "abb", "abbb", etc. It does not match "a" when no "b" follows. + +To match an optional item, use "\=". Example: > + + /folders\= + +Matches "folder" and "folders". + + +SPECIFIC COUNTS + +To match a specific number of items use the form "\{n,m}". "n" and "m" are +numbers. The item before it will be matched "n" to "m" times |inclusive|. +Example: > + + /ab\{3,5} + +matches "abbb", "abbbb" and "abbbbb". + When "n" is omitted, it defaults to zero. When "m" is omitted it defaults +to infinity. When ",m" is omitted, it matches exactly "n" times. +Examples: + + pattern match count ~ + \{,4} 0, 1, 2, 3 or 4 + \{3,} 3, 4, 5, etc. + \{0,1} 0 or 1, same as \= + \{0,} 0 or more, same as * + \{1,} 1 or more, same as \+ + \{3} 3 + + +MATCHING AS LITTLE AS POSSIBLE + +The items so far match as many characters as they can find. To match as few +as possible, use "\{-n,m}". It works the same as "\{n,m}", except that the +minimal amount possible is used. + For example, use: > + + /ab\{-1,3} + +Will match "ab" in "abbb". Actually, it will never match more than one b, +because there is no reason to match more. It requires something else to force +it to match more than the lower limit. + The same rules apply to removing "n" and "m". It's even possible to remove +both of the numbers, resulting in "\{-}". This matches the item before it +zero or more times, as few as possible. The item by itself always matches +zero times. It is useful when combined with something else. Example: > + + /a.\{-}b + +This matches "axb" in "axbxb". If this pattern would be used: > + + /a.*b + +It would try to match as many characters as possible with ".*", thus it +matches "axbxb" as a whole. + +============================================================================== +*27.5* Alternatives + +The "or" operator in a pattern is "\|". Example: > + + /foo\|bar + +This matches "foo" or "bar". More alternatives can be concatenated: > + + /one\|two\|three + +Matches "one", "two" and "three". + To match multiple times, the whole thing must be placed in "\(" and "\)": > + + /\(foo\|bar\)\+ + +This matches "foo", "foobar", "foofoo", "barfoobar", etc. + Another example: > + + /end\(if\|while\|for\) + +This matches "endif", "endwhile" and "endfor". + +A related item is "\&". This requires that both alternatives match in the +same place. The resulting match uses the last alternative. Example: > + + /forever\&... + +This matches "for" in "forever". It will not match "fortuin", for example. + +============================================================================== +*27.6* Character ranges + +To match "a", "b" or "c" you could use "/a\|b\|c". When you want to match all +letters from "a" to "z" this gets very long. There is a shorter method: > + + /[a-z] + +The [] construct matches a single character. Inside you specify which +characters to match. You can include a list of characters, like this: > + + /[0123456789abcdef] + +This will match any of the characters included. For consecutive characters +you can specify the range. "0-3" stands for "0123". "w-z" stands for "wxyz". +Thus the same command as above can be shortened to: > + + /[0-9a-f] + +To match the "-" character itself make it the first or last one in the range. +These special characters are accepted to make it easier to use them inside a +[] range (they can actually be used anywhere in the search pattern): + + \e <Esc> + \t <Tab> + \r <CR> + \b <BS> + +There are a few more special cases for [] ranges, see |/[]| for the whole +story. + + +COMPLEMENTED RANGE + +To avoid matching a specific character, use "^" at the start of the range. +The [] item then matches everything but the characters included. Example: > + + /"[^"]*" +< + " a double quote + [^"] any character that is not a double quote + * as many as possible + " a double quote again + +This matches "foo" and "3!x", including the double quotes. + + +PREDEFINED RANGES + +A number of ranges are used very often. Vim provides a shortcut for these. +For example: > + + /\a + +Finds alphabetic characters. This is equal to using "/[a-zA-Z]". Here are a +few more of these: + + item matches equivalent ~ + \d digit [0-9] + \D non-digit [^0-9] + \x hex digit [0-9a-fA-F] + \X non-hex digit [^0-9a-fA-F] + \s white space [ ] (<Tab> and <Space>) + \S non-white characters [^ ] (not <Tab> and <Space>) + \l lowercase alpha [a-z] + \L non-lowercase alpha [^a-z] + \u uppercase alpha [A-Z] + \U non-uppercase alpha [^A-Z] + + Note: + Using these predefined ranges works a lot faster than the character + range it stands for. + These items can not be used inside []. Thus "[\d\l]" does NOT work to + match a digit or lowercase alpha. Use "\(\d\|\l\)" instead. + +See |/\s| for the whole list of these ranges. + +============================================================================== +*27.7* Character classes + +The character range matches a fixed set of characters. A character class is +similar, but with an essential difference: The set of characters can be +redefined without changing the search pattern. + For example, search for this pattern: > + + /\f\+ + +The "\f" items stands for file name characters. Thus this matches a sequence +of characters that can be a file name. + Which characters can be part of a file name depends on the system you are +using. On MS-Windows, the backslash is included, on Unix it is not. This is +specified with the 'isfname' option. The default value for Unix is: > + + :set isfname + isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,= + +For other systems the default value is different. Thus you can make a search +pattern with "\f" to match a file name, and it will automatically adjust to +the system you are using it on. + + Note: + Actually, Unix allows using just about any character in a file name, + including white space. Including these characters in 'isfname' would + be theoretically correct. But it would make it impossible to find the + end of a file name in text. Thus the default value of 'isfname' is a + compromise. + +The character classes are: + + item matches option ~ + \i identifier characters 'isident' + \I like \i, excluding digits + \k keyword characters 'iskeyword' + \K like \k, excluding digits + \p printable characters 'isprint' + \P like \p, excluding digits + \f file name characters 'isfname' + \F like \f, excluding digits + +============================================================================== +*27.8* Matching a line break + +Vim can find a pattern that includes a line break. You need to specify where +the line break happens, because all items mentioned so far don't match a line +break. + To check for a line break in a specific place, use the "\n" item: > + + /the\nword + +This will match at a line that ends in "the" and the next line starts with +"word". To match "the word" as well, you need to match a space or a line +break. The item to use for it is "\_s": > + + /the\_sword + +To allow any amount of white space: > + + /the\_s\+word + +This also matches when "the " is at the end of a line and " word" at the +start of the next one. + +"\s" matches white space, "\_s" matches white space or a line break. +Similarly, "\a" matches an alphabetic character, and "\_a" matches an +alphabetic character or a line break. The other character classes and ranges +can be modified in the same way by inserting a "_". + +Many other items can be made to match a line break by prepending "\_". For +example: "\_." matches any character or a line break. + + Note: + "\_.*" matches everything until the end of the file. Be careful with + this, it can make a search command very slow. + +Another example is "\_[]", a character range that includes a line break: > + + /"\_[^"]*" + +This finds a text in double quotes that may be split up in several lines. + +============================================================================== +*27.9* Examples + +Here are a few search patterns you might find useful. This shows how the +items mentioned above can be combined. + + +FINDING A CALIFORNIA LICENSE PLATE + +A sample license place number is "1MGU103". It has one digit, three uppercase +letters and three digits. Directly putting this into a search pattern: > + + /\d\u\u\u\d\d\d + +Another way is to specify that there are three digits and letters with a +count: > + + /\d\u\{3}\d\{3} + +Using [] ranges instead: > + + /[0-9][A-Z]\{3}[0-9]\{3} + +Which one of these you should use? Whichever one you can remember. The +simple way you can remember is much faster than the fancy way that you can't. +If you can remember them all, then avoid the last one, because it's both more +typing and slower to execute. + + +FINDING AN IDENTIFIER + +In C programs (and many other computer languages) an identifier starts with a +letter and further consists of letters and digits. Underscores can be used +too. This can be found with: > + + /\<\h\w*\> + +"\<" and "\>" are used to find only whole words. "\h" stands for "[A-Za-z_]" +and "\w" for "[0-9A-Za-z_]". + + Note: + "\<" and "\>" depend on the 'iskeyword' option. If it includes "-", + for example, then "ident-" is not matched. In this situation use: > + + /\w\@<!\h\w*\w\@! +< + This checks if "\w" does not match before or after the identifier. + See |/\@<!| and |/\@!|. + +============================================================================== + +Next chapter: |usr_28.txt| Folding + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_28.txt b/Aufgabe5/doc.lang/usr_28.txt new file mode 100644 index 0000000..ad4f024 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_28.txt @@ -0,0 +1,426 @@ +*usr_28.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Folding + + +Structured text can be separated in sections. And sections in sub-sections. +Folding allows you to display a section as one line, providing an overview. +This chapter explains the different ways this can be done. + +|28.1| What is folding? +|28.2| Manual folding +|28.3| Working with folds +|28.4| Saving and restoring folds +|28.5| Folding by indent +|28.6| Folding with markers +|28.7| Folding by syntax +|28.8| Folding by expression +|28.9| Folding unchanged lines +|28.10| Which fold method to use? + + Next chapter: |usr_29.txt| Moving through programs + Previous chapter: |usr_27.txt| Search commands and patterns +Table of contents: |usr_toc.txt| + +============================================================================== +*28.1* What is folding? + +Folding is used to show a range of lines in the buffer as a single line on the +screen. Like a piece of paper which is folded to make it shorter: + + +------------------------+ + | line 1 | + | line 2 | + | line 3 | + |_______________________ | + \ \ + \________________________\ + / folded lines / + /________________________/ + | line 12 | + | line 13 | + | line 14 | + +------------------------+ + +The text is still in the buffer, unchanged. Only the way lines are displayed +is affected by folding. + +The advantage of folding is that you can get a better overview of the +structure of text, by folding lines of a section and replacing it with a line +that indicates that there is a section. + +============================================================================== +*28.2* Manual folding + +Try it out: Position the cursor in a paragraph and type: > + + zfap + +You will see that the paragraph is replaced by a highlighted line. You have +created a fold. |zf| is an operator and |ap| a text object selection. You +can use the |zf| operator with any movement command to create a fold for the +text that it moved over. |zf| also works in Visual mode. + +To view the text again, open the fold by typing: > + + zo + +And you can close the fold again with: > + + zc + +All the folding commands start with "z". With some fantasy, this looks like a +folded piece of paper, seen from the side. The letter after the "z" has a +mnemonic meaning to make it easier to remember the commands: + + zf F-old creation + zo O-pen a fold + zc C-lose a fold + +Folds can be nested: A region of text that contains folds can be folded +again. For example, you can fold each paragraph in this section, and then +fold all the sections in this chapter. Try it out. You will notice that +opening the fold for the whole chapter will restore the nested folds as they +were, some may be open and some may be closed. + +Suppose you have created several folds, and now want to view all the text. +You could go to each fold and type "zo". To do this faster, use this command: > + + zr + +This will R-educe the folding. The opposite is: > + + zm + +This folds M-ore. You can repeat "zr" and "zm" to open and close nested folds +of several levels. + +If you have nested several levels deep, you can open all of them with: > + + zR + +This R-educes folds until there are none left. And you can close all folds +with: > + + zM + +This folds M-ore and M-ore. + +You can quickly disable the folding with the |zn| command. Then |zN| brings +back the folding as it was. |zi| toggles between the two. This is a useful +way of working: +- create folds to get overview on your file +- move around to where you want to do your work +- do |zi| to look at the text and edit it +- do |zi| again to go back to moving around + +More about manual folding in the reference manual: |fold-manual| + +============================================================================== +*28.3* Working with folds + +When some folds are closed, movement commands like "j" and "k" move over a +fold like it was a single, empty line. This allows you to quickly move around +over folded text. + +You can yank, delete and put folds as if it was a single line. This is very +useful if you want to reorder functions in a program. First make sure that +each fold contains a whole function (or a bit less) by selecting the right +'foldmethod'. Then delete the function with "dd", move the cursor and put it +with "p". If some lines of the function are above or below the fold, you can +use Visual selection: +- put the cursor on the first line to be moved +- hit "V" to start Visual mode +- put the cursor on the last line to be moved +- hit "d" to delete the selected lines. +- move the cursor to the new position and "p"ut the lines there. + +It is sometimes difficult to see or remember where a fold is located, thus +where a |zo| command would actually work. To see the defined folds: > + + :set foldcolumn=4 + +This will show a small column on the left of the window to indicate folds. +A "+" is shown for a closed fold. A "-" is shown at the start of each open +fold and "|" at following lines of the fold. + +You can use the mouse to open a fold by clicking on the "+" in the foldcolumn. +Clicking on the "-" or a "|" below it will close an open fold. + +To open all folds at the cursor line use |zO|. +To close all folds at the cursor line use |zC|. +To delete a fold at the cursor line use |zd|. +To delete all folds at the cursor line use |zD|. + +When in Insert mode, the fold at the cursor line is never closed. That allows +you to see what you type! + +Folds are opened automatically when jumping around or moving the cursor left +or right. For example, the "0" command opens the fold under the cursor +(if 'foldopen' contains "hor", which is the default). The 'foldopen' option +can be changed to open folds for specific commands. If you want the line +under the cursor always to be open, do this: > + + :set foldopen=all + +Warning: You won't be able to move onto a closed fold then. You might want to +use this only temporarily and then set it back to the default: > + + :set foldopen& + +You can make folds close automatically when you move out of it: > + + :set foldclose=all + +This will re-apply 'foldlevel' to all folds that don't contain the cursor. +You have to try it out if you like how this feels. Use |zm| to fold more and +|zr| to fold less (reduce folds). + +The folding is local to the window. This allows you to open two windows on +the same buffer, one with folds and one without folds. Or one with all folds +closed and one with all folds open. + +============================================================================== +*28.4* Saving and restoring folds + +When you abandon a file (starting to edit another one), the state of the folds +is lost. If you come back to the same file later, all manually opened and +closed folds are back to their default. When folds have been created +manually, all folds are gone! To save the folds use the |:mkview| command: > + + :mkview + +This will store the settings and other things that influence the view on the +file. You can change what is stored with the 'viewoptions' option. +When you come back to the same file later, you can load the view again: > + + :loadview + +You can store up to ten views on one file. For example, to save the current +setup as the third view and load the second view: > + + :mkview 3 + :loadview 2 + +Note that when you insert or delete lines the views might become invalid. +Also check out the 'viewdir' option, which specifies where the views are +stored. You might want to delete old views now and then. + +============================================================================== +*28.5* Folding by indent + +Defining folds with |zf| is a lot of work. If your text is structured by +giving lower level items a larger indent, you can use the indent folding +method. This will create folds for every sequence of lines with the same +indent. Lines with a larger indent will become nested folds. This works well +with many programming languages. + +Try this by setting the 'foldmethod' option: > + + :set foldmethod=indent + +Then you can use the |zm| and |zr| commands to fold more and reduce folding. +It's easy to see on this example text: + +This line is not indented + This line is indented once + This line is indented twice + This line is indented twice + This line is indented once +This line is not indented + This line is indented once + This line is indented once + +Note that the relation between the amount of indent and the fold depth depends +on the 'shiftwidth' option. Each 'shiftwidth' worth of indent adds one to the +depth of the fold. This is called a fold level. + +When you use the |zr| and |zm| commands you actually increase or decrease the +'foldlevel' option. You could also set it directly: > + + :set foldlevel=3 + +This means that all folds with three times a 'shiftwidth' indent or more will +be closed. The lower the foldlevel, the more folds will be closed. When +'foldlevel' is zero, all folds are closed. |zM| does set 'foldlevel' to zero. +The opposite command |zR| sets 'foldlevel' to the deepest fold level that is +present in the file. + +Thus there are two ways to open and close the folds: +(A) By setting the fold level. + This gives a very quick way of "zooming out" to view the structure of the + text, move the cursor, and "zoom in" on the text again. + +(B) By using |zo| and |zc| commands to open or close specific folds. + This allows opening only those folds that you want to be open, while other + folds remain closed. + +This can be combined: You can first close most folds by using |zm| a few times +and then open a specific fold with |zo|. Or open all folds with |zR| and +then close specific folds with |zc|. + +But you cannot manually define folds when 'foldmethod' is "indent", as that +would conflict with the relation between the indent and the fold level. + +More about folding by indent in the reference manual: |fold-indent| + +============================================================================== +*28.6* Folding with markers + +Markers in the text are used to specify the start and end of a fold region. +This gives precise control over which lines are included in a fold. The +disadvantage is that the text needs to be modified. + +Try it: > + + :set foldmethod=marker + +Example text, as it could appear in a C program: + + /* foobar () {{{ */ + int foobar() + { + /* return a value {{{ */ + return 42; + /* }}} */ + } + /* }}} */ + +Notice that the folded line will display the text before the marker. This is +very useful to tell what the fold contains. + +It's quite annoying when the markers don't pair up correctly after moving some +lines around. This can be avoided by using numbered markers. Example: + + /* global variables {{{1 */ + int varA, varB; + + /* functions {{{1 */ + /* funcA() {{{2 */ + void funcA() {} + + /* funcB() {{{2 */ + void funcB() {} + /* }}}1 */ + +At every numbered marker a fold at the specified level begins. This will make +any fold at a higher level stop here. You can just use numbered start markers +to define all folds. Only when you want to explicitly stop a fold before +another starts you need to add an end marker. + +More about folding with markers in the reference manual: |fold-marker| + +============================================================================== +*28.7* Folding by syntax + +For each language Vim uses a different syntax file. This defines the colors +for various items in the file. If you are reading this in Vim, in a terminal +that supports colors, the colors you see are made with the "help" syntax file. + In the syntax files it is possible to add syntax items that have the "fold" +argument. These define a fold region. This requires writing a syntax file +and adding these items in it. That's not so easy to do. But once it's done, +all folding happens automatically. + Here we'll assume you are using an existing syntax file. Then there is +nothing more to explain. You can open and close folds as explained above. +The folds will be created and deleted automatically when you edit the file. + +More about folding by syntax in the reference manual: |fold-syntax| + +============================================================================== +*28.8* Folding by expression + +This is similar to folding by indent, but instead of using the indent of a +line a user function is called to compute the fold level of a line. You can +use this for text where something in the text indicates which lines belong +together. An example is an e-mail message where the quoted text is indicated +by a ">" before the line. To fold these quotes use this: > + + :set foldmethod=expr + :set foldexpr=strlen(substitute(substitute(getline(v:lnum),'\\s','',\"g\"),'[^>].*','','')) + +You can try it out on this text: + +> quoted text he wrote +> quoted text he wrote +> > double quoted text I wrote +> > double quoted text I wrote + +Explanation for the 'foldexpr' used in the example (inside out): + getline(v:lnum) gets the current line + substitute(...,'\\s','','g') removes all white space from the line + substitute(...,'[^>].*','','') removes everything after leading '>'s + strlen(...) counts the length of the string, which + is the number of '>'s found + +Note that a backslash must be inserted before every space, double quote and +backslash for the ":set" command. If this confuses you, do > + + :set foldexpr + +to check the actual resulting value. To correct a complicated expression, use +the command-line completion: > + + :set foldexpr=<Tab> + +Where <Tab> is a real Tab. Vim will fill in the previous value, which you can +then edit. + +When the expression gets more complicated you should put it in a function and +set 'foldexpr' to call that function. + +More about folding by expression in the reference manual: |fold-expr| + +============================================================================== +*28.9* Folding unchanged lines + +This is useful when you set the 'diff' option in the same window. The +|vimdiff| command does this for you. Example: > + + setlocal diff foldmethod=diff scrollbind nowrap foldlevel=1 + +Do this in every window that shows a different version of the same file. You +will clearly see the differences between the files, while the text that didn't +change is folded. + +For more details see |fold-diff|. + +============================================================================== +*28.10* Which fold method to use? + +All these possibilities makes you wonder which method you should chose. +Unfortunately, there is no golden rule. Here are some hints. + +If there is a syntax file with folding for the language you are editing, that +is probably the best choice. If there isn't one, you might try to write it. +This requires a good knowledge of search patterns. It's not easy, but when +it's working you will not have to define folds manually. + +Typing commands to manually fold regions can be used for unstructured text. +Then use the |:mkview| command to save and restore your folds. + +The marker method requires you to change the file. If you are sharing the +files with other people or you have to meet company standards, you might not +be allowed to add them. + The main advantage of markers is that you can put them exactly where you +want them. That avoids that a few lines are missed when you cut and paste +folds. And you can add a comment about what is contained in the fold. + +Folding by indent is something that works in many files, but not always very +well. Use it when you can't use one of the other methods. However, it is +very useful for outlining. Then you specifically use one 'shiftwidth' for +each nesting level. + +Folding with expressions can make folds in almost any structured text. It is +quite simple to specify, especially if the start and end of a fold can easily +be recognized. + If you use the "expr" method to define folds, but they are not exactly how +you want them, you could switch to the "manual" method. This will not remove +the defined folds. Then you can delete or add folds manually. + +============================================================================== + +Next chapter: |usr_29.txt| Moving through programs + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_29.txt b/Aufgabe5/doc.lang/usr_29.txt new file mode 100644 index 0000000..b3a1d51 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_29.txt @@ -0,0 +1,613 @@ +*usr_29.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Moving through programs + + +The creator of Vim is a computer programmer. It's no surprise that Vim +contains many features to aid in writing programs. Jump around to find where +identifiers are defined and used. Preview declarations in a separate window. +There is more in the next chapter. + +|29.1| Using tags +|29.2| The preview window +|29.3| Moving through a program +|29.4| Finding global identifiers +|29.5| Finding local identifiers + + Next chapter: |usr_30.txt| Editing programs + Previous chapter: |usr_28.txt| Folding +Table of contents: |usr_toc.txt| + +============================================================================== +*29.1* Using tags + +What is a tag? It is a location where an identifier is defined. An example +is a function definition in a C or C++ program. A list of tags is kept in a +tags file. This can be used by Vim to directly jump from any place to the +tag, the place where an identifier is defined. + To generate the tags file for all C files in the current directory, use the +following command: > + + ctags *.c + +"ctags" is a separate program. Most Unix systems already have it installed. +If you do not have it yet, you can find Exuberant ctags here: + + http://ctags.sf.net ~ + +Now when you are in Vim and you want to go to a function definition, you can +jump to it by using the following command: > + + :tag startlist + +This command will find the function "startlist" even if it is in another file. + The CTRL-] command jumps to the tag of the word that is under the cursor. +This makes it easy to explore a tangle of C code. Suppose, for example, that +you are in the function "write_block". You can see that it calls +"write_line". But what does "write_line" do? By placing the cursor on the +call to "write_line" and pressing CTRL-], you jump to the definition of this +function. + The "write_line" function calls "write_char". You need to figure out what +it does. So you position the cursor over the call to "write_char" and press +CTRL-]. Now you are at the definition of "write_char". + + +-------------------------------------+ + |void write_block(char **s; int cnt) | + |{ | + | int i; | + | for (i = 0; i < cnt; ++i) | + | write_line(s[i]); | + |} | | + +-----------|-------------------------+ + | + CTRL-] | + | +----------------------------+ + +--> |void write_line(char *s) | + |{ | + | while (*s != 0) | + | write_char(*s++); | + |} | | + +--------|-------------------+ + | + CTRL-] | + | +------------------------------------+ + +--> |void write_char(char c) | + |{ | + | putchar((int)(unsigned char)c); | + |} | + +------------------------------------+ + +The ":tags" command shows the list of tags that you traversed through: + + :tags + # TO tag FROM line in file/text ~ + 1 1 write_line 8 write_block.c ~ + 2 1 write_char 7 write_line.c ~ + > ~ +> +Now to go back. The CTRL-T command goes to the preceding tag. In the example +above you get back to the "write_line" function, in the call to "write_char". + This command takes a count argument that indicates how many tags to jump +back. You have gone forward, and now back. Let's go forward again. The +following command goes to the tag on top of the list: > + + :tag + +You can prefix it with a count and jump forward that many tags. For example: +":3tag". CTRL-T also can be preceded with a count. + These commands thus allow you to go down a call tree with CTRL-] and back +up again with CTRL-T. Use ":tags" to find out where you are. + + +SPLIT WINDOWS + +The ":tag" command replaces the file in the current window with the one +containing the new function. But suppose you want to see not only the old +function but also the new one? You can split the window using the ":split" +command followed by the ":tag" command. Vim has a shorthand command that does +both: > + :stag tagname + +To split the current window and jump to the tag under the cursor use this +command: > + + CTRL-W ] + +If a count is specified, the new window will be that many lines high. + + +MORE TAGS FILES + +When you have files in many directories, you can create a tags file in each of +them. Vim will then only be able to jump to tags within that directory. + To find more tags files, set the 'tags' option to include all the relevant +tags files. Example: > + + :set tags=./tags,./../tags,./*/tags + +This finds a tags file in the same directory as the current file, one +directory level higher and in all subdirectories. + This is quite a number of tags files, but it may still not be enough. For +example, when editing a file in "~/proj/src", you will not find the tags file +"~/proj/sub/tags". For this situation Vim offers to search a whole directory +tree for tags files. Example: > + + :set tags=~/proj/**/tags + + +ONE TAGS FILE + +When Vim has to search many places for tags files, you can hear the disk +rattling. It may get a bit slow. In that case it's better to spend this +time while generating one big tags file. You might do this overnight. + This requires the Exuberant ctags program, mentioned above. It offers an +argument to search a whole directory tree: > + + cd ~/proj + ctags -R . + +The nice thing about this is that Exuberant ctags recognizes various file +types. Thus this doesn't work just for C and C++ programs, also for Eiffel +and even Vim scripts. See the ctags documentation to tune this. + Now you only need to tell Vim where your big tags file is: > + + :set tags=~/proj/tags + + +MULTIPLE MATCHES + +When a function is defined multiple times (or a method in several classes), +the ":tag" command will jump to the first one. If there is a match in the +current file, that one is used first. + You can now jump to other matches for the same tag with: > + + :tnext + +Repeat this to find further matches. If there are many, you can select which +one to jump to: > + + :tselect tagname + +Vim will present you with a list of choices: + + # pri kind tag file ~ + 1 F f mch_init os_amiga.c ~ + mch_init() ~ + 2 F f mch_init os_mac.c ~ + mch_init() ~ + 3 F f mch_init os_msdos.c ~ + mch_init(void) ~ + 4 F f mch_init os_riscos.c ~ + mch_init() ~ + Enter nr of choice (<CR> to abort): ~ + +You can now enter the number (in the first column) of the match that you would +like to jump to. The information in the other columns give you a good idea of +where the match is defined. + +To move between the matching tags, these commands can be used: + + :tfirst go to first match + :[count]tprevious go to [count] previous match + :[count]tnext go to [count] next match + :tlast go to last match + +If [count] is omitted then one is used. + + +GUESSING TAG NAMES + +Command line completion is a good way to avoid typing a long tag name. Just +type the first bit and press <Tab>: > + + :tag write_<Tab> + +You will get the first match. If it's not the one you want, press <Tab> until +you find the right one. + Sometimes you only know part of the name of a function. Or you have many +tags that start with the same string, but end differently. Then you can tell +Vim to use a pattern to find the tag. + Suppose you want to jump to a tag that contains "block". First type +this: > + + :tag /block + +Now use command line completion: press <Tab>. Vim will find all tags that +contain "block" and use the first match. + The "/" before a tag name tells Vim that what follows is not a literal tag +name, but a pattern. You can use all the items for search patterns here. For +example, suppose you want to select a tag that starts with "write_": > + + :tselect /^write_ + +The "^" specifies that the tag starts with "write_". Otherwise it would also +be found halfway a tag name. Similarly "$" at the end makes sure the pattern +matches until the end of a tag. + + +A TAGS BROWSER + +Since CTRL-] takes you to the definition of the identifier under the cursor, +you can use a list of identifier names as a table of contents. Here is an +example. + First create a list of identifiers (this requires Exuberant ctags): > + + ctags --c-types=f -f functions *.c + +Now start Vim without a file, and edit this file in Vim, in a vertically split +window: > + + vim + :vsplit functions + +The window contains a list of all the functions. There is some more stuff, +but you can ignore that. Do ":setlocal ts=99" to clean it up a bit. + In this window, define a mapping: > + + :nnoremap <buffer> <CR> 0ye<C-W>w:tag <C-R>"<CR> + +Move the cursor to the line that contains the function you want to go to. +Now press <Enter>. Vim will go to the other window and jump to the selected +function. + + +RELATED ITEMS + +You can set 'ignorecase' to make case in tag names be ignored. + +The 'tagbsearch' option tells if the tags file is sorted or not. The default +is to assume a sorted tags file, which makes a tags search a lot faster, but +doesn't work if the tags file isn't sorted. + +The 'taglength' option can be used to tell Vim the number of significant +characters in a tag. + +When you use the SNiFF+ program, you can use the Vim interface to it |sniff|. +SNiFF+ is a commercial program. + +Cscope is a free program. It does not only find places where an identifier is +declared, but also where it is used. See |cscope|. + +============================================================================== +*29.2* The preview window + +When you edit code that contains a function call, you need to use the correct +arguments. To know what values to pass you can look at how the function is +defined. The tags mechanism works very well for this. Preferably the +definition is displayed in another window. For this the preview window can be +used. + To open a preview window to display the function "write_char": > + + :ptag write_char + +Vim will open a window, and jumps to the tag "write_char". Then it takes you +back to the original position. Thus you can continue typing without the need +to use a CTRL-W command. + If the name of a function appears in the text, you can get its definition +in the preview window with: > + + CTRL-W } + +There is a script that automatically displays the text where the word under +the cursor was defined. See |CursorHold-example|. + +To close the preview window use this command: > + + :pclose + +To edit a specific file in the preview window, use ":pedit". This can be +useful to edit a header file, for example: > + + :pedit defs.h + +Finally, ":psearch" can be used to find a word in the current file and any +included files and display the match in the preview window. This is +especially useful when using library functions, for which you do not have a +tags file. Example: > + + :psearch popen + +This will show the "stdio.h" file in the preview window, with the function +prototype for popen(): + + FILE *popen __P((const char *, const char *)); ~ + +You can specify the height of the preview window, when it is opened, with the +'previewheight' option. + +============================================================================== +*29.3* Moving through a program + +Since a program is structured, Vim can recognize items in it. Specific +commands can be used to move around. + C programs often contain constructs like this: + + #ifdef USE_POPEN ~ + fd = popen("ls", "r") ~ + #else ~ + fd = fopen("tmp", "w") ~ + #endif ~ + +But then much longer, and possibly nested. Position the cursor on the +"#ifdef" and press %. Vim will jump to the "#else". Pressing % again takes +you to the "#endif". Another % takes you to the "#ifdef" again. + When the construct is nested, Vim will find the matching items. This is a +good way to check if you didn't forget an "#endif". + When you are somewhere inside a "#if" - "#endif", you can jump to the start +of it with: > + + [# + +If you are not after a "#if" or "#ifdef" Vim will beep. To jump forward to +the next "#else" or "#endif" use: > + + ]# + +These two commands skip any "#if" - "#endif" blocks that they encounter. +Example: + + #if defined(HAS_INC_H) ~ + a = a + inc(); ~ + # ifdef USE_THEME ~ + a += 3; ~ + # endif ~ + set_width(a); ~ + +With the cursor in the last line, "[#" moves to the first line. The "#ifdef" +- "#endif" block in the middle is skipped. + + +MOVING IN CODE BLOCKS + +In C code blocks are enclosed in {}. These can get pretty long. To move to +the start of the outer block use the "[[" command. Use "][" to find the end. +This assumes that the "{" and "}" are in the first column. + The "[{" command moves to the start of the current block. It skips over +pairs of {} at the same level. "]}" jumps to the end. + An overview: + + function(int a) + +-> { + | if (a) + | +-> { + [[ | | for (;;) --+ + | | +-> { | + | [{ | | foo(32); | --+ + | | [{ | if (bar(a)) --+ | ]} | + +-- | +-- break; | ]} | | + | } <-+ | | ][ + +-- foobar(a) | | + } <-+ | + } <-+ + +When writing C++ or Java, the outer {} block is for the class. The next level +of {} is for a method. When somewhere inside a class use "[m" to find the +previous start of a method. "]m" finds the next end of a method. + +Additionally, "[]" moves backward to the end of a function and "]]" moves +forward to the start of the next function. The end of a function is defined +by a "}" in the first column. + + int func1(void) + { + return 1; + +----------> } + | + [] | int func2(void) + | +-> { + | [[ | if (flag) + start +-- +-- return flag; + | ][ | return 2; + | +-> } + ]] | + | int func3(void) + +----------> { + return 3; + } + +Don't forget you can also use "%" to move between matching (), {} and []. +That also works when they are many lines apart. + + +MOVING IN BRACES + +The "[(" and "])" commands work similar to "[{" and "]}", except that they +work on () pairs instead of {} pairs. +> + [( +< <-------------------------------- + <------- + if (a == b && (c == d || (e > f)) && x > y) ~ + --------------> + --------------------------------> > + ]) + +MOVING IN COMMENTS + +To move back to the start of a comment use "[/". Move forward to the end of a +comment with "]/". This only works for /* - */ comments. + + +-> +-> /* + | [/ | * A comment about --+ + [/ | +-- * wonderful life. | ]/ + | */ <-+ + | + +-- foo = bar * 3; --+ + | ]/ + /* a short comment */ <-+ + +============================================================================== +*29.4* Finding global identifiers + +You are editing a C program and wonder if a variable is declared as "int" or +"unsigned". A quick way to find this is with the "[I" command. + Suppose the cursor is on the word "column". Type: > + + [I + +Vim will list the matching lines it can find. Not only in the current file, +but also in all included files (and files included in them, etc.). The result +looks like this: + + structs.h ~ + 1: 29 unsigned column; /* column number */ ~ + +The advantage over using tags or the preview window is that included files are +searched. In most cases this results in the right declaration to be found. +Also when the tags file is out of date. Also when you don't have tags for the +included files. + However, a few things must be right for "[I" to do its work. First of all, +the 'include' option must specify how a file is included. The default value +works for C and C++. For other languages you will have to change it. + + +LOCATING INCLUDED FILES + + Vim will find included files in the places specified with the 'path' +option. If a directory is missing, some include files will not be found. You +can discover this with this command: > + + :checkpath + +It will list the include files that could not be found. Also files included +by the files that could be found. An example of the output: + + --- Included files not found in path --- ~ + <io.h> ~ + vim.h --> ~ + <functions.h> ~ + <clib/exec_protos.h> ~ + +The "io.h" file is included by the current file and can't be found. "vim.h" +can be found, thus ":checkpath" goes into this file and checks what it +includes. The "functions.h" and "clib/exec_protos.h" files, included by +"vim.h" are not found. + + Note: + Vim is not a compiler. It does not recognize "#ifdef" statements. + This means every "#include" statement is used, also when it comes + after "#if NEVER". + +To fix the files that could not be found, add a directory to the 'path' +option. A good place to find out about this is the Makefile. Look out for +lines that contain "-I" items, like "-I/usr/local/X11". To add this directory +use: > + + :set path+=/usr/local/X11 + +When there are many subdirectories, you an use the "*" wildcard. Example: > + + :set path+=/usr/*/include + +This would find files in "/usr/local/include" as well as "/usr/X11/include". + +When working on a project with a whole nested tree of included files, the "**" +items is useful. This will search down in all subdirectories. Example: > + + :set path+=/projects/invent/**/include + +This will find files in the directories: + + /projects/invent/include ~ + /projects/invent/main/include ~ + /projects/invent/main/os/include ~ + etc. + +There are even more possibilities. Check out the 'path' option for info. + If you want to see which included files are actually found, use this +command: > + + :checkpath! + +You will get a (very long) list of included files, the files they include, and +so on. To shorten the list a bit, Vim shows "(Already listed)" for files that +were found before and doesn't list the included files in there again. + + +JUMPING TO A MATCH + +"[I" produces a list with only one line of text. When you want to have a +closer look at the first item, you can jump to that line with the command: > + + [<Tab> + +You can also use "[ CTRL-I", since CTRL-I is the same as pressing <Tab>. + +The list that "[I" produces has a number at the start of each line. When you +want to jump to another item than the first one, type the number first: > + + 3[<Tab> + +Will jump to the third item in the list. Remember that you can use CTRL-O to +jump back to where you started from. + + +RELATED COMMANDS + + [i only lists the first match + ]I only lists items below the cursor + ]i only lists the first item below the cursor + + +FINDING DEFINED IDENTIFIERS + +The "[I" command finds any identifier. To find only macros, defined with +"#define" use: > + + [D + +Again, this searches in included files. The 'define' option specifies what a +line looks like that defines the items for "[D". You could change it to make +it work with other languages than C or C++. + The commands related to "[D" are: + + [d only lists the first match + ]D only lists items below the cursor + ]d only lists the first item below the cursor + +============================================================================== +*29.5* Finding local identifiers + +The "[I" command searches included files. To search in the current file only, +and jump to the first place where the word under the cursor is used: > + + gD + +Hint: Goto Definition. This command is very useful to find a variable or +function that was declared locally ("static", in C terms). Example (cursor on +"counter"): + + +-> static int counter = 0; + | + | int get_counter(void) + gD | { + | ++counter; + +-- return counter; + } + +To restrict the search even further, and look only in the current function, +use this command: > + + gd + +This will go back to the start of the current function and find the first +occurrence of the word under the cursor. Actually, it searches backwards to +an empty line above the a "{" in the first column. From there it searches +forward for the identifier. Example (cursor on "idx"): + + int find_entry(char *name) + { + +-> int idx; + | + gd | for (idx = 0; idx < table_len; ++idx) + | if (strcmp(table[idx].name, name) == 0) + +-- return idx; + } + +============================================================================== + +Next chapter: |usr_30.txt| Editing programs + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_30.txt b/Aufgabe5/doc.lang/usr_30.txt new file mode 100644 index 0000000..4e76b3d --- /dev/null +++ b/Aufgabe5/doc.lang/usr_30.txt @@ -0,0 +1,643 @@ +*usr_30.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Editing programs + + +Vim has various commands that aid in writing computer programs. Compile a +program and directly jump to reported errors. Automatically set the indent +for many languages and format comments. + +|30.1| Compiling +|30.2| Indenting C files +|30.3| Automatic indenting +|30.4| Other indenting +|30.5| Tabs and spaces +|30.6| Formatting comments + + Next chapter: |usr_31.txt| Exploiting the GUI + Previous chapter: |usr_29.txt| Moving through programs +Table of contents: |usr_toc.txt| + +============================================================================== +*30.1* Compiling + +Vim has a set of so called "quickfix" commands. They enable you to compile a +program from within Vim and then go through the errors generated and fix them +(hopefully). You can then recompile and fix any new errors that are found +until finally your program compiles without any error. + +The following command runs the program "make" (supplying it with any argument +you give) and captures the results: > + + :make {arguments} + +If errors were generated, they are captured and the editor positions you where +the first error occurred. + Take a look at an example ":make" session. (Typical :make sessions generate +far more errors and fewer stupid ones.) After typing ":make" the screen looks +like this: + + :!make | &tee /tmp/vim215953.err ~ + gcc -g -Wall -o prog main.c sub.c ~ + main.c: In function 'main': ~ + main.c:6: too many arguments to function 'do_sub' ~ + main.c: At top level: ~ + main.c:10: parse error before '}' ~ + make: *** [prog] Error 1 ~ + + 2 returned ~ + "main.c" 11L, 111C ~ + (3 of 6): too many arguments to function 'do_sub' ~ + Hit ENTER or type command to continue ~ + +From this you can see that you have errors in the file "main.c". When you +press <Enter>, Vim displays the file "main.c", with the cursor positioned on +line 6, the first line with an error. You did not need to specify the file or +the line number, Vim knew where to go by looking in the error messages. + + +---------------------------------------------------+ + |int main() | + |{ | + | int i=3; | + cursor -> | do_sub("foo"); | + | ++i; | + | return (0); | + |} | + |} | + | ~ | + |(3 of 12): too many arguments to function 'do_sub' | + +---------------------------------------------------+ + +The following command goes to where the next error occurs: > + + :cnext + +Vim jumps to line 10, the last line in the file, where there is an extra '}'. + When there is not enough room, Vim will shorten the error message. To see +the whole message use: > + + :cc + +You can get an overview of all the error messages with the ":clist" command. +The output looks like this: > + + :clist +< 3 main.c: 6:too many arguments to function 'do_sub' ~ + 5 main.c: 10:parse error before '}' ~ + +Only the lines where Vim recognized a file name and line number are listed +here. It assumes those are the interesting lines and the rest is just boring +messages. However, sometimes unrecognized lines do contain something you want +to see. Output from the linker, for example, about an undefined function. +To see all the messages add a "!" to the command: > + + :clist! +< 1 gcc -g -Wall -o prog main.c sub.c ~ + 2 main.c: In function 'main': ~ + 3 main.c:6: too many arguments to function 'do_sub' ~ + 4 main.c: At top level: ~ + 5 main.c:10: parse error before '}' ~ + 6 make: *** [prog] Error 1 ~ + +Vim will highlight the current error. To go back to the previous error, use: +> + :cprevious + +Other commands to move around in the error list: + + :cfirst to first error + :clast to last error + :cc 3 to error nr 3 + + +USING ANOTHER COMPILER + +The name of the program to run when the ":make" command is executed is defined +by the 'makeprg' option. Usually this is set to "make", but Visual C++ users +should set this to "nmake" by executing the following command: > + + :set makeprg=nmake + +You can also include arguments in this option. Special characters need to +be escaped with a backslash. Example: > + + :set makeprg=nmake\ -f\ project.mak + +You can include special Vim keywords in the command specification. The % +character expands to the name of the current file. So if you execute the +command: > + :set makeprg=make\ % + +When you are editing main.c, then ":make" executes the following command: > + + make main.c + +This is not too useful, so you will refine the command a little and use the :r +(root) modifier: > + + :set makeprg=make\ %:r.o + +Now the command executed is as follows: > + + make main.o + +More about these modifiers here: |filename-modifiers|. + + +OLD ERROR LISTS + +Suppose you ":make" a program. There is an warning message in one file and an +error message in another. You fix the error and use ":make" again to check if +it was really fixed. Now you want to look at the warning message. It doesn't +show up in the last error list, since the file with the warning wasn't +compiled again. You can go back to the previous error list with: > + + :colder + +Then use ":clist" and ":cc {nr}" to jump to the place with the warning. + To go forward to the next error list: > + + :cnewer + +Vim remembers ten error lists. + + +SWITCHING COMPILERS + +You have to tell Vim what format the error messages are that your compiler +produces. This is done with the 'errorformat' option. The syntax of this +option is quite complicated and it can be made to fit almost any compiler. +You can find the explanation here: |errorformat|. + +You might be using various different compilers. Setting the 'makeprg' option, +and especially the 'errorformat' each time is not easy. Vim offers a simple +method for this. For example, to switch to using the Microsoft Visual C++ +compiler: > + + :compiler msvc + +This will find the Vim script for the "msvc" compiler and set the appropriate +options. + You can write your own compiler files. See |write-compiler-plugin|. + + +OUTPUT REDIRECTION + +The ":make" command redirects the output of the executed program to an error +file. How this works depends on various things, such as the 'shell'. If your +":make" command doesn't capture the output, check the 'makeef' and +'shellpipe' options. The 'shellquote' and 'shellxquote' options might also +matter. + +In case you can't get ":make" to redirect the file for you, an alternative is +to compile the program in another window and redirect the output into a file. +Then have Vim read this file with: > + + :cfile {filename} + +Jumping to errors will work like with the ":make" command. + +============================================================================== +*30.2* Indenting C files + +A program is much easier to understand when the lines have been properly +indented. Vim offers various ways to make this less work. + For C programs set the 'cindent' option. Vim knows a lot about C programs +and will try very hard to automatically set the indent for you. Set the +'shiftwidth' option to the amount of spaces you want for a deeper level. Four +spaces will work fine. One ":set" command will do it: > + + :set cindent shiftwidth=4 + +With this option enabled, when you type something such as "if (x)", the next +line will automatically be indented an additional level. + + if (flag) + Automatic indent ---> do_the_work(); + Automatic unindent <-- if (other_flag) { + Automatic indent ---> do_file(); + keep indent do_some_more(); + Automatic unindent <-- } + +When you type something in curly braces ({}), the text will be indented at the +start and unindented at the end. The unindenting will happen after typing the +'}', since Vim can't guess what you are going to type. + +One side effect of automatic indentation is that it helps you catch errors in +your code early. When you type a } to finish a function, only to find that +the automatic indentation gives it more indent than what you expected, there +is probably a } missing. Use the "%" command to find out which { matches the +} you typed. + A missing ) and ; also cause extra indent. Thus if you get more white +space than you would expect, check the preceding lines. + +When you have code that is badly formatted, or you inserted and deleted lines, +you need to re-indent the lines. The "=" operator does this. The simplest +form is: > + + == + +This indents the current line. Like with all operators, there are three ways +to use it. In Visual mode "=" indents the selected lines. A useful text +object is "a{". This selects the current {} block. Thus, to re-indent the +code code block the cursor is in: > + + =a{ + +I you have really badly indented code, you can re-indent the whole file with: +> + gg=G + +However, don't do this in files that have been carefully indented manually. +The automatic indenting does a good job, but in some situations you might want +to overrule it. + + +SETTING INDENT STYLE + +Different people have different styles of indentation. By default Vim does a +pretty good job of indenting in a way that 90% of programmers do. There are +different styles, however; so if you want to, you can customize the +indentation style with the 'cinoptions' option. + By default 'cinoptions' is empty and Vim uses the default style. You can +add various items where you want something different. For example, to make +curly braces be placed like this: + + if (flag) ~ + { ~ + i = 8; ~ + j = 0; ~ + } ~ + +Use this command: > + + :set cinoptions+={2 + +There are many of these items. See |cinoptions-values|. + +============================================================================== +*30.3* Automatic indenting + +You don't want to switch on the 'cindent' option manually every time you edit +a C file. This is how you make it work automatically: > + + :filetype indent on + +Actually, this does a lot more than switching on 'cindent' for C files. First +of all, it enables detecting the type of a file. That's the same as what is +used for syntax highlighting. + When the filetype is known, Vim will search for an indent file for this +type of file. The Vim distribution includes a number of these for various +programming languages. This indent file will then prepare for automatic +indenting specifically for this file. + +If you don't like the automatic indenting, you can switch it off again: > + + :filetype indent off + +If you don't like the indenting for one specific type of file, this is how you +avoid it. Create a file with just this one line: > + + :let b:did_indent = 1 + +Now you need to write this in a file with a specific name: + + {directory}/indent/{filetype}.vim + +The {filetype} is the name of the file type, such as "cpp" or "java". You can +see the exact name that Vim detected with this command: > + + :set filetype + +In this file the output is: + + filetype=help ~ + +This you would use "help" for {filetype}. + For the {directory} part you need to use your runtime directory. Look at +the output of this command: > + + set runtimepath + +Now use the first item, the name before the first comma. Thus if the output +looks like this: + + runtimepath=~/.vim,/usr/local/share/vim/vim60/runtime,~/.vim/after ~ + +You use "~/.vim" for {directory}. Then the resulting file name is: + + ~/.vim/indent/help.vim ~ + +Instead of switching the indenting off, you could write your own indent file. +How to do that is explained here: |indent-expression|. + +============================================================================== +*30.4* Other indenting + +The most simple form of automatic indenting is with the 'autoindent' option. +It uses the indent from the previous line. A bit smarter is the 'smartindent' +option. This is useful for languages where no indent file is available. +'smartindent'is not as smart as 'cindent', but smarter than 'autoindent'. + With 'smartindent' set, an extra level of indentation is added for each { +and removed for each }. An extra level of indentation will also be added for +any of the words in the 'cinwords' option. Lines that begin with # are +treated specially: all indentation is removed. This is done so that +preprocessor directives will all start in column 1. The indentation is +restored for the next line. + + +CORRECTING INDENTS + +When you are using 'autoindent' or 'smartindent' to get the indent of the +previous line, there will be many times when you need to add or remove one +'shiftwidth' worth of indent. A quick way to do this is using the CTRL-D and +CTRL-T commands in Insert mode. + For example, you are typing a shell script that is supposed to look like +this: + + if test -n a; then ~ + echo a ~ + echo "-------" ~ + fi ~ + +Start off by setting these option: > + + :set autoindent shiftwidth=3 + +You start by typing the first line, <Enter> and the start of the second line: + + if test -n a; then ~ + echo ~ + +Now you see that you need an extra indent. Type CTRL-T. The result: + + if test -n a; then ~ + echo ~ + +The CTRL-T command, in Insert mode, adds one 'shiftwidth' to the indent, no +matter where in the line you are. + You continue typing the second line, <Enter> and the third line. This time +the indent is OK. Then <Enter> and the last line. Now you have this: + + if test -n a; then ~ + echo a ~ + echo "-------" ~ + fi ~ + +To remove the superfluous indent in the last line press CTRL-D. This deletes +one 'shiftwidth' worth of indent, no matter where you are in the line. + When you are in Normal mode, you can use the ">>" and "<<" commands to +shift lines. ">" and "<" are operators, thus you have the usual three ways to +specify the lines you want to indent. A useful combination is: > + + >i{ + +This adds one indent to the current block of lines, inside {}. The { and } +lines themselves are left unmodified. ">a{" includes them. In this example +the cursor is on "printf": + + original text after ">i{" after ">a{" + + if (flag) if (flag) if (flag) ~ + { { { ~ + printf("yes"); printf("yes"); printf("yes"); ~ + flag = 0; flag = 0; flag = 0; ~ + } } } ~ + +============================================================================== +*30.5* Tabs and spaces + +'tabstop' is set to eight by default. Although you can change it, you quickly +run into trouble later. Other programs won't know what tabstop value you +used. They probably use the default value of eight, and your text suddenly +looks very different. Also, most printers use a fixed tabstop value of eight. +Thus it's best to keep 'tabstop' alone. (If you edit a file which was written +with a different tabstop setting, see |25.3| for how to fix that.) + For indenting lines in a program, using a multiple of eight spaces makes +you quickly run into the right border of the window. Using a single space +doesn't provide enough visual difference. Many people prefer to use four +spaces, a good compromise. + Since a <Tab> is eight spaces and you want to use an indent of four spaces, +you can't use a <Tab> character to make your indent. There are two ways to +handle this: + +1. Use a mix of <Tab> and space characters. Since a <Tab> takes the place of + eight spaces, you have fewer characters in your file. Inserting a <Tab> + is quicker than eight spaces. Backspacing works faster as well. + +2. Use spaces only. This avoids the trouble with programs that use a + different tabstop value. + +Fortunately, Vim supports both methods quite well. + + +SPACES AND TABS + +If you are using a combination of tabs and spaces, you just edit normally. +The Vim defaults do a fine job of handling things. + You can make life a little easier by setting the 'softtabstop' option. +This option tells Vim to make the <Tab> key look and feel as if tabs were set +at the value of 'softtabstop', but actually use a combination of tabs and +spaces. + After you execute the following command, every time you press the <Tab> key +the cursor moves to the next 4-column boundary: > + + :set softtabstop=4 + +When you start in the first column and press <Tab>, you get 4 spaces inserted +in your text. The second time, Vim takes out the 4 spaces and puts in a <Tab> +(thus taking you to column 8). Thus Vim uses as many <Tab>s as possible, and +then fills up with spaces. + When backspacing it works the other way around. A <BS> will always delete +the amount specified with 'softtabstop'. Then <Tabs> are used as many as +possible and spaces to fill the gap. + The following shows what happens pressing <Tab> a few times, and then using +<BS>. A "." stands for a space and "------->" for a <Tab>. + + type result ~ + <Tab> .... + <Tab><Tab> -------> + <Tab><Tab><Tab> ------->.... + <Tab><Tab><Tab><BS> -------> + <Tab><Tab><Tab><BS><BS> .... + +An alternative is to use the 'smarttab' option. When it's set, Vim uses +'shiftwidth' for a <Tab> typed in the indent of a line, and a real <Tab> when +typed after the first non-blank character. However, <BS> doesn't work like +with 'softtabstop'. + + +JUST SPACES + +If you want absolutely no tabs in your file, you can set the 'expandtab' +option: > + + :set expandtab + +When this option is set, the <Tab> key inserts a series of spaces. Thus you +get the same amount of white space as if a <Tab> character was inserted, but +there isn't a real <Tab> character in your file. + The backspace key will delete each space by itself. Thus after typing one +<Tab> you have to press the <BS> key up to eight times to undo it. If you are +in the indent, pressing CTRL-D will be a lot quicker. + + +CHANGING TABS IN SPACES (AND BACK) + +Setting 'expandtab' does not affect any existing tabs. In other words, any +tabs in the document remain tabs. If you want to convert tabs to spaces, use +the ":retab" command. Use these commands: > + + :set expandtab + :%retab + +Now Vim will have changed all indents to use spaces instead of tabs. However, +all tabs that come after a non-blank character are kept. If you want these to +be converted as well, add a !: > + + :%retab! + +This is a little bit dangerous, because it can also change tabs inside a +string. To check if these exist, you could use this: > + + /"[^"\t]*\t[^"]*" + +It's recommended not to use hard tabs inside a string. Replace them with +"\t" to avoid trouble. + +The other way around works just as well: > + + :set noexpandtab + :%retab! + +============================================================================== +*30.6* Formatting comments + +One of the great things about Vim is that it understands comments. You can +ask Vim to format a comment and it will do the right thing. + Suppose, for example, that you have the following comment: + + /* ~ + * This is a test ~ + * of the text formatting. ~ + */ ~ + +You then ask Vim to format it by positioning the cursor at the start of the +comment and type: > + + gq]/ + +"gq" is the operator to format text. "]/" is the motion that takes you to the +end of a comment. The result is: + + /* ~ + * This is a test of the text formatting. ~ + */ ~ + +Notice that Vim properly handled the beginning of each line. + An alternative is to select the text that is to be formatted in Visual mode +and type "gq". + +To add a new line to the comment, position the cursor on the middle line and +press "o". The result looks like this: + + /* ~ + * This is a test of the text formatting. ~ + * ~ + */ ~ + +Vim has automatically inserted a star and a space for you. Now you can type +the comment text. When it gets longer than 'textwidth', Vim will break the +line. Again, the star is inserted automatically: + + /* ~ + * This is a test of the text formatting. ~ + * Typing a lot of text here will make Vim ~ + * break ~ + */ ~ + +For this to work some flags must be present in 'formatoptions': + + r insert the star when typing <Enter> in Insert mode + o insert the star when using "o" or "O" in Normal mode + c break comment text according to 'textwidth' + +See |fo-table| for more flags. + + +DEFINING A COMMENT + +The 'comments' option defines what a comment looks like. Vim distinguishes +between a single-line comment and a comment that has a different start, end +and middle part. + Many single-line comments start with a specific character. In C++ // is +used, in Makefiles #, in Vim scripts ". For example, to make Vim understand +C++ comments: > + + :set comments=:// + +The colon separates the flags of an item from the text by which the comment is +recognized. The general form of an item in 'comments' is: + + {flags}:{text} + +The {flags} part can be empty, as in this case. + Several of these items can be concatenated, separated by commas. This +allows recognizing different types of comments at the same time. For example, +let's edit an e-mail message. When replying, the text that others wrote is +preceded with ">" and "!" characters. This command would work: > + + :set comments=n:>,n:! + +There are two items, one for comments starting with ">" and one for comments +that start with "!". Both use the flag "n". This means that these comments +nest. Thus a line starting with ">" may have another comment after the ">". +This allows formatting a message like this: + + > ! Did you see that site? ~ + > ! It looks really great. ~ + > I don't like it. The ~ + > colors are terrible. ~ + What is the URL of that ~ + site? ~ + +Try setting 'textwidth' to a different value, e.g., 80, and format the text by +Visually selecting it and typing "gq". The result is: + + > ! Did you see that site? It looks really great. ~ + > I don't like it. The colors are terrible. ~ + What is the URL of that site? ~ + +You will notice that Vim did not move text from one type of comment to +another. The "I" in the second line would have fit at the end of the first +line, but since that line starts with "> !" and the second line with ">", Vim +knows that this is a different kind of comment. + + +A THREE PART COMMENT + +A C comment starts with "/*", has "*" in the middle and "*/" at the end. The +entry in 'comments' for this looks like this: > + + :set comments=s1:/*,mb:*,ex:*/ + +The start is defined with "s1:/*". The "s" indicates the start of a +three-piece comment. The colon separates the flags from the text by which the +comment is recognized: "/*". There is one flag: "1". This tells Vim that the +middle part has an offset of one space. + The middle part "mb:*" starts with "m", which indicates it is a middle +part. The "b" flag means that a blank must follow the text. Otherwise Vim +would consider text like "*pointer" also to be the middle of a comment. + The end part "ex:*/" has the "e" for identification. The "x" flag has a +special meaning. It means that after Vim automatically inserted a star, +typing / will remove the extra space. + +For more details see |format-comments|. + +============================================================================== + +Next chapter: |usr_31.txt| Exploiting the GUI + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_31.txt b/Aufgabe5/doc.lang/usr_31.txt new file mode 100644 index 0000000..4c11232 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_31.txt @@ -0,0 +1,272 @@ +*usr_31.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Exploiting the GUI + + +Vim works well in a terminal, but the GUI has a few extra items. A file +browser can be used for commands that use a file. A dialog to make a choice +between alternatives. Use keyboard shortcuts to access menu items quickly. + +|31.1| The file browser +|31.2| Confirmation +|31.3| Menu shortcuts +|31.4| Vim window position and size +|31.5| Various + + Next chapter: |usr_32.txt| The undo tree + Previous chapter: |usr_30.txt| Editing programs +Table of contents: |usr_toc.txt| + +============================================================================== +*31.1* The file browser + +When using the File/Open... menu you get a file browser. This makes it easier +to find the file you want to edit. But what if you want to split a window to +edit another file? There is no menu entry for this. You could first use +Window/Split and then File/Open..., but that's more work. + Since you are typing most commands in Vim, opening the file browser with a +typed command is possible as well. To make the split command use the file +browser, prepend "browse": > + + :browse split + +Select a file and then the ":split" command will be executed with it. If you +cancel the file dialog nothing happens, the window isn't split. + You can also specify a file name argument. This is used to tell the file +browser where to start. Example: > + + :browse split /etc + +The file browser will pop up, starting in the directory "/etc". + +The ":browse" command can be prepended to just about any command that opens a +file. + If no directory is specified, Vim will decide where to start the file +browser. By default it uses the same directory as the last time. Thus when +you used ":browse split" and selected a file in "/usr/local/share", the next +time you use a ":browse" it will start in "/usr/local/share" again. + This can be changed with the 'browsedir' option. It can have one of three +values: + + last Use the last directory browsed (default) + buffer Use the same directory as the current buffer + current use the current directory + +For example, when you are in the directory "/usr", editing the file +"/usr/local/share/readme", then the command: > + + :set browsedir=buffer + :browse edit + +Will start the browser in "/usr/local/share". Alternatively: > + + :set browsedir=current + :browse edit + +Will start the browser in "/usr". + + Note: + To avoid using the mouse, most file browsers offer using key presses + to navigate. Since this is different for every system, it is not + explained here. Vim uses a standard browser when possible, your + system documentation should contain an explanation on the keyboard + shortcuts somewhere. + +When you are not using the GUI version, you could use the file explorer window +to select files like in a file browser. However, this doesn't work for the +":browse" command. See |netrw-browse|. + +============================================================================== +*31.2* Confirmation + +Vim protects you from accidentally overwriting a file and other ways to lose +changes. If you do something that might be a bad thing to do, Vim produces an +error message and suggests appending ! if you really want to do it. + To avoid retyping the command with the !, you can make Vim give you a +dialog. You can then press "OK" or "Cancel" to tell Vim what you want. + For example, you are editing a file and made changes to it. You start +editing another file with: > + + :confirm edit foo.txt + +Vim will pop up a dialog that looks something like this: + + +-----------------------------------+ + | | + | ? Save changes to "bar.txt"? | + | | + | YES NO CANCEL | + +-----------------------------------+ + +Now make your choice. If you do want to save the changes, select "YES". If +you want to lose the changes for ever: "NO". If you forgot what you were +doing and want to check what really changed use "CANCEL". You will be back in +the same file, with the changes still there. + +Just like ":browse", the ":confirm" command can be prepended to most commands +that edit another file. They can also be combined: > + + :confirm browse edit + +This will produce a dialog when the current buffer was changed. Then it will +pop up a file browser to select the file to edit. + + Note: + In the dialog you can use the keyboard to select the choice. + Typically the <Tab> key and the cursor keys change the choice. + Pressing <Enter> selects the choice. This depends on the system + though. + +When you are not using the GUI, the ":confirm" command works as well. Instead +of popping up a dialog, Vim will print the message at the bottom of the Vim +window and ask you to press a key to make a choice. > + + :confirm edit main.c +< Save changes to "Untitled"? ~ + [Y]es, (N)o, (C)ancel: ~ + +You can now press the single key for the choice. You don't have to press +<Enter>, unlike other typing on the command line. + +============================================================================== +*31.3* Menu shortcuts + +The keyboard is used for all Vim commands. The menus provide a simple way to +select commands, without knowing what they are called. But you have to move +your hand from the keyboard and grab the mouse. + Menus can often be selected with keys as well. This depends on your +system, but most often it works this way. Use the <Alt> key in combination +with the underlined letter of a menu. For example, <A-w> (<Alt> and w) pops +up the Window menu. + In the Window menu, the "split" item has the p underlined. To select it, +let go of the <Alt> key and press p. + +After the first selection of a menu with the <Alt> key, you can use the cursor +keys to move through the menus. <Right> selects a submenu and <left> closes +it. <Esc> also closes a menu. <Enter> selects a menu item. + +There is a conflict between using the <Alt> key to select menu items, and +using <Alt> key combinations for mappings. The 'winaltkeys' option tells Vim +what it should do with the <Alt> key. + The default value "menu" is the smart choice: If the key combination is a +menu shortcut it can't be mapped. All other keys are available for mapping. + The value "no" doesn't use any <Alt> keys for the menus. Thus you must use +the mouse for the menus, and all <Alt> keys can be mapped. + The value "yes" means that Vim will use any <Alt> keys for the menus. Some +<Alt> key combinations may also do other things than selecting a menu. + +============================================================================== +*31.4* Vim window position and size + +To see the current Vim window position on the screen use: > + + :winpos + +This will only work in the GUI. The output may look like this: + + Window position: X 272, Y 103 ~ + +The position is given in screen pixels. Now you can use the numbers to move +Vim somewhere else. For example, to move it to the left a hundred pixels: > + + :winpos 172 103 +< + Note: + There may be a small offset between the reported position and where + the window moves. This is because of the border around the window. + This is added by the window manager. + +You can use this command in your startup script to position the window at a +specific position. + +The size of the Vim window is computed in characters. Thus this depends on +the size of the font being used. You can see the current size with this +command: > + + :set lines columns + +To change the size set the 'lines' and/or 'columns' options to a new value: > + + :set lines=50 + :set columns=80 + +Obtaining the size works in a terminal just like in the GUI. Setting the size +is not possible in most terminals. + +You can start the X-Windows version of gvim with an argument to specify the +size and position of the window: > + + gvim -geometry {width}x{height}+{x_offset}+{y_offset} + +{width} and {height} are in characters, {x_offset} and {y_offset} are in +pixels. Example: > + + gvim -geometry 80x25+100+300 + +============================================================================== +*31.5* Various + +You can use gvim to edit an e-mail message. In your e-mail program you must +select gvim to be the editor for messages. When you try that, you will +see that it doesn't work: The mail program thinks that editing is finished, +while gvim is still running! + What happens is that gvim disconnects from the shell it was started in. +That is fine when you start gvim in a terminal, so that you can do other work +in that terminal. But when you really want to wait for gvim to finish, you +must prevent it from disconnecting. The "-f" argument does this: > + + gvim -f file.txt + +The "-f" stands for foreground. Now Vim will block the shell it was started +in until you finish editing and exit. + + +DELAYED START OF THE GUI + +On Unix it's possible to first start Vim in a terminal. That's useful if you +do various tasks in the same shell. If you are editing a file and decide you +want to use the GUI after all, you can start it with: > + + :gui + +Vim will open the GUI window and no longer use the terminal. You can continue +using the terminal for something else. The "-f" argument is used here to run +the GUI in the foreground. You can also use ":gui -f". + + +THE GVIM STARTUP FILE + +When gvim starts, it reads the gvimrc file. That's similar to the vimrc file +used when starting Vim. The gvimrc file can be used for settings and commands +that are only to be used when the GUI is going to be started. For example, +you can set the 'lines' option to set a different window size: > + + :set lines=55 + +You don't want to do this in a terminal, since it's size is fixed (except for +an xterm that supports resizing). + The gvimrc file is searched for in the same locations as the vimrc file. +Normally it's name is "~/.gvimrc" for Unix and "$VIM/_gvimrc" for MS-Windows. +The $MYGVIMRC environment variable is set to it, thus you can use this command +to edit the file, if you have one: > + + :edit $MYGVIMRC +< + If for some reason you don't want to use the normal gvimrc file, you can +specify another one with the "-U" argument: > + + gvim -U thisrc ... + +That allows starting gvim for different kinds of editing. You could set +another font size, for example. + To completely skip reading a gvimrc file: > + + gvim -U NONE ... + +============================================================================== + +Next chapter: |usr_32.txt| The undo tree + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_32.txt b/Aufgabe5/doc.lang/usr_32.txt new file mode 100644 index 0000000..055a5ad --- /dev/null +++ b/Aufgabe5/doc.lang/usr_32.txt @@ -0,0 +1,151 @@ +*usr_32.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + VIM USER MANUAL - by Bram Moolenaar + + The undo tree + + +Vim provides multi-level undo. If you undo a few changes and then make a new +change you create a branch in the undo tree. This text is about moving +through the branches. + +|32.1| Numbering changes +|32.2| Jumping around the tree +|32.3| Time travelling + + Next chapter: |usr_40.txt| Make new commands + Previous chapter: |usr_31.txt| Exploiting the GUI +Table of contents: |usr_toc.txt| + +============================================================================== +*32.1* Numbering changes + +In section |02.5| we only discussed one line of undo/redo. But it is also +possible to branch off. This happens when you undo a few changes and then +make a new change. The new changes become a branch in the undo tree. + +Let's start with the text "one". The first change to make is to append +" too". And then move to the first 'o' and change it into 'w'. We then have +two changes, numbered 1 and 2, and three states of the text: + + one ~ + | + change 1 + | + one too ~ + | + change 2 + | + one two ~ + +If we now undo one change, back to "one too", and change "one" to "me" we +create a branch in the undo tree: + + one ~ + | + change 1 + | + one too ~ + / \ + change 2 change 3 + | | + one two me too ~ + +You can now use the |u| command to undo. If you do this twice you get to +"one". Use |CTRL-R| to redo, and you will go to "one too". One more |CTRL-R| +takes you to "me too". Thus undo and redo go up and down in the tree, using +the branch that was last used. + +What matters here is the order in which the changes are made. Undo and redo +are not considered changes in this context. After each change you have a new +state of the text. + +Note that only the changes are numbered, the text shown in the tree above has +no identifier. They are mostly referred to by the number of the change above +it. But sometimes by the number of one of the changes below it, especially +when moving up in the tree, so that you know which change was just undone. + +============================================================================== +*32.2* Jumping around the tree + +So how do you get to "one two" now? You can use this command: > + + :undo 2 + +The text is now "one two", you are below change 2. You can use the |:undo| +command to jump to below any change in the tree. + +Now make another change: change "one" to "not": + + one ~ + | + change 1 + | + one too ~ + / \ + change 2 change 3 + | | + one two me too ~ + | + change 4 + | + not two ~ + +Now you change your mind and want to go back to "me too". Use the |g-| +command. This moves back in time. Thus it doesn't walk the tree upwards or +downwards, but goes to the change made before. + +You can repeat |g-| and you will see the text change: + me too ~ + one two ~ + one too ~ + one ~ + +Use |g+| to move forward in time: + one ~ + one too ~ + one two ~ + me too ~ + not two ~ + +Using |:undo| is useful if you know what change you want to jump to. |g-| and +|g+| are useful if you don't know exactly what the change number is. + +You can type a count before |g-| and |g+| to repeat them. + +============================================================================== +*32.3* Time travelling + +When you have been working on text for a while the tree grows to become big. +Then you may want to go to the text of some minutes ago. + +To see what branches there are in the undo tree use this command: > + + :undolist +< number changes time ~ + 3 2 16 seconds ago + 4 3 5 seconds ago + +Here you can see the number of the leaves in each branch and when the change +was made. Assuming we are below change 4, at "not two", you can go back ten +seconds with this command: > + + :earlier 10s + +Depending on how much time you took for the changes you end up at a certain +position in the tree. The |:earlier| command argument can be "m" for minutes +and "h" for hours. To go all the way back use a big number: > + + :earlier 10h + +To travel forward in time again use the |:later| command: > + + :later 1m + +The arguments are "s", "m" and "h", just like with |:earlier|. + +============================================================================== + +Next chapter: |usr_40.txt| Make new commands + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_40.txt b/Aufgabe5/doc.lang/usr_40.txt new file mode 100644 index 0000000..879d145 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_40.txt @@ -0,0 +1,656 @@ +*usr_40.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Make new commands + + +Vim is an extensible editor. You can take a sequence of commands you use +often and turn it into a new command. Or redefine an existing command. +Autocommands make it possible to execute commands automatically. + +|40.1| Key mapping +|40.2| Defining command-line commands +|40.3| Autocommands + + Next chapter: |usr_41.txt| Write a Vim script + Previous chapter: |usr_32.txt| The undo tree +Table of contents: |usr_toc.txt| + +============================================================================== +*40.1* Key mapping + +A simple mapping was explained in section |05.3|. The principle is that one +sequence of key strokes is translated into another sequence of key strokes. +This is a simple, yet powerful mechanism. + The simplest form is that one key is mapped to a sequence of keys. Since +the function keys, except <F1>, have no predefined meaning in Vim, these are a +good choice to map. Example: > + + :map <F2> GoDate: <Esc>:read !date<CR>kJ + +This shows how three modes are used. After going to the last line with "G", +the "o" command opens a new line and starts Insert mode. The text "Date: " is +inserted and <Esc> takes you out of insert mode. + Notice the use of special keys inside <>. This is called angle bracket +notation. You type these as separate characters, not by pressing the key +itself. This makes the mappings better readable and you can copy and paste +the text without problems. + The ":" character takes Vim to the command line. The ":read !date" command +reads the output from the "date" command and appends it below the current +line. The <CR> is required to execute the ":read" command. + At this point of execution the text looks like this: + + Date: ~ + Fri Jun 15 12:54:34 CEST 2001 ~ + +Now "kJ" moves the cursor up and joins the lines together. + To decide which key or keys you use for mapping, see |map-which-keys|. + + +MAPPING AND MODES + +The ":map" command defines remapping for keys in Normal mode. You can also +define mappings for other modes. For example, ":imap" applies to Insert mode. +You can use it to insert a date below the cursor: > + + :imap <F2> <CR>Date: <Esc>:read !date<CR>kJ + +It looks a lot like the mapping for <F2> in Normal mode, only the start is +different. The <F2> mapping for Normal mode is still there. Thus you can map +the same key differently for each mode. + Notice that, although this mapping starts in Insert mode, it ends in Normal +mode. If you want it to continue in Insert mode, append an "a" to the +mapping. + +Here is an overview of map commands and in which mode they work: + + :map Normal, Visual and Operator-pending + :vmap Visual + :nmap Normal + :omap Operator-pending + :map! Insert and Command-line + :imap Insert + :cmap Command-line + +Operator-pending mode is when you typed an operator character, such as "d" or +"y", and you are expected to type the motion command or a text object. Thus +when you type "dw", the "w" is entered in operator-pending mode. + +Suppose that you want to define <F7> so that the command d<F7> deletes a C +program block (text enclosed in curly braces, {}). Similarly y<F7> would yank +the program block into the unnamed register. Therefore, what you need to do +is to define <F7> to select the current program block. You can do this with +the following command: > + + :omap <F7> a{ + +This causes <F7> to perform a select block "a{" in operator-pending mode, just +like you typed it. This mapping is useful if typing a { on your keyboard is a +bit difficult. + + +LISTING MAPPINGS + +To see the currently defined mappings, use ":map" without arguments. Or one +of the variants that include the mode in which they work. The output could +look like this: + + _g :call MyGrep(1)<CR> ~ + v <F2> :s/^/> /<CR>:noh<CR>`` ~ + n <F2> :.,$s/^/> /<CR>:noh<CR>`` ~ + <xHome> <Home> + <xEnd> <End> + + +The first column of the list shows in which mode the mapping is effective. +This is "n" for Normal mode, "i" for Insert mode, etc. A blank is used for a +mapping defined with ":map", thus effective in both Normal and Visual mode. + One useful purpose of listing the mapping is to check if special keys in <> +form have been recognized (this only works when color is supported). For +example, when <Esc> is displayed in color, it stands for the escape character. +When it has the same color as the other text, it is five characters. + + +REMAPPING + +The result of a mapping is inspected for other mappings in it. For example, +the mappings for <F2> above could be shortened to: > + + :map <F2> G<F3> + :imap <F2> <Esc><F3> + :map <F3> oDate: <Esc>:read !date<CR>kJ + +For Normal mode <F2> is mapped to go to the last line, and then behave like +<F3> was pressed. In Insert mode <F2> stops Insert mode with <Esc> and then +also uses <F3>. Then <F3> is mapped to do the actual work. + +Suppose you hardly ever use Ex mode, and want to use the "Q" command to format +text (this was so in old versions of Vim). This mapping will do it: > + + :map Q gq + +But, in rare cases you need to use Ex mode anyway. Let's map "gQ" to Q, so +that you can still go to Ex mode: > + + :map gQ Q + +What happens now is that when you type "gQ" it is mapped to "Q". So far so +good. But then "Q" is mapped to "gq", thus typing "gQ" results in "gq", and +you don't get to Ex mode at all. + To avoid keys to be mapped again, use the ":noremap" command: > + + :noremap gQ Q + +Now Vim knows that the "Q" is not to be inspected for mappings that apply to +it. There is a similar command for every mode: + + :noremap Normal, Visual and Operator-pending + :vnoremap Visual + :nnoremap Normal + :onoremap Operator-pending + :noremap! Insert and Command-line + :inoremap Insert + :cnoremap Command-line + + +RECURSIVE MAPPING + +When a mapping triggers itself, it will run forever. This can be used to +repeat an action an unlimited number of times. + For example, you have a list of files that contain a version number in the +first line. You edit these files with "vim *.txt". You are now editing the +first file. Define this mapping: > + + :map ,, :s/5.1/5.2/<CR>:wnext<CR>,, + +Now you type ",,". This triggers the mapping. It replaces "5.1" with "5.2" +in the first line. Then it does a ":wnext" to write the file and edit the +next one. The mapping ends in ",,". This triggers the same mapping again, +thus doing the substitution, etc. + This continues until there is an error. In this case it could be a file +where the substitute command doesn't find a match for "5.1". You can then +make a change to insert "5.1" and continue by typing ",," again. Or the +":wnext" fails, because you are in the last file in the list. + When a mapping runs into an error halfway, the rest of the mapping is +discarded. CTRL-C interrupts the mapping (CTRL-Break on MS-Windows). + + +DELETE A MAPPING + +To remove a mapping use the ":unmap" command. Again, the mode the unmapping +applies to depends on the command used: + + :unmap Normal, Visual and Operator-pending + :vunmap Visual + :nunmap Normal + :ounmap Operator-pending + :unmap! Insert and Command-line + :iunmap Insert + :cunmap Command-line + +There is a trick to define a mapping that works in Normal and Operator-pending +mode, but not in Visual mode. First define it for all three modes, then +delete it for Visual mode: > + + :map <C-A> /---><CR> + :vunmap <C-A> + +Notice that the five characters "<C-A>" stand for the single key CTRL-A. + +To remove all mappings use the |:mapclear| command. You can guess the +variations for different modes by now. Be careful with this command, it can't +be undone. + + +SPECIAL CHARACTERS + +The ":map" command can be followed by another command. A | character +separates the two commands. This also means that a | character can't be used +inside a map command. To include one, use <Bar> (five characters). Example: +> + :map <F8> :write <Bar> !checkin %<CR> + +The same problem applies to the ":unmap" command, with the addition that you +have to watch out for trailing white space. These two commands are different: +> + :unmap a | unmap b + :unmap a| unmap b + +The first command tries to unmap "a ", with a trailing space. + +When using a space inside a mapping, use <Space> (seven characters): > + + :map <Space> W + +This makes the spacebar move a blank-separated word forward. + +It is not possible to put a comment directly after a mapping, because the " +character is considered to be part of the mapping. You can use |", this +starts a new, empty command with a comment. Example: > + + :map <Space> W| " Use spacebar to move forward a word + + +MAPPINGS AND ABBREVIATIONS + +Abbreviations are a lot like Insert mode mappings. The arguments are handled +in the same way. The main difference is the way they are triggered. An +abbreviation is triggered by typing a non-word character after the word. A +mapping is triggered when typing the last character. + Another difference is that the characters you type for an abbreviation are +inserted in the text while you type them. When the abbreviation is triggered +these characters are deleted and replaced by what the abbreviation produces. +When typing the characters for a mapping, nothing is inserted until you type +the last character that triggers it. If the 'showcmd' option is set, the +typed characters are displayed in the last line of the Vim window. + An exception is when a mapping is ambiguous. Suppose you have done two +mappings: > + + :imap aa foo + :imap aaa bar + +Now, when you type "aa", Vim doesn't know if it should apply the first or the +second mapping. It waits for another character to be typed. If it is an "a", +the second mapping is applied and results in "bar". If it is a space, for +example, the first mapping is applied, resulting in "foo", and then the space +is inserted. + + +ADDITIONALLY... + +The <script> keyword can be used to make a mapping local to a script. See +|:map-<script>|. + +The <buffer> keyword can be used to make a mapping local to a specific buffer. +See |:map-<buffer>| + +The <unique> keyword can be used to make defining a new mapping fail when it +already exists. Otherwise a new mapping simply overwrites the old one. See +|:map-<unique>|. + +To make a key do nothing, map it to <Nop> (five characters). This will make +the <F7> key do nothing at all: > + + :map <F7> <Nop>| map! <F7> <Nop> + +There must be no space after <Nop>. + +============================================================================== +*40.2* Defining command-line commands + +The Vim editor enables you to define your own commands. You execute these +commands just like any other Command-line mode command. + To define a command, use the ":command" command, as follows: > + + :command DeleteFirst 1delete + +Now when you execute the command ":DeleteFirst" Vim executes ":1delete", which +deletes the first line. + + Note: + User-defined commands must start with a capital letter. You cannot + use ":X", ":Next" and ":Print". The underscore cannot be used! You + can use digits, but this is discouraged. + +To list the user-defined commands, execute the following command: > + + :command + +Just like with the builtin commands, the user defined commands can be +abbreviated. You need to type just enough to distinguish the command from +another. Command line completion can be used to get the full name. + + +NUMBER OF ARGUMENTS + +User-defined commands can take a series of arguments. The number of arguments +must be specified by the -nargs option. For instance, the example +:DeleteFirst command takes no arguments, so you could have defined it as +follows: > + + :command -nargs=0 DeleteFirst 1delete + +However, because zero arguments is the default, you do not need to add +"-nargs=0". The other values of -nargs are as follows: + + -nargs=0 No arguments + -nargs=1 One argument + -nargs=* Any number of arguments + -nargs=? Zero or one argument + -nargs=+ One or more arguments + + +USING THE ARGUMENTS + +Inside the command definition, the arguments are represented by the +<args> keyword. For example: > + + :command -nargs=+ Say :echo "<args>" + +Now when you type > + + :Say Hello World + +Vim echoes "Hello World". However, if you add a double quote, it won't work. +For example: > + + :Say he said "hello" + +To get special characters turned into a string, properly escaped to use as an +expression, use "<q-args>": > + + :command -nargs=+ Say :echo <q-args> + +Now the above ":Say" command will result in this to be executed: > + + :echo "he said \"hello\"" + +The <f-args> keyword contains the same information as the <args> keyword, +except in a format suitable for use as function call arguments. For example: +> + :command -nargs=* DoIt :call AFunction(<f-args>) + :DoIt a b c + +Executes the following command: > + + :call AFunction("a", "b", "c") + + +LINE RANGE + +Some commands take a range as their argument. To tell Vim that you are +defining such a command, you need to specify a -range option. The values for +this option are as follows: + + -range Range is allowed; default is the current line. + -range=% Range is allowed; default is the whole file. + -range={count} Range is allowed; the last number in it is used as a + single number whose default is {count}. + +When a range is specified, the keywords <line1> and <line2> get the values of +the first and last line in the range. For example, the following command +defines the SaveIt command, which writes out the specified range to the file +"save_file": > + + :command -range=% SaveIt :<line1>,<line2>write! save_file + + +OTHER OPTIONS + +Some of the other options and keywords are as follows: + + -count={number} The command can take a count whose default is + {number}. The resulting count can be used + through the <count> keyword. + -bang You can use a !. If present, using <bang> will + result in a !. + -register You can specify a register. (The default is + the unnamed register.) + The register specification is available as + <reg> (a.k.a. <register>). + -complete={type} Type of command-line completion used. See + |:command-completion| for the list of possible + values. + -bar The command can be followed by | and another + command, or " and a comment. + -buffer The command is only available for the current + buffer. + +Finally, you have the <lt> keyword. It stands for the character <. Use this +to escape the special meaning of the <> items mentioned. + + +REDEFINING AND DELETING + +To redefine the same command use the ! argument: > + + :command -nargs=+ Say :echo "<args>" + :command! -nargs=+ Say :echo <q-args> + +To delete a user command use ":delcommand". It takes a single argument, which +is the name of the command. Example: > + + :delcommand SaveIt + +To delete all the user commands: > + + :comclear + +Careful, this can't be undone! + +More details about all this in the reference manual: |user-commands|. + +============================================================================== +*40.3* Autocommands + +An autocommand is a command that is executed automatically in response to some +event, such as a file being read or written or a buffer change. Through the +use of autocommands you can train Vim to edit compressed files, for example. +That is used in the |gzip| plugin. + Autocommands are very powerful. Use them with care and they will help you +avoid typing many commands. Use them carelessly and they will cause a lot of +trouble. + +Suppose you want to replace a datestamp on the end of a file every time it is +written. First you define a function: > + + :function DateInsert() + : $delete + : read !date + :endfunction + +You want this function to be called each time, just before a file is written. +This will make that happen: > + + :autocmd FileWritePre * call DateInsert() + +"FileWritePre" is the event for which this autocommand is triggered: Just +before (pre) writing a file. The "*" is a pattern to match with the file +name. In this case it matches all files. + With this command enabled, when you do a ":write", Vim checks for any +matching FileWritePre autocommands and executes them, and then it +performs the ":write". + The general form of the :autocmd command is as follows: > + + :autocmd [group] {events} {file_pattern} [nested] {command} + +The [group] name is optional. It is used in managing and calling the commands +(more on this later). The {events} parameter is a list of events (comma +separated) that trigger the command. + {file_pattern} is a filename, usually with wildcards. For example, using +"*.txt" makes the autocommand be used for all files whose name end in ".txt". +The optional [nested] flag allows for nesting of autocommands (see below), and +finally, {command} is the command to be executed. + + +EVENTS + +One of the most useful events is BufReadPost. It is triggered after a new +file is being edited. It is commonly used to set option values. For example, +you know that "*.gsm" files are GNU assembly language. To get the syntax file +right, define this autocommand: > + + :autocmd BufReadPost *.gsm set filetype=asm + +If Vim is able to detect the type of file, it will set the 'filetype' option +for you. This triggers the Filetype event. Use this to do something when a +certain type of file is edited. For example, to load a list of abbreviations +for text files: > + + :autocmd Filetype text source ~/.vim/abbrevs.vim + +When starting to edit a new file, you could make Vim insert a skeleton: > + + :autocmd BufNewFile *.[ch] 0read ~/skeletons/skel.c + +See |autocmd-events| for a complete list of events. + + +PATTERNS + +The {file_pattern} argument can actually be a comma-separated list of file +patterns. For example: "*.c,*.h" matches files ending in ".c" and ".h". + The usual file wildcards can be used. Here is a summary of the most often +used ones: + + * Match any character any number of times + ? Match any character once + [abc] Match the character a, b or c + . Matches a dot + a{b,c} Matches "ab" and "ac" + +When the pattern includes a slash (/) Vim will compare directory names. +Without the slash only the last part of a file name is used. For example, +"*.txt" matches "/home/biep/readme.txt". The pattern "/home/biep/*" would +also match it. But "home/foo/*.txt" wouldn't. + When including a slash, Vim matches the pattern against both the full path +of the file ("/home/biep/readme.txt") and the relative path (e.g., +"biep/readme.txt"). + + Note: + When working on a system that uses a backslash as file separator, such + as MS-Windows, you still use forward slashes in autocommands. This + makes it easier to write the pattern, since a backslash has a special + meaning. It also makes the autocommands portable. + + +DELETING + +To delete an autocommand, use the same command as what it was defined with, +but leave out the {command} at the end and use a !. Example: > + + :autocmd! FileWritePre * + +This will delete all autocommands for the "FileWritePre" event that use the +"*" pattern. + + +LISTING + +To list all the currently defined autocommands, use this: > + + :autocmd + +The list can be very long, especially when filetype detection is used. To +list only part of the commands, specify the group, event and/or pattern. For +example, to list all BufNewFile autocommands: > + + :autocmd BufNewFile + +To list all autocommands for the pattern "*.c": > + + :autocmd * *.c + +Using "*" for the event will list all the events. To list all autocommands +for the cprograms group: > + + :autocmd cprograms + + +GROUPS + +The {group} item, used when defining an autocommand, groups related autocommands +together. This can be used to delete all the autocommands in a certain group, +for example. + When defining several autocommands for a certain group, use the ":augroup" +command. For example, let's define autocommands for C programs: > + + :augroup cprograms + : autocmd BufReadPost *.c,*.h :set sw=4 sts=4 + : autocmd BufReadPost *.cpp :set sw=3 sts=3 + :augroup END + +This will do the same as: > + + :autocmd cprograms BufReadPost *.c,*.h :set sw=4 sts=4 + :autocmd cprograms BufReadPost *.cpp :set sw=3 sts=3 + +To delete all autocommands in the "cprograms" group: > + + :autocmd! cprograms + + +NESTING + +Generally, commands executed as the result of an autocommand event will not +trigger any new events. If you read a file in response to a FileChangedShell +event, it will not trigger the autocommands that would set the syntax, for +example. To make the events triggered, add the "nested" argument: > + + :autocmd FileChangedShell * nested edit + + +EXECUTING AUTOCOMMANDS + +It is possible to trigger an autocommand by pretending an event has occurred. +This is useful to have one autocommand trigger another one. Example: > + + :autocmd BufReadPost *.new execute "doautocmd BufReadPost " . expand("<afile>:r") + +This defines an autocommand that is triggered when a new file has been edited. +The file name must end in ".new". The ":execute" command uses expression +evaluation to form a new command and execute it. When editing the file +"tryout.c.new" the executed command will be: > + + :doautocmd BufReadPost tryout.c + +The expand() function takes the "<afile>" argument, which stands for the file +name the autocommand was executed for, and takes the root of the file name +with ":r". + +":doautocmd" executes on the current buffer. The ":doautoall" command works +like "doautocmd" except it executes on all the buffers. + + +USING NORMAL MODE COMMANDS + +The commands executed by an autocommand are Command-line command. If you want +to use a Normal mode command, the ":normal" command can be used. Example: > + + :autocmd BufReadPost *.log normal G + +This will make the cursor jump to the last line of *.log files when you start +to edit it. + Using the ":normal" command is a bit tricky. First of all, make sure its +argument is a complete command, including all the arguments. When you use "i" +to go to Insert mode, there must also be a <Esc> to leave Insert mode again. +If you use a "/" to start a search pattern, there must be a <CR> to execute +it. + The ":normal" command uses all the text after it as commands. Thus there +can be no | and another command following. To work around this, put the +":normal" command inside an ":execute" command. This also makes it possible +to pass unprintable characters in a convenient way. Example: > + + :autocmd BufReadPost *.chg execute "normal ONew entry:\<Esc>" | + \ 1read !date + +This also shows the use of a backslash to break a long command into more +lines. This can be used in Vim scripts (not at the command line). + +When you want the autocommand do something complicated, which involves jumping +around in the file and then returning to the original position, you may want +to restore the view on the file. See |restore-position| for an example. + + +IGNORING EVENTS + +At times, you will not want to trigger an autocommand. The 'eventignore' +option contains a list of events that will be totally ignored. For example, +the following causes events for entering and leaving a window to be ignored: > + + :set eventignore=WinEnter,WinLeave + +To ignore all events, use the following command: > + + :set eventignore=all + +To set it back to the normal behavior, make 'eventignore' empty: > + + :set eventignore= + +============================================================================== + +Next chapter: |usr_41.txt| Write a Vim script + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_41.txt b/Aufgabe5/doc.lang/usr_41.txt new file mode 100644 index 0000000..4139ad8 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_41.txt @@ -0,0 +1,2374 @@ +*usr_41.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + VIM USER MANUAL - by Bram Moolenaar + + Write a Vim script + + +The Vim script language is used for the startup vimrc file, syntax files, and +many other things. This chapter explains the items that can be used in a Vim +script. There are a lot of them, thus this is a long chapter. + +|41.1| Introduction +|41.2| Variables +|41.3| Expressions +|41.4| Conditionals +|41.5| Executing an expression +|41.6| Using functions +|41.7| Defining a function +|41.8| Lists and Dictionaries +|41.9| Exceptions +|41.10| Various remarks +|41.11| Writing a plugin +|41.12| Writing a filetype plugin +|41.13| Writing a compiler plugin +|41.14| Writing a plugin that loads quickly +|41.15| Writing library scripts +|41.16| Distributing Vim scripts + + Next chapter: |usr_42.txt| Add new menus + Previous chapter: |usr_40.txt| Make new commands +Table of contents: |usr_toc.txt| + +============================================================================== +*41.1* Introduction *vim-script-intro* *script* + +Your first experience with Vim scripts is the vimrc file. Vim reads it when +it starts up and executes the commands. You can set options to values you +prefer. And you can use any colon command in it (commands that start with a +":"; these are sometimes referred to as Ex commands or command-line commands). + Syntax files are also Vim scripts. As are files that set options for a +specific file type. A complicated macro can be defined by a separate Vim +script file. You can think of other uses yourself. + +Let's start with a simple example: > + + :let i = 1 + :while i < 5 + : echo "count is" i + : let i += 1 + :endwhile +< + Note: + The ":" characters are not really needed here. You only need to use + them when you type a command. In a Vim script file they can be left + out. We will use them here anyway to make clear these are colon + commands and make them stand out from Normal mode commands. + Note: + You can try out the examples by yanking the lines from the text here + and executing them with :@" + +The output of the example code is: + + count is 1 ~ + count is 2 ~ + count is 3 ~ + count is 4 ~ + +In the first line the ":let" command assigns a value to a variable. The +generic form is: > + + :let {variable} = {expression} + +In this case the variable name is "i" and the expression is a simple value, +the number one. + The ":while" command starts a loop. The generic form is: > + + :while {condition} + : {statements} + :endwhile + +The statements until the matching ":endwhile" are executed for as long as the +condition is true. The condition used here is the expression "i < 5". This +is true when the variable i is smaller than five. + Note: + If you happen to write a while loop that keeps on running, you can + interrupt it by pressing CTRL-C (CTRL-Break on MS-Windows). + +The ":echo" command prints its arguments. In this case the string "count is" +and the value of the variable i. Since i is one, this will print: + + count is 1 ~ + +Then there is the ":let i += 1" command. This does the same thing as +":let i = i + 1". This adds one to the variable i and assigns the new value +to the same variable. + +The example was given to explain the commands, but would you really want to +make such a loop it can be written much more compact: > + + :for i in range(1, 4) + : echo "count is" i + :endfor + +We won't explain how |:for| and |range()| work until later. Follow the links +if you are impatient. + + +THREE KINDS OF NUMBERS + +Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts +with "0x" or "0X". For example "0x1f" is decimal 31. An octal number starts +with a zero. "017" is decimal 15. Careful: don't put a zero before a decimal +number, it will be interpreted as an octal number! + The ":echo" command always prints decimal numbers. Example: > + + :echo 0x7f 036 +< 127 30 ~ + +A number is made negative with a minus sign. This also works for hexadecimal +and octal numbers. A minus sign is also used for subtraction. Compare this +with the previous example: > + + :echo 0x7f -036 +< 97 ~ + +White space in an expression is ignored. However, it's recommended to use it +for separating items, to make the expression easier to read. For example, to +avoid the confusion with a negative number above, put a space between the +minus sign and the following number: > + + :echo 0x7f - 036 + +============================================================================== +*41.2* Variables + +A variable name consists of ASCII letters, digits and the underscore. It +cannot start with a digit. Valid variable names are: + + counter + _aap3 + very_long_variable_name_with_underscores + FuncLength + LENGTH + +Invalid names are "foo+bar" and "6var". + These variables are global. To see a list of currently defined variables +use this command: > + + :let + +You can use global variables everywhere. This also means that when the +variable "count" is used in one script file, it might also be used in another +file. This leads to confusion at least, and real problems at worst. To avoid +this, you can use a variable local to a script file by prepending "s:". For +example, one script contains this code: > + + :let s:count = 1 + :while s:count < 5 + : source other.vim + : let s:count += 1 + :endwhile + +Since "s:count" is local to this script, you can be sure that sourcing the +"other.vim" script will not change this variable. If "other.vim" also uses an +"s:count" variable, it will be a different copy, local to that script. More +about script-local variables here: |script-variable|. + +There are more kinds of variables, see |internal-variables|. The most often +used ones are: + + b:name variable local to a buffer + w:name variable local to a window + g:name global variable (also in a function) + v:name variable predefined by Vim + + +DELETING VARIABLES + +Variables take up memory and show up in the output of the ":let" command. To +delete a variable use the ":unlet" command. Example: > + + :unlet s:count + +This deletes the script-local variable "s:count" to free up the memory it +uses. If you are not sure if the variable exists, and don't want an error +message when it doesn't, append !: > + + :unlet! s:count + +When a script finishes, the local variables used there will not be +automatically freed. The next time the script executes, it can still use the +old value. Example: > + + :if !exists("s:call_count") + : let s:call_count = 0 + :endif + :let s:call_count = s:call_count + 1 + :echo "called" s:call_count "times" + +The "exists()" function checks if a variable has already been defined. Its +argument is the name of the variable you want to check. Not the variable +itself! If you would do this: > + + :if !exists(s:call_count) + +Then the value of s:call_count will be used as the name of the variable that +exists() checks. That's not what you want. + The exclamation mark ! negates a value. When the value was true, it +becomes false. When it was false, it becomes true. You can read it as "not". +Thus "if !exists()" can be read as "if not exists()". + What Vim calls true is anything that is not zero. Zero is false. + Note: + Vim automatically converts a string to a number when it is looking for + a number. When using a string that doesn't start with a digit the + resulting number is zero. Thus look out for this: > + :if "true" +< The "true" will be interpreted as a zero, thus as false! + + +STRING VARIABLES AND CONSTANTS + +So far only numbers were used for the variable value. Strings can be used as +well. Numbers and strings are the basic types of variables that Vim supports. +The type is dynamic, it is set each time when assigning a value to the +variable with ":let". More about types in |41.8|. + To assign a string value to a variable, you need to use a string constant. +There are two types of these. First the string in double quotes: > + + :let name = "peter" + :echo name +< peter ~ + +If you want to include a double quote inside the string, put a backslash in +front of it: > + + :let name = "\"peter\"" + :echo name +< "peter" ~ + +To avoid the need for a backslash, you can use a string in single quotes: > + + :let name = '"peter"' + :echo name +< "peter" ~ + +Inside a single-quote string all the characters are as they are. Only the +single quote itself is special: you need to use two to get one. A backslash +is taken literally, thus you can't use it to change the meaning of the +character after it. + In double-quote strings it is possible to use special characters. Here are +a few useful ones: + + \t <Tab> + \n <NL>, line break + \r <CR>, <Enter> + \e <Esc> + \b <BS>, backspace + \" " + \\ \, backslash + \<Esc> <Esc> + \<C-W> CTRL-W + +The last two are just examples. The "\<name>" form can be used to include +the special key "name". + See |expr-quote| for the full list of special items in a string. + +============================================================================== +*41.3* Expressions + +Vim has a rich, yet simple way to handle expressions. You can read the +definition here: |expression-syntax|. Here we will show the most common +items. + The numbers, strings and variables mentioned above are expressions by +themselves. Thus everywhere an expression is expected, you can use a number, +string or variable. Other basic items in an expression are: + + $NAME environment variable + &name option + @r register + +Examples: > + + :echo "The value of 'tabstop' is" &ts + :echo "Your home directory is" $HOME + :if @a > 5 + +The &name form can be used to save an option value, set it to a new value, +do something and restore the old value. Example: > + + :let save_ic = &ic + :set noic + :/The Start/,$delete + :let &ic = save_ic + +This makes sure the "The Start" pattern is used with the 'ignorecase' option +off. Still, it keeps the value that the user had set. (Another way to do +this would be to add "\C" to the pattern, see |/\C|.) + + +MATHEMATICS + +It becomes more interesting if we combine these basic items. Let's start with +mathematics on numbers: + + a + b add + a - b subtract + a * b multiply + a / b divide + a % b modulo + +The usual precedence is used. Example: > + + :echo 10 + 5 * 2 +< 20 ~ + +Grouping is done with braces. No surprises here. Example: > + + :echo (10 + 5) * 2 +< 30 ~ + +Strings can be concatenated with ".". Example: > + + :echo "foo" . "bar" +< foobar ~ + +When the ":echo" command gets multiple arguments, it separates them with a +space. In the example the argument is a single expression, thus no space is +inserted. + +Borrowed from the C language is the conditional expression: + + a ? b : c + +If "a" evaluates to true "b" is used, otherwise "c" is used. Example: > + + :let i = 4 + :echo i > 5 ? "i is big" : "i is small" +< i is small ~ + +The three parts of the constructs are always evaluated first, thus you could +see it work as: + + (a) ? (b) : (c) + +============================================================================== +*41.4* Conditionals + +The ":if" commands executes the following statements, until the matching +":endif", only when a condition is met. The generic form is: + + :if {condition} + {statements} + :endif + +Only when the expression {condition} evaluates to true (non-zero) will the +{statements} be executed. These must still be valid commands. If they +contain garbage, Vim won't be able to find the ":endif". + You can also use ":else". The generic form for this is: + + :if {condition} + {statements} + :else + {statements} + :endif + +The second {statements} is only executed if the first one isn't. + Finally, there is ":elseif": + + :if {condition} + {statements} + :elseif {condition} + {statements} + :endif + +This works just like using ":else" and then "if", but without the need for an +extra ":endif". + A useful example for your vimrc file is checking the 'term' option and +doing something depending upon its value: > + + :if &term == "xterm" + : " Do stuff for xterm + :elseif &term == "vt100" + : " Do stuff for a vt100 terminal + :else + : " Do something for other terminals + :endif + + +LOGIC OPERATIONS + +We already used some of them in the examples. These are the most often used +ones: + + a == b equal to + a != b not equal to + a > b greater than + a >= b greater than or equal to + a < b less than + a <= b less than or equal to + +The result is one if the condition is met and zero otherwise. An example: > + + :if v:version >= 700 + : echo "congratulations" + :else + : echo "you are using an old version, upgrade!" + :endif + +Here "v:version" is a variable defined by Vim, which has the value of the Vim +version. 600 is for version 6.0. Version 6.1 has the value 601. This is +very useful to write a script that works with multiple versions of Vim. +|v:version| + +The logic operators work both for numbers and strings. When comparing two +strings, the mathematical difference is used. This compares byte values, +which may not be right for some languages. + When comparing a string with a number, the string is first converted to a +number. This is a bit tricky, because when a string doesn't look like a +number, the number zero is used. Example: > + + :if 0 == "one" + : echo "yes" + :endif + +This will echo "yes", because "one" doesn't look like a number, thus it is +converted to the number zero. + +For strings there are two more items: + + a =~ b matches with + a !~ b does not match with + +The left item "a" is used as a string. The right item "b" is used as a +pattern, like what's used for searching. Example: > + + :if str =~ " " + : echo "str contains a space" + :endif + :if str !~ '\.$' + : echo "str does not end in a full stop" + :endif + +Notice the use of a single-quote string for the pattern. This is useful, +because backslashes would need to be doubled in a double-quote string and +patterns tend to contain many backslashes. + +The 'ignorecase' option is used when comparing strings. When you don't want +that, append "#" to match case and "?" to ignore case. Thus "==?" compares +two strings to be equal while ignoring case. And "!~#" checks if a pattern +doesn't match, also checking the case of letters. For the full table see +|expr-==|. + + +MORE LOOPING + +The ":while" command was already mentioned. Two more statements can be used +in between the ":while" and the ":endwhile": + + :continue Jump back to the start of the while loop; the + loop continues. + :break Jump forward to the ":endwhile"; the loop is + discontinued. + +Example: > + + :while counter < 40 + : call do_something() + : if skip_flag + : continue + : endif + : if finished_flag + : break + : endif + : sleep 50m + :endwhile + +The ":sleep" command makes Vim take a nap. The "50m" specifies fifty +milliseconds. Another example is ":sleep 4", which sleeps for four seconds. + +Even more looping can be done with the ":for" command, see below in |41.8|. + +============================================================================== +*41.5* Executing an expression + +So far the commands in the script were executed by Vim directly. The +":execute" command allows executing the result of an expression. This is a +very powerful way to build commands and execute them. + An example is to jump to a tag, which is contained in a variable: > + + :execute "tag " . tag_name + +The "." is used to concatenate the string "tag " with the value of variable +"tag_name". Suppose "tag_name" has the value "get_cmd", then the command that +will be executed is: > + + :tag get_cmd + +The ":execute" command can only execute colon commands. The ":normal" command +executes Normal mode commands. However, its argument is not an expression but +the literal command characters. Example: > + + :normal gg=G + +This jumps to the first line and formats all lines with the "=" operator. + To make ":normal" work with an expression, combine ":execute" with it. +Example: > + + :execute "normal " . normal_commands + +The variable "normal_commands" must contain the Normal mode commands. + Make sure that the argument for ":normal" is a complete command. Otherwise +Vim will run into the end of the argument and abort the command. For example, +if you start Insert mode, you must leave Insert mode as well. This works: > + + :execute "normal Inew text \<Esc>" + +This inserts "new text " in the current line. Notice the use of the special +key "\<Esc>". This avoids having to enter a real <Esc> character in your +script. + +If you don't want to execute a string but evaluate it to get its expression +value, you can use the eval() function: > + + :let optname = "path" + :let optval = eval('&' . optname) + +A "&" character is prepended to "path", thus the argument to eval() is +"&path". The result will then be the value of the 'path' option. + The same thing can be done with: > + :exe 'let optval = &' . optname + +============================================================================== +*41.6* Using functions + +Vim defines many functions and provides a large amount of functionality that +way. A few examples will be given in this section. You can find the whole +list here: |functions|. + +A function is called with the ":call" command. The parameters are passed in +between braces, separated by commas. Example: > + + :call search("Date: ", "W") + +This calls the search() function, with arguments "Date: " and "W". The +search() function uses its first argument as a search pattern and the second +one as flags. The "W" flag means the search doesn't wrap around the end of +the file. + +A function can be called in an expression. Example: > + + :let line = getline(".") + :let repl = substitute(line, '\a', "*", "g") + :call setline(".", repl) + +The getline() function obtains a line from the current buffer. Its argument +is a specification of the line number. In this case "." is used, which means +the line where the cursor is. + The substitute() function does something similar to the ":substitute" +command. The first argument is the string on which to perform the +substitution. The second argument is the pattern, the third the replacement +string. Finally, the last arguments are the flags. + The setline() function sets the line, specified by the first argument, to a +new string, the second argument. In this example the line under the cursor is +replaced with the result of the substitute(). Thus the effect of the three +statements is equal to: > + + :substitute/\a/*/g + +Using the functions becomes more interesting when you do more work before and +after the substitute() call. + + +FUNCTIONS *function-list* + +There are many functions. We will mention them here, grouped by what they are +used for. You can find an alphabetical list here: |functions|. Use CTRL-] on +the function name to jump to detailed help on it. + +String manipulation: + nr2char() get a character by its ASCII value + char2nr() get ASCII value of a character + str2nr() convert a string to a number + printf() format a string according to % items + escape() escape characters in a string with a '\' + tr() translate characters from one set to another + strtrans() translate a string to make it printable + tolower() turn a string to lowercase + toupper() turn a string to uppercase + match() position where a pattern matches in a string + matchend() position where a pattern match ends in a string + matchstr() match of a pattern in a string + matchlist() like matchstr() and also return submatches + stridx() first index of a short string in a long string + strridx() last index of a short string in a long string + strlen() length of a string + substitute() substitute a pattern match with a string + submatch() get a specific match in a ":substitute" + strpart() get part of a string + expand() expand special keywords + iconv() convert text from one encoding to another + byteidx() byte index of a character in a string + repeat() repeat a string multiple times + eval() evaluate a string expression + +List manipulation: + get() get an item without error for wrong index + len() number of items in a List + empty() check if List is empty + insert() insert an item somewhere in a List + add() append an item to a List + extend() append a List to a List + remove() remove one or more items from a List + copy() make a shallow copy of a List + deepcopy() make a full copy of a List + filter() remove selected items from a List + map() change each List item + sort() sort a List + reverse() reverse the order of a List + split() split a String into a List + join() join List items into a String + range() return a List with a sequence of numbers + string() String representation of a List + call() call a function with List as arguments + index() index of a value in a List + max() maximum value in a List + min() minimum value in a List + count() count number of times a value appears in a List + repeat() repeat a List multiple times + +Dictionary manipulation: + get() get an entry without an error for a wrong key + len() number of entries in a Dictionary + has_key() check whether a key appears in a Dictionary + empty() check if Dictionary is empty + remove() remove an entry from a Dictionary + extend() add entries from one Dictionary to another + filter() remove selected entries from a Dictionary + map() change each Dictionary entry + keys() get List of Dictionary keys + values() get List of Dictionary values + items() get List of Dictionary key-value pairs + copy() make a shallow copy of a Dictionary + deepcopy() make a full copy of a Dictionary + string() String representation of a Dictionary + max() maximum value in a Dictionary + min() minimum value in a Dictionary + count() count number of times a value appears + +Variables: + type() type of a variable + islocked() check if a variable is locked + function() get a Funcref for a function name + getbufvar() get a variable value from a specific buffer + setbufvar() set a variable in a specific buffer + getwinvar() get a variable from specific window + gettabwinvar() get a variable from specific window & tab page + setwinvar() set a variable in a specific window + settabwinvar() set a variable in a specific window & tab page + garbagecollect() possibly free memory + +Cursor and mark position: + col() column number of the cursor or a mark + virtcol() screen column of the cursor or a mark + line() line number of the cursor or mark + wincol() window column number of the cursor + winline() window line number of the cursor + cursor() position the cursor at a line/column + getpos() get position of cursor, mark, etc. + setpos() set position of cursor, mark, etc. + byte2line() get line number at a specific byte count + line2byte() byte count at a specific line + diff_filler() get the number of filler lines above a line + +Working with text in the current buffer: + getline() get a line or list of lines from the buffer + setline() replace a line in the buffer + append() append line or list of lines in the buffer + indent() indent of a specific line + cindent() indent according to C indenting + lispindent() indent according to Lisp indenting + nextnonblank() find next non-blank line + prevnonblank() find previous non-blank line + search() find a match for a pattern + searchpos() find a match for a pattern + searchpair() find the other end of a start/skip/end + searchpairpos() find the other end of a start/skip/end + searchdecl() search for the declaration of a name + +System functions and manipulation of files: + glob() expand wildcards + globpath() expand wildcards in a number of directories + findfile() find a file in a list of directories + finddir() find a directory in a list of directories + resolve() find out where a shortcut points to + fnamemodify() modify a file name + pathshorten() shorten directory names in a path + simplify() simplify a path without changing its meaning + executable() check if an executable program exists + filereadable() check if a file can be read + filewritable() check if a file can be written to + getfperm() get the permissions of a file + getftype() get the kind of a file + isdirectory() check if a directory exists + getfsize() get the size of a file + getcwd() get the current working directory + tempname() get the name of a temporary file + mkdir() create a new directory + delete() delete a file + rename() rename a file + system() get the result of a shell command + hostname() name of the system + readfile() read a file into a List of lines + writefile() write a List of lines into a file + +Date and Time: + getftime() get last modification time of a file + localtime() get current time in seconds + strftime() convert time to a string + reltime() get the current or elapsed time accurately + reltimestr() convert reltime() result to a string + +Buffers, windows and the argument list: + argc() number of entries in the argument list + argidx() current position in the argument list + argv() get one entry from the argument list + bufexists() check if a buffer exists + buflisted() check if a buffer exists and is listed + bufloaded() check if a buffer exists and is loaded + bufname() get the name of a specific buffer + bufnr() get the buffer number of a specific buffer + tabpagebuflist() return List of buffers in a tab page + tabpagenr() get the number of a tab page + tabpagewinnr() like winnr() for a specified tab page + winnr() get the window number for the current window + bufwinnr() get the window number of a specific buffer + winbufnr() get the buffer number of a specific window + getbufline() get a list of lines from the specified buffer + +Command line: + getcmdline() get the current command line + getcmdpos() get position of the cursor in the command line + setcmdpos() set position of the cursor in the command line + getcmdtype() return the current command-line type + +Quickfix and location lists: + getqflist() list of quickfix errors + setqflist() modify a quickfix list + getloclist() list of location list items + setloclist() modify a location list + +Insert mode completion: + complete() set found matches + complete_add() add to found matches + complete_check() check if completion should be aborted + pumvisible() check if the popup menu is displayed + +Folding: + foldclosed() check for a closed fold at a specific line + foldclosedend() like foldclosed() but return the last line + foldlevel() check for the fold level at a specific line + foldtext() generate the line displayed for a closed fold + foldtextresult() get the text displayed for a closed fold + +Syntax and highlighting: + hlexists() check if a highlight group exists + hlID() get ID of a highlight group + synID() get syntax ID at a specific position + synIDattr() get a specific attribute of a syntax ID + synIDtrans() get translated syntax ID + diff_hlID() get highlight ID for diff mode at a position + matcharg() get info about |:match| arguments + +Spelling: + spellbadword() locate badly spelled word at or after cursor + spellsuggest() return suggested spelling corrections + soundfold() return the sound-a-like equivalent of a word + +History: + histadd() add an item to a history + histdel() delete an item from a history + histget() get an item from a history + histnr() get highest index of a history list + +Interactive: + browse() put up a file requester + browsedir() put up a directory requester + confirm() let the user make a choice + getchar() get a character from the user + getcharmod() get modifiers for the last typed character + input() get a line from the user + inputlist() let the user pick an entry from a list + inputsecret() get a line from the user without showing it + inputdialog() get a line from the user in a dialog + inputsave() save and clear typeahead + inputrestore() restore typeahead + +GUI: + getfontname() get name of current font being used + getwinposx() X position of the GUI Vim window + getwinposy() Y position of the GUI Vim window + +Vim server: + serverlist() return the list of server names + remote_send() send command characters to a Vim server + remote_expr() evaluate an expression in a Vim server + server2client() send a reply to a client of a Vim server + remote_peek() check if there is a reply from a Vim server + remote_read() read a reply from a Vim server + foreground() move the Vim window to the foreground + remote_foreground() move the Vim server window to the foreground + +Window size and position: + winheight() get height of a specific window + winwidth() get width of a specific window + winrestcmd() return command to restore window sizes + winsaveview() get view of current window + winrestview() restore saved view of current window + +Various: + mode() get current editing mode + visualmode() last visual mode used + hasmapto() check if a mapping exists + mapcheck() check if a matching mapping exists + maparg() get rhs of a mapping + exists() check if a variable, function, etc. exists + has() check if a feature is supported in Vim + changenr() return number of most recent change + cscope_connection() check if a cscope connection exists + did_filetype() check if a FileType autocommand was used + eventhandler() check if invoked by an event handler + + libcall() call a function in an external library + libcallnr() idem, returning a number + + getreg() get contents of a register + getregtype() get type of a register + setreg() set contents and type of a register + + taglist() get list of matching tags + tagfiles() get a list of tags files + +============================================================================== +*41.7* Defining a function + +Vim enables you to define your own functions. The basic function declaration +begins as follows: > + + :function {name}({var1}, {var2}, ...) + : {body} + :endfunction +< + Note: + Function names must begin with a capital letter. + +Let's define a short function to return the smaller of two numbers. It starts +with this line: > + + :function Min(num1, num2) + +This tells Vim that the function is named "Min" and it takes two arguments: +"num1" and "num2". + The first thing you need to do is to check to see which number is smaller: + > + : if a:num1 < a:num2 + +The special prefix "a:" tells Vim that the variable is a function argument. +Let's assign the variable "smaller" the value of the smallest number: > + + : if a:num1 < a:num2 + : let smaller = a:num1 + : else + : let smaller = a:num2 + : endif + +The variable "smaller" is a local variable. Variables used inside a function +are local unless prefixed by something like "g:", "a:", or "s:". + + Note: + To access a global variable from inside a function you must prepend + "g:" to it. Thus "g:count" inside a function is used for the global + variable "count", and "count" is another variable, local to the + function. + +You now use the ":return" statement to return the smallest number to the user. +Finally, you end the function: > + + : return smaller + :endfunction + +The complete function definition is as follows: > + + :function Min(num1, num2) + : if a:num1 < a:num2 + : let smaller = a:num1 + : else + : let smaller = a:num2 + : endif + : return smaller + :endfunction + +For people who like short functions, this does the same thing: > + + :function Min(num1, num2) + : if a:num1 < a:num2 + : return a:num1 + : endif + : return a:num2 + :endfunction + +A user defined function is called in exactly the same way as a built-in +function. Only the name is different. The Min function can be used like +this: > + + :echo Min(5, 8) + +Only now will the function be executed and the lines be interpreted by Vim. +If there are mistakes, like using an undefined variable or function, you will +now get an error message. When defining the function these errors are not +detected. + +When a function reaches ":endfunction" or ":return" is used without an +argument, the function returns zero. + +To redefine a function that already exists, use the ! for the ":function" +command: > + + :function! Min(num1, num2, num3) + + +USING A RANGE + +The ":call" command can be given a line range. This can have one of two +meanings. When a function has been defined with the "range" keyword, it will +take care of the line range itself. + The function will be passed the variables "a:firstline" and "a:lastline". +These will have the line numbers from the range the function was called with. +Example: > + + :function Count_words() range + : let n = a:firstline + : let count = 0 + : while n <= a:lastline + : let count = count + Wordcount(getline(n)) + : let n = n + 1 + : endwhile + : echo "found " . count . " words" + :endfunction + +You can call this function with: > + + :10,30call Count_words() + +It will be executed once and echo the number of words. + The other way to use a line range is by defining a function without the +"range" keyword. The function will be called once for every line in the +range, with the cursor in that line. Example: > + + :function Number() + : echo "line " . line(".") . " contains: " . getline(".") + :endfunction + +If you call this function with: > + + :10,15call Number() + +The function will be called six times. + + +VARIABLE NUMBER OF ARGUMENTS + +Vim enables you to define functions that have a variable number of arguments. +The following command, for instance, defines a function that must have 1 +argument (start) and can have up to 20 additional arguments: > + + :function Show(start, ...) + +The variable "a:1" contains the first optional argument, "a:2" the second, and +so on. The variable "a:0" contains the number of extra arguments. + For example: > + + :function Show(start, ...) + : echohl Title + : echo "Show is " . a:start + : echohl None + : let index = 1 + : while index <= a:0 + : echo " Arg " . index . " is " . a:{index} + : let index = index + 1 + : endwhile + : echo "" + :endfunction + +This uses the ":echohl" command to specify the highlighting used for the +following ":echo" command. ":echohl None" stops it again. The ":echon" +command works like ":echo", but doesn't output a line break. + +You can also use the a:000 variable, it is a List of all the "..." arguments. +See |a:000|. + + +LISTING FUNCTIONS + +The ":function" command lists the names and arguments of all user-defined +functions: > + + :function +< function Show(start, ...) ~ + function GetVimIndent() ~ + function SetSyn(name) ~ + +To see what a function does, use its name as an argument for ":function": > + + :function SetSyn +< 1 if &syntax == '' ~ + 2 let &syntax = a:name ~ + 3 endif ~ + endfunction ~ + + +DEBUGGING + +The line number is useful for when you get an error message or when debugging. +See |debug-scripts| about debugging mode. + You can also set the 'verbose' option to 12 or higher to see all function +calls. Set it to 15 or higher to see every executed line. + + +DELETING A FUNCTION + +To delete the Show() function: > + + :delfunction Show + +You get an error when the function doesn't exist. + + +FUNCTION REFERENCES + +Sometimes it can be useful to have a variable point to one function or +another. You can do it with the function() function. It turns the name of a +function into a reference: > + + :let result = 0 " or 1 + :function! Right() + : return 'Right!' + :endfunc + :function! Wrong() + : return 'Wrong!' + :endfunc + : + :if result == 1 + : let Afunc = function('Right') + :else + : let Afunc = function('Wrong') + :endif + :echo call(Afunc, []) +< Wrong! ~ + +Note that the name of a variable that holds a function reference must start +with a capital. Otherwise it could be confused with the name of a builtin +function. + The way to invoke a function that a variable refers to is with the call() +function. Its first argument is the function reference, the second argument +is a List with arguments. + +Function references are most useful in combination with a Dictionary, as is +explained in the next section. + +============================================================================== +*41.8* Lists and Dictionaries + +So far we have used the basic types String and Number. Vim also supports two +composite types: List and Dictionary. + +A List is an ordered sequence of things. The things can be any kind of value, +thus you can make a List of numbers, a List of Lists and even a List of mixed +items. To create a List with three strings: > + + :let alist = ['aap', 'mies', 'noot'] + +The List items are enclosed in square brackets and separated by commas. To +create an empty List: > + + :let alist = [] + +You can add items to a List with the add() function: > + + :let alist = [] + :call add(alist, 'foo') + :call add(alist, 'bar') + :echo alist +< ['foo', 'bar'] ~ + +List concatenation is done with +: > + + :echo alist + ['foo', 'bar'] +< ['foo', 'bar', 'foo', 'bar'] ~ + +Or, if you want to extend a List directly: > + + :let alist = ['one'] + :call extend(alist, ['two', 'three']) + :echo alist +< ['one', 'two', 'three'] ~ + +Notice that using add() will have a different effect: > + + :let alist = ['one'] + :call add(alist, ['two', 'three']) + :echo alist +< ['one', ['two', 'three']] ~ + +The second argument of add() is added as a single item. + + +FOR LOOP + +One of the nice things you can do with a List is iterate over it: > + + :let alist = ['one', 'two', 'three'] + :for n in alist + : echo n + :endfor +< one ~ + two ~ + three ~ + +This will loop over each element in List "alist", assigning the value to +variable "n". The generic form of a for loop is: > + + :for {varname} in {listexpression} + : {commands} + :endfor + +To loop a certain number of times you need a List of a specific length. The +range() function creates one for you: > + + :for a in range(3) + : echo a + :endfor +< 0 ~ + 1 ~ + 2 ~ + +Notice that the first item of the List that range() produces is zero, thus the +last item is one less than the length of the list. + You can also specify the maximum value, the stride and even go backwards: > + + :for a in range(8, 4, -2) + : echo a + :endfor +< 8 ~ + 6 ~ + 4 ~ + +A more useful example, looping over lines in the buffer: > + + :for line in getline(1, 20) + : if line =~ "Date: " + : echo matchstr(line, 'Date: \zs.*') + : endif + :endfor + +This looks into lines 1 to 20 (inclusive) and echoes any date found in there. + + +DICTIONARIES + +A Dictionary stores key-value pairs. You can quickly lookup a value if you +know the key. A Dictionary is created with curly braces: > + + :let uk2nl = {'one': 'een', 'two': 'twee', 'three': 'drie'} + +Now you can lookup words by putting the key in square brackets: > + + :echo uk2nl['two'] +< twee ~ + +The generic form for defining a Dictionary is: > + + {<key> : <value>, ...} + +An empty Dictionary is one without any keys: > + + {} + +The possibilities with Dictionaries are numerous. There are various functions +for them as well. For example, you can obtain a list of the keys and loop +over them: > + + :for key in keys(uk2nl) + : echo key + :endfor +< three ~ + one ~ + two ~ + +The will notice the keys are not ordered. You can sort the list to get a +specific order: > + + :for key in sort(keys(uk2nl)) + : echo key + :endfor +< one ~ + three ~ + two ~ + +But you can never get back the order in which items are defined. For that you +need to use a List, it stores items in an ordered sequence. + + +DICTIONARY FUNCTIONS + +The items in a Dictionary can normally be obtained with an index in square +brackets: > + + :echo uk2nl['one'] +< een ~ + +A method that does the same, but without so many punctuation characters: > + + :echo uk2nl.one +< een ~ + +This only works for a key that is made of ASCII letters, digits and the +underscore. You can also assign a new value this way: > + + :let uk2nl.four = 'vier' + :echo uk2nl +< {'three': 'drie', 'four': 'vier', 'one': 'een', 'two': 'twee'} ~ + +And now for something special: you can directly define a function and store a +reference to it in the dictionary: > + + :function uk2nl.translate(line) dict + : return join(map(split(a:line), 'get(self, v:val, "???")')) + :endfunction + +Let's first try it out: > + + :echo uk2nl.translate('three two five one') +< drie twee ??? een ~ + +The first special thing you notice is the "dict" at the end of the ":function" +line. This marks the function as being used from a Dictionary. The "self" +local variable will then refer to that Dictionary. + Now let's break up the complicated return command: > + + split(a:line) + +The split() function takes a string, chops it into white separated words +and returns a list with these words. Thus in the example it returns: > + + :echo split('three two five one') +< ['three', 'two', 'five', 'one'] ~ + +This list is the first argument to the map() function. This will go through +the list, evaluating its second argument with "v:val" set to the value of each +item. This is a shortcut to using a for loop. This command: > + + :let alist = map(split(a:line), 'get(self, v:val, "???")') + +Is equivalent to: > + + :let alist = split(a:line) + :for idx in range(len(alist)) + : let alist[idx] = get(self, alist[idx], "???") + :endfor + +The get() function checks if a key is present in a Dictionary. If it is, then +the value is retrieved. If it isn't, then the default value is returned, in +the example it's '???'. This is a convenient way to handle situations where a +key may not be present and you don't want an error message. + +The join() function does the opposite of split(): it joins together a list of +words, putting a space in between. + This combination of split(), map() and join() is a nice way to filter a line +of words in a very compact way. + + +OBJECT ORIENTED PROGRAMMING + +Now that you can put both values and functions in a Dictionary, you can +actually use a Dictionary like an object. + Above we used a Dictionary for translating Dutch to English. We might want +to do the same for other languages. Let's first make an object (aka +Dictionary) that has the translate function, but no words to translate: > + + :let transdict = {} + :function transdict.translate(line) dict + : return join(map(split(a:line), 'get(self.words, v:val, "???")')) + :endfunction + +It's slightly different from the function above, using 'self.words' to lookup +word translations. But we don't have a self.words. Thus you could call this +an abstract class. + +Now we can instantiate a Dutch translation object: > + + :let uk2nl = copy(transdict) + :let uk2nl.words = {'one': 'een', 'two': 'twee', 'three': 'drie'} + :echo uk2nl.translate('three one') +< drie een ~ + +And a German translator: > + + :let uk2de = copy(transdict) + :let uk2de.words = {'one': 'ein', 'two': 'zwei', 'three': 'drei'} + :echo uk2de.translate('three one') +< drei ein ~ + +You see that the copy() function is used to make a copy of the "transdict" +Dictionary and then the copy is changed to add the words. The original +remains the same, of course. + +Now you can go one step further, and use your preferred translator: > + + :if $LANG =~ "de" + : let trans = uk2de + :else + : let trans = uk2nl + :endif + :echo trans.translate('one two three') +< een twee drie ~ + +Here "trans" refers to one of the two objects (Dictionaries). No copy is +made. More about List and Dictionary identity can be found at |list-identity| +and |dict-identity|. + +Now you might use a language that isn't supported. You can overrule the +translate() function to do nothing: > + + :let uk2uk = copy(transdict) + :function! uk2uk.translate(line) + : return a:line + :endfunction + :echo uk2uk.translate('three one wladiwostok') +< three one wladiwostok ~ + +Notice that a ! was used to overwrite the existing function reference. Now +use "uk2uk" when no recognized language is found: > + + :if $LANG =~ "de" + : let trans = uk2de + :elseif $LANG =~ "nl" + : let trans = uk2nl + :else + : let trans = uk2uk + :endif + :echo trans.translate('one two three') +< one two three ~ + +For further reading see |Lists| and |Dictionaries|. + +============================================================================== +*41.9* Exceptions + +Let's start with an example: > + + :try + : read ~/templates/pascal.tmpl + :catch /E484:/ + : echo "Sorry, the Pascal template file cannot be found." + :endtry + +The ":read" command will fail if the file does not exist. Instead of +generating an error message, this code catches the error and gives the user a +nice message instead. + +For the commands in between ":try" and ":endtry" errors are turned into +exceptions. An exception is a string. In the case of an error the string +contains the error message. And every error message has a number. In this +case, the error we catch contains "E484:". This number is guaranteed to stay +the same (the text may change, e.g., it may be translated). + +When the ":read" command causes another error, the pattern "E484:" will not +match in it. Thus this exception will not be caught and result in the usual +error message. + +You might be tempted to do this: > + + :try + : read ~/templates/pascal.tmpl + :catch + : echo "Sorry, the Pascal template file cannot be found." + :endtry + +This means all errors are caught. But then you will not see errors that are +useful, such as "E21: Cannot make changes, 'modifiable' is off". + +Another useful mechanism is the ":finally" command: > + + :let tmp = tempname() + :try + : exe ".,$write " . tmp + : exe "!filter " . tmp + : .,$delete + : exe "$read " . tmp + :finally + : call delete(tmp) + :endtry + +This filters the lines from the cursor until the end of the file through the +"filter" command, which takes a file name argument. No matter if the +filtering works, something goes wrong in between ":try" and ":finally" or the +user cancels the filtering by pressing CTRL-C, the "call delete(tmp)" is +always executed. This makes sure you don't leave the temporary file behind. + +More information about exception handling can be found in the reference +manual: |exception-handling|. + +============================================================================== +*41.10* Various remarks + +Here is a summary of items that apply to Vim scripts. They are also mentioned +elsewhere, but form a nice checklist. + +The end-of-line character depends on the system. For Unix a single <NL> +character is used. For MS-DOS, Windows, OS/2 and the like, <CR><LF> is used. +This is important when using mappings that end in a <CR>. See |:source_crnl|. + + +WHITE SPACE + +Blank lines are allowed and ignored. + +Leading whitespace characters (blanks and TABs) are always ignored. The +whitespaces between parameters (e.g. between the 'set' and the 'cpoptions' in +the example below) are reduced to one blank character and plays the role of a +separator, the whitespaces after the last (visible) character may or may not +be ignored depending on the situation, see below. + +For a ":set" command involving the "=" (equal) sign, such as in: > + + :set cpoptions =aABceFst + +the whitespace immediately before the "=" sign is ignored. But there can be +no whitespace after the "=" sign! + +To include a whitespace character in the value of an option, it must be +escaped by a "\" (backslash) as in the following example: > + + :set tags=my\ nice\ file + +The same example written as > + + :set tags=my nice file + +will issue an error, because it is interpreted as: > + + :set tags=my + :set nice + :set file + + +COMMENTS + +The character " (the double quote mark) starts a comment. Everything after +and including this character until the end-of-line is considered a comment and +is ignored, except for commands that don't consider comments, as shown in +examples below. A comment can start on any character position on the line. + +There is a little "catch" with comments for some commands. Examples: > + + :abbrev dev development " shorthand + :map <F3> o#include " insert include + :execute cmd " do it + :!ls *.c " list C files + +The abbreviation 'dev' will be expanded to 'development " shorthand'. The +mapping of <F3> will actually be the whole line after the 'o# ....' including +the '" insert include'. The "execute" command will give an error. The "!" +command will send everything after it to the shell, causing an error for an +unmatched '"' character. + There can be no comment after ":map", ":abbreviate", ":execute" and "!" +commands (there are a few more commands with this restriction). For the +":map", ":abbreviate" and ":execute" commands there is a trick: > + + :abbrev dev development|" shorthand + :map <F3> o#include|" insert include + :execute cmd |" do it + +With the '|' character the command is separated from the next one. And that +next command is only a comment. + +Notice that there is no white space before the '|' in the abbreviation and +mapping. For these commands, any character until the end-of-line or '|' is +included. As a consequence of this behavior, you don't always see that +trailing whitespace is included: > + + :map <F4> o#include + +To avoid these problems, you can set the 'list' option when editing vimrc +files. + + +PITFALLS + +Even bigger problem arises in the following example: > + + :map ,ab o#include + :unmap ,ab + +Here the unmap command will not work, because it tries to unmap ",ab ". This +does not exist as a mapped sequence. An error will be issued, which is very +hard to identify, because the ending whitespace character in ":unmap ,ab " is +not visible. + +And this is the same as what happens when one uses a comment after an 'unmap' +command: > + + :unmap ,ab " comment + +Here the comment part will be ignored. However, Vim will try to unmap +',ab ', which does not exist. Rewrite it as: > + + :unmap ,ab| " comment + + +RESTORING THE VIEW + +Sometimes you want to make a change and go back to where cursor was. +Restoring the relative position would also be nice, so that the same line +appears at the top of the window. + This example yanks the current line, puts it above the first line in the +file and then restores the view: > + + map ,p ma"aYHmbgg"aP`bzt`a + +What this does: > + ma"aYHmbgg"aP`bzt`a +< ma set mark a at cursor position + "aY yank current line into register a + Hmb go to top line in window and set mark b there + gg go to first line in file + "aP put the yanked line above it + `b go back to top line in display + zt position the text in the window as before + `a go back to saved cursor position + + +PACKAGING + +To avoid your function names to interfere with functions that you get from +others, use this scheme: +- Prepend a unique string before each function name. I often use an + abbreviation. For example, "OW_" is used for the option window functions. +- Put the definition of your functions together in a file. Set a global + variable to indicate that the functions have been loaded. When sourcing the + file again, first unload the functions. +Example: > + + " This is the XXX package + + if exists("XXX_loaded") + delfun XXX_one + delfun XXX_two + endif + + function XXX_one(a) + ... body of function ... + endfun + + function XXX_two(b) + ... body of function ... + endfun + + let XXX_loaded = 1 + +============================================================================== +*41.11* Writing a plugin *write-plugin* + +You can write a Vim script in such a way that many people can use it. This is +called a plugin. Vim users can drop your script in their plugin directory and +use its features right away |add-plugin|. + +There are actually two types of plugins: + + global plugins: For all types of files. +filetype plugins: Only for files of a specific type. + +In this section the first type is explained. Most items are also relevant for +writing filetype plugins. The specifics for filetype plugins are in the next +section |write-filetype-plugin|. + + +NAME + +First of all you must choose a name for your plugin. The features provided +by the plugin should be clear from its name. And it should be unlikely that +someone else writes a plugin with the same name but which does something +different. And please limit the name to 8 characters, to avoid problems on +old Windows systems. + +A script that corrects typing mistakes could be called "typecorr.vim". We +will use it here as an example. + +For the plugin to work for everybody, it should follow a few guidelines. This +will be explained step-by-step. The complete example plugin is at the end. + + +BODY + +Let's start with the body of the plugin, the lines that do the actual work: > + + 14 iabbrev teh the + 15 iabbrev otehr other + 16 iabbrev wnat want + 17 iabbrev synchronisation + 18 \ synchronization + 19 let s:count = 4 + +The actual list should be much longer, of course. + +The line numbers have only been added to explain a few things, don't put them +in your plugin file! + + +HEADER + +You will probably add new corrections to the plugin and soon have several +versions laying around. And when distributing this file, people will want to +know who wrote this wonderful plugin and where they can send remarks. +Therefore, put a header at the top of your plugin: > + + 1 " Vim global plugin for correcting typing mistakes + 2 " Last Change: 2000 Oct 15 + 3 " Maintainer: Bram Moolenaar <Bram@vim.org> + +About copyright and licensing: Since plugins are very useful and it's hardly +worth restricting their distribution, please consider making your plugin +either public domain or use the Vim |license|. A short note about this near +the top of the plugin should be sufficient. Example: > + + 4 " License: This file is placed in the public domain. + + +LINE CONTINUATION, AVOIDING SIDE EFFECTS *use-cpo-save* + +In line 18 above, the line-continuation mechanism is used |line-continuation|. +Users with 'compatible' set will run into trouble here, they will get an error +message. We can't just reset 'compatible', because that has a lot of side +effects. To avoid this, we will set the 'cpoptions' option to its Vim default +value and restore it later. That will allow the use of line-continuation and +make the script work for most people. It is done like this: > + + 11 let s:save_cpo = &cpo + 12 set cpo&vim + .. + 42 let &cpo = s:save_cpo + +We first store the old value of 'cpoptions' in the s:save_cpo variable. At +the end of the plugin this value is restored. + +Notice that a script-local variable is used |s:var|. A global variable could +already be in use for something else. Always use script-local variables for +things that are only used in the script. + + +NOT LOADING + +It's possible that a user doesn't always want to load this plugin. Or the +system administrator has dropped it in the system-wide plugin directory, but a +user has his own plugin he wants to use. Then the user must have a chance to +disable loading this specific plugin. This will make it possible: > + + 6 if exists("loaded_typecorr") + 7 finish + 8 endif + 9 let loaded_typecorr = 1 + +This also avoids that when the script is loaded twice it would cause error +messages for redefining functions and cause trouble for autocommands that are +added twice. + + +MAPPING + +Now let's make the plugin more interesting: We will add a mapping that adds a +correction for the word under the cursor. We could just pick a key sequence +for this mapping, but the user might already use it for something else. To +allow the user to define which keys a mapping in a plugin uses, the <Leader> +item can be used: > + + 22 map <unique> <Leader>a <Plug>TypecorrAdd + +The "<Plug>TypecorrAdd" thing will do the work, more about that further on. + +The user can set the "mapleader" variable to the key sequence that he wants +this mapping to start with. Thus if the user has done: > + + let mapleader = "_" + +the mapping will define "_a". If the user didn't do this, the default value +will be used, which is a backslash. Then a map for "\a" will be defined. + +Note that <unique> is used, this will cause an error message if the mapping +already happened to exist. |:map-<unique>| + +But what if the user wants to define his own key sequence? We can allow that +with this mechanism: > + + 21 if !hasmapto('<Plug>TypecorrAdd') + 22 map <unique> <Leader>a <Plug>TypecorrAdd + 23 endif + +This checks if a mapping to "<Plug>TypecorrAdd" already exists, and only +defines the mapping from "<Leader>a" if it doesn't. The user then has a +chance of putting this in his vimrc file: > + + map ,c <Plug>TypecorrAdd + +Then the mapped key sequence will be ",c" instead of "_a" or "\a". + + +PIECES + +If a script gets longer, you often want to break up the work in pieces. You +can use functions or mappings for this. But you don't want these functions +and mappings to interfere with the ones from other scripts. For example, you +could define a function Add(), but another script could try to define the same +function. To avoid this, we define the function local to the script by +prepending it with "s:". + +We will define a function that adds a new typing correction: > + + 30 function s:Add(from, correct) + 31 let to = input("type the correction for " . a:from . ": ") + 32 exe ":iabbrev " . a:from . " " . to + .. + 36 endfunction + +Now we can call the function s:Add() from within this script. If another +script also defines s:Add(), it will be local to that script and can only +be called from the script it was defined in. There can also be a global Add() +function (without the "s:"), which is again another function. + +<SID> can be used with mappings. It generates a script ID, which identifies +the current script. In our typing correction plugin we use it like this: > + + 24 noremap <unique> <script> <Plug>TypecorrAdd <SID>Add + .. + 28 noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR> + +Thus when a user types "\a", this sequence is invoked: > + + \a -> <Plug>TypecorrAdd -> <SID>Add -> :call <SID>Add() + +If another script would also map <SID>Add, it would get another script ID and +thus define another mapping. + +Note that instead of s:Add() we use <SID>Add() here. That is because the +mapping is typed by the user, thus outside of the script. The <SID> is +translated to the script ID, so that Vim knows in which script to look for +the Add() function. + +This is a bit complicated, but it's required for the plugin to work together +with other plugins. The basic rule is that you use <SID>Add() in mappings and +s:Add() in other places (the script itself, autocommands, user commands). + +We can also add a menu entry to do the same as the mapping: > + + 26 noremenu <script> Plugin.Add\ Correction <SID>Add + +The "Plugin" menu is recommended for adding menu items for plugins. In this +case only one item is used. When adding more items, creating a submenu is +recommended. For example, "Plugin.CVS" could be used for a plugin that offers +CVS operations "Plugin.CVS.checkin", "Plugin.CVS.checkout", etc. + +Note that in line 28 ":noremap" is used to avoid that any other mappings cause +trouble. Someone may have remapped ":call", for example. In line 24 we also +use ":noremap", but we do want "<SID>Add" to be remapped. This is why +"<script>" is used here. This only allows mappings which are local to the +script. |:map-<script>| The same is done in line 26 for ":noremenu". +|:menu-<script>| + + +<SID> AND <Plug> *using-<Plug>* + +Both <SID> and <Plug> are used to avoid that mappings of typed keys interfere +with mappings that are only to be used from other mappings. Note the +difference between using <SID> and <Plug>: + +<Plug> is visible outside of the script. It is used for mappings which the + user might want to map a key sequence to. <Plug> is a special code + that a typed key will never produce. + To make it very unlikely that other plugins use the same sequence of + characters, use this structure: <Plug> scriptname mapname + In our example the scriptname is "Typecorr" and the mapname is "Add". + This results in "<Plug>TypecorrAdd". Only the first character of + scriptname and mapname is uppercase, so that we can see where mapname + starts. + +<SID> is the script ID, a unique identifier for a script. + Internally Vim translates <SID> to "<SNR>123_", where "123" can be any + number. Thus a function "<SID>Add()" will have a name "<SNR>11_Add()" + in one script, and "<SNR>22_Add()" in another. You can see this if + you use the ":function" command to get a list of functions. The + translation of <SID> in mappings is exactly the same, that's how you + can call a script-local function from a mapping. + + +USER COMMAND + +Now let's add a user command to add a correction: > + + 38 if !exists(":Correct") + 39 command -nargs=1 Correct :call s:Add(<q-args>, 0) + 40 endif + +The user command is defined only if no command with the same name already +exists. Otherwise we would get an error here. Overriding the existing user +command with ":command!" is not a good idea, this would probably make the user +wonder why the command he defined himself doesn't work. |:command| + + +SCRIPT VARIABLES + +When a variable starts with "s:" it is a script variable. It can only be used +inside a script. Outside the script it's not visible. This avoids trouble +with using the same variable name in different scripts. The variables will be +kept as long as Vim is running. And the same variables are used when sourcing +the same script again. |s:var| + +The fun is that these variables can also be used in functions, autocommands +and user commands that are defined in the script. In our example we can add +a few lines to count the number of corrections: > + + 19 let s:count = 4 + .. + 30 function s:Add(from, correct) + .. + 34 let s:count = s:count + 1 + 35 echo s:count . " corrections now" + 36 endfunction + +First s:count is initialized to 4 in the script itself. When later the +s:Add() function is called, it increments s:count. It doesn't matter from +where the function was called, since it has been defined in the script, it +will use the local variables from this script. + + +THE RESULT + +Here is the resulting complete example: > + + 1 " Vim global plugin for correcting typing mistakes + 2 " Last Change: 2000 Oct 15 + 3 " Maintainer: Bram Moolenaar <Bram@vim.org> + 4 " License: This file is placed in the public domain. + 5 + 6 if exists("loaded_typecorr") + 7 finish + 8 endif + 9 let loaded_typecorr = 1 + 10 + 11 let s:save_cpo = &cpo + 12 set cpo&vim + 13 + 14 iabbrev teh the + 15 iabbrev otehr other + 16 iabbrev wnat want + 17 iabbrev synchronisation + 18 \ synchronization + 19 let s:count = 4 + 20 + 21 if !hasmapto('<Plug>TypecorrAdd') + 22 map <unique> <Leader>a <Plug>TypecorrAdd + 23 endif + 24 noremap <unique> <script> <Plug>TypecorrAdd <SID>Add + 25 + 26 noremenu <script> Plugin.Add\ Correction <SID>Add + 27 + 28 noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR> + 29 + 30 function s:Add(from, correct) + 31 let to = input("type the correction for " . a:from . ": ") + 32 exe ":iabbrev " . a:from . " " . to + 33 if a:correct | exe "normal viws\<C-R>\" \b\e" | endif + 34 let s:count = s:count + 1 + 35 echo s:count . " corrections now" + 36 endfunction + 37 + 38 if !exists(":Correct") + 39 command -nargs=1 Correct :call s:Add(<q-args>, 0) + 40 endif + 41 + 42 let &cpo = s:save_cpo + +Line 33 wasn't explained yet. It applies the new correction to the word under +the cursor. The |:normal| command is used to use the new abbreviation. Note +that mappings and abbreviations are expanded here, even though the function +was called from a mapping defined with ":noremap". + +Using "unix" for the 'fileformat' option is recommended. The Vim scripts will +then work everywhere. Scripts with 'fileformat' set to "dos" do not work on +Unix. Also see |:source_crnl|. To be sure it is set right, do this before +writing the file: > + + :set fileformat=unix + + +DOCUMENTATION *write-local-help* + +It's a good idea to also write some documentation for your plugin. Especially +when its behavior can be changed by the user. See |add-local-help| for how +they are installed. + +Here is a simple example for a plugin help file, called "typecorr.txt": > + + 1 *typecorr.txt* Plugin for correcting typing mistakes + 2 + 3 If you make typing mistakes, this plugin will have them corrected + 4 automatically. + 5 + 6 There are currently only a few corrections. Add your own if you like. + 7 + 8 Mappings: + 9 <Leader>a or <Plug>TypecorrAdd + 10 Add a correction for the word under the cursor. + 11 + 12 Commands: + 13 :Correct {word} + 14 Add a correction for {word}. + 15 + 16 *typecorr-settings* + 17 This plugin doesn't have any settings. + +The first line is actually the only one for which the format matters. It will +be extracted from the help file to be put in the "LOCAL ADDITIONS:" section of +help.txt |local-additions|. The first "*" must be in the first column of the +first line. After adding your help file do ":help" and check that the entries +line up nicely. + +You can add more tags inside ** in your help file. But be careful not to use +existing help tags. You would probably use the name of your plugin in most of +them, like "typecorr-settings" in the example. + +Using references to other parts of the help in || is recommended. This makes +it easy for the user to find associated help. + + +FILETYPE DETECTION *plugin-filetype* + +If your filetype is not already detected by Vim, you should create a filetype +detection snippet in a separate file. It is usually in the form of an +autocommand that sets the filetype when the file name matches a pattern. +Example: > + + au BufNewFile,BufRead *.foo set filetype=foofoo + +Write this single-line file as "ftdetect/foofoo.vim" in the first directory +that appears in 'runtimepath'. For Unix that would be +"~/.vim/ftdetect/foofoo.vim". The convention is to use the name of the +filetype for the script name. + +You can make more complicated checks if you like, for example to inspect the +contents of the file to recognize the language. Also see |new-filetype|. + + +SUMMARY *plugin-special* + +Summary of special things to use in a plugin: + +s:name Variables local to the script. + +<SID> Script-ID, used for mappings and functions local to + the script. + +hasmapto() Function to test if the user already defined a mapping + for functionality the script offers. + +<Leader> Value of "mapleader", which the user defines as the + keys that plugin mappings start with. + +:map <unique> Give a warning if a mapping already exists. + +:noremap <script> Use only mappings local to the script, not global + mappings. + +exists(":Cmd") Check if a user command already exists. + +============================================================================== +*41.12* Writing a filetype plugin *write-filetype-plugin* *ftplugin* + +A filetype plugin is like a global plugin, except that it sets options and +defines mappings for the current buffer only. See |add-filetype-plugin| for +how this type of plugin is used. + +First read the section on global plugins above |41.11|. All that is said there +also applies to filetype plugins. There are a few extras, which are explained +here. The essential thing is that a filetype plugin should only have an +effect on the current buffer. + + +DISABLING + +If you are writing a filetype plugin to be used by many people, they need a +chance to disable loading it. Put this at the top of the plugin: > + + " Only do this when not done yet for this buffer + if exists("b:did_ftplugin") + finish + endif + let b:did_ftplugin = 1 + +This also needs to be used to avoid that the same plugin is executed twice for +the same buffer (happens when using an ":edit" command without arguments). + +Now users can disable loading the default plugin completely by making a +filetype plugin with only this line: > + + let b:did_ftplugin = 1 + +This does require that the filetype plugin directory comes before $VIMRUNTIME +in 'runtimepath'! + +If you do want to use the default plugin, but overrule one of the settings, +you can write the different setting in a script: > + + setlocal textwidth=70 + +Now write this in the "after" directory, so that it gets sourced after the +distributed "vim.vim" ftplugin |after-directory|. For Unix this would be +"~/.vim/after/ftplugin/vim.vim". Note that the default plugin will have set +"b:did_ftplugin", but it is ignored here. + + +OPTIONS + +To make sure the filetype plugin only affects the current buffer use the > + + :setlocal + +command to set options. And only set options which are local to a buffer (see +the help for the option to check that). When using |:setlocal| for global +options or options local to a window, the value will change for many buffers, +and that is not what a filetype plugin should do. + +When an option has a value that is a list of flags or items, consider using +"+=" and "-=" to keep the existing value. Be aware that the user may have +changed an option value already. First resetting to the default value and +then changing it often a good idea. Example: > + + :setlocal formatoptions& formatoptions+=ro + + +MAPPINGS + +To make sure mappings will only work in the current buffer use the > + + :map <buffer> + +command. This needs to be combined with the two-step mapping explained above. +An example of how to define functionality in a filetype plugin: > + + if !hasmapto('<Plug>JavaImport') + map <buffer> <unique> <LocalLeader>i <Plug>JavaImport + endif + noremap <buffer> <unique> <Plug>JavaImport oimport ""<Left><Esc> + +|hasmapto()| is used to check if the user has already defined a map to +<Plug>JavaImport. If not, then the filetype plugin defines the default +mapping. This starts with |<LocalLeader>|, which allows the user to select +the key(s) he wants filetype plugin mappings to start with. The default is a +backslash. +"<unique>" is used to give an error message if the mapping already exists or +overlaps with an existing mapping. +|:noremap| is used to avoid that any other mappings that the user has defined +interferes. You might want to use ":noremap <script>" to allow remapping +mappings defined in this script that start with <SID>. + +The user must have a chance to disable the mappings in a filetype plugin, +without disabling everything. Here is an example of how this is done for a +plugin for the mail filetype: > + + " Add mappings, unless the user didn't want this. + if !exists("no_plugin_maps") && !exists("no_mail_maps") + " Quote text by inserting "> " + if !hasmapto('<Plug>MailQuote') + vmap <buffer> <LocalLeader>q <Plug>MailQuote + nmap <buffer> <LocalLeader>q <Plug>MailQuote + endif + vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR> + nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR> + endif + +Two global variables are used: +no_plugin_maps disables mappings for all filetype plugins +no_mail_maps disables mappings for a specific filetype + + +USER COMMANDS + +To add a user command for a specific file type, so that it can only be used in +one buffer, use the "-buffer" argument to |:command|. Example: > + + :command -buffer Make make %:r.s + + +VARIABLES + +A filetype plugin will be sourced for each buffer of the type it's for. Local +script variables |s:var| will be shared between all invocations. Use local +buffer variables |b:var| if you want a variable specifically for one buffer. + + +FUNCTIONS + +When defining a function, this only needs to be done once. But the filetype +plugin will be sourced every time a file with this filetype will be opened. +This construct make sure the function is only defined once: > + + :if !exists("*s:Func") + : function s:Func(arg) + : ... + : endfunction + :endif +< + +UNDO *undo_ftplugin* + +When the user does ":setfiletype xyz" the effect of the previous filetype +should be undone. Set the b:undo_ftplugin variable to the commands that will +undo the settings in your filetype plugin. Example: > + + let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<" + \ . "| unlet b:match_ignorecase b:match_words b:match_skip" + +Using ":setlocal" with "<" after the option name resets the option to its +global value. That is mostly the best way to reset the option value. + +This does require removing the "C" flag from 'cpoptions' to allow line +continuation, as mentioned above |use-cpo-save|. + + +FILE NAME + +The filetype must be included in the file name |ftplugin-name|. Use one of +these three forms: + + .../ftplugin/stuff.vim + .../ftplugin/stuff_foo.vim + .../ftplugin/stuff/bar.vim + +"stuff" is the filetype, "foo" and "bar" are arbitrary names. + + +SUMMARY *ftplugin-special* + +Summary of special things to use in a filetype plugin: + +<LocalLeader> Value of "maplocalleader", which the user defines as + the keys that filetype plugin mappings start with. + +:map <buffer> Define a mapping local to the buffer. + +:noremap <script> Only remap mappings defined in this script that start + with <SID>. + +:setlocal Set an option for the current buffer only. + +:command -buffer Define a user command local to the buffer. + +exists("*s:Func") Check if a function was already defined. + +Also see |plugin-special|, the special things used for all plugins. + +============================================================================== +*41.13* Writing a compiler plugin *write-compiler-plugin* + +A compiler plugin sets options for use with a specific compiler. The user can +load it with the |:compiler| command. The main use is to set the +'errorformat' and 'makeprg' options. + +Easiest is to have a look at examples. This command will edit all the default +compiler plugins: > + + :next $VIMRUNTIME/compiler/*.vim + +Use |:next| to go to the next plugin file. + +There are two special items about these files. First is a mechanism to allow +a user to overrule or add to the default file. The default files start with: > + + :if exists("current_compiler") + : finish + :endif + :let current_compiler = "mine" + +When you write a compiler file and put it in your personal runtime directory +(e.g., ~/.vim/compiler for Unix), you set the "current_compiler" variable to +make the default file skip the settings. + *:CompilerSet* +The second mechanism is to use ":set" for ":compiler!" and ":setlocal" for +":compiler". Vim defines the ":CompilerSet" user command for this. However, +older Vim versions don't, thus your plugin should define it then. This is an +example: > + + if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal <args> + endif + CompilerSet errorformat& " use the default 'errorformat' + CompilerSet makeprg=nmake + +When you write a compiler plugin for the Vim distribution or for a system-wide +runtime directory, use the mechanism mentioned above. When +"current_compiler" was already set by a user plugin nothing will be done. + +When you write a compiler plugin to overrule settings from a default plugin, +don't check "current_compiler". This plugin is supposed to be loaded +last, thus it should be in a directory at the end of 'runtimepath'. For Unix +that could be ~/.vim/after/compiler. + +============================================================================== +*41.14* Writing a plugin that loads quickly *write-plugin-quickload* + +A plugin may grow and become quite long. The startup delay may become +noticeable, while you hardly every use the plugin. Then it's time for a +quickload plugin. + +The basic idea is that the plugin is loaded twice. The first time user +commands and mappings are defined that offer the functionality. The second +time the functions that implement the functionality are defined. + +It may sound surprising that quickload means loading a script twice. What we +mean is that it loads quickly the first time, postponing the bulk of the +script to the second time, which only happens when you actually use it. When +you always use the functionality it actually gets slower! + +Note that since Vim 7 there is an alternative: use the |autoload| +functionality |41.15|. + +The following example shows how it's done: > + + " Vim global plugin for demonstrating quick loading + " Last Change: 2005 Feb 25 + " Maintainer: Bram Moolenaar <Bram@vim.org> + " License: This file is placed in the public domain. + + if !exists("s:did_load") + command -nargs=* BNRead call BufNetRead(<f-args>) + map <F19> :call BufNetWrite('something')<CR> + + let s:did_load = 1 + exe 'au FuncUndefined BufNet* source ' . expand('<sfile>') + finish + endif + + function BufNetRead(...) + echo 'BufNetRead(' . string(a:000) . ')' + " read functionality here + endfunction + + function BufNetWrite(...) + echo 'BufNetWrite(' . string(a:000) . ')' + " write functionality here + endfunction + +When the script is first loaded "s:did_load" is not set. The commands between +the "if" and "endif" will be executed. This ends in a |:finish| command, thus +the rest of the script is not executed. + +The second time the script is loaded "s:did_load" exists and the commands +after the "endif" are executed. This defines the (possible long) +BufNetRead() and BufNetWrite() functions. + +If you drop this script in your plugin directory Vim will execute it on +startup. This is the sequence of events that happens: + +1. The "BNRead" command is defined and the <F19> key is mapped when the script + is sourced at startup. A |FuncUndefined| autocommand is defined. The + ":finish" command causes the script to terminate early. + +2. The user types the BNRead command or presses the <F19> key. The + BufNetRead() or BufNetWrite() function will be called. + +3. Vim can't find the function and triggers the |FuncUndefined| autocommand + event. Since the pattern "BufNet*" matches the invoked function, the + command "source fname" will be executed. "fname" will be equal to the name + of the script, no matter where it is located, because it comes from + expanding "<sfile>" (see |expand()|). + +4. The script is sourced again, the "s:did_load" variable exists and the + functions are defined. + +Notice that the functions that are loaded afterwards match the pattern in the +|FuncUndefined| autocommand. You must make sure that no other plugin defines +functions that match this pattern. + +============================================================================== +*41.15* Writing library scripts *write-library-script* + +Some functionality will be required in several places. When this becomes more +than a few lines you will want to put it in one script and use it from many +scripts. We will call that one script a library script. + +Manually loading a library script is possible, so long as you avoid loading it +when it's already done. You can do this with the |exists()| function. +Example: > + + if !exists('*MyLibFunction') + runtime library/mylibscript.vim + endif + call MyLibFunction(arg) + +Here you need to know that MyLibFunction() is defined in a script +"library/mylibscript.vim" in one of the directories in 'runtimepath'. + +To make this a bit simpler Vim offers the autoload mechanism. Then the +example looks like this: > + + call mylib#myfunction(arg) + +That's a lot simpler, isn't it? Vim will recognize the function name and when +it's not defined search for the script "autoload/mylib.vim" in 'runtimepath'. +That script must define the "mylib#myfunction()" function. + +You can put many other functions in the mylib.vim script, you are free to +organize your functions in library scripts. But you must use function names +where the part before the '#' matches the script name. Otherwise Vim would +not know what script to load. + +If you get really enthusiastic and write lots of library scripts, you may +want to use subdirectories. Example: > + + call netlib#ftp#read('somefile') + +For Unix the library script used for this could be: + + ~/.vim/autoload/netlib/ftp.vim + +Where the function is defined like this: > + + function netlib#ftp#read(fname) + " Read the file fname through ftp + endfunction + +Notice that the name the function is defined with is exactly the same as the +name used for calling the function. And the part before the last '#' +exactly matches the subdirectory and script name. + +You can use the same mechanism for variables: > + + let weekdays = dutch#weekdays + +This will load the script "autoload/dutch.vim", which should contain something +like: > + + let dutch#weekdays = ['zondag', 'maandag', 'dinsdag', 'woensdag', + \ 'donderdag', 'vrijdag', 'zaterdag'] + +Further reading: |autoload|. + +============================================================================== +*41.16* Distributing Vim scripts *distribute-script* + +Vim users will look for scripts on the Vim website: http://www.vim.org. +If you made something that is useful for others, share it! + +Vim scripts can be used on any system. There might not be a tar or gzip +command. If you want to pack files together and/or compress them the "zip" +utility is recommended. + +For utmost portability use Vim itself to pack scripts together. This can be +done with the Vimball utility. See |vimball|. + +It's good if you add a line to allow automatic updating. See |glvs-plugins|. + +============================================================================== + +Next chapter: |usr_42.txt| Add new menus + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_42.txt b/Aufgabe5/doc.lang/usr_42.txt new file mode 100644 index 0000000..5370a30 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_42.txt @@ -0,0 +1,365 @@ +*usr_42.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Add new menus + + +By now you know that Vim is very flexible. This includes the menus used in +the GUI. You can define your own menu entries to make certain commands easily +accessible. This is for mouse-happy users only. + +|42.1| Introduction +|42.2| Menu commands +|42.3| Various +|42.4| Toolbar and popup menus + + Next chapter: |usr_43.txt| Using filetypes + Previous chapter: |usr_41.txt| Write a Vim script +Table of contents: |usr_toc.txt| + +============================================================================== +*42.1* Introduction + +The menus that Vim uses are defined in the file "$VIMRUNTIME/menu.vim". If +you want to write your own menus, you might first want to look through that +file. + To define a menu item, use the ":menu" command. The basic form of this +command is as follows: > + + :menu {menu-item} {keys} + +The {menu-item} describes where on the menu to put the item. A typical +{menu-item} is "File.Save", which represents the item "Save" under the +"File" menu. A dot is used to separate the names. Example: > + + :menu File.Save :update<CR> + +The ":update" command writes the file when it was modified. + You can add another level: "Edit.Settings.Shiftwidth" defines a submenu +"Settings" under the "Edit" menu, with an item "Shiftwidth". You could use +even deeper levels. Don't use this too much, you need to move the mouse quite +a bit to use such an item. + The ":menu" command is very similar to the ":map" command: the left side +specifies how the item is triggered and the right hand side defines the +characters that are executed. {keys} are characters, they are used just like +you would have typed them. Thus in Insert mode, when {keys} is plain text, +that text is inserted. + + +ACCELERATORS + +The ampersand character (&) is used to indicate an accelerator. For instance, +you can use Alt-F to select "File" and S to select "Save". (The 'winaltkeys' +option may disable this though!). Therefore, the {menu-item} looks like +"&File.&Save". The accelerator characters will be underlined in the menu. + You must take care that each key is used only once in each menu. Otherwise +you will not know which of the two will actually be used. Vim doesn't warn +you for this. + + +PRIORITIES + +The actual definition of the File.Save menu item is as follows: > + + :menu 10.340 &File.&Save<Tab>:w :confirm w<CR> + +The number 10.340 is called the priority number. It is used by the editor to +decide where it places the menu item. The first number (10) indicates the +position on the menu bar. Lower numbered menus are positioned to the left, +higher numbers to the right. + These are the priorities used for the standard menus: + + 10 20 40 50 60 70 9999 + + +------------------------------------------------------------+ + | File Edit Tools Syntax Buffers Window Help | + +------------------------------------------------------------+ + +Notice that the Help menu is given a very high number, to make it appear on +the far right. + The second number (340) determines the location of the item within the +pull-down menu. Lower numbers go on top, higher number on the bottom. These +are the priorities in the File menu: + + +-----------------+ + 10.310 |Open... | + 10.320 |Split-Open... | + 10.325 |New | + 10.330 |Close | + 10.335 |---------------- | + 10.340 |Save | + 10.350 |Save As... | + 10.400 |---------------- | + 10.410 |Split Diff with | + 10.420 |Split Patched By | + 10.500 |---------------- | + 10.510 |Print | + 10.600 |---------------- | + 10.610 |Save-Exit | + 10.620 |Exit | + +-----------------+ + +Notice that there is room in between the numbers. This is where you can +insert your own items, if you really want to (it's often better to leave the +standard menus alone and add a new menu for your own items). + When you create a submenu, you can add another ".number" to the priority. +Thus each name in {menu-item} has its priority number. + + +SPECIAL CHARACTERS + +The {menu-item} in this example is "&File.&Save<Tab>:w". This brings up an +important point: {menu-item} must be one word. If you want to put a dot, +space or tabs in the name, you either use the <> notation (<Space> and <Tab>, +for instance) or use the backslash (\) escape. > + + :menu 10.305 &File.&Do\ It\.\.\. :exit<CR> + +In this example, the name of the menu item "Do It..." contains a space and the +command is ":exit<CR>". + +The <Tab> character in a menu name is used to separate the part that defines +the menu name from the part that gives a hint to the user. The part after the +<Tab> is displayed right aligned in the menu. In the File.Save menu the name +used is "&File.&Save<Tab>:w". Thus the menu name is "File.Save" and the hint +is ":w". + + +SEPARATORS + +The separator lines, used to group related menu items together, can be defined +by using a name that starts and ends in a '-'. For example "-sep-". When +using several separators the names must be different. Otherwise the names +don't matter. + The command from a separator will never be executed, but you have to define +one anyway. A single colon will do. Example: > + + :amenu 20.510 Edit.-sep3- : + +============================================================================== +*42.2* Menu commands + +You can define menu items that exist for only certain modes. This works just +like the variations on the ":map" command: + + :menu Normal, Visual and Operator-pending mode + :nmenu Normal mode + :vmenu Visual mode + :omenu Operator-pending mode + :menu! Insert and Command-line mode + :imenu Insert mode + :cmenu Command-line mode + :amenu All modes + +To avoid that the commands of a menu item are being mapped, use the command +":noremenu", ":nnoremenu", ":anoremenu", etc. + + +USING :AMENU + +The ":amenu" command is a bit different. It assumes that the {keys} you +give are to be executed in Normal mode. When Vim is in Visual or Insert mode +when the menu is used, Vim first has to go back to Normal mode. ":amenu" +inserts a CTRL-C or CTRL-O for you. For example, if you use this command: +> + :amenu 90.100 Mine.Find\ Word * + +Then the resulting menu commands will be: + + Normal mode: * + Visual mode: CTRL-C * + Operator-pending mode: CTRL-C * + Insert mode: CTRL-O * + Command-line mode: CTRL-C * + +When in Command-line mode the CTRL-C will abandon the command typed so far. +In Visual and Operator-pending mode CTRL-C will stop the mode. The CTRL-O in +Insert mode will execute the command and then return to Insert mode. + CTRL-O only works for one command. If you need to use two or more +commands, put them in a function and call that function. Example: > + + :amenu Mine.Next\ File :call <SID>NextFile()<CR> + :function <SID>NextFile() + : next + : 1/^Code + :endfunction + +This menu entry goes to the next file in the argument list with ":next". Then +it searches for the line that starts with "Code". + The <SID> before the function name is the script ID. This makes the +function local to the current Vim script file. This avoids problems when a +function with the same name is defined in another script file. See |<SID>|. + + +SILENT MENUS + +The menu executes the {keys} as if you typed them. For a ":" command this +means you will see the command being echoed on the command line. If it's a +long command, the hit-Enter prompt will appear. That can be very annoying! + To avoid this, make the menu silent. This is done with the <silent> +argument. For example, take the call to NextFile() in the previous example. +When you use this menu, you will see this on the command line: + + :call <SNR>34_NextFile() ~ + +To avoid this text on the command line, insert "<silent>" as the first +argument: > + + :amenu <silent> Mine.Next\ File :call <SID>NextFile()<CR> + +Don't use "<silent>" too often. It is not needed for short commands. If you +make a menu for someone else, being able the see the executed command will +give him a hint about what he could have typed, instead of using the mouse. + + +LISTING MENUS + +When a menu command is used without a {keys} part, it lists the already +defined menus. You can specify a {menu-item}, or part of it, to list specific +menus. Example: > + + :amenu + +This lists all menus. That's a long list! Better specify the name of a menu +to get a shorter list: > + + :amenu Edit + +This lists only the "Edit" menu items for all modes. To list only one +specific menu item for Insert mode: > + + :imenu Edit.Undo + +Take care that you type exactly the right name. Case matters here. But the +'&' for accelerators can be omitted. The <Tab> and what comes after it can be +left out as well. + + +DELETING MENUS + +To delete a menu, the same command is used as for listing, but with "menu" +changed to "unmenu". Thus ":menu" becomes, ":unmenu", ":nmenu" becomes +":nunmenu", etc. To delete the "Tools.Make" item for Insert mode: > + + :iunmenu Tools.Make + +You can delete a whole menu, with all its items, by using the menu name. +Example: > + + :aunmenu Syntax + +This deletes the Syntax menu and all the items in it. + +============================================================================== +*42.3* Various + +You can change the appearance of the menus with flags in 'guioptions'. In the +default value they are all included. You can remove a flag with a command +like: > + + :set guioptions-=m +< + m When removed the menubar is not displayed. + + M When removed the default menus are not loaded. + + g When removed the inactive menu items are not made grey + but are completely removed. (Does not work on all + systems.) + + t When removed the tearoff feature is not enabled. + +The dotted line at the top of a menu is not a separator line. When you select +this item, the menu is "teared-off": It is displayed in a separate window. +This is called a tearoff menu. This is useful when you use the same menu +often. + +For translating menu items, see |:menutrans|. + +Since the mouse has to be used to select a menu item, it is a good idea to use +the ":browse" command for selecting a file. And ":confirm" to get a dialog +instead of an error message, e.g., when the current buffer contains changes. +These two can be combined: > + + :amenu File.Open :browse confirm edit<CR> + +The ":browse" makes a file browser appear to select the file to edit. The +":confirm" will pop up a dialog when the current buffer has changes. You can +then select to save the changes, throw them away or cancel the command. + For more complicated items, the confirm() and inputdialog() functions can +be used. The default menus contain a few examples. + +============================================================================== +*42.4* Toolbar and popup menus + +There are two special menus: ToolBar and PopUp. Items that start with these +names do not appear in the normal menu bar. + + +TOOLBAR + +The toolbar appears only when the "T" flag is included in the 'guioptions' +option. + The toolbar uses icons rather than text to represent the command. For +example, the {menu-item} named "ToolBar.New" causes the "New" icon to appear +on the toolbar. + The Vim editor has 28 built-in icons. You can find a table here: +|builtin-tools|. Most of them are used in the default toolbar. You can +redefine what these items do (after the default menus are setup). + You can add another bitmap for a toolbar item. Or define a new toolbar +item with a bitmap. For example, define a new toolbar item with: > + + :tmenu ToolBar.Compile Compile the current file + :amenu ToolBar.Compile :!cc % -o %:r<CR> + +Now you need to create the icon. For MS-Windows it must be in bitmap format, +with the name "Compile.bmp". For Unix XPM format is used, the file name is +"Compile.xpm". The size must be 18 by 18 pixels. On MS-Windows other sizes +can be used as well, but it will look ugly. + Put the bitmap in the directory "bitmaps" in one of the directories from +'runtimepath'. E.g., for Unix "~/.vim/bitmaps/Compile.xpm". + +You can define tooltips for the items in the toolbar. A tooltip is a short +text that explains what a toolbar item will do. For example "Open file". It +appears when the mouse pointer is on the item, without moving for a moment. +This is very useful if the meaning of the picture isn't that obvious. +Example: > + + :tmenu ToolBar.Make Run make in the current directory +< + Note: + Pay attention to the case used. "Toolbar" and "toolbar" are different + from "ToolBar"! + +To remove a tooltip, use the |:tunmenu| command. + +The 'toolbar' option can be used to display text instead of a bitmap, or both +text and a bitmap. Most people use just the bitmap, since the text takes +quite a bit of space. + + +POPUP MENU + +The popup menu pops up where the mouse pointer is. On MS-Windows you activate +it by clicking the right mouse button. Then you can select an item with the +left mouse button. On Unix the popup menu is used by pressing and holding the +right mouse button. + The popup menu only appears when the 'mousemodel' has been set to "popup" +or "popup_setpos". The difference between the two is that "popup_setpos" +moves the cursor to the mouse pointer position. When clicking inside a +selection, the selection will be used unmodified. When there is a selection +but you click outside of it, the selection is removed. + There is a separate popup menu for each mode. Thus there are never grey +items like in the normal menus. + +What is the meaning of life, the universe and everything? *42* +Douglas Adams, the only person who knew what this question really was about is +now dead, unfortunately. So now you might wonder what the meaning of death +is... + +============================================================================== + +Next chapter: |usr_43.txt| Using filetypes + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_43.txt b/Aufgabe5/doc.lang/usr_43.txt new file mode 100644 index 0000000..4e2070e --- /dev/null +++ b/Aufgabe5/doc.lang/usr_43.txt @@ -0,0 +1,172 @@ +*usr_43.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Using filetypes + + +When you are editing a file of a certain type, for example a C program or a +shell script, you often use the same option settings and mappings. You +quickly get tired of manually setting these each time. This chapter explains +how to do it automatically. + +|43.1| Plugins for a filetype +|43.2| Adding a filetype + + Next chapter: |usr_44.txt| Your own syntax highlighted + Previous chapter: |usr_42.txt| Add new menus +Table of contents: |usr_toc.txt| + +============================================================================== +*43.1* Plugins for a filetype *filetype-plugin* + +How to start using filetype plugins has already been discussed here: +|add-filetype-plugin|. But you probably are not satisfied with the default +settings, because they have been kept minimal. Suppose that for C files you +want to set the 'softtabstop' option to 4 and define a mapping to insert a +three-line comment. You do this with only two steps: + + *your-runtime-dir* +1. Create your own runtime directory. On Unix this usually is "~/.vim". In + this directory create the "ftplugin" directory: > + + mkdir ~/.vim + mkdir ~/.vim/ftplugin +< + When you are not on Unix, check the value of the 'runtimepath' option to + see where Vim will look for the "ftplugin" directory: > + + set runtimepath + +< You would normally use the first directory name (before the first comma). + You might want to prepend a directory name to the 'runtimepath' option in + your |vimrc| file if you don't like the default value. + +2. Create the file "~/.vim/ftplugin/c.vim", with the contents: > + + setlocal softtabstop=4 + noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc> + +Try editing a C file. You should notice that the 'softtabstop' option is set +to 4. But when you edit another file it's reset to the default zero. That is +because the ":setlocal" command was used. This sets the 'softtabstop' option +only locally to the buffer. As soon as you edit another buffer, it will be +set to the value set for that buffer. For a new buffer it will get the +default value or the value from the last ":set" command. + +Likewise, the mapping for "\c" will disappear when editing another buffer. +The ":map <buffer>" command creates a mapping that is local to the current +buffer. This works with any mapping command: ":map!", ":vmap", etc. The +|<LocalLeader>| in the mapping is replaced with the value of "maplocalleader". + +You can find examples for filetype plugins in this directory: > + + $VIMRUNTIME/ftplugin/ + +More details about writing a filetype plugin can be found here: +|write-plugin|. + +============================================================================== +*43.2* Adding a filetype + +If you are using a type of file that is not recognized by Vim, this is how to +get it recognized. You need a runtime directory of your own. See +|your-runtime-dir| above. + +Create a file "filetype.vim" which contains an autocommand for your filetype. +(Autocommands were explained in section |40.3|.) Example: > + + augroup filetypedetect + au BufNewFile,BufRead *.xyz setf xyz + augroup END + +This will recognize all files that end in ".xyz" as the "xyz" filetype. The +":augroup" commands put this autocommand in the "filetypedetect" group. This +allows removing all autocommands for filetype detection when doing ":filetype +off". The "setf" command will set the 'filetype' option to its argument, +unless it was set already. This will make sure that 'filetype' isn't set +twice. + +You can use many different patterns to match the name of your file. Directory +names can also be included. See |autocmd-patterns|. For example, the files +under "/usr/share/scripts/" are all "ruby" files, but don't have the expected +file name extension. Adding this to the example above: > + + augroup filetypedetect + au BufNewFile,BufRead *.xyz setf xyz + au BufNewFile,BufRead /usr/share/scripts/* setf ruby + augroup END + +However, if you now edit a file /usr/share/scripts/README.txt, this is not a +ruby file. The danger of a pattern ending in "*" is that it quickly matches +too many files. To avoid trouble with this, put the filetype.vim file in +another directory, one that is at the end of 'runtimepath'. For Unix for +example, you could use "~/.vim/after/filetype.vim". + You now put the detection of text files in ~/.vim/filetype.vim: > + + augroup filetypedetect + au BufNewFile,BufRead *.txt setf text + augroup END + +That file is found in 'runtimepath' first. Then use this in +~/.vim/after/filetype.vim, which is found last: > + + augroup filetypedetect + au BufNewFile,BufRead /usr/share/scripts/* setf ruby + augroup END + +What will happen now is that Vim searches for "filetype.vim" files in each +directory in 'runtimepath'. First ~/.vim/filetype.vim is found. The +autocommand to catch *.txt files is defined there. Then Vim finds the +filetype.vim file in $VIMRUNTIME, which is halfway 'runtimepath'. Finally +~/.vim/after/filetype.vim is found and the autocommand for detecting ruby +files in /usr/share/scripts is added. + When you now edit /usr/share/scripts/README.txt, the autocommands are +checked in the order in which they were defined. The *.txt pattern matches, +thus "setf text" is executed to set the filetype to "text". The pattern for +ruby matches too, and the "setf ruby" is executed. But since 'filetype' was +already set to "text", nothing happens here. + When you edit the file /usr/share/scripts/foobar the same autocommands are +checked. Only the one for ruby matches and "setf ruby" sets 'filetype' to +ruby. + + +RECOGNIZING BY CONTENTS + +If your file cannot be recognized by its file name, you might be able to +recognize it by its contents. For example, many script files start with a +line like: + + #!/bin/xyz ~ + +To recognize this script create a file "scripts.vim" in your runtime directory +(same place where filetype.vim goes). It might look like this: > + + if did_filetype() + finish + endif + if getline(1) =~ '^#!.*[/\\]xyz\>' + setf xyz + endif + +The first check with did_filetype() is to avoid that you will check the +contents of files for which the filetype was already detected by the file +name. That avoids wasting time on checking the file when the "setf" command +won't do anything. + The scripts.vim file is sourced by an autocommand in the default +filetype.vim file. Therefore, the order of checks is: + + 1. filetype.vim files before $VIMRUNTIME in 'runtimepath' + 2. first part of $VIMRUNTIME/filetype.vim + 3. all scripts.vim files in 'runtimepath' + 4. remainder of $VIMRUNTIME/filetype.vim + 5. filetype.vim files after $VIMRUNTIME in 'runtimepath' + +If this is not sufficient for you, add an autocommand that matches all files +and sources a script or executes a function to check the contents of the file. + +============================================================================== + +Next chapter: |usr_44.txt| Your own syntax highlighted + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_44.txt b/Aufgabe5/doc.lang/usr_44.txt new file mode 100644 index 0000000..e5b0fa9 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_44.txt @@ -0,0 +1,719 @@ +*usr_44.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Your own syntax highlighted + + +Vim comes with highlighting for a couple of hundred different file types. If +the file you are editing isn't included, read this chapter to find out how to +get this type of file highlighted. Also see |:syn-define| in the reference +manual. + +|44.1| Basic syntax commands +|44.2| Keywords +|44.3| Matches +|44.4| Regions +|44.5| Nested items +|44.6| Following groups +|44.7| Other arguments +|44.8| Clusters +|44.9| Including another syntax file +|44.10| Synchronizing +|44.11| Installing a syntax file +|44.12| Portable syntax file layout + + Next chapter: |usr_45.txt| Select your language + Previous chapter: |usr_43.txt| Using filetypes +Table of contents: |usr_toc.txt| + +============================================================================== +*44.1* Basic syntax commands + +Using an existing syntax file to start with will save you a lot of time. Try +finding a syntax file in $VIMRUNTIME/syntax for a language that is similar. +These files will also show you the normal layout of a syntax file. To +understand it, you need to read the following. + +Let's start with the basic arguments. Before we start defining any new +syntax, we need to clear out any old definitions: > + + :syntax clear + +This isn't required in the final syntax file, but very useful when +experimenting. + +There are more simplifications in this chapter. If you are writing a syntax +file to be used by others, read all the way through the end to find out the +details. + + +LISTING DEFINED ITEMS + +To check which syntax items are currently defined, use this command: > + + :syntax + +You can use this to check which items have actually been defined. Quite +useful when you are experimenting with a new syntax file. It also shows the +colors used for each item, which helps to find out what is what. + To list the items in a specific syntax group use: > + + :syntax list {group-name} + +This also can be used to list clusters (explained in |44.8|). Just include +the @ in the name. + + +MATCHING CASE + +Some languages are not case sensitive, such as Pascal. Others, such as C, are +case sensitive. You need to tell which type you have with the following +commands: > + :syntax case match + :syntax case ignore + +The "match" argument means that Vim will match the case of syntax elements. +Therefore, "int" differs from "Int" and "INT". If the "ignore" argument is +used, the following are equivalent: "Procedure", "PROCEDURE" and "procedure". + The ":syntax case" commands can appear anywhere in a syntax file and affect +the syntax definitions that follow. In most cases, you have only one ":syntax +case" command in your syntax file; if you work with an unusual language that +contains both case-sensitive and non-case-sensitive elements, however, you can +scatter the ":syntax case" command throughout the file. + +============================================================================== +*44.2* Keywords + +The most basic syntax elements are keywords. To define a keyword, use the +following form: > + + :syntax keyword {group} {keyword} ... + +The {group} is the name of a syntax group. With the ":highlight" command you +can assign colors to a {group}. The {keyword} argument is an actual keyword. +Here are a few examples: > + + :syntax keyword xType int long char + :syntax keyword xStatement if then else endif + +This example uses the group names "xType" and "xStatement". By convention, +each group name is prefixed by the filetype for the language being defined. +This example defines syntax for the x language (eXample language without an +interesting name). In a syntax file for "csh" scripts the name "cshType" +would be used. Thus the prefix is equal to the value of 'filetype'. + These commands cause the words "int", "long" and "char" to be highlighted +one way and the words "if", "then", "else" and "endif" to be highlighted +another way. Now you need to connect the x group names to standard Vim +names. You do this with the following commands: > + + :highlight link xType Type + :highlight link xStatement Statement + +This tells Vim to highlight "xType" like "Type" and "xStatement" like +"Statement". See |group-name| for the standard names. + + +UNUSUAL KEYWORDS + +The characters used in a keyword must be in the 'iskeyword' option. If you +use another character, the word will never match. Vim doesn't give a warning +message for this. + The x language uses the '-' character in keywords. This is how it's done: +> + :setlocal iskeyword+=- + :syntax keyword xStatement when-not + +The ":setlocal" command is used to change 'iskeyword' only for the current +buffer. Still it does change the behavior of commands like "w" and "*". If +that is not wanted, don't define a keyword but use a match (explained in the +next section). + +The x language allows for abbreviations. For example, "next" can be +abbreviated to "n", "ne" or "nex". You can define them by using this command: +> + :syntax keyword xStatement n[ext] + +This doesn't match "nextone", keywords always match whole words only. + +============================================================================== +*44.3* Matches + +Consider defining something a bit more complex. You want to match ordinary +identifiers. To do this, you define a match syntax item. This one matches +any word consisting of only lowercase letters: > + + :syntax match xIdentifier /\<\l\+\>/ +< + Note: + Keywords overrule any other syntax item. Thus the keywords "if", + "then", etc., will be keywords, as defined with the ":syntax keyword" + commands above, even though they also match the pattern for + xIdentifier. + +The part at the end is a pattern, like it's used for searching. The // is +used to surround the pattern (like how it's done in a ":substitute" command). +You can use any other character, like a plus or a quote. + +Now define a match for a comment. In the x language it is anything from # to +the end of a line: > + + :syntax match xComment /#.*/ + +Since you can use any search pattern, you can highlight very complex things +with a match item. See |pattern| for help on search patterns. + +============================================================================== +*44.4* Regions + +In the example x language, strings are enclosed in double quotation marks ("). +To highlight strings you define a region. You need a region start (double +quote) and a region end (double quote). The definition is as follows: > + + :syntax region xString start=/"/ end=/"/ + +The "start" and "end" directives define the patterns used to find the start +and end of the region. But what about strings that look like this? + + "A string with a double quote (\") in it" ~ + +This creates a problem: The double quotation marks in the middle of the string +will end the region. You need to tell Vim to skip over any escaped double +quotes in the string. Do this with the skip keyword: > + + :syntax region xString start=/"/ skip=/\\"/ end=/"/ + +The double backslash matches a single backslash, since the backslash is a +special character in search patterns. + +When to use a region instead of a match? The main difference is that a match +item is a single pattern, which must match as a whole. A region starts as +soon as the "start" pattern matches. Whether the "end" pattern is found or +not doesn't matter. Thus when the item depends on the "end" pattern to match, +you cannot use a region. Otherwise, regions are often simpler to define. And +it is easier to use nested items, as is explained in the next section. + +============================================================================== +*44.5* Nested items + +Take a look at this comment: + + %Get input TODO: Skip white space ~ + +You want to highlight TODO in big yellow letters, even though it is in a +comment that is highlighted blue. To let Vim know about this, you define the +following syntax groups: > + + :syntax keyword xTodo TODO contained + :syntax match xComment /%.*/ contains=xTodo + +In the first line, the "contained" argument tells Vim that this keyword can +exist only inside another syntax item. The next line has "contains=xTodo". +This indicates that the xTodo syntax element is inside it. The result is that +the comment line as a whole is matched with "xComment" and made blue. The +word TODO inside it is matched by xTodo and highlighted yellow (highlighting +for xTodo was setup for this). + + +RECURSIVE NESTING + +The x language defines code blocks in curly braces. And a code block may +contain other code blocks. This can be defined this way: > + + :syntax region xBlock start=/{/ end=/}/ contains=xBlock + +Suppose you have this text: + + while i < b { ~ + if a { ~ + b = c; ~ + } ~ + } ~ + +First a xBlock starts at the { in the first line. In the second line another +{ is found. Since we are inside a xBlock item, and it contains itself, a +nested xBlock item will start here. Thus the "b = c" line is inside the +second level xBlock region. Then a } is found in the next line, which matches +with the end pattern of the region. This ends the nested xBlock. Because the +} is included in the nested region, it is hidden from the first xBlock region. +Then at the last } the first xBlock region ends. + + +KEEPING THE END + +Consider the following two syntax items: > + + :syntax region xComment start=/%/ end=/$/ contained + :syntax region xPreProc start=/#/ end=/$/ contains=xComment + +You define a comment as anything from % to the end of the line. A +preprocessor directive is anything from # to the end of the line. Because you +can have a comment on a preprocessor line, the preprocessor definition +includes a "contains=xComment" argument. Now look what happens with this +text: + + #define X = Y % Comment text ~ + int foo = 1; ~ + +What you see is that the second line is also highlighted as xPreProc. The +preprocessor directive should end at the end of the line. That is why +you have used "end=/$/". So what is going wrong? + The problem is the contained comment. The comment starts with % and ends +at the end of the line. After the comment ends, the preprocessor syntax +continues. This is after the end of the line has been seen, so the next +line is included as well. + To avoid this problem and to avoid a contained syntax item eating a needed +end of line, use the "keepend" argument. This takes care of +the double end-of-line matching: > + + :syntax region xComment start=/%/ end=/$/ contained + :syntax region xPreProc start=/#/ end=/$/ contains=xComment keepend + + +CONTAINING MANY ITEMS + +You can use the contains argument to specify that everything can be contained. +For example: > + + :syntax region xList start=/\[/ end=/\]/ contains=ALL + +All syntax items will be contained in this one. It also contains itself, but +not at the same position (that would cause an endless loop). + You can specify that some groups are not contained. Thus contain all +groups but the ones that are listed: +> + :syntax region xList start=/\[/ end=/\]/ contains=ALLBUT,xString + +With the "TOP" item you can include all items that don't have a "contained" +argument. "CONTAINED" is used to only include items with a "contained" +argument. See |:syn-contains| for the details. + +============================================================================== +*44.6* Following groups + +The x language has statements in this form: + + if (condition) then ~ + +You want to highlight the three items differently. But "(condition)" and +"then" might also appear in other places, where they get different +highlighting. This is how you can do this: > + + :syntax match xIf /if/ nextgroup=xIfCondition skipwhite + :syntax match xIfCondition /([^)]*)/ contained nextgroup=xThen skipwhite + :syntax match xThen /then/ contained + +The "nextgroup" argument specifies which item can come next. This is not +required. If none of the items that are specified are found, nothing happens. +For example, in this text: + + if not (condition) then ~ + +The "if" is matched by xIf. "not" doesn't match the specified nextgroup +xIfCondition, thus only the "if" is highlighted. + +The "skipwhite" argument tells Vim that white space (spaces and tabs) may +appear in between the items. Similar arguments are "skipnl", which allows a +line break in between the items, and "skipempty", which allows empty lines. +Notice that "skipnl" doesn't skip an empty line, something must match after +the line break. + +============================================================================== +*44.7* Other arguments + +MATCHGROUP + +When you define a region, the entire region is highlighted according to the +group name specified. To highlight the text enclosed in parentheses () with +the group xInside, for example, use the following command: > + + :syntax region xInside start=/(/ end=/)/ + +Suppose, that you want to highlight the parentheses differently. You can do +this with a lot of convoluted region statements, or you can use the +"matchgroup" argument. This tells Vim to highlight the start and end of a +region with a different highlight group (in this case, the xParen group): > + + :syntax region xInside matchgroup=xParen start=/(/ end=/)/ + +The "matchgroup" argument applies to the start or end match that comes after +it. In the previous example both start and end are highlighted with xParen. +To highlight the end with xParenEnd: > + + :syntax region xInside matchgroup=xParen start=/(/ + \ matchgroup=xParenEnd end=/)/ + +A side effect of using "matchgroup" is that contained items will not match in +the start or end of the region. The example for "transparent" uses this. + + +TRANSPARENT + +In a C language file you would like to highlight the () text after a "while" +differently from the () text after a "for". In both of these there can be +nested () items, which should be highlighted in the same way. You must make +sure the () highlighting stops at the matching ). This is one way to do this: +> + :syntax region cWhile matchgroup=cWhile start=/while\s*(/ end=/)/ + \ contains=cCondNest + :syntax region cFor matchgroup=cFor start=/for\s*(/ end=/)/ + \ contains=cCondNest + :syntax region cCondNest start=/(/ end=/)/ contained transparent + +Now you can give cWhile and cFor different highlighting. The cCondNest item +can appear in either of them, but take over the highlighting of the item it is +contained in. The "transparent" argument causes this. + Notice that the "matchgroup" argument has the same group as the item +itself. Why define it then? Well, the side effect of using a matchgroup is +that contained items are not found in the match with the start item then. +This avoids that the cCondNest group matches the ( just after the "while" or +"for". If this would happen, it would span the whole text until the matching +) and the region would continue after it. Now cCondNest only matches after +the match with the start pattern, thus after the first (. + + +OFFSETS + +Suppose you want to define a region for the text between ( and ) after an +"if". But you don't want to include the "if" or the ( and ). You can do this +by specifying offsets for the patterns. Example: > + + :syntax region xCond start=/if\s*(/ms=e+1 end=/)/me=s-1 + +The offset for the start pattern is "ms=e+1". "ms" stands for Match Start. +This defines an offset for the start of the match. Normally the match starts +where the pattern matches. "e+1" means that the match now starts at the end +of the pattern match, and then one character further. + The offset for the end pattern is "me=s-1". "me" stands for Match End. +"s-1" means the start of the pattern match and then one character back. The +result is that in this text: + + if (foo == bar) ~ + +Only the text "foo == bar" will be highlighted as xCond. + +More about offsets here: |:syn-pattern-offset|. + + +ONELINE + +The "oneline" argument indicates that the region does not cross a line +boundary. For example: > + + :syntax region xIfThen start=/if/ end=/then/ oneline + +This defines a region that starts at "if" and ends at "then". But if there is +no "then" after the "if", the region doesn't match. + + Note: + When using "oneline" the region doesn't start if the end pattern + doesn't match in the same line. Without "oneline" Vim does _not_ + check if there is a match for the end pattern. The region starts even + when the end pattern doesn't match in the rest of the file. + + +CONTINUATION LINES AND AVOIDING THEM + +Things now become a little more complex. Let's define a preprocessor line. +This starts with a # in the first column and continues until the end of the +line. A line that ends with \ makes the next line a continuation line. The +way you handle this is to allow the syntax item to contain a continuation +pattern: > + + :syntax region xPreProc start=/^#/ end=/$/ contains=xLineContinue + :syntax match xLineContinue "\\$" contained + +In this case, although xPreProc normally matches a single line, the group +contained in it (namely xLineContinue) lets it go on for more than one line. +For example, it would match both of these lines: + + #define SPAM spam spam spam \ ~ + bacon and spam ~ + +In this case, this is what you want. If it is not what you want, you can call +for the region to be on a single line by adding "excludenl" to the contained +pattern. For example, you want to highlight "end" in xPreProc, but only at +the end of the line. To avoid making the xPreProc continue on the next line, +like xLineContinue does, use "excludenl" like this: > + + :syntax region xPreProc start=/^#/ end=/$/ + \ contains=xLineContinue,xPreProcEnd + :syntax match xPreProcEnd excludenl /end$/ contained + :syntax match xLineContinue "\\$" contained + +"excludenl" must be placed before the pattern. Since "xLineContinue" doesn't +have "excludenl", a match with it will extend xPreProc to the next line as +before. + +============================================================================== +*44.8* Clusters + +One of the things you will notice as you start to write a syntax file is that +you wind up generating a lot of syntax groups. Vim enables you to define a +collection of syntax groups called a cluster. + Suppose you have a language that contains for loops, if statements, while +loops, and functions. Each of them contains the same syntax elements: numbers +and identifiers. You define them like this: > + + :syntax match xFor /^for.*/ contains=xNumber,xIdent + :syntax match xIf /^if.*/ contains=xNumber,xIdent + :syntax match xWhile /^while.*/ contains=xNumber,xIdent + +You have to repeat the same "contains=" every time. If you want to add +another contained item, you have to add it three times. Syntax clusters +simplify these definitions by enabling you to have one cluster stand for +several syntax groups. + To define a cluster for the two items that the three groups contain, use +the following command: > + + :syntax cluster xState contains=xNumber,xIdent + +Clusters are used inside other syntax items just like any syntax group. +Their names start with @. Thus, you can define the three groups like this: > + + :syntax match xFor /^for.*/ contains=@xState + :syntax match xIf /^if.*/ contains=@xState + :syntax match xWhile /^while.*/ contains=@xState + +You can add new group names to this cluster with the "add" argument: > + + :syntax cluster xState add=xString + +You can remove syntax groups from this list as well: > + + :syntax cluster xState remove=xNumber + +============================================================================== +*44.9* Including another syntax file + +The C++ language syntax is a superset of the C language. Because you do not +want to write two syntax files, you can have the C++ syntax file read in the +one for C by using the following command: > + + :runtime! syntax/c.vim + +The ":runtime!" command searches 'runtimepath' for all "syntax/c.vim" files. +This makes the C syntax be defined like for C files. If you have replaced the +c.vim syntax file, or added items with an extra file, these will be loaded as +well. + After loading the C syntax items the specific C++ items can be defined. +For example, add keywords that are not used in C: > + + :syntax keyword cppStatement new delete this friend using + +This works just like in any other syntax file. + +Now consider the Perl language. It consists of two distinct parts: a +documentation section in POD format, and a program written in Perl itself. +The POD section starts with "=head" and ends with "=cut". + You want to define the POD syntax in one file, and use it from the Perl +syntax file. The ":syntax include" command reads in a syntax file and stores +the elements it defined in a syntax cluster. For Perl, the statements are as +follows: > + + :syntax include @Pod <sfile>:p:h/pod.vim + :syntax region perlPOD start=/^=head/ end=/^=cut/ contains=@Pod + +When "=head" is found in a Perl file, the perlPOD region starts. In this +region the @Pod cluster is contained. All the items defined as top-level +items in the pod.vim syntax files will match here. When "=cut" is found, the +region ends and we go back to the items defined in the Perl file. + The ":syntax include" command is clever enough to ignore a ":syntax clear" +command in the included file. And an argument such as "contains=ALL" will +only contain items defined in the included file, not in the file that includes +it. + The "<sfile>:p:h/" part uses the name of the current file (<sfile>), +expands it to a full path (:p) and then takes the head (:h). This results in +the directory name of the file. This causes the pod.vim file in the same +directory to be included. + +============================================================================== +*44.10* Synchronizing + +Compilers have it easy. They start at the beginning of a file and parse it +straight through. Vim does not have it so easy. It must start in the middle, +where the editing is being done. So how does it tell where it is? + The secret is the ":syntax sync" command. This tells Vim how to figure out +where it is. For example, the following command tells Vim to scan backward +for the beginning or end of a C-style comment and begin syntax coloring from +there: > + + :syntax sync ccomment + +You can tune this processing with some arguments. The "minlines" argument +tells Vim the minimum number of lines to look backward, and "maxlines" tells +the editor the maximum number of lines to scan. + For example, the following command tells Vim to look at least 10 lines +before the top of the screen: > + + :syntax sync ccomment minlines=10 maxlines=500 + +If it cannot figure out where it is in that space, it starts looking farther +and farther back until it figures out what to do. But it looks no farther +back than 500 lines. (A large "maxlines" slows down processing. A small one +might cause synchronization to fail.) + To make synchronizing go a bit faster, tell Vim which syntax items can be +skipped. Every match and region that only needs to be used when actually +displaying text can be given the "display" argument. + By default, the comment to be found will be colored as part of the Comment +syntax group. If you want to color things another way, you can specify a +different syntax group: > + + :syntax sync ccomment xAltComment + +If your programming language does not have C-style comments in it, you can try +another method of synchronization. The simplest way is to tell Vim to space +back a number of lines and try to figure out things from there. The following +command tells Vim to go back 150 lines and start parsing from there: > + + :syntax sync minlines=150 + +A large "minlines" value can make Vim slower, especially when scrolling +backwards in the file. + Finally, you can specify a syntax group to look for by using this command: +> + :syntax sync match {sync-group-name} + \ grouphere {group-name} {pattern} + +This tells Vim that when it sees {pattern} the syntax group named {group-name} +begins just after the pattern given. The {sync-group-name} is used to give a +name to this synchronization specification. For example, the sh scripting +language begins an if statement with "if" and ends it with "fi": + + if [ --f file.txt ] ; then ~ + echo "File exists" ~ + fi ~ + +To define a "grouphere" directive for this syntax, you use the following +command: > + + :syntax sync match shIfSync grouphere shIf "\<if\>" + +The "groupthere" argument tells Vim that the pattern ends a group. For +example, the end of the if/fi group is as follows: > + + :syntax sync match shIfSync groupthere NONE "\<fi\>" + +In this example, the NONE tells Vim that you are not in any special syntax +region. In particular, you are not inside an if block. + +You also can define matches and regions that are with no "grouphere" or +"groupthere" arguments. These groups are for syntax groups skipped during +synchronization. For example, the following skips over anything inside {}, +even if it would normally match another synchronization method: > + + :syntax sync match xSpecial /{.*}/ + +More about synchronizing in the reference manual: |:syn-sync|. + +============================================================================== +*44.11* Installing a syntax file + +When your new syntax file is ready to be used, drop it in a "syntax" directory +in 'runtimepath'. For Unix that would be "~/.vim/syntax". + The name of the syntax file must be equal to the file type, with ".vim" +added. Thus for the x language, the full path of the file would be: + + ~/.vim/syntax/x.vim ~ + +You must also make the file type be recognized. See |43.2|. + +If your file works well, you might want to make it available to other Vim +users. First read the next section to make sure your file works well for +others. Then e-mail it to the Vim maintainer: <maintainer@vim.org>. Also +explain how the filetype can be detected. With a bit of luck your file will +be included in the next Vim version! + + +ADDING TO AN EXISTING SYNTAX FILE + +We were assuming you were adding a completely new syntax file. When an existing +syntax file works, but is missing some items, you can add items in a separate +file. That avoids changing the distributed syntax file, which will be lost +when installing a new version of Vim. + Write syntax commands in your file, possibly using group names from the +existing syntax. For example, to add new variable types to the C syntax file: +> + :syntax keyword cType off_t uint + +Write the file with the same name as the original syntax file. In this case +"c.vim". Place it in a directory near the end of 'runtimepath'. This makes +it loaded after the original syntax file. For Unix this would be: + + ~/.vim/after/syntax/c.vim ~ + +============================================================================== +*44.12* Portable syntax file layout + +Wouldn't it be nice if all Vim users exchange syntax files? To make this +possible, the syntax file must follow a few guidelines. + +Start with a header that explains what the syntax file is for, who maintains +it and when it was last updated. Don't include too much information about +changes history, not many people will read it. Example: > + + " Vim syntax file + " Language: C + " Maintainer: Bram Moolenaar <Bram@vim.org> + " Last Change: 2001 Jun 18 + " Remark: Included by the C++ syntax. + +Use the same layout as the other syntax files. Using an existing syntax file +as an example will save you a lot of time. + +Choose a good, descriptive name for your syntax file. Use lowercase letters +and digits. Don't make it too long, it is used in many places: The name of +the syntax file "name.vim", 'filetype', b:current_syntax the start of each +syntax group (nameType, nameStatement, nameString, etc). + +Start with a check for "b:current_syntax". If it is defined, some other +syntax file, earlier in 'runtimepath' was already loaded: > + + if exists("b:current_syntax") + finish + endif + +To be compatible with Vim 5.8 use: > + + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish + endif + +Set "b:current_syntax" to the name of the syntax at the end. Don't forget +that included files do this too, you might have to reset "b:current_syntax" if +you include two files. + +If you want your syntax file to work with Vim 5.x, add a check for v:version. +See yacc.vim for an example. + +Do not include anything that is a user preference. Don't set 'tabstop', +'expandtab', etc. These belong in a filetype plugin. + +Do not include mappings or abbreviations. Only include setting 'iskeyword' if +it is really necessary for recognizing keywords. + +To allow users select their own preferred colors, make a different group name +for every kind of highlighted item. Then link each of them to one of the +standard highlight groups. That will make it work with every color scheme. +If you select specific colors it will look bad with some color schemes. And +don't forget that some people use a different background color, or have only +eight colors available. + +For the linking use "hi def link", so that the user can select different +highlighting before your syntax file is loaded. Example: > + + hi def link nameString String + hi def link nameNumber Number + hi def link nameCommand Statement + ... etc ... + +Add the "display" argument to items that are not used when syncing, to speed +up scrolling backwards and CTRL-L. + +============================================================================== + +Next chapter: |usr_45.txt| Select your language + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_45.txt b/Aufgabe5/doc.lang/usr_45.txt new file mode 100644 index 0000000..d436bdd --- /dev/null +++ b/Aufgabe5/doc.lang/usr_45.txt @@ -0,0 +1,419 @@ +*usr_45.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Select your language + + +The messages in Vim can be given in several languages. This chapter explains +how to change which one is used. Also, the different ways to work with files +in various languages is explained. + +|45.1| Language for Messages +|45.2| Language for Menus +|45.3| Using another encoding +|45.4| Editing files with a different encoding +|45.5| Entering language text + + Next chapter: |usr_90.txt| Installing Vim + Previous chapter: |usr_44.txt| Your own syntax highlighted +Table of contents: |usr_toc.txt| + +============================================================================== +*45.1* Language for Messages + +When you start Vim, it checks the environment to find out what language you +are using. Mostly this should work fine, and you get the messages in your +language (if they are available). To see what the current language is, use +this command: > + + :language + +If it replies with "C", this means the default is being used, which is +English. + + Note: + Using different languages only works when Vim was compiled to handle + it. To find out if it works, use the ":version" command and check the + output for "+gettext" and "+multi_lang". If they are there, you are + OK. If you see "-gettext" or "-multi_lang" you will have to find + another Vim. + +What if you would like your messages in a different language? There are +several ways. Which one you should use depends on the capabilities of your +system. + The first way is to set the environment to the desired language before +starting Vim. Example for Unix: > + + env LANG=de_DE.ISO_8859-1 vim + +This only works if the language is available on your system. The advantage is +that all the GUI messages and things in libraries will use the right language +as well. A disadvantage is that you must do this before starting Vim. If you +want to change language while Vim is running, you can use the second method: > + + :language fr_FR.ISO_8859-1 + +This way you can try out several names for your language. You will get an +error message when it's not supported on your system. You don't get an error +when translated messages are not available. Vim will silently fall back to +using English. + To find out which languages are supported on your system, find the +directory where they are listed. On my system it is "/usr/share/locale". On +some systems it's in "/usr/lib/locale". The manual page for "setlocale" +should give you a hint where it is found on your system. + Be careful to type the name exactly as it should be. Upper and lowercase +matter, and the '-' and '_' characters are easily confused. + +You can also set the language separately for messages, edited text and the +time format. See |:language|. + + +DO-IT-YOURSELF MESSAGE TRANSLATION + +If translated messages are not available for your language, you could write +them yourself. To do this, get the source code for Vim and the GNU gettext +package. After unpacking the sources, instructions can be found in the +directory src/po/README.txt. + It's not too difficult to do the translation. You don't need to be a +programmer. You must know both English and the language you are translating +to, of course. + When you are satisfied with the translation, consider making it available +to others. Upload it at vim-online (http://vim.sf.net) or e-mail it to +the Vim maintainer <maintainer@vim.org>. Or both. + +============================================================================== +*45.2* Language for Menus + +The default menus are in English. To be able to use your local language, they +must be translated. Normally this is automatically done for you if the +environment is set for your language, just like with messages. You don't need +to do anything extra for this. But it only works if translations for the +language are available. + Suppose you are in Germany, with the language set to German, but prefer to +use "File" instead of "Datei". You can switch back to using the English menus +this way: > + + :set langmenu=none + +It is also possible to specify a language: > + + :set langmenu=nl_NL.ISO_8859-1 + +Like above, differences between "-" and "_" matter. However, upper/lowercase +differences are ignored here. + The 'langmenu' option must be set before the menus are loaded. Once the +menus have been defined changing 'langmenu' has no direct effect. Therefore, +put the command to set 'langmenu' in your vimrc file. + If you really want to switch menu language while running Vim, you can do it +this way: > + + :source $VIMRUNTIME/delmenu.vim + :set langmenu=de_DE.ISO_8859-1 + :source $VIMRUNTIME/menu.vim + +There is one drawback: All menus that you defined yourself will be gone. You +will need to redefine them as well. + + +DO-IT-YOURSELF MENU TRANSLATION + +To see which menu translations are available, look in this directory: + + $VIMRUNTIME/lang ~ + +The files are called menu_{language}.vim. If you don't see the language you +want to use, you can do your own translations. The simplest way to do this is +by copying one of the existing language files, and change it. + First find out the name of your language with the ":language" command. Use +this name, but with all letters made lowercase. Then copy the file to your +own runtime directory, as found early in 'runtimepath'. For example, for Unix +you would do: > + + :!cp $VIMRUNTIME/lang/menu_ko_kr.euckr.vim ~/.vim/lang/menu_nl_be.iso_8859-1.vim + +You will find hints for the translation in "$VIMRUNTIME/lang/README.txt". + +============================================================================== +*45.3* Using another encoding + +Vim guesses that the files you are going to edit are encoded for your +language. For many European languages this is "latin1". Then each byte is +one character. That means there are 256 different characters possible. For +Asian languages this is not sufficient. These mostly use a double-byte +encoding, providing for over ten thousand possible characters. This still +isn't enough when a text is to contain several different languages. This is +where Unicode comes in. It was designed to include all characters used in +commonly used languages. This is the "Super encoding that replaces all +others". But it isn't used that much yet. + Fortunately, Vim supports these three kinds of encodings. And, with some +restrictions, you can use them even when your environment uses another +language than the text. + Nevertheless, when you only edit files that are in the encoding of your +language, the default should work fine and you don't need to do anything. The +following is only relevant when you want to edit different languages. + + Note: + Using different encodings only works when Vim was compiled to handle + it. To find out if it works, use the ":version" command and check the + output for "+multi_byte". If it's there, you are OK. If you see + "-multi_byte" you will have to find another Vim. + + +USING UNICODE IN THE GUI + +The nice thing about Unicode is that other encodings can be converted to it +and back without losing information. When you make Vim use Unicode +internally, you will be able to edit files in any encoding. + Unfortunately, the number of systems supporting Unicode is still limited. +Thus it's unlikely that your language uses it. You need to tell Vim you want +to use Unicode, and how to handle interfacing with the rest of the system. + Let's start with the GUI version of Vim, which is able to display Unicode +characters. This should work: > + + :set encoding=utf-8 + :set guifont=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 + +The 'encoding' option tells Vim the encoding of the characters that you use. +This applies to the text in buffers (files you are editing), registers, Vim +script files, etc. You can regard 'encoding' as the setting for the internals +of Vim. + This example assumes you have this font on your system. The name in the +example is for the X Window System. This font is in a package that is used to +enhance xterm with Unicode support. If you don't have this font, you might +find it here: + + http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~ + +For MS-Windows, some fonts have a limited number of Unicode characters. Try +using the "Courier New" font. You can use the Edit/Select Font... menu to +select and try out the fonts available. Only fixed-width fonts can be used +though. Example: > + + :set guifont=courier_new:h12 + +If it doesn't work well, try getting a fontpack. If Microsoft didn't move it, +you can find it here: + + http://www.microsoft.com/typography/fontpack/default.htm ~ + +Now you have told Vim to use Unicode internally and display text with a +Unicode font. Typed characters still arrive in the encoding of your original +language. This requires converting them to Unicode. Tell Vim the language +from which to convert with the 'termencoding' option. You can do it like +this: > + + :let &termencoding = &encoding + :set encoding=utf-8 + +This assigns the old value of 'encoding' to 'termencoding' before setting +'encoding' to utf-8. You will have to try out if this really works for your +setup. It should work especially well when using an input method for an Asian +language, and you want to edit Unicode text. + + +USING UNICODE IN A UNICODE TERMINAL + +There are terminals that support Unicode directly. The standard xterm that +comes with XFree86 is one of them. Let's use that as an example. + First of all, the xterm must have been compiled with Unicode support. See +|UTF8-xterm| how to check that and how to compile it when needed. + Start the xterm with the "-u8" argument. You might also need so specify a +font. Example: > + + xterm -u8 -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 + +Now you can run Vim inside this terminal. Set 'encoding' to "utf-8" as +before. That's all. + + +USING UNICODE IN AN ORDINARY TERMINAL + +Suppose you want to work with Unicode files, but don't have a terminal with +Unicode support. You can do this with Vim, although characters that are not +supported by the terminal will not be displayed. The layout of the text +will be preserved. > + + :let &termencoding = &encoding + :set encoding=utf-8 + +This is the same as what was used for the GUI. But it works differently: Vim +will convert the displayed text before sending it to the terminal. That +avoids that the display is messed up with strange characters. + For this to work the conversion between 'termencoding' and 'encoding' must +be possible. Vim will convert from latin1 to Unicode, thus that always works. +For other conversions the |+iconv| feature is required. + Try editing a file with Unicode characters in it. You will notice that Vim +will put a question mark (or underscore or some other character) in places +where a character should be that the terminal can't display. Move the cursor +to a question mark and use this command: > + + ga + +Vim will display a line with the code of the character. This gives you a hint +about what character it is. You can look it up in a Unicode table. You could +actually view a file that way, if you have lots of time at hand. + + Note: + Since 'encoding' is used for all text inside Vim, changing it makes + all non-ASCII text invalid. You will notice this when using registers + and the 'viminfo' file (e.g., a remembered search pattern). It's + recommended to set 'encoding' in your vimrc file, and leave it alone. + +============================================================================== +*45.4* Editing files with a different encoding + +Suppose you have setup Vim to use Unicode, and you want to edit a file that is +in 16-bit Unicode. Sounds simple, right? Well, Vim actually uses utf-8 +encoding internally, thus the 16-bit encoding must be converted. Thus there +is a difference between the character set (Unicode) and the encoding (utf-8 or +16-bit). + Vim will try to detect what kind of file you are editing. It uses the +encoding names in the 'fileencodings' option. When using Unicode, the default +value is: "ucs-bom,utf-8,latin1". This means that Vim checks the file to see +if it's one of these encodings: + + ucs-bom File must start with a Byte Order Mark (BOM). This + allows detection of 16-bit, 32-bit and utf-8 Unicode + encodings. + utf-8 utf-8 Unicode. This is rejected when a sequence of + bytes is illegal in utf-8. + latin1 The good old 8-bit encoding. Always works. + +When you start editing that 16-bit Unicode file, and it has a BOM, Vim will +detect this and convert the file to utf-8 when reading it. The 'fileencoding' +option (without s at the end) is set to the detected value. In this case it +is "ucs-2le". That means it's Unicode, two bytes and little-endian. This +file format is common on MS-Windows (e.g., for registry files). + When writing the file, Vim will compare 'fileencoding' with 'encoding'. If +they are different, the text will be converted. + An empty value for 'fileencoding' means that no conversion is to be done. +Thus the text is assumed to be encoded with 'encoding'. + +If the default 'fileencodings' value is not good for you, set it to the +encodings you want Vim to try. Only when a value is found to be invalid will +the next one be used. Putting "latin1" first doesn't work, because it is +never illegal. An example, to fall back to Japanese when the file doesn't +have a BOM and isn't utf-8: > + + :set fileencodings=ucs-bom,utf-8,sjis + +See |encoding-values| for suggested values. Other values may work as well. +This depends on the conversion available. + + +FORCING AN ENCODING + +If the automatic detection doesn't work you must tell Vim what encoding the +file is. Example: > + + :edit ++enc=koi8-r russian.txt + +The "++enc" part specifies the name of the encoding to be used for this file +only. Vim will convert the file from the specified encoding, Russian in this +example, to 'encoding'. 'fileencoding' will also be set to the specified +encoding, so that the reverse conversion can be done when writing the file. + The same argument can be used when writing the file. This way you can +actually use Vim to convert a file. Example: > + + :write ++enc=utf-8 russian.txt +< + Note: + Conversion may result in lost characters. Conversion from an encoding + to Unicode and back is mostly free of this problem, unless there are + illegal characters. Conversion from Unicode to other encodings often + loses information when there was more than one language in the file. + +============================================================================== +*45.5* Entering language text + +Computer keyboards don't have much more than a hundred keys. Some languages +have thousands of characters, Unicode has ten thousands. So how do you type +these characters? + First of all, when you don't use too many of the special characters, you +can use digraphs. This was already explained in |24.9|. + When you use a language that uses many more characters than keys on your +keyboard, you will want to use an Input Method (IM). This requires learning +the translation from typed keys to resulting character. When you need an IM +you probably already have one on your system. It should work with Vim like +with other programs. For details see |mbyte-XIM| for the X Window system and +|mbyte-IME| for MS-Windows. + + +KEYMAPS + +For some languages the character set is different from latin, but uses a +similar number of characters. It's possible to map keys to characters. Vim +uses keymaps for this. + Suppose you want to type Hebrew. You can load the keymap like this: > + + :set keymap=hebrew + +Vim will try to find a keymap file for you. This depends on the value of +'encoding'. If no matching file was found, you will get an error message. + +Now you can type Hebrew in Insert mode. In Normal mode, and when typing a ":" +command, Vim automatically switches to English. You can use this command to +switch between Hebrew and English: > + + CTRL-^ + +This only works in Insert mode and Command-line mode. In Normal mode it does +something completely different (jumps to alternate file). + The usage of the keymap is indicated in the mode message, if you have the +'showmode' option set. In the GUI Vim will indicate the usage of keymaps with +a different cursor color. + You can also change the usage of the keymap with the 'iminsert' and +'imsearch' options. + +To see the list of mappings, use this command: > + + :lmap + +To find out which keymap files are available, in the GUI you can use the +Edit/Keymap menu. Otherwise you can use this command: > + + :echo globpath(&rtp, "keymap/*.vim") + + +DO-IT-YOURSELF KEYMAPS + +You can create your own keymap file. It's not very difficult. Start with +a keymap file that is similar to the language you want to use. Copy it to the +"keymap" directory in your runtime directory. For example, for Unix, you +would use the directory "~/.vim/keymap". + The name of the keymap file must look like this: + + keymap/{name}.vim ~ +or + keymap/{name}_{encoding}.vim ~ + +{name} is the name of the keymap. Chose a name that is obvious, but different +from existing keymaps (unless you want to replace an existing keymap file). +{name} cannot contain an underscore. Optionally, add the encoding used after +an underscore. Examples: + + keymap/hebrew.vim ~ + keymap/hebrew_utf-8.vim ~ + +The contents of the file should be self-explanatory. Look at a few of the +keymaps that are distributed with Vim. For the details, see |mbyte-keymap|. + + +LAST RESORT + +If all other methods fail, you can enter any character with CTRL-V: + + encoding type range ~ + 8-bit CTRL-V 123 decimal 0-255 + 8-bit CTRL-V x a1 hexadecimal 00-ff + 16-bit CTRL-V u 013b hexadecimal 0000-ffff + 31-bit CTRL-V U 001303a4 hexadecimal 00000000-7fffffff + +Don't type the spaces. See |i_CTRL-V_digit| for the details. + +============================================================================== + +Next chapter: |usr_90.txt| Installing Vim + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_90.txt b/Aufgabe5/doc.lang/usr_90.txt new file mode 100644 index 0000000..65aad26 --- /dev/null +++ b/Aufgabe5/doc.lang/usr_90.txt @@ -0,0 +1,498 @@ +*usr_90.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Installing Vim + + *install* +Before you can use Vim you have to install it. Depending on your system it's +simple or easy. This chapter gives a few hints and also explains how +upgrading to a new version is done. + +|90.1| Unix +|90.2| MS-Windows +|90.3| Upgrading +|90.4| Common installation issues +|90.5| Uninstalling Vim + + Previous chapter: |usr_45.txt| Select your language +Table of contents: |usr_toc.txt| + +============================================================================== +*90.1* Unix + +First you have to decide if you are going to install Vim system-wide or for a +single user. The installation is almost the same, but the directory where Vim +is installed in differs. + For a system-wide installation the base directory "/usr/local" is often +used. But this may be different for your system. Try finding out where other +packages are installed. + When installing for a single user, you can use your home directory as the +base. The files will be placed in subdirectories like "bin" and "shared/vim". + + +FROM A PACKAGE + +You can get precompiled binaries for many different UNIX systems. There is a +long list with links on this page: + + http://www.vim.org/binaries.html ~ + +Volunteers maintain the binaries, so they are often out of date. It is a +good idea to compile your own UNIX version from the source. Also, creating +the editor from the source allows you to control which features are compiled. +This does require a compiler though. + +If you have a Linux distribution, the "vi" program is probably a minimal +version of Vim. It doesn't do syntax highlighting, for example. Try finding +another Vim package in your distribution, or search on the web site. + + +FROM SOURCES + +To compile and install Vim, you will need the following: + + - A C compiler (GCC preferred) + - The GZIP program (you can get it from www.gnu.org) + - The Vim source and runtime archives + +To get the Vim archives, look in this file for a mirror near you, this should +provide the fastest download: + + ftp://ftp.vim.org/pub/vim/MIRRORS ~ + +Or use the home site ftp.vim.org, if you think it's fast enough. Go to the +"unix" directory and you'll find a list of files there. The version number is +embedded in the file name. You will want to get the most recent version. + You can get the files for Unix in two ways: One big archive that contains +everything, or four smaller ones that each fit on a floppy disk. For version +6.1 the single big one is called: + + vim-6.1.tar.bz2 ~ + +You need the bzip2 program to uncompress it. If you don't have it, get the +four smaller files, which can be uncompressed with gzip. For Vim 6.1 they are +called: + + vim-6.1-src1.tar.gz ~ + vim-6.1-src2.tar.gz ~ + vim-6.1-rt1.tar.gz ~ + vim-6.1-rt2.tar.gz ~ + + +COMPILING + +First create a top directory to work in, for example: > + + mkdir ~/vim + cd ~/vim + +Then unpack the archives there. If you have the one big archive, you unpack +it like this: > + + bzip2 -d -c path/vim-6.1.tar.bz2 | tar xf - + +Change "path" to where you have downloaded the file. > + + gzip -d -c path/vim-6.1-src1.tar.gz | tar xf - + gzip -d -c path/vim-6.1-src2.tar.gz | tar xf - + gzip -d -c path/vim-6.1-rt1.tar.gz | tar xf - + gzip -d -c path/vim-6.1-rt2.tar.gz | tar xf - + +If you are satisfied with getting the default features, and your environment +is setup properly, you should be able to compile Vim with just this: > + + cd vim61/src + make + +The make program will run configure and compile everything. Further on we +will explain how to compile with different features. + If there are errors while compiling, carefully look at the error messages. +There should be a hint about what went wrong. Hopefully you will be able to +correct it. You might have to disable some features to make Vim compile. +Look in the Makefile for specific hints for your system. + + +TESTING + +Now you can check if compiling worked OK: > + + make test + +This will run a sequence of test scripts to verify that Vim works as expected. +Vim will be started many times and all kinds of text and messages flash by. +If it is alright you will finally see: + + test results: ~ + ALL DONE ~ + +If there are one or two messages about failed tests, Vim might still work, but +not perfectly. If you see a lot of error messages or Vim doesn't finish until +the end, there must be something wrong. Either try to find out yourself, or +find someone who can solve it. You could look in the |maillist-archive| for a +solution. If everything else fails, you could ask in the vim |maillist| if +someone can help you. + + +INSTALLING + *install-home* +If you want to install in your home directory, edit the Makefile and search +for a line: + + #prefix = $(HOME) ~ + +Remove the # at the start of the line. + When installing for the whole system, Vim has most likely already selected +a good installation directory for you. You can also specify one, see below. +You need to become root for the following. + +To install Vim do: > + + make install + +That should move all the relevant files to the right place. Now you can try +running vim to verify that it works. Use two simple tests to check if Vim can +find its runtime files: > + + :help + :syntax enable + +If this doesn't work, use this command to check where Vim is looking for the +runtime files: > + + :echo $VIMRUNTIME + +You can also start Vim with the "-V" argument to see what happens during +startup: > + + vim -V + +Don't forget that the user manual assumes you Vim in a certain way. After +installing Vim, follow the instructions at |not-compatible| to make Vim work +as assumed in this manual. + + +SELECTING FEATURES + +Vim has many ways to select features. One of the simple ways is to edit the +Makefile. There are many directions and examples. Often you can enable or +disable a feature by uncommenting a line. + An alternative is to run "configure" separately. This allows you to +specify configuration options manually. The disadvantage is that you have to +figure out what exactly to type. + Some of the most interesting configure arguments follow. These can also be +enabled from the Makefile. + + --prefix={directory} Top directory where to install Vim. + + --with-features=tiny Compile with many features disabled. + --with-features=small Compile with some features disabled. + --with-features=big Compile with more features enabled. + --with-features=huge Compile with most features enabled. + See |+feature-list| for which feature + is enabled in which case. + + --enable-perlinterp Enable the Perl interface. There are + similar arguments for ruby, python and + tcl. + + --disable-gui Do not compile the GUI interface. + --without-x Do not compile X-windows features. + When both of these are used, Vim will + not connect to the X server, which + makes startup faster. + +To see the whole list use: > + + ./configure --help + +You can find a bit of explanation for each feature, and links for more +information here: |feature-list|. + For the adventurous, edit the file "feature.h". You can also change the +source code yourself! + +============================================================================== +*90.2* MS-Windows + +There are two ways to install the Vim program for Microsoft Windows. You can +uncompress several archives, or use a self-installing big archive. Most users +with fairly recent computers will prefer the second method. For the first +one, you will need: + + - An archive with binaries for Vim. + - The Vim runtime archive. + - A program to unpack the zip files. + +To get the Vim archives, look in this file for a mirror near you, this should +provide the fastest download: + + ftp://ftp.vim.org/pub/vim/MIRRORS ~ + +Or use the home site ftp.vim.org, if you think it's fast enough. Go to the +"pc" directory and you'll find a list of files there. The version number is +embedded in the file name. You will want to get the most recent version. +We will use "61" here, which is version 6.1. + + gvim61.exe The self-installing archive. + +This is all you need for the second method. Just launch the executable, and +follow the prompts. + +For the first method you must chose one of the binary archives. These are +available: + + gvim61.zip The normal MS-Windows GUI version. + gvim61ole.zip The MS-Windows GUI version with OLE support. + Uses more memory, supports interfacing with + other OLE applications. + vim61w32.zip 32 bit MS-Windows console version. For use in + a Win NT/2000/XP console. Does not work well + on Win 95/98. + vim61d32.zip 32 bit MS-DOS version. For use in the + Win 95/98 console window. + vim61d16.zip 16 bit MS-DOS version. Only for old systems. + Does not support long filenames. + +You only need one of them. Although you could install both a GUI and a +console version. You always need to get the archive with runtime files. + + vim61rt.zip The runtime files. + +Use your un-zip program to unpack the files. For example, using the "unzip" +program: > + + cd c:\ + unzip path\gvim61.zip + unzip path\vim61rt.zip + +This will unpack the files in the directory "c:\vim\vim61". If you already +have a "vim" directory somewhere, you will want to move to the directory just +above it. + Now change to the "vim\vim61" directory and run the install program: > + + install + +Carefully look through the messages and select the options you want to use. +If you finally select "do it" the install program will carry out the actions +you selected. + The install program doesn't move the runtime files. They remain where you +unpacked them. + +In case you are not satisfied with the features included in the supplied +binaries, you could try compiling Vim yourself. Get the source archive from +the same location as where the binaries are. You need a compiler for which a +makefile exists. Microsoft Visual C works, but is expensive. The Free +Borland command-line compiler 5.5 can be used, as well as the free MingW and +Cygwin compilers. Check the file src/INSTALLpc.txt for hints. + +============================================================================== +*90.3* Upgrading + +If you are running one version of Vim and want to install another, here is +what to do. + + +UNIX + +When you type "make install" the runtime files will be copied to a directory +which is specific for this version. Thus they will not overwrite a previous +version. This makes it possible to use two or more versions next to +each other. + The executable "vim" will overwrite an older version. If you don't care +about keeping the old version, running "make install" will work fine. You can +delete the old runtime files manually. Just delete the directory with the +version number in it and all files below it. Example: > + + rm -rf /usr/local/share/vim/vim58 + +There are normally no changed files below this directory. If you did change +the "filetype.vim" file, for example, you better merge the changes into the +new version before deleting it. + +If you are careful and want to try out the new version for a while before +switching to it, install the new version under another name. You need to +specify a configure argument. For example: > + + ./configure --with-vim-name=vim6 + +Before running "make install", you could use "make -n install" to check that +no valuable existing files are overwritten. + When you finally decide to switch to the new version, all you need to do is +to rename the binary to "vim". For example: > + + mv /usr/local/bin/vim6 /usr/local/bin/vim + + +MS-WINDOWS + +Upgrading is mostly equal to installing a new version. Just unpack the files +in the same place as the previous version. A new directory will be created, +e.g., "vim61", for the files of the new version. Your runtime files, vimrc +file, viminfo, etc. will be left alone. + If you want to run the new version next to the old one, you will have to do +some handwork. Don't run the install program, it will overwrite a few files +of the old version. Execute the new binaries by specifying the full path. +The program should be able to automatically find the runtime files for the +right version. However, this won't work if you set the $VIMRUNTIME variable +somewhere. + If you are satisfied with the upgrade, you can delete the files of the +previous version. See |90.5|. + +============================================================================== +*90.4* Common installation issues + +This section describes some of the common problems that occur when installing +Vim and suggests some solutions. It also contains answers to many +installation questions. + + +Q: I Do Not Have Root Privileges. How Do I Install Vim? (Unix) + +Use the following configuration command to install Vim in a directory called +$HOME/vim: > + + ./configure --prefix=$HOME + +This gives you a personal copy of Vim. You need to put $HOME/bin in your +path to execute the editor. Also see |install-home|. + + +Q: The Colors Are Not Right on My Screen. (Unix) + +Check your terminal settings by using the following command in a shell: > + + echo $TERM + +If the terminal type listed is not correct, fix it. For more hints, see +|06.2|. Another solution is to always use the GUI version of Vim, called +gvim. This avoids the need for a correct terminal setup. + + +Q: My Backspace And Delete Keys Don't Work Right + +The definition of what key sends what code is very unclear for backspace <BS> +and Delete <Del> keys. First of all, check your $TERM setting. If there is +nothing wrong with it, try this: > + + :set t_kb=^V<BS> + :set t_kD=^V<Del> + +In the first line you need to press CTRL-V and then hit the backspace key. +In the second line you need to press CTRL-V and then hit the Delete key. +You can put these lines in your vimrc file, see |05.1|. A disadvantage is +that it won't work when you use another terminal some day. Look here for +alternate solutions: |:fixdel|. + + +Q: I Am Using RedHat Linux. Can I Use the Vim That Comes with the System? + +By default RedHat installs a minimal version of Vim. Check your RPM packages +for something named "Vim-enhanced-version.rpm" and install that. + + +Q: How Do I Turn Syntax Coloring On? How do I make plugins work? + +Use the example vimrc script. You can find an explanation on how to use it +here: |not-compatible|. + +See chapter 6 for information about syntax highlighting: |usr_06.txt|. + + +Q: What Is a Good vimrc File to Use? + +See the www.vim.org Web site for several good examples. + + +Q: Where Do I Find a Good Vim Plugin? + +See the Vim-online site: http://vim.sf.net. Many users have uploaded useful +Vim scripts and plugins there. + + +Q: Where Do I Find More Tips? + +See the Vim-online site: http://vim.sf.net. There is an archive with hints +from Vim users. You might also want to search in the |maillist-archive|. + +============================================================================== +*90.5* Uninstalling Vim + +In the unlikely event you want to uninstall Vim completely, this is how you do +it. + + +UNIX + +When you installed Vim as a package, check your package manager to find out +how to remove the package again. + If you installed Vim from sources you can use this command: > + + make uninstall + +However, if you have deleted the original files or you used an archive that +someone supplied, you can't do this. Do delete the files manually, here is an +example for when "/usr/local" was used as the root: > + + rm -rf /usr/local/share/vim/vim61 + rm /usr/local/bin/eview + rm /usr/local/bin/evim + rm /usr/local/bin/ex + rm /usr/local/bin/gview + rm /usr/local/bin/gvim + rm /usr/local/bin/gvim + rm /usr/local/bin/gvimdiff + rm /usr/local/bin/rgview + rm /usr/local/bin/rgvim + rm /usr/local/bin/rview + rm /usr/local/bin/rvim + rm /usr/local/bin/rvim + rm /usr/local/bin/view + rm /usr/local/bin/vim + rm /usr/local/bin/vimdiff + rm /usr/local/bin/vimtutor + rm /usr/local/bin/xxd + rm /usr/local/man/man1/eview.1 + rm /usr/local/man/man1/evim.1 + rm /usr/local/man/man1/ex.1 + rm /usr/local/man/man1/gview.1 + rm /usr/local/man/man1/gvim.1 + rm /usr/local/man/man1/gvimdiff.1 + rm /usr/local/man/man1/rgview.1 + rm /usr/local/man/man1/rgvim.1 + rm /usr/local/man/man1/rview.1 + rm /usr/local/man/man1/rvim.1 + rm /usr/local/man/man1/view.1 + rm /usr/local/man/man1/vim.1 + rm /usr/local/man/man1/vimdiff.1 + rm /usr/local/man/man1/vimtutor.1 + rm /usr/local/man/man1/xxd.1 + + +MS-WINDOWS + +If you installed Vim with the self-installing archive you can run +the "uninstall-gui" program located in the same directory as the other Vim +programs, e.g. "c:\vim\vim61". You can also launch it from the Start menu if +installed the Vim entries there. This will remove most of the files, menu +entries and desktop shortcuts. Some files may remain however, as they need a +Windows restart before being deleted. + You will be given the option to remove the whole "vim" directory. It +probably contains your vimrc file and other runtime files that you created, so +be careful. + +Else, if you installed Vim with the zip archives, the preferred way is to use +the "uninstal" program (note the missing l at the end). You can find it in +the same directory as the "install" program, e.g., "c:\vim\vim61". This +should also work from the usual "install/remove software" page. + However, this only removes the registry entries for Vim. You have to +delete the files yourself. Simply select the directory "vim\vim61" and delete +it recursively. There should be no files there that you changed, but you +might want to check that first. + The "vim" directory probably contains your vimrc file and other runtime +files that you created. You might want to keep that. + +============================================================================== + +Table of contents: |usr_toc.txt| + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/usr_toc.txt b/Aufgabe5/doc.lang/usr_toc.txt new file mode 100644 index 0000000..9fe133c --- /dev/null +++ b/Aufgabe5/doc.lang/usr_toc.txt @@ -0,0 +1,353 @@ +*usr_toc.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + VIM USER MANUAL - by Bram Moolenaar + + Table Of Contents *user-manual* + +============================================================================== +Overview ~ + +Getting Started +|usr_01.txt| About the manuals +|usr_02.txt| The first steps in Vim +|usr_03.txt| Moving around +|usr_04.txt| Making small changes +|usr_05.txt| Set your settings +|usr_06.txt| Using syntax highlighting +|usr_07.txt| Editing more than one file +|usr_08.txt| Splitting windows +|usr_09.txt| Using the GUI +|usr_10.txt| Making big changes +|usr_11.txt| Recovering from a crash +|usr_12.txt| Clever tricks + +Editing Effectively +|usr_20.txt| Typing command-line commands quickly +|usr_21.txt| Go away and come back +|usr_22.txt| Finding the file to edit +|usr_23.txt| Editing other files +|usr_24.txt| Inserting quickly +|usr_25.txt| Editing formatted text +|usr_26.txt| Repeating +|usr_27.txt| Search commands and patterns +|usr_28.txt| Folding +|usr_29.txt| Moving through programs +|usr_30.txt| Editing programs +|usr_31.txt| Exploiting the GUI +|usr_32.txt| The undo tree + +Tuning Vim +|usr_40.txt| Make new commands +|usr_41.txt| Write a Vim script +|usr_42.txt| Add new menus +|usr_43.txt| Using filetypes +|usr_44.txt| Your own syntax highlighted +|usr_45.txt| Select your language + +Making Vim Run +|usr_90.txt| Installing Vim + + +Reference manual +|reference_toc| More detailed information for all commands + +The user manual is available as a single, ready to print HTML and PDF file +here: + http://vimdoc.sf.net + +============================================================================== +Getting Started ~ + +Read this from start to end to learn the essential commands. + +|usr_01.txt| About the manuals + |01.1| Two manuals + |01.2| Vim installed + |01.3| Using the Vim tutor + |01.4| Copyright + +|usr_02.txt| The first steps in Vim + |02.1| Running Vim for the First Time + |02.2| Inserting text + |02.3| Moving around + |02.4| Deleting characters + |02.5| Undo and Redo + |02.6| Other editing commands + |02.7| Getting out + |02.8| Finding help + +|usr_03.txt| Moving around + |03.1| Word movement + |03.2| Moving to the start or end of a line + |03.3| Moving to a character + |03.4| Matching a paren + |03.5| Moving to a specific line + |03.6| Telling where you are + |03.7| Scrolling around + |03.8| Simple searches + |03.9| Simple search patterns + |03.10| Using marks + +|usr_04.txt| Making small changes + |04.1| Operators and motions + |04.2| Changing text + |04.3| Repeating a change + |04.4| Visual mode + |04.5| Moving text + |04.6| Copying text + |04.7| Using the clipboard + |04.8| Text objects + |04.9| Replace mode + |04.10| Conclusion + +|usr_05.txt| Set your settings + |05.1| The vimrc file + |05.2| The example vimrc file explained + |05.3| Simple mappings + |05.4| Adding a plugin + |05.5| Adding a help file + |05.6| The option window + |05.7| Often used options + +|usr_06.txt| Using syntax highlighting + |06.1| Switching it on + |06.2| No or wrong colors? + |06.3| Different colors + |06.4| With colors or without colors + |06.5| Printing with colors + |06.6| Further reading + +|usr_07.txt| Editing more than one file + |07.1| Edit another file + |07.2| A list of files + |07.3| Jumping from file to file + |07.4| Backup files + |07.5| Copy text between files + |07.6| Viewing a file + |07.7| Changing the file name + +|usr_08.txt| Splitting windows + |08.1| Split a window + |08.2| Split a window on another file + |08.3| Window size + |08.4| Vertical splits + |08.5| Moving windows + |08.6| Commands for all windows + |08.7| Viewing differences with vimdiff + |08.8| Various + +|usr_09.txt| Using the GUI + |09.1| Parts of the GUI + |09.2| Using the mouse + |09.3| The clipboard + |09.4| Select mode + +|usr_10.txt| Making big changes + |10.1| Record and playback commands + |10.2| Substitution + |10.3| Command ranges + |10.4| The global command + |10.5| Visual block mode + |10.6| Reading and writing part of a file + |10.7| Formatting text + |10.8| Changing case + |10.9| Using an external program + +|usr_11.txt| Recovering from a crash + |11.1| Basic recovery + |11.2| Where is the swap file? + |11.3| Crashed or not? + |11.4| Further reading + +|usr_12.txt| Clever tricks + |12.1| Replace a word + |12.2| Change "Last, First" to "First Last" + |12.3| Sort a list + |12.4| Reverse line order + |12.5| Count words + |12.6| Find a man page + |12.7| Trim blanks + |12.8| Find where a word is used + +============================================================================== +Editing Effectively ~ + +Subjects that can be read independently. + +|usr_20.txt| Typing command-line commands quickly + |20.1| Command line editing + |20.2| Command line abbreviations + |20.3| Command line completion + |20.4| Command line history + |20.5| Command line window + +|usr_21.txt| Go away and come back + |21.1| Suspend and resume + |21.2| Executing shell commands + |21.3| Remembering information; viminfo + |21.4| Sessions + |21.5| Views + |21.6| Modelines + +|usr_22.txt| Finding the file to edit + |22.1| The file explorer + |22.2| The current directory + |22.3| Finding a file + |22.4| The buffer list + +|usr_23.txt| Editing other files + |23.1| DOS, Mac and Unix files + |23.2| Files on the internet + |23.3| Encryption + |23.4| Binary files + |23.5| Compressed files + +|usr_24.txt| Inserting quickly + |24.1| Making corrections + |24.2| Showing matches + |24.3| Completion + |24.4| Repeating an insert + |24.5| Copying from another line + |24.6| Inserting a register + |24.7| Abbreviations + |24.8| Entering special characters + |24.9| Digraphs + |24.10| Normal mode commands + +|usr_25.txt| Editing formatted text + |25.1| Breaking lines + |25.2| Aligning text + |25.3| Indents and tabs + |25.4| Dealing with long lines + |25.5| Editing tables + +|usr_26.txt| Repeating + |26.1| Repeating with Visual mode + |26.2| Add and subtract + |26.3| Making a change in many files + |26.4| Using Vim from a shell script + +|usr_27.txt| Search commands and patterns + |27.1| Ignoring case + |27.2| Wrapping around the file end + |27.3| Offsets + |27.4| Matching multiple times + |27.5| Alternatives + |27.6| Character ranges + |27.7| Character classes + |27.8| Matching a line break + |27.9| Examples + +|usr_28.txt| Folding + |28.1| What is folding? + |28.2| Manual folding + |28.3| Working with folds + |28.4| Saving and restoring folds + |28.5| Folding by indent + |28.6| Folding with markers + |28.7| Folding by syntax + |28.8| Folding by expression + |28.9| Folding unchanged lines + |28.10| Which fold method to use? + +|usr_29.txt| Moving through programs + |29.1| Using tags + |29.2| The preview window + |29.3| Moving through a program + |29.4| Finding global identifiers + |29.5| Finding local identifiers + +|usr_30.txt| Editing programs + |30.1| Compiling + |30.2| Indenting C files + |30.3| Automatic indenting + |30.4| Other indenting + |30.5| Tabs and spaces + |30.6| Formatting comments + +|usr_31.txt| Exploiting the GUI + |31.1| The file browser + |31.2| Confirmation + |31.3| Menu shortcuts + |31.4| Vim window position and size + |31.5| Various + +|usr_32.txt| The undo tree + |32.1| Numbering changes + |32.2| Jumping around the tree + |32.3| Time travelling + +============================================================================== +Tuning Vim ~ + +Make Vim work as you like it. + +|usr_40.txt| Make new commands + |40.1| Key mapping + |40.2| Defining command-line commands + |40.3| Autocommands + +|usr_41.txt| Write a Vim script + |41.1| Introduction + |41.2| Variables + |41.3| Expressions + |41.4| Conditionals + |41.5| Executing an expression + |41.6| Using functions + |41.7| Defining a function + |41.8| Lists and Dictionaries + |41.9| Exceptions + |41.10| Various remarks + |41.11| Writing a plugin + |41.12| Writing a filetype plugin + |41.13| Writing a compiler plugin + |41.14| Writing a plugin that loads quickly + |41.15| Writing library scripts + |41.16| Distributing Vim scripts + +|usr_42.txt| Add new menus + |42.1| Introduction + |42.2| Menu commands + |42.3| Various + |42.4| Toolbar and popup menus + +|usr_43.txt| Using filetypes + |43.1| Plugins for a filetype + |43.2| Adding a filetype + +|usr_44.txt| Your own syntax highlighted + |44.1| Basic syntax commands + |44.2| Keywords + |44.3| Matches + |44.4| Regions + |44.5| Nested items + |44.6| Following groups + |44.7| Other arguments + |44.8| Clusters + |44.9| Including another syntax file + |44.10| Synchronizing + |44.11| Installing a syntax file + |44.12| Portable syntax file layout + +|usr_45.txt| Select your language + |45.1| Language for Messages + |45.2| Language for Menus + |45.3| Using another encoding + |45.4| Editing files with a different encoding + |45.5| Entering language text + +============================================================================== +Making Vim Run ~ + +Before you can use Vim. + +|usr_90.txt| Installing Vim + |90.1| Unix + |90.2| MS-Windows + |90.3| Upgrading + |90.4| Common installation issues + |90.5| Uninstalling Vim + +============================================================================== + +Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/various.txt b/Aufgabe5/doc.lang/various.txt new file mode 100644 index 0000000..2f1d3ff --- /dev/null +++ b/Aufgabe5/doc.lang/various.txt @@ -0,0 +1,838 @@ +*various.txt* For Vim version 7.0. Last change: 2006 Apr 25 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Various commands *various* + +1. Various commands |various-cmds| +2. Online help |online-help| +3. Using Vim like less or more |less| + +============================================================================== +1. Various commands *various-cmds* + + *CTRL-L* +CTRL-L Clear and redraw the screen. The redraw may happen + later, after processing typeahead. + + *:redr* *:redraw* +:redr[aw][!] Redraw the screen right now. When ! is included it is + cleared first. + Useful to update the screen halfway executing a script + or function. Also when halfway a mapping and + 'lazyredraw' is set. + + *:redraws* *:redrawstatus* +:redraws[tatus][!] Redraw the status line of the current window. When ! + is included all status lines are redrawn. + Useful to update the status line(s) when 'statusline' + includes an item that doesn't cause automatic + updating. + + *N<Del>* +<Del> When entering a number: Remove the last digit. + Note: if you like to use <BS> for this, add this + mapping to your .vimrc: > + :map CTRL-V <BS> CTRL-V <Del> +< See |:fixdel| if your <Del> key does not do what you + want. + +:as[cii] or *ga* *:as* *:ascii* +ga Print the ascii value of the character under the + cursor in decimal, hexadecimal and octal. For + example, when the cursor is on a 'R': + <R> 82, Hex 52, Octal 122 ~ + When the character is a non-standard ASCII character, + but printable according to the 'isprint' option, the + non-printable version is also given. When the + character is larger than 127, the <M-x> form is also + printed. For example: + <~A> <M-^A> 129, Hex 81, Octal 201 ~ + <p> <|~> <M-~> 254, Hex fe, Octal 376 ~ + (where <p> is a special character) + The <Nul> character in a file is stored internally as + <NL>, but it will be shown as: + <^@> 0, Hex 00, Octal 000 ~ + If the character has composing characters these are + also shown. The value of 'maxcombine' doesn't matter. + Mnemonic: Get Ascii value. {not in Vi} + + *g8* +g8 Print the hex values of the bytes used in the + character under the cursor, assuming it is in |UTF-8| + encoding. This also shows composing characters. The + value of 'maxcombine' doesn't matter. + Example of a character with two composing characters: + e0 b8 81 + e0 b8 b9 + e0 b9 89 ~ + {not in Vi} {only when compiled with the |+multi_byte| + feature} + + *8g8* +8g8 Find an illegal UTF-8 byte sequence at or after the + cursor. This works in two situations: + 1. when 'encoding' is any 8-bit encoding + 2. when 'encoding' is "utf-8" and 'fileencoding' is + any 8-bit encoding + Thus it can be used when editing a file that was + supposed to be UTF-8 but was read as if it is an 8-bit + encoding because it contains illegal bytes. + Does not wrap around the end of the file. + Note that when the cursor is on an illegal byte or the + cursor is halfway a multi-byte character the command + won't move the cursor. + {not in Vi} {only when compiled with the |+multi_byte| + feature} + + *:p* *:pr* *:print* *E749* +:[range]p[rint] [flags] + Print [range] lines (default current line). + Note: If you are looking for a way to print your text + on paper see |:hardcopy|. In the GUI you can use the + File.Print menu entry. + See |ex-flags| for [flags]. + +:[range]p[rint] {count} [flags] + Print {count} lines, starting with [range] (default + current line |cmdline-ranges|). + See |ex-flags| for [flags]. + + *:P* *:Print* +:[range]P[rint] [count] [flags] + Just as ":print". Was apparently added to Vi for + people that keep the shift key pressed too long... + See |ex-flags| for [flags]. + + *:l* *:list* +:[range]l[ist] [count] [flags] + Same as :print, but display unprintable characters + with '^' and put $ after the line. + See |ex-flags| for [flags]. + + *:nu* *:number* +:[range]nu[mber] [count] [flags] + Same as :print, but precede each line with its line + number. (See also 'highlight' and 'numberwidth' + option). + See |ex-flags| for [flags]. + + *:#* +:[range]# [count] [flags] + synonym for :number. + + *:z* *E144* +:{range}z[+-^.=]{count} Display several lines of text surrounding the line + specified with {range}, or around the current line + if there is no {range}. If there is a {count}, that's + how many lines you'll see; if there is only one window + then the 'window' option is used, otherwise the + current window size is used. + + :z can be used either alone or followed by any of + several punctuation marks. These have the following + effect: + + mark first line last line new location ~ + ---- ---------- --------- ------------ + + current line 1 scr forward 1 scr forward + - 1 scr back current line current line + ^ 2 scr back 1 scr back 1 scr back + . 1/2 scr back 1/2 scr fwd 1/2 scr fwd + = 1/2 scr back 1/2 scr fwd current line + + Specifying no mark at all is the same as "+". + If the mark is "=", a line of dashes is printed + around the current line. + +:{range}z#[+-^.=]{count} *:z#* + Like ":z", but number the lines. + {not in all versions of Vi, not with these arguments} + + *:=* +:= [flags] Print the last line number. + See |ex-flags| for [flags]. + +:{range}= [flags] Prints the last line number in {range}. For example, + this prints the current line number: > + :.= +< See |ex-flags| for [flags]. + +:norm[al][!] {commands} *:norm* *:normal* + Execute Normal mode commands {commands}. This makes + it possible to execute Normal mode commands typed on + the command-line. {commands} is executed like it is + typed. For undo all commands are undone together. + If the [!] is given, mappings will not be used. + {commands} should be a complete command. If + {commands} does not finish a command, the last one + will be aborted as if <Esc> or <C-C> was typed. + The display isn't updated while ":normal" is busy. + This implies that an insert command must be completed + (to start Insert mode, see |:startinsert|). A ":" + command must be completed as well. And you can't use + "Q" or "gQ" to start Ex mode. + {commands} cannot start with a space. Put a 1 (one) + before it, 1 space is one space. + The 'insertmode' option is ignored for {commands}. + This command cannot be followed by another command, + since any '|' is considered part of the command. + This command can be used recursively, but the depth is + limited by 'maxmapdepth'. + When this command is called from a non-remappable + mapping |:noremap|, the argument can be mapped anyway. + An alternative is to use |:execute|, which uses an + expression as argument. This allows the use of + printable characters. Example: > + :exe "normal \<c-w>\<c-w>" +< {not in Vi, of course} + {not available when the |+ex_extra| feature was + disabled at compile time} + +:{range}norm[al][!] {commands} *:normal-range* + Execute Normal mode commands {commands} for each line + in the {range}. Before executing the {commands}, the + cursor is positioned in the first column of the range, + for each line. Otherwise it's the same as the + ":normal" command without a range. + {not in Vi} + Not available when |+ex_extra| feature was disabled at + compile time. + + *:sh* *:shell* *E371* +:sh[ell] This command starts a shell. When the shell exits + (after the "exit" command) you return to Vim. The + name for the shell command comes from 'shell' option. + *E360* + Note: This doesn't work when Vim on the Amiga was + started in QuickFix mode from a compiler, because the + compiler will have set stdin to a non-interactive + mode. + + *:!cmd* *:!* *E34* +:!{cmd} Execute {cmd} with the shell. See also the 'shell' + and 'shelltype' option. + Any '!' in {cmd} is replaced with the previous + external command (see also 'cpoptions'). But not when + there is a backslash before the '!', then that + backslash is removed. Example: ":!ls" followed by + ":!echo ! \! \\!" executes "echo ls ! \!". + After the command has been executed, the timestamp of + the current file is checked |timestamp|. + There cannot be a '|' in {cmd}, see |:bar|. + A newline character ends {cmd}, what follows is + interpreted as a following ":" command. However, if + there is a backslash before the newline it is removed + and {cmd} continues. It doesn't matter how many + backslashes are before the newline, only one is + removed. + On Unix the command normally runs in a non-interactive + shell. If you want an interactive shell to be used + (to use aliases) set 'shellcmdflag' to "-ic". + For Win32 also see |:!start|. + Vim redraws the screen after the command is finished, + because it may have printed any text. This requires a + hit-enter prompt, so that you can read any messages. + To avoid this use: > + :silent !{cmd} +< The screen is not redrawn then, thus you have to use + CTRL-L or ":redraw!" if the command did display + something. + Also see |shell-window|. + + *:!!* +:!! Repeat last ":!{cmd}". + + *:ve* *:version* +:ve[rsion] Print the version number of the editor. If the + compiler used understands "__DATE__" the compilation + date is mentioned. Otherwise a fixed release-date is + shown. + The following lines contain information about which + features were enabled when Vim was compiled. When + there is a preceding '+', the feature is included, + when there is a '-' it is excluded. To change this, + you have to edit feature.h and recompile Vim. + To check for this in an expression, see |has()|. + Here is an overview of the features. + The first column shows the smallest version in which + they are included: + T tiny + S small + N normal + B big + H huge + m manually enabled or depends on other features + (none) system dependent + Thus if a feature is marked with "N", it is included + in the normal, big and huge versions of Vim. + + *+feature-list* + *+ARP* Amiga only: ARP support included +B *+arabic* |Arabic| language support +N *+autocmd* |:autocmd|, automatic commands +m *+balloon_eval* |balloon-eval| support. Included when compiling with + supported GUI (Motif, GTK, GUI) and either + Netbeans/Sun Workshop integration or |+eval| feature. +N *+browse* |:browse| command +N *+builtin_terms* some terminals builtin |builtin-terms| +B *++builtin_terms* maximal terminals builtin |builtin-terms| +N *+byte_offset* support for 'o' flag in 'statusline' option, "go" + and ":goto" commands. +N *+cindent* |'cindent'|, C indenting +N *+clientserver* Unix and Win32: Remote invocation |clientserver| + *+clipboard* |clipboard| support +N *+cmdline_compl* command line completion |cmdline-completion| +N *+cmdline_hist* command line history |cmdline-history| +N *+cmdline_info* |'showcmd'| and |'ruler'| +N *+comments* |'comments'| support +N *+cryptv* encryption support |encryption| +B *+cscope* |cscope| support +m *+cursorshape* |termcap-cursor-shape| support +m *+debug* Compiled for debugging. +N *+dialog_gui* Support for |:confirm| with GUI dialog. +N *+dialog_con* Support for |:confirm| with console dialog. +N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog. +N *+diff* |vimdiff| and 'diff' +N *+digraphs* |digraphs| *E196* + *+dnd* Support for DnD into the "~ register |quote_~|. +B *+emacs_tags* |emacs-tags| files +N *+eval* expression evaluation |eval.txt| +N *+ex_extra* Vim's extra Ex commands: |:center|, |:left|, + |:normal|, |:retab| and |:right| +N *+extra_search* |'hlsearch'| and |'incsearch'| options. +B *+farsi* |farsi| language +N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>| +N *+find_in_path* include file searches: |[I|, |:isearch|, + |CTRL-W_CTRL-I|, |:checkpath|, etc. +N *+folding* |folding| + *+footer* |gui-footer| + *+fork* Unix only: |fork| shell commands +N *+gettext* message translations |multi-lang| + *+GUI_Athena* Unix only: Athena |GUI| + *+GUI_neXtaw* Unix only: neXtaw |GUI| + *+GUI_GTK* Unix only: GTK+ |GUI| + *+GUI_Motif* Unix only: Motif |GUI| + *+GUI_Photon* QNX only: Photon |GUI| +m *+hangul_input* Hangul input support |hangul| + *+iconv* Compiled with the |iconv()| function + *+iconv/dyn* Likewise |iconv-dynamic| |/dyn| +N *+insert_expand* |insert_expand| Insert mode completion +N *+jumplist* |jumplist| +B *+keymap* |'keymap'| +B *+langmap* |'langmap'| +N *+libcall* |libcall()| +N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'| +N *+lispindent* |'lisp'| +N *+listcmds* Vim commands for the list of buffers |buffer-hidden| + and argument list |:argdelete| +N *+localmap* Support for mappings local to a buffer |:map-local| +N *+menu* |:menu| +N *+mksession* |:mksession| +N *+modify_fname* |filename-modifiers| +N *+mouse* Mouse handling |mouse-using| +N *+mouseshape* |'mouseshape'| +B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse| +N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse| +B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse| +N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal| +N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse| +B *+multi_byte* Korean and other languages |multibyte| + *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime| +N *+multi_lang* non-English language support |multi-lang| +m *+mzscheme* Mzscheme interface |mzscheme| +m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn| +m *+netbeans_intg* |netbeans| +m *+ole* Win32 GUI only: |ole-interface| + *+osfiletype* Support for the 'osfiletype' option and filetype + checking in automatic commands. |autocmd-osfiletypes| +N *+path_extra* Up/downwards search in 'path' and 'tags' +m *+perl* Perl interface |perl| +m *+perl/dyn* Perl interface |perl-dynamic| |/dyn| + *+postscript* |:hardcopy| writes a PostScript file +N *+printer* |:hardcopy| command +H *+profile* |:profile| command +m *+python* Python interface |python| +m *+python/dyn* Python interface |python-dynamic| |/dyn| +N *+quickfix* |:make| and |quickfix| commands +N *+reltime* |reltime()| function +B *+rightleft* Right to left typing |'rightleft'| +m *+ruby* Ruby interface |ruby| +m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| +N *+scrollbind* |'scrollbind'| +B *+signs* |:sign| +N *+smartindent* |'smartindent'| +m *+sniff* SniFF interface |sniff| +N *+statusline* Options 'statusline', 'rulerformat' and special + formats of 'titlestring' and 'iconstring' +m *+sun_workshop* |workshop| +N *+syntax* Syntax highlighting |syntax| + *+system()* Unix only: opposite of |+fork| +N *+tag_binary* binary searching in tags file |tag-binary-search| +N *+tag_old_static* old method for static tags |tag-old-static| +m *+tag_any_white* any white space allowed in tags file |tag-any-white| +m *+tcl* Tcl interface |tcl| +m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn| + *+terminfo* uses |terminfo| instead of termcap +N *+termresponse* support for |t_RV| and |v:termresponse| +N *+textobjects* |text-objects| selection + *+tgetent* non-Unix only: able to use external termcap +N *+title* Setting the window title |'title'| +N *+toolbar* |gui-toolbar| +N *+user_commands* User-defined commands. |user-commands| +N *+viminfo* |'viminfo'| +N *+vertsplit* Vertically split windows |:vsplit| +N *+virtualedit* |'virtualedit'| +S *+visual* Visual mode |Visual-mode| +N *+visualextra* extra Visual mode commands |blockwise-operators| +N *+vreplace* |gR| and |gr| +N *+wildignore* |'wildignore'| +N *+wildmenu* |'wildmenu'| +S *+windows* more than one window +m *+writebackup* |'writebackup'| is default on +m *+xim* X input method |xim| + *+xfontset* X fontset support |xfontset| + *+xsmp* XSMP (X session management) support + *+xsmp_interact* interactive XSMP (X session management) support +N *+xterm_clipboard* Unix only: xterm clipboard handling +m *+xterm_save* save and restore xterm screen |xterm-screens| +N *+X11* Unix only: can restore window title |X11| + + */dyn* *E370* *E448* + To some of the features "/dyn" is added when the + feature is only available when the related library can + be dynamically loaded. + +:ve[rsion] {nr} Is now ignored. This was previously used to check the + version number of a .vimrc file. It was removed, + because you can now use the ":if" command for + version-dependent behavior. {not in Vi} + + *:redi* *:redir* +:redi[r][!] > {file} Redirect messages to file {file}. The messages which + are the output of commands are written to that file, + until redirection ends. The messages are also still + shown on the screen. When [!] is included, an + existing file is overwritten. When [!] is omitted, + and {file} exists, this command fails. + Only one ":redir" can be active at a time. Calls to + ":redir" will close any active redirection before + starting redirection to the new target. + To stop the messages and commands from being echoed to + the screen, put the commands in a function and call it + with ":silent call Function()". + An alternative is to use the 'verbosefile' option, + this can be used in combination with ":redir". + {not in Vi} + +:redi[r] >> {file} Redirect messages to file {file}. Append if {file} + already exists. {not in Vi} + +:redi[r] @{a-zA-Z}> Redirect messages to register {a-z}. Append to the + contents of the register if its name is given + uppercase {A-Z}. For backward compatibility, the ">" + after the register name can be omitted. {not in Vi} +:redi[r] @{a-z}>> Append messages to register {a-z}. {not in Vi} + +:redi[r] @*> Redirect messages to the clipboard. For backward + compatibility, the ">" after the register name can be + omitted. {not in Vi} +:redi[r] @*>> Append messages to the clipboard. {not in Vi} + +:redi[r] @"> Redirect messages to the unnamed register. For + backward compatibility, the ">" after the register + name can be omitted. {not in Vi} +:redi[r] @">> Append messages to the unnamed register. {not in Vi} + +:redi[r] => {var} Redirect messages to a variable. If the variable + doesn't exist, then it is created. If the variable + exists, then it is initialized to an empty string. + Only string variables can be used. After the + redirection starts, if the variable is removed or + locked or the variable type is changed, then further + command output messages will cause errors. {not in Vi} + +:redi[r] =>> {var} Append messages to an existing variable. Only string + variables can be used. {not in Vi} + +:redi[r] END End redirecting messages. {not in Vi} + + *:sil* *:silent* +:sil[ent][!] {command} Execute {command} silently. Normal messages will not + be given or added to the message history. + When [!] is added, error messages will also be + skipped, and commands and mappings will not be aborted + when an error is detected. |v:errmsg| is still set. + When [!] is not used, an error message will cause + further messages to be displayed normally. + Redirection, started with |:redir|, will continue as + usual, although there might be small differences. + This will allow redirecting the output of a command + without seeing it on the screen. Example: > + :redir >/tmp/foobar + :silent g/Aap/p + :redir END +< To execute a Normal mode command silently, use the + |:normal| command. For example, to search for a + string without messages: > + :silent exe "normal /path\<CR>" +< ":silent!" is useful to execute a command that may + fail, but the failure is to be ignored. Example: > + :let v:errmsg = "" + :silent! /^begin + :if v:errmsg != "" + : ... pattern was not found +< ":silent" will also avoid the hit-enter prompt. When + using this for an external command, this may cause the + screen to be messed up. Use |CTRL-L| to clean it up + then. + ":silent menu ..." defines a menu that will not echo a + Command-line command. The command will still produce + messages though. Use ":silent" in the command itself + to avoid that: ":silent menu .... :silent command". + + *:verb* *:verbose* +:[count]verb[ose] {command} + Execute {command} with 'verbose' set to [count]. If + [count] is omitted one is used. ":0verbose" can be + used to set 'verbose' to zero. + The additional use of ":silent" makes messages + generated but not displayed. + The combination of ":silent" and ":verbose" can be + used to generate messages and check them with + |v:statusmsg| and friends. For example: > + :let v:statusmsg = "" + :silent verbose runtime foobar.vim + :if v:statusmsg != "" + : " foobar.vim could not be found + :endif +< When concatenating another command, the ":verbose" + only applies to the first one: > + :4verbose set verbose | set verbose +< verbose=4 ~ + verbose=0 ~ + For logging verbose messages in a file use the + 'verbosefile' option. + + *:verbose-cmd* +When 'verbose' is non-zero, listing the value of a Vim option or a key map or +an abbreviation or a user-defined function or a command or a highlight group +or an autocommand will also display where it was last defined. If it was +defined manually then there will be no "Last set" message. When it was +defined while executing a function, user command or autocommand, the script in +which it was defined is reported. +{not available when compiled without the +eval feature} + + *K* +K Run a program to lookup the keyword under the + cursor. The name of the program is given with the + 'keywordprg' (kp) option (default is "man"). The + keyword is formed of letters, numbers and the + characters in 'iskeyword'. The keyword under or + right of the cursor is used. The same can be done + with the command > + :!{program} {keyword} +< There is an example of a program to use in the tools + directory of Vim. It is called 'ref' and does a + simple spelling check. + Special cases: + - If 'keywordprg' is empty, the ":help" command is + used. It's a good idea to include more characters + in 'iskeyword' then, to be able to find more help. + - When 'keywordprg' is equal to "man", a count before + "K" is inserted after the "man" command and before + the keyword. For example, using "2K" while the + cursor is on "mkdir", results in: > + !man 2 mkdir +< - When 'keywordprg' is equal to "man -s", a count + before "K" is inserted after the "-s". If there is + no count, the "-s" is removed. + {not in Vi} + + *v_K* +{Visual}K Like "K", but use the visually highlighted text for + the keyword. Only works when the highlighted text is + not more than one line. {not in Vi} + +[N]gs *gs* *:sl* *:sleep* +:[N]sl[eep] [N] [m] Do nothing for [N] seconds. When [m] is included, + sleep for [N] milliseconds. The count for "gs" always + uses seconds. The default is one second. > + :sleep "sleep for one second + :5sleep "sleep for five seconds + :sleep 100m "sleep for a hundred milliseconds + 10gs "sleep for ten seconds +< Can be interrupted with CTRL-C (CTRL-Break on MS-DOS). + "gs" stands for "goto sleep". + While sleeping the cursor is positioned in the text, + if at a visible position. {not in Vi} + + *g_CTRL-A* +g CTRL-A Only when Vim was compiled with MEM_PROFILING defined + (which is very rare): print memory usage statistics. + Only useful for debugging Vim. + +============================================================================== +2. Online help *online-help* + + *help* *<Help>* *:h* *:help* *<F1>* *i_<F1>* *i_<Help>* +<Help> or +:h[elp] Open a window and display the help file in read-only + mode. If there is a help window open already, use + that one. Otherwise, if the current window uses the + full width of the screen or is at least 80 characters + wide, the help window will appear just above the + current window. Otherwise the new window is put at + the very top. + The 'helplang' option is used to select a language, if + the main help file is available in several languages. + {not in Vi} + + *{subject}* *E149* *E661* +:h[elp] {subject} Like ":help", additionally jump to the tag {subject}. + {subject} can include wildcards like "*", "?" and + "[a-z]": + :help z? jump to help for any "z" command + :help z. jump to the help for "z." + If there is no full match for the pattern, or there + are several matches, the "best" match will be used. + A sophisticated algorithm is used to decide which + match is better than another one. These items are + considered in the computation: + - A match with same case is much better than a match + with different case. + - A match that starts after a non-alphanumeric + character is better than a match in the middle of a + word. + - A match at or near the beginning of the tag is + better than a match further on. + - The more alphanumeric characters match, the better. + - The shorter the length of the match, the better. + + The 'helplang' option is used to select a language, if + the {subject} is available in several languages. + To find a tag in a specific language, append "@ab", + where "ab" is the two-letter language code. See + |help-translated|. + + Note that the longer the {subject} you give, the less + matches will be found. You can get an idea how this + all works by using commandline completion (type CTRL-D + after ":help subject"). + If there are several matches, you can have them listed + by hitting CTRL-D. Example: > + :help cont<Ctrl-D> +< To use a regexp |pattern|, first do ":help" and then + use ":tag {pattern}" in the help window. The + ":tnext" command can then be used to jump to other + matches, "tselect" to list matches and choose one. > + :help index| :tse z. +< This command can be followed by '|' and another + command, but you don't need to escape the '|' inside a + help command. So these both work: > + :help | + :help k| only +< Note that a space before the '|' is seen as part of + the ":help" argument. + You can also use <LF> or <CR> to separate the help + command from a following command. You need to type + CTRL-V first to insert the <LF> or <CR>. Example: > + :help so<C-V><CR>only +< {not in Vi} + +:h[elp]! [subject] Like ":help", but in non-English help files prefer to + find a tag in a file with the same language as the + current file. See |help-translated|. + + *:helpg* *:helpgrep* +:helpg[rep] {pattern}[@xx] + Search all help text files and make a list of lines + in which {pattern} matches. Jumps to the first match. + The optional [@xx] specifies that only matches in the + "xx" language are to be found. + You can navigate through the matches with the + |quickfix| commands, e.g., |:cnext| to jump to the + next one. Or use |:cwindow| to get the list of + matches in the quickfix window. + {pattern} is used as a Vim regexp |pattern|. + 'ignorecase' is not used, add "\c" to ignore case. + Example for case sensitive search: > + :helpgrep Uganda +< Example for case ignoring search: > + :helpgrep uganda\c +< Example for searching in French help: > + :helpgrep backspace@fr +< Cannot be followed by another command, everything is + used as part of the pattern. But you can use + |:execute| when needed. + Compressed help files will not be searched (Debian + compresses the help files). + {not in Vi} + + *:lh* *:lhelpgrep* +:lh[elpgrep] {pattern}[@xx] + Same as ":helpgrep", except the location list is used + instead of the quickfix list. If the help window is + already opened, then the location list for that window + is used. Otherwise, a new help window is opened and + the location list for that window is set. The + location list for the current window is not changed. + + *:exu* *:exusage* +:exu[sage] Show help on Ex commands. Added to simulate the Nvi + command. {not in Vi} + + *:viu* *:viusage* +:viu[sage] Show help on Normal mode commands. Added to simulate + the Nvi command. {not in Vi} + +When no argument is given to |:help| the file given with the 'helpfile' option +will be opened. Otherwise the specified tag is searched for in all "doc/tags" +files in the directories specified in the 'runtimepath' option. + +The initial height of the help window can be set with the 'helpheight' option +(default 20). + +Jump to specific subjects by using tags. This can be done in two ways: +- Use the "CTRL-]" command while standing on the name of a command or option. + This only works when the tag is a keyword. "<C-Leftmouse>" and + "g<LeftMouse>" work just like "CTRL-]". +- use the ":ta {subject}" command. This also works with non-keyword + characters. + +Use CTRL-T or CTRL-O to jump back. +Use ":q" to close the help window. + +If there are several matches for an item you are looking for, this is how you +can jump to each one of them: +1. Open a help window +2. Use the ":tag" command with a slash prepended to the tag. E.g.: > + :tag /min +3. Use ":tnext" to jump to the next matching tag. + +It is possible to add help files for plugins and other items. You don't need +to change the distributed help files for that. See |add-local-help|. + +To write a local help file, see |write-local-help|. + +Note that the title lines from the local help files are automagically added to +the "LOCAL ADDITIONS" section in the "help.txt" help file |local-additions|. +This is done when viewing the file in Vim, the file itself is not changed. It +is done by going through all help files and obtaining the first line of each +file. The files in $VIMRUNTIME/doc are skipped. + + *help-xterm-window* +If you want to have the help in another xterm window, you could use this +command: > + :!xterm -e vim +help & +< + + *:helpfind* *:helpf* +:helpf[ind] Like |:help|, but use a dialog to enter the argument. + Only for backwards compatibility. It now executes the + ToolBar.FindHelp menu entry instead of using a builtin + dialog. {only when compiled with |+GUI_GTK|} +< {not in Vi} + + *:helpt* *:helptags* + *E154* *E150* *E151* *E152* *E153* *E670* +:helpt[ags] {dir} Generate the help tags file(s) for directory {dir}. + All "*.txt" and "*.??x" files in the directory are + scanned for a help tag definition in between stars. + The "*.??x" files are for translated docs, they + generate the "tags-??" file, see |help-translated|. + The generated tags files are sorted. + When there are duplicates an error message is given. + An existing tags file is silently overwritten. + To rebuild the help tags in the runtime directory + (requires write permission there): > + :helptags $VIMRUNTIME/doc +< {not in Vi} + + +TRANSLATED HELP *help-translated* + +It is possible to add translated help files, next to the original English help +files. Vim will search for all help in "doc" directories in 'runtimepath'. +This is only available when compiled with the |+multi_lang| feature. + +At this moment translations are available for: + Chinese - multiple authors + French - translated by David Blanchet + Italian - translated by Antonio Colombo + Polish - translated by Mikolaj Machowski + Russian - translated by Vassily Ragosin +See the Vim website to find them: http://www.vim.org/translations.php + +A set of translated help files consists of these files: + + help.abx + howto.abx + ... + tags-ab + +"ab" is the two-letter language code. Thus for Italian the names are: + + help.itx + howto.itx + ... + tags-it + +The 'helplang' option can be set to the preferred language(s). The default is +set according to the environment. Vim will first try to find a matching tag +in the preferred language(s). English is used when it cannot be found. + +To find a tag in a specific language, append "@ab" to a tag, where "ab" is the +two-letter language code. Example: > + :he user-manual@it + :he user-manual@en +The first one finds the Italian user manual, even when 'helplang' is empty. +The second one finds the English user manual, even when 'helplang' is set to +"it". + +When using command-line completion for the ":help" command, the "@en" +extention is only shown when a tag exists for multiple languages. When the +tag only exists for English "@en" is omitted. + +When using |CTRL-]| or ":help!" in a non-English help file Vim will try to +find the tag in the same language. If not found then 'helplang' will be used +to select a language. + +Help files must use latin1 or utf-8 encoding. Vim assumes the encoding is +utf-8 when finding non-ASCII characters in the first line. Thus you must +translate the header with "For Vim version". + +The same encoding must be used for the help files of one language in one +directory. You can use a different encoding for different languages and use +a different encoding for help files of the same language but in a different +directory. + +Hints for translators: +- Do not translate the tags. This makes it possible to use 'helplang' to + specify the preferred language. You may add new tags in your language. +- When you do not translate a part of a file, add tags to the English version, + using the "tag@en" notation. +- Make a package with all the files and the tags file available for download. + Users can drop it in one of the "doc" directories and start use it. + Report this to Bram, so that he can add a link on www.vim.org. +- Use the |:helptags| command to generate the tags files. It will find all + languages in the specified directory. + +============================================================================== +3. Using Vim like less or more *less* + +If you use the less or more program to view a file, you don't get syntax +highlighting. Thus you would like to use Vim instead. You can do this by +using the shell script "$VIMRUNTIME/macros/less.sh". + +This shell script uses the Vim script "$VIMRUNTIME/macros/less.vim". It sets +up mappings to simulate the commands that less supports. Otherwise, you can +still use the Vim commands. + +This isn't perfect. For example, when viewing a short file Vim will still use +the whole screen. But it works good enough for most uses, and you get syntax +highlighting. + +The "h" key will give you a short overview of the available commands. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/version4.txt b/Aufgabe5/doc.lang/version4.txt new file mode 100644 index 0000000..fdc710d --- /dev/null +++ b/Aufgabe5/doc.lang/version4.txt @@ -0,0 +1,355 @@ +*version4.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +This document lists the incompatible differences between Vim 3.0 and Vim 4.0. +Although 4.0 is mentioned here, this is also for version 4.1, 4.2, etc.. + +This file is important for everybody upgrading from Vim 3.0. Read it +carefully to avoid unexpected problems. + +'backup' option default changed |backup-changed| +Extension for backup file changed |backup-extension| +Structure of swap file changed |swapfile-changed| +"-w scriptout" argument changed |scriptout-changed| +Backspace and Delete keys |backspace-delete| +Escape for | changed |escape-bar| +Key codes changed |key-codes-changed| +Terminal options changed |termcap-changed| +'errorformat' option changed |errorformat-changed| +'graphic' option gone |graphic-option-gone| +'yankendofline' option gone |ye-option-gone| +'icon' and 'title' default value changed |icon-changed| +'highlight' option changed |highlight-changed| +'tildeop' and 'weirdinvert' short names changed |short-name-changed| +Use of "v", "V" and "CTRL-V" in Visual mode |use-visual-cmds| +CTRL-B in Insert mode removed |toggle-revins| + + +'backup' option default changed *backup-changed* +------------------------------- + +The default value for 'backup' used to be on. This resulted in a backup file +being made when the original file was overwritten. + +Now the default for 'backup' is off. As soon as the writing of the file has +successfully finished, the backup file is deleted. If you want to keep the +backup file, set 'backup' on in your vimrc. The reason for this change is +that many people complained that leaving a backup file behind is not +Vi-compatible. |'backup'| + + +Extension for backup file changed *backup-extension* +--------------------------------- + +The extension for the backup file used to be ".bak". Since other programs +also use this extension and some users make copies with this extension, it was +changed to the less obvious "~". Another advantage is that this takes less +space, which is useful when working on a system with short file names. For +example, on MS-DOS the backup files for "longfile.c" and "longfile.h" would +both become "longfile.bak"; now they will be "longfile.c~" and "longfile.h~". + +If you prefer to use ".bak", you can set the 'backupext' option: > + :set bex=.bak + + +Structure of swap file changed *swapfile-changed* +------------------------------ + +The contents of the swap file were extended with several parameters. Vim +stores the user name and other information about the edited file to make +recovery more easy and to be able to know where the swap file comes from. The +first part of the swap file can now be understood on a machine with a +different byte order or sizeof(int). When you try to recover a file on such a +machine, you will get an error message that this is not possible. + +Because of this change, swap files cannot be exchanged between 3.0 and 4.0. +If you have a swap file from a crashed session with 3.0, use Vim 3.0 to +recover the file---don't use 4.0. |swap-file| + + +"-w scriptout" argument changed *scriptout-changed* +------------------------------- + +"vim -w scriptout" used to append to the scriptout file. Since this was +illogical, it now creates a new file. An existing file is not overwritten +(to avoid destroying an existing file for those who rely on the appending). +[This was removed again later] |-w| + + +Backspace and Delete keys *backspace-delete* +------------------------- + +In 3.0 both the delete key and the backspace key worked as a backspace in +insert mode; they deleted the character to the left of the cursor. In 4.0 the +delete key has a new function: it deletes the character under the cursor, just +like it does on the command-line. If the cursor is after the end of the line +and 'bs' is set, two lines are joined. |<Del>| |i_<Del>| + +In 3.0 the backspace key was always defined as CTRL-H and delete as CTRL-?. +In 4.0 the code for the backspace and delete key is obtained from termcap or +termlib, and adjusted for the "stty erase" value on Unix. This helps people +who define the erase character according to the keyboard they are working on. + |<BS>| |i_<BS>| + +If you prefer backspace and delete in Insert mode to have the old behavior, +put this line in your vimrc: + + inoremap ^? ^H + +And you may also want to add these, to fix the values for <BS> and <Del>: + + set t_kb=^H + set t_kD=^? + +(Enter ^H with CTRL-V CTRL-H and ^? with CTRL-V CTRL-? or <Del>.) + +If the value for t_kb is correct, but the t_kD value is not, use the ":fixdel" +command. It will set t_kD according to the value of t_kb. This is useful if +you are using several different terminals. |:fixdel| + +When ^H is not recognized as <BS> or <Del>, it is used like a backspace. + + +Escape for | changed *escape-bar* +-------------------- + +When the 'b' flag is present in 'cpoptions', the backslash cannot be used to +escape '|' in mapping and abbreviate commands, only CTRL-V can. This is +Vi-compatible. If you work in Vi-compatible mode and had used "\|" to include +a bar in a mapping, this needs to be replaced by "^V|". See |:bar|. + + +Key codes changed *key-codes-changed* +----------------- + +The internal representation of key codes has changed dramatically. In 3.0 a +one-byte code was used to represent a key. This caused problems with +different characters sets that also used these codes. In 4.0 a three-byte +code is used that cannot be confused with a character. |key-notation| + +If you have used the single-byte key codes in your vimrc for mappings, you +will have to replace them with the 4.0 codes. Instead of using the three-byte +code directly, you should use the symbolic representation for this in <>. See +the table below. The table also lists the old name, as it was used in the 3.0 +documentation. + +The key names in <> can be used in mappings directly. This makes it possible +to copy/paste examples or type them literally. The <> notation has been +introduced for this |<>|. The 'B' and '<' flags must not be present in +'cpoptions' to enable this to work |'cpoptions'|. + +old name new name old code old MS-DOS code ~ + hex dec hex dec ~ +<ESC> <Esc> +<TAB> <Tab> +<LF> <NL> <NewLine> <LineFeed> +<SPACE> <Space> +<NUL> <Nul> +<BELL> <Bell> +<BS> <BS> <BackSpace> +<INSERT> <Insert> +<DEL> <Del> <Delete> +<HOME> <Home> +<END> <End> +<PAGE_UP> <PageUp> +<PAGE_DOWN> <PageDown> + +<C_UP> <Up> 0x80 128 0xb0 176 +<C_DOWN> <Down> 0x81 129 0xb1 177 +<C_LEFT> <Left> 0x82 130 0xb2 178 +<C_RIGHT> <Right> 0x83 131 0xb3 179 +<SC_UP> <S-Up> 0x84 132 0xb4 180 +<SC_DOWN> <S-Down> 0x85 133 0xb5 181 +<SC_LEFT> <S-Left> 0x86 134 0xb6 182 +<SC_RIGHT> <S-Right> 0x87 135 0xb7 183 + +<F1> <F1> 0x88 136 0xb8 184 +<F2> <F2> 0x89 137 0xb9 185 +<F3> <F3> 0x8a 138 0xba 186 +<F4> <F4> 0x8b 139 0xbb 187 +<F5> <F5> 0x8c 140 0xbc 188 +<F6> <F6> 0x8d 141 0xbd 189 +<F7> <F7> 0x8e 142 0xbe 190 +<F8> <F8> 0x8f 143 0xbf 191 +<F9> <F9> 0x90 144 0xc0 192 +<F10> <F10> 0x91 145 0xc1 193 + +<SF1> <S-F1> 0x92 146 0xc2 194 +<SF2> <S-F2> 0x93 147 0xc3 195 +<SF3> <S-F3> 0x94 148 0xc4 196 +<SF4> <S-F4> 0x95 149 0xc5 197 +<SF5> <S-F5> 0x96 150 0xc6 198 +<SF6> <S-F6> 0x97 151 0xc7 199 +<SF7> <S-F7> 0x98 152 0xc8 200 +<SF8> <S-F8> 0x99 153 0xc9 201 +<SF9> <S-F9> 0x9a 154 0xca 202 +<SF10> <S-F10> 0x9b 155 0xcb 203 + +<HELP> <Help> 0x9c 156 0xcc 204 +<UNDO> <Undo> 0x9d 157 0xcd 205 + + (not used) 0x9e 158 0xce 206 + (not used) 0x9f 159 0xcf 207 + + +Terminal options changed *termcap-changed* +------------------------ + +The names of the terminal options have been changed to match the termcap names +of these options. All terminal options now have the name t_xx, where xx is +the termcap name. Normally these options are not used, unless you have a +termcap entry that is wrong or incomplete, or you have set the highlight +options to a different value. |terminal-options| + +Note that for some keys there is no termcap name. Use the <> type of name +instead, which is a good idea anyway. + +Note that "t_ti" has become "t_mr" (invert/reverse output) and "t_ts" has +become "t_ti" (init terminal mode). Be careful when you use "t_ti"! + +old name new name meaning ~ +t_cdl t_DL delete number of lines *t_cdl* +t_ci t_vi cursor invisible *t_ci* +t_cil t_AL insert number of lines *t_cil* +t_cm t_cm move cursor +t_cri t_RI cursor number of chars right *t_cri* +t_cv t_ve cursor visible *t_cv* +t_cvv t_vs cursor very visible *t_cvv* +t_dl t_dl delete line +t_cs t_cs scroll region +t_ed t_cl clear display *t_ed* +t_el t_ce clear line *t_el* +t_il t_al insert line *t_il* + t_da display may be retained above the screen + t_db display may be retained below the screen +t_ke t_ke put terminal out of keypad transmit mode +t_ks t_ks put terminal in keypad transmit mode +t_ms t_ms save to move cursor in highlight mode +t_se t_se normal mode (undo t_so) +t_so t_so shift out (standout) mode +t_ti t_mr reverse highlight +t_tb t_md bold mode *t_tb* +t_tp t_me highlight end *t_tp* +t_sr t_sr scroll reverse +t_te t_te out of termcap mode +t_ts t_ti into termcap mode *t_ts_old* +t_vb t_vb visual bell +t_csc t_CS cursor is relative to scroll region *t_csc* + +t_ku t_ku <Up> arrow up +t_kd t_kd <Down> arrow down +t_kr t_kr <Right> arrow right +t_kl t_kl <Left> arrow left +t_sku <S-Up> shifted arrow up *t_sku* +t_skd <S-Down> shifted arrow down *t_skd* +t_skr t_%i <S-Right> shifted arrow right *t_skr* +t_skl t_#4 <S-Left> shifted arrow left *t_skl* +t_f1 t_k1 <F1> function key 1 *t_f1* +t_f2 t_k2 <F2> function key 2 *t_f2* +t_f3 t_k3 <F3> function key 3 *t_f3* +t_f4 t_k4 <F4> function key 4 *t_f4* +t_f5 t_k5 <F5> function key 5 *t_f5* +t_f6 t_k6 <F6> function key 6 *t_f6* +t_f7 t_k7 <F7> function key 7 *t_f7* +t_f8 t_k8 <F8> function key 8 *t_f8* +t_f9 t_k9 <F9> function key 9 *t_f9* +t_f10 t_k; <F10> function key 10 *t_f10* +t_sf1 <S-F1> shifted function key 1 *t_sf1* +t_sf2 <S-F2> shifted function key 2 *t_sf2* +t_sf3 <S-F3> shifted function key 3 *t_sf3* +t_sf4 <S-F4> shifted function key 4 *t_sf4* +t_sf5 <S-F5> shifted function key 5 *t_sf5* +t_sf6 <S-F6> shifted function key 6 *t_sf6* +t_sf7 <S-F7> shifted function key 7 *t_sf7* +t_sf8 <S-F8> shifted function key 8 *t_sf8* +t_sf9 <S-F9> shifted function key 9 *t_sf9* +t_sf10 <S-F10> shifted function key 10 *t_sf10* +t_help t_%1 <Help> help key *t_help* +t_undo t_&8 <Undo> undo key *t_undo* + + +'errorformat' option changed *errorformat-changed* +---------------------------- + +'errorformat' can now contain several formats, separated by commas. The first +format that matches is used. The default values have been adjusted to catch +the most common formats. |errorformat| + +If you have a format that contains a comma, it needs to be preceded with a +backslash. Type two backslashes, because the ":set" command will eat one. + + +'graphic' option gone *graphic-option-gone* +--------------------- + +The 'graphic' option was used to make the characters between <~> and 0xa0 +display directly on the screen. Now the 'isprint' option takes care of this +with many more possibilities. The default setting is the same; you only need +to look into this if you previously set the 'graphic' option in your vimrc. + |'isprint'| + + +'yankendofline' option gone *ye-option-gone* +--------------------------- + +The 'yankendofline' option has been removed. Instead you can just use + :map Y y$ + + +'icon' and 'title' default value changed *icon-changed* +---------------------------------------- + +The 'title' option is now only set by default if the original title can be +restored. Avoids "Thanks for flying Vim" titles. If you want them anyway, +put ":set title" in your vimrc. |'title'| + +The default for 'icon' now depends on the possibility of restoring the +original value, just like 'title'. If you don't like your icon titles to be +changed, add this line to your vimrc: |'icon'| + :set noicon + + +'highlight' option changed *highlight-changed* +-------------------------- + +The 'i' flag now means italic highlighting, instead of invert. The 'r' flag +is used for reverse highlighting, which is what 'i' used to be. Normally you +won't see the difference, because italic mode is not supported on most +terminals and reverse mode is used as a fallback. |'highlight'| + +When an occasion is not present in 'highlight', use the mode from the default +value for 'highlight', instead of reverse mode. + + +'tildeop' and 'weirdinvert' short names changed *short-name-changed* +----------------------------------------------- + +Renamed 'to' (abbreviation for 'tildeop') to 'top'. |'tildeop'| +Renamed 'wi' (abbreviation for 'weirdinvert') to 'wiv'. |'weirdinvert'| + +This was done because Vi uses 'wi' as the short name for 'window' and 'to' as +the short name for 'timeout'. This means that if you try setting these +options, you won't get an error message, but the effect will be different. + + +Use of "v", "V" and "CTRL-V" in Visual mode *use-visual-cmds* +------------------------------------------- + +In Visual mode, "v", "V", and "CTRL-V" used to end Visual mode. Now this +happens only if the Visual mode was in the corresponding type. Otherwise the +type of Visual mode is changed. Now only ESC can be used in all circumstances +to end Visual mode without doing anything. |v_V| + + +CTRL-B in Insert mode removed *toggle-revins* +----------------------------- + +CTRL-B in Insert mode used to toggle the 'revins' option. If you don't know +this and accidentally hit CTRL-B, it is very difficult to find out how to undo +it. Since hardly anybody uses this feature, it is disabled by default. If +you want to use it, define RIGHTLEFT in feature.h before compiling. |'revins'| + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/version5.txt b/Aufgabe5/doc.lang/version5.txt new file mode 100644 index 0000000..bc0628e --- /dev/null +++ b/Aufgabe5/doc.lang/version5.txt @@ -0,0 +1,7813 @@ +*version5.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + +Welcome to Vim Version 5.0! + +This document lists the differences between Vim 4.x and Vim 5.0. +Although 5.0 is mentioned here, this is also for version 5.1, 5.2, etc.. +See |vi_diff.txt| for an overview of differences between Vi and Vim 5.0. +See |version4.txt| for differences between Vim 3.0 and Vim 4.0. + +INCOMPATIBLE: |incompatible-5| + +Default value for 'compatible' changed |cp-default| +Text formatting command "Q" changed |Q-command-changed| +Command-line arguments changed |cmdline-changed| +Autocommands are kept |autocmds-kept| +Use of 'hidden' changed |hidden-changed| +Text object commands changed |text-objects-changed| +X-Windows Resources removed |x-resources| +Use of $VIM |$VIM-use| +Use of $HOME for MS-DOS and Win32 |$HOME-use| +Tags file format changed |tags-file-changed| +Options changed |options-changed| +CTRL-B in Insert mode gone |i_CTRL-B-gone| + +NEW FEATURES: |new-5| + +Syntax highlighting |new-highlighting| +Built-in script language |new-script| +Perl and Python support |new-perl-python| +Win32 GUI version |added-win32-GUI| +VMS version |added-VMS| +BeOS version |added-BeOS| +Macintosh GUI version |added-Mac| +More Vi compatible |more-compatible| +Read input from stdin |read-stdin| +Regular expression patterns |added-regexp| +Overloaded tags |tag-overloaded| +New commands |new-commands| +New options |added-options| +New command-line arguments |added-cmdline-args| +Various additions |added-various| + +IMPROVEMENTS |improvements-5| + +COMPILE TIME CHANGES |compile-changes-5| + +BUG FIXES |bug-fixes-5| + +VERSION 5.1 |version-5.1| +Changed |changed-5.1| +Added |added-5.1| +Fixed |fixed-5.1| + +VERSION 5.2 |version-5.2| +Long lines editable |long-lines| +File browser added |file-browser-5.2| +Dialogs added |dialogs-added| +Popup menu added |popup-menu-added| +Select mode added |new-Select-mode| +Session files added |new-session-files| +User defined functions and commands |new-user-defined| +New interfaces |interfaces-5.2| +New ports |ports-5.2| +Multi-byte support |new-multi-byte| +New functions |new-functions-5.2| +New options |new-options-5.2| +New Ex commands |new-ex-commands-5.2| +Changed |changed-5.2| +Added |added-5.2| +Fixed |fixed-5.2| + +VERSION 5.3 |version-5.3| +Changed |changed-5.3| +Added |added-5.3| +Fixed |fixed-5.3| + +VERSION 5.4 |version-5.4| +Runtime directory introduced |new-runtime-dir| +Filetype introduced |new-filetype-5.4| +Vim script line continuation |new-line-continuation| +Improved session files |improved-sessions| +Autocommands improved |improved-autocmds-5.4| +Encryption |new-encryption| +GTK GUI port |new-GTK-GUI| +Menu changes |menu-changes-5.4| +Viminfo improved |improved-viminfo| +Various new commands |new-commands-5.4| +Various new options |new-options-5.4| +Vim scripts |new-script-5.4| +Avoid hit-enter prompt |avoid-hit-enter| +Improved quickfix |improved-quickfix| +Regular expressions |regexp-changes-5.4| +Changed |changed-5.4| +Added |added-5.4| +Fixed |fixed-5.4| + +VERSION 5.5 |version-5.5| +Changed |changed-5.5| +Added |added-5.5| +Fixed |fixed-5.5| + +VERSION 5.6 |version-5.6| +Changed |changed-5.6| +Added |added-5.6| +Fixed |fixed-5.6| + +VERSION 5.7 |version-5.7| +Changed |changed-5.7| +Added |added-5.7| +Fixed |fixed-5.7| + +VERSION 5.8 |version-5.8| +Changed |changed-5.8| +Added |added-5.8| +Fixed |fixed-5.8| + +============================================================================== + INCOMPATIBLE *incompatible-5* + +Default value for 'compatible' changed *cp-default* +-------------------------------------- + +Vim version 5.0 tries to be more Vi compatible. This helps people who use Vim +as a drop-in replacement for Vi, but causes some things to be incompatible +with version 4.x. + +In version 4.x the default value for the 'compatible' option was off. Now the +default is on. The first thing you will notice is that the "u" command undoes +itself. Other side effects will be that mappings may work differently or not +work at all. + +Since a lot of people switching from Vim 4.x to 5.0 will find this annoying, +the 'compatible' option is switched off if Vim finds a vimrc file. This is a +bit of magic to make sure that 90% of the Vim users will not be bitten by +this change. + +What does this mean? +- If you prefer to run in 'compatible' mode and don't have a vimrc file, you + don't have to do anything. +- If you prefer to run in 'nocompatible' mode and do have a vimrc file, you + don't have to do anything. +- If you prefer to run in 'compatible' mode and do have a vimrc file, you + should put this line first in your vimrc file: > + :set compatible +- If you prefer to run in 'nocompatible' mode and don't have a vimrc file, + you can do one of the following: + - Create an empty vimrc file (e.g.: "~/.vimrc" for Unix). + - Put this command in your .exrc file or $EXINIT: > + :set nocompatible +< - Start Vim with the "-N" argument. + +If you are new to Vi and Vim, using 'nocompatible' is strongly recommended, +because Vi has a lot of unexpected side effects, which are avoided by this +setting. See 'compatible'. + +If you like some things from 'compatible' and some not, you can tune the +compatibility with 'cpoptions'. + +When you invoke Vim as "ex" or "gex", Vim always starts in compatible mode. + + +Text formatting command "Q" changed *Q-command-changed* +----------------------------------- + +The "Q" command formerly formatted lines to the width the 'textwidth' option +specifies. The command for this is now "gq" (see |gq| for more info). The +reason for this change is that "Q" is the standard Vi command to enter "Ex" +mode, and Vim now does in fact have an "Ex" mode (see |Q| for more info). + +If you still want to use "Q" for formatting, use this mapping: > + :noremap Q gq +And if you also want to use the functionality of "Q": > + :noremap gQ Q + + +Command-line arguments changed *cmdline-changed* +------------------------------ + +Command-line file-arguments and option-arguments can now be mixed. You can +give options after the file names. Example: > + vim main.c -g + +This is not possible when editing a file that starts with a '-'. Use the "--" +argument then |---|: > + vim -g -- -main.c + +"-v" now means to start Ex in Vi mode, use "-R" for read-only mode. +old: "vim -v file" |-v| +new: "vim -R file" |-R| + +"-e" now means to start Vi in Ex mode, use "-q" for quickfix. +old: "vim -e errorfile" |-e| +new: "vim -q errorfile" |-q| + +"-s" in Ex mode now means to run in silent (batch) mode. |-s-ex| + +"-x" reserved for crypt, use "-f" to avoid starting a new CLI (Amiga). +old: "vim -x file" |-x| +new: "vim -f file" |-f| + +Vim allows up to ten "+cmd" and "-c cmd" arguments. Previously Vim executed +only the last one. + +"-n" now overrides any setting for 'updatecount' in a vimrc file, but not in +a gvimrc file. + + +Autocommands are kept *autocmds-kept* +--------------------- + +Before version 5.0, autocommands with the same event, file name pattern, and +command could appear only once. This was fine for simple autocommands (like +setting option values), but for more complicated autocommands, where the same +command might appear twice, this restriction caused problems. Therefore +Vim stores all autocommands and keeps them in the order that they are defined. + +The most obvious side effect of this change is that when you source a vimrc +file twice, the autocommands in it will be defined twice. To avoid this, do +one of these: + +- Remove any autocommands that might potentially defined twice before + defining them. Example: > + :au! * *.ext + :au BufEnter *.ext ... + +- Put the autocommands inside an ":if" command. Example: > + if !exists("did_ext_autocmds") + let did_ext_autocmds = 1 + autocmd BufEnter *.ext ... + endif + +- Put your autocommands in a different autocommand group so you can remove + them before defining them |:augroup|: > + augroup uncompress + au! + au BufReadPost *.gz ... + augroup END + + +Use of 'hidden' changed *hidden-changed* +----------------------- + +In version 4.x, only some commands used the 'hidden' option. Now all commands +uses it whenever a buffer disappears from a window. + +Previously you could do ":buf xxx" in a changed buffer and that buffer would +then become hidden. Now you must set the 'hidden' option for this to work. + +The new behavior is simpler: whether Vim hides buffers no longer depends on +the specific command that you use. +- with 'hidden' not set, you never get hidden buffers. Exceptions are the + ":hide" and ":close!" commands and, in rare cases, where you would otherwise + lose changes to the buffer. +- With 'hidden' set, you almost never unload a buffer. Exceptions are the + ":bunload" or ":bdel" commands. + +":buffer" now supports a "!": abandon changes in current buffer. So do +":bnext", ":brewind", etc. + + +Text object commands changed *text-objects-changed* +---------------------------- + +Text object commands have new names. This allows more text objects and makes +characters available for other Visual mode commands. Since no more single +characters were available, text objects names now require two characters. +The first one is always 'i' or 'a'. + OLD NEW ~ + a aw a word |v_aw| + A aW a WORD |v_aW| + s as a sentence |v_as| + p ap a paragraph |v_ap| + S ab a () block |v_ab| + P aB a {} block |v_aB| + +There is another set of text objects that starts with "i", for "inner". These +select the same objects, but exclude white space. + + +X-Windows Resources removed *x-resources* +-------------------------- + +Vim no longer supports the following X resources: +- boldColor +- italicColor +- underlineColor +- cursorColor + +Vim now uses highlight groups to set colors. This avoids the confusion of +using a bold Font, which would imply a certain color. See |:highlight| and +|gui-resources|. + + +Use of $VIM *$VIM-use* +----------- + +Vim now uses the VIM environment variable to find all Vim system files. This +includes the global vimrc, gvimrc, and menu.vim files and all on-line help +and syntax files. See |$VIM|. Starting with version 5.4, |$VIMRUNTIME| can +also be used. +For Unix, Vim sets a default value for $VIM when doing "make install". +When $VIM is not set, its default value is the directory from 'helpfile', +excluding "/doc/help.txt". + + +Use of $HOME for MS-DOS and Win32 *$HOME-use* +--------------------------------- + +The MS-DOS and Win32 versions of Vim now first check $HOME when searching for +a vimrc or exrc file and for reading/storing the viminfo file. Previously Vim +used $VIM for these systems, but this causes trouble on a system with several +users. Now Vim uses $VIM only when $HOME is not set or the file is not found +in $HOME. See |_vimrc|. + + +Tags file format changed *tags-file-changed* +------------------------ + +Only Tabs are allowed to separate fields in a tags file. This allows for +spaces in a file name and is still Vi compatible. In previous versions of +Vim, any white space was allowed to separate the fields. If you have a file +which doesn't use a single Tab between fields, edit the tags file and execute +this command: > + :%s/\(\S*\)\s\+\(\S*\)\s\+\(.*\)/\1\t\2\t\3/ + + +Options changed *options-changed* +--------------- + +The default value of 'errorfile' has changed from "errors.vim" to "errors.err". +The reason is that only Vim scripts should have the ".vim" extensions. + +The ":make" command no longer uses the 'errorfile' option. This prevents the +output of the ":make" command from overwriting a manually saved error file. +":make" uses the 'makeef' option instead. This also allows for generating a +unique name, to prevent concurrently running ":make" commands from overwriting +each other's files. + +With 'insertmode' set, a few more things change: +- <Esc> in Normal mode goes to Insert mode. +- <Esc> in Insert mode doesn't leave Insert mode. +- When doing ":set im", go to Insert mode immediately. + +Vim considers a buffer to be changed when the 'fileformat' (formerly the +'textmode' option) is different from the buffer's initial format. + + +CTRL-B in Insert mode gone *i_CTRL-B-gone* +-------------------------- + +When Vim was compiled with the |+rightleft| feature, you could use CTRL-B to +toggle the 'revins' option. Unfortunately, some people hit the 'B' key +accidentally when trying to type CTRL-V or CTRL-N and then didn't know how to +undo this. Since toggling the 'revins' option can easily be done with the +mapping below, this use of the CTRL-B key is disabled. You can still use the +CTRL-_ key for this |i_CTRL-_|. > + :imap <C-B> <C-O>:set revins!<CR> + +============================================================================== + NEW FEATURES *new-5* + +Syntax highlighting *new-highlighting* +------------------- + +Vim now has a very flexible way to highlighting just about any type of file. +See |syntax|. Summary: > + :syntax on + +Colors and attributes can be set for the syntax highlighting, and also for +other highlighted items with the ':' flag in the 'highlight' option. All +highlighted items are assigned a highlight group which specifies their +highlighting. See |:highlight|. The default colors have been improved. + +You can use the "Normal" group to set the default fore/background colors for a +color terminal. For the GUI, you can use this group to specify the font, too. + +The "2html.vim" script can be used to convert any file that has syntax +highlighting to HTML. The colors will be exactly the same as how you see them +in Vim. With a HTML viewer you can also print the file with colors. + + +Built-in script language *new-script* +------------------------ + +A few extra commands and an expression evaluator enable you to write simple +but powerful scripts. Commands include ":if" and ":while". Expressions can +manipulate numbers and strings. You can use the '=' register to insert +directly the result of an expression. See |expression|. + + +Perl and Python support *new-perl-python* +----------------------- + +Vim can call Perl commands with ":perldo", ":perl", etc. See |perl|. +Patches made by Sven Verdoolaege and Matt Gerassimoff. + +Vim can call Python commands with ":python" and ":pyfile". See |python|. + +Both of these are only available when enabled at compile time. + + +Win32 GUI version *added-win32-GUI* +----------------- + +The GUI has been ported to MS Windows 95 and NT. All the features of the X11 +GUI are available to Windows users now. |gui-w32| +This also fixes problems with running the Win32 console version under Windows +95, where console support has always been bad. +There is also a version that supports OLE automation interface. |if_ole.txt| +Vim can be integrated with Microsoft Developer Studio using the VisVim DLL. +It is possible to produce a DLL version of gvim with Borland C++ (Aaron). + + +VMS version *added-VMS* +----------- + +Vim can now also be used on VMS systems. Port done by Henk Elbers. +This has not been tested much, but it should work. +Sorry, no documentation! + + +BeOS version *added-BeOS* +------------ + +Vim can be used on BeOS systems (including the BeBox). (Olaf Seibert) +See |os_beos.txt|. + + +Macintosh GUI version *added-Mac* +--------------------- + +Vim can now be used on the Macintosh. (Dany St-Amant) +It has not been tested much yet, be careful! +See |os_mac.txt|. + + +More Vi compatible *more-compatible* +------------------ + +There is now a real Ex mode. Started with the "Q" command, or by calling the +executable "ex" or "gex". |Ex-mode| + +Always allow multi-level undo, also in Vi compatible mode. When the 'u' flag +in 'cpoptions' is included, CTRL-R is used for repeating the undo or redo +(like "." in Nvi). + + +Read input from stdin *read-stdin* +--------------------- + +When using the "-" command-line argument, Vim reads its text input from stdin. +This can be used for putting Vim at the end of a pipe: > + grep "^a.*" *.c | vim - +See |--|. + + +Regular expression patterns *added-regexp* +--------------------------- + +Added specifying a range for the number of matches of a atom: "\{a,b}". |/\{| +Added the "shortest match" regexp "\{-}" (Webb). +Added "\s", matches a white character. Can replace "[ \t]". |/\s| +Added "\S", matches a non-white character. Can replace "[^ \t]". |/\S| + + +Overloaded tags *tag-overloaded* +--------------- + +When using a language like C++, there can be several tags for the same +tagname. Commands have been added to be able to jump to any of these +overloaded tags: +|:tselect| List matching tags, and jump to one of them. +|:stselect| Idem, and split window. +|g_CTRL-]| Do ":tselect" with the word under the cursor. + + After ":ta {tagname}" with multiple matches: +|:tnext| Go to next matching tag. +|:tprevious| Go to previous matching tag. +|:trewind| Go to first matching tag. +|:tlast| Go to last matching tag. + +The ":tag" command now also accepts wildcards. When doing command-line +completion on tags, case-insensitive matching is also available (at the end). + + +New commands *new-commands* +------------ + +|:amenu| Define menus for all modes, inserting a CTRL-O for Insert + mode, ESC for Visual and CTRL-C for Cmdline mode. "amenu" is + used for the default menus and the Syntax menu. + +|:augroup| Set group to be used for following autocommands. Allows the + grouping of autocommands to enable deletion of a specific + group. + +|:crewind| Go to first error. +|:clast| Go to last error. + +|:doautoall| Execute autocommands for all loaded buffers. + +|:echo| Echo its argument, which is an expression. Can be used to + display messages which include variables. + +|:execute| Execute its argument, which is an expression. Can be used to + built up an Ex command with anything. + +|:hide| Works like ":close". + +|:if| Conditional execution, for built-in script language. + +|:intro| Show introductory message. This is always executed when Vim + is started without file arguments. + +|:let| Assign a value to an internal variable. + +|:omap| Map only in operator-pending mode. Makes it possible to map + text-object commands. + +|:redir| Redirect output of messages to a file. + +|:update| Write when buffer has changed. + +|:while| While-loop for built-in script language. + +Visual mode: +|v_O| "O" in Visual block mode, moves the cursor to the other corner + horizontally. +|v_D| "D" in Visual block mode deletes till end of line. + +Insert mode: +|i_CTRL-]| Triggers abbreviation, without inserting any character. + + +New options *added-options* +----------- + +'background' Used for selecting highlight color defaults. Also used in + "syntax.vim" for selecting the syntax colors. Often set + automatically, depending on the terminal used. + +'complete' Specifies how Insert mode completion works. + +'eventignore' Makes it possible to ignore autocommands temporarily. + +'fileformat' Current file format. Replaces 'textmode'. +'fileformats' Possible file formats. Replaces 'textauto'. + New is that this also supports Macintosh format: A single <CR> + separates lines. + The default for 'fileformats' for MS-DOS, Win32 and OS/2 is + "dos,unix", also when 'compatible' set. Unix type files + didn't work anyway when 'fileformats' was empty. + +'guicursor' Set the cursor shape and blinking in various modes. + Default is to adjust the cursor for Insert and Replace mode, + and when an operator is pending. Blinking is default on. + +'fkmap' Farsi key mapping. + +'hlsearch' Highlight all matches with the last used search pattern. + +'hkmapp' Phonetic Hebrew mapping. (Ilya Dogolazky) + +'iconstring' Define the name of the icon, when not empty. (Version 5.2: the + string is used literally, a newline can be used to make two + lines.) + +'lazyredraw' Don't redraw the screen while executing macros, registers or + other not typed commands. + +'makeef' Errorfile to be used for ":make". "##" is replaced with a + unique number. Avoids that two Vim sessions overwrite each + others errorfile. The Unix default is "/tmp/vim##.err"; for + Amiga "t:vim##.Err, for others "vim##.err". + +'matchtime' 1/10s of a second to show a matching paren, when 'showmatch' + is set. Like Nvi. + +'mousehide' Hide mouse pointer in GUI when typing text. + +'nrformats' Defines what bases Vim will consider for numbers when using + the CTRL-A and CTRL-X commands. Default: "hex,octal". + +'shellxquote' Add extra quotes around the whole shell command, including + redirection. + +'softtabstop' Make typing behave like tabstop is set at this value, without + changing the value of 'tabstop'. Makes it more easy to keep + 'ts' at 8, while still getting four spaces for a <Tab>. + +'titlestring' String for the window title, when not empty. (Version 5.2: + this string is used literally, a newline can be used to make + two lines.) + +'verbose' Level of verbosity. Makes it possible to show which .vimrc, + .exrc, .viminfo files etc. are used for initializing. Also + to show autocommands that are being executed. Can also be set + by using the "-V" command-line argument. + + +New command-line arguments *added-cmdline-args* +-------------------------- + +|-U| Set the gvimrc file to be used. Like "-u" for the vimrc. + +|-V| Set the 'verbose' option. E.g. "vim -V10". + +|-N| Start in non-compatible mode. + +|-C| Start in compatible mode. + +|-Z| Start in restricted mode, disallow shell commands. Can also + be done by calling the executable "rvim". + +|-h| Show usage information and exit. + + +Various additions *added-various* +----------------- + +Added support for SNiFF+ connection (submitted by Toni Leherbauer). Vim can +be used as an editor for SNiFF. No documentation available... + +For producing a bug report, the bugreport.vim script has been included. +Can be used with ":so $VIMRUNTIME/bugreport.vim", which creates the file +"bugreport.txt" in the current directory. |bugs| + +Added range to ":normal" command. Now you can repeat the same command for +each line in the range. |:normal-range| + +Included support for the Farsi language (Shiran). Only when enabled at +compile time. See |farsi|. + +============================================================================== + IMPROVEMENTS *improvements-5* + +Performance: +- When 'showcmd' was set, mappings would execute much more slowly because the + output would be flushed very often. Helps a lot when executing the "life" + macros with 'showcmd' set. +- Included patches for binary searching in tags file (David O'Neill). + Can be disabled by resetting the 'tagbsearch' option. +- Don't update the ruler when repeating insert (slowed it down a lot). +- For Unix, file name expansion is now done internally instead of starting a + shell for it. +- Expand environment variables with expand_env(), instead of calling the + shell. Makes ":so $VIMRUNTIME/syntax/syntax.vim" a LOT faster. +- Reduced output for cursor positioning: Use CR-LF for moving to first few + columns in next few lines; Don't output CR twice when using termios. +- Optimized cursor positioning. Use CR, BS and NL when it's shorter than + absolute cursor positioning. +- Disable redrawing while repeating insert "1000ii<Esc>". +- Made "d$" or "D" for long lines a lot faster (delete all characters at once, + instead of one by one). +- Access option table by first letter, instead of searching from start. +- Made setting special highlighting attributes a lot faster by using + highlight_attr[], instead of searching in the 'highlight' string. +- Don't show the mode when redrawing is disabled. +- When setting an option, only redraw the screen when required. +- Improved performance of Ex commands by using a lookup table for the first + character. + +Options: +'cinoptions' Added 'g' flag, for C++ scope declarations. +'cpoptions' Added 'E' flag: Disallow yanking, deleting, etc. empty text + area. Default is to allow empty yanks. When 'E' is included, + "y$" in an empty line now is handled as an error (Vi + compatible). + Added 'j' flag: Only add two spaces for a join after a '.', + not after a '?' or '!'. + Added 'A' flag: don't give ATTENTION message. + Added 'L' flag: When not included, and 'list' is set, + 'textwidth' formatting works like 'list' is not set. + Added 'W' flag: Let ":w!" behave like Vi: don't overwrite + readonly files, or a file owned by someone else. +'highlight' Added '@' flag, for '@' characters after the last line on the + screen, and '$' at the end of the line when 'list' is set. + Added 'i' flag: Set highlighting for 'incsearch'. Default + uses "IncSearch" highlight group, which is linked to "Visual". + Disallow 'h' flag in 'highlight' (wasn't used anymore since + 3.0). +'guifont' Win32 GUI only: When set to "*" brings up a font requester. +'guipty' Default on, because so many people need it. +'path' Can contain wildcards, and "**" for searching a whole tree. +'shortmess' Added 'I' flag to avoid the intro message. +'viminfo' Added '%' flag: Store buffer list in viminfo file. + +- Increased defaults for 'maxmem' and 'maxmemtot' for Unix and Win32. Most + machines have much more RAM now that prices have dropped. +- Implemented ":set all&", set all options to their default value. |:set| + +Swap file: +- Don't create a swap file for a readonly file. Then create one on the first + change. Also create a swapfile when the amount of memory used is getting + too high. |swap-file| +- Make swap file "hidden", if possible. On Unix this is done by prepending a + dot to the swap file name. When long file names are used, the DJGPP and + Win32 versions also prepend a dot, in case a file on a mounted Unix file + system is edited. |:swapname| On MSDOS the hidden file attribute is NOT + set, because this causes problems with share.exe. +- 'updatecount' always defaults to non-zero, also for Vi compatible mode. + This means there is a swap file, which can be used for recovery. + +Tags: +- Included ctags 2.0 (Darren Hiebert). The syntax for static tags changed + from + {tag}:{fname} {fname} {command} + to + {tag} {fname} {command};" file: + Which is both faster to parse, shorter and Vi compatible. The old format is + also still accepted, unless disabled in src/feature.h (see OLD_STATIC_TAGS). + |tags-file-format| +- Completion of tags now also includes static tags for other files, at the + end. +- Included "shtags" from Stephen Riehm. +- When finding a matching tag, but the file doesn't exist, continue searching + for another match. Helps when using the same tags file (with links) for + different versions of source code. +- Give a tag with a global match in the current file a higher priority than a + global match in another file. + +Included xxd version V1.8 (Juergen Weigert). + +Autocommands: +- VimLeave autocommands are executed after writing the viminfo file, instead + of before. |VimLeave| +- Allow changing autocommands while executing them. This allows for + self-modifying autocommands. (idea from Goldberg) +- When using autocommands with two or more patterns, could not split + ":if/:endif" over two lines. Now all matching autocommands are executed in + one do_cmdline(). +- Autocommands no longer change the command repeated with ".". +- Search patterns are restored after executing autocommands. This avoids + that the 'hlsearch' highlighting is messed up by autocommands. +- When trying to execute an autocommand, also try matching the pattern with + the short file name. Helps when short file name is different from full + file name (expanded symbolic links). |autocmd-patterns| +- Made the output of ":autocmd" shorter and look better. +- Expand <sfile> in an ":autocmd" when it is defined. |<sfile>| +- Added "nested" flag to ":autocmd", allows nesting. |autocmd-nested| +- Added [group] argument to ":autocmd". Overrides the currently set group. + |autocmd-groups| +- new events: + |BufUnload| before a buffer is unloaded + |BufDelete| before a buffer is deleted from the buffer list + |FileChangedShell| when a file's modification time has changed after + executing a shell command + |User| user-defined autocommand +- When 'modified' was set by a BufRead* autocommand, it was reset again + afterwards. Now the ":set modified" is remembered. + +GUI: +- Improved GUI scrollbar handling when redrawing is slower than the scrollbar + events are generated. +- "vim -u NONE" now also stops loading the .gvimrc and other GUI inits. |-u| + Use "-U" to use another gvimrc file. |-U| +- Handle CTRL-C for external command, also for systems where "setsid()" is + supported. +- When starting the GUI, restrict the window size to the screen size. +- The default menus are read from $VIMRUNTIME/menu.vim. This allows for a + customized default menu. |menu.vim| +- Improved the default menus. Added File/Print, a Window menu, Syntax menu, + etc. +- Added priority to the ":menu" command. Now each menu can be put in a place + where you want it, independent of the order in which the menus are defined. + |menu-priority| + +Give a warning in the intro screen when running the Win32 console version on +Windows 95 because there are problems using this version under Windows 95. +|win32-problems| + +Added 'e' flag for ":substitute" command: Don't complain when not finding a +match (Campbell). |:s| + +When using search commands in a mapping, only the last one is kept in the +history. Avoids that the history is trashed by long mappings. + +Ignore characters after "ex", "view" and "gvim" when checking startup mode. +Allows the use of "gvim5" et. al. |gvim| "gview" starts the GUI in readonly +mode. |gview| + +When resizing windows, the cursor is kept in the same relative position, if +possible. (Webb) + +":all" and ":ball" no longer close and then open a window for the same buffer. +Avoids losing options, jumplist, and other info. + +"-f" command-line argument is now ignored if Vim was compiled without GUI. +|-f| + +In Visual block mode, the right mouse button picks up the nearest corner. + +Changed default mappings for DOS et al. Removed the DOS-specific mappings, +only use the Windows ones. Added Shift-Insert, Ctrl-Insert, Ctrl-Del and +Shift-Del. + +Changed the numbers in the output of ":jumps", so you can see where {count} +CTRL-O takes you. |:jumps| + +Using "~" for $HOME now works for all systems. |$HOME| + +Unix: Besides using CTRL-C, also use the INTR character from the tty settings. +Somebody has INTR set to DEL. + +Allow a <LF> in a ":help" command argument to end the help command, so another +command can follow. + +Doing "%" on a line that starts with " #if" didn't jump to matching "#else". +Don't recognize "#if", "#else" etc. for '%' when 'cpo' contains the '%' flag. +|%| + +Insert mode expansion with "CTRL-N", "CTRL-P" and "CTRL-X" improved +|ins-completion|: +- 'complete' option added. +- When 'nowrapscan' is set, and no match found, report the searched direction + in the error message. +- Repeating CTRL-X commands adds following words/lines after the match. +- When adding-expansions, accept single character matches. +- Made repeated CTRL-X CTRL-N not break undo, and "." repeats the whole + insertion. Also fixes not being able to backspace over a word that has been + inserted with CTRL-N. + +When copying characters in Insert mode from previous/next line, with CTRL-E or +CTRL-Y, 'textwidth' is no longer used. |i_CTRL-E| + +Commands that move in the arglist, like ":n" and ":rew", keep the old cursor +position of the file (this is mostly Vi compatible). + +Vim now remembers the '< and '> marks for each buffer. This fixes a problem +that a line-delete in one buffer invalidated the '< and '> marks in another +buffer. |'<| + +For MSDOS, Unix and OS/2: When $VIM not set, use the path from the executable. +When using the executable path for $VIM, remove "src/" when present. Should +make Vim find the docs and syntax files when it is run directly after +compiling. |$VIM| + +When quitting Visual mode with <Esc>, the cursor is put at start of the Visual +area (like after executing an operator). + +Win32 and Unix version: Removed 1100 character limit on external commands. + +Added possibility to include a space in a ":edit +command" argument, by +putting a backslash before it. |+cmd| + +After recovery, BufReadPost autocommands are applied. |:recover| + +Added color support for "os2ansi", OS/2 console. (Slootman) |os2ansi| + +Allow "%:p:h" when % is empty. |:_%| + +Included "<sfile>": file name from the ":source" command. |<sfile>| + +Added "<Bslash>" special character. Helps for avoiding multiple backslashes +in mappings and menus. + +In a help window, a double-click jumps to the tag under the cursor (like +CTRL-]). + +<C-Left> and <C-Right> now work like <S-Left> and <S-Right>, move a word +forward/backward (Windows compatible). |<C-Left>| + +Removed the requirement for a ":version" command in a .vimrc file. It wasn't +used for anything. You can use ":if" to handle differences between versions. +|:version| + +For MS-DOS, Win32 and OS/2: When comparing file names for autocommands, don't +make a difference between '/' and '\' for path separator. + +New termcap options: +"mb": blink. Can only be used by assigning it to one of the other highlight + options. |t_mb| +"bc": backspace character. |t_bc| +"nd": Used for moving the cursor right in the GUI, to avoid removing one line + of pixels from the last bold character. |t_nd| +"xs": highlighting not erased by overwriting, for hpterm. Combined with + 'weirdinvert'. Visual mode works on hpterm now. |t_xs| + +Unix: Set time of patch and backup file same as original file. (Hiebert). + +Amiga: In QuickFix mode no longer opens another window. Shell commands can be +used now. + +Added decmouse patches from David Binette. Can now use Dec and Netterm mouse. +But only when enabled at compile time. + +Added '#' register: Alternate file name |quote#|. Display '#' register with +":dis" command. |:display| + +Removed ':' from 'isfname' default for Unix. Check for "://" in a file name +anyway. Also check for ":\\", for MS-DOS. + +Added count to "K"eyword command, when 'keywordprg' is "man", is inserted in +the man command. "2K" results in "!man 2 <cword>". |K| + +When using "gf" on a relative path name, remove "../" from the file name, like +it's done for file names in the tags file. |gf| + +When finishing recording, don't make the recorded register the default put +register. + +When using "!!", don't put ":5,5!" on the command-line, but ":.!". And some +other enhancements to replace the line number with "." or "$" when possible. + +MSDOS et al.: Renamed $VIM/viminfo to $VIM/_viminfo. It's more consistent: +.vimrc/_vimrc and .viminfo/_viminfo + +For systems where case doesn't matter in file names (MSDOS, Amiga), ignore +case while sorting file names. For buffer names too. + +When reading from stdin doesn't work, read from stderr (helps for "foo | xargs +vim"). + +32 bit MS-DOS version: Replaced csdpmi3 by csdpmi4. + +Changed <C-Left> and <C-Right> to skip a WORD instead of a word. + +Warning for changed modified time when overwriting a file now also works on +other systems than Unix. + +Unix: Changed the defaults for configure to be the same as the defaults for +Makefile: include GUI, Perl, and Python. + +Some versions of Motif require "-lXpm". Added check for this in configure. + +Don't add "-L/usr/lib" to the link line, causes problems on a few systems. + +============================================================================== + COMPILE TIME CHANGES *compile-changes-5* + +When compiling, allow a choice for minimal, normal or maximal features in an +easy way, by changing a single line in src/feature.h. +The DOS16 version has been compiled with minimal features to avoid running +out of memory too quickly. |dos16| +The Win32, DJGPP, and OS/2 versions use maximal features, because they have +enough memory. +The Amiga version is available with normal and maximal features. + +Added "make test" to Unix version Makefile. Allows for a quick check if most +"normal" commands work properly. Also tests a few specific commands. + +Added setlocale() with codepage support for DJGPP version. + +autoconf: +- Added autoconf check for -lXdmcp. +- Included check for -lXmu, no longer needed to edit the Makefile for this. +- Switched to autoconf 2.12. +- Added configure check for <poll.h>. Seems to be needed when including + Perl on Linux? +- termlib is now checked before termcap. +- Added configure check for strncasecmp(), stricmp() and strnicmp(). Added + vim_stricmp() for when there's no library function for stricmp(). +- Use "datadir" in configure, instead of our own check for HELPDIR. + +Removed "make proto" from Makefile.manx. Could not make it work without a lot +of #ifdefs. + +Removed "proto/" from paths in proto.h. Needed for the Mac port. + +Drastically changed Makefile.mint. Now it includes the Unix Makefile. + +Added support for Dos16 in Makefile.b32 (renamed Makefile.b32 to Makefile.bor) + +All source files are now edited with a tabstop of 8 instead of 4, which is +better when debugging and using other tools. 'softtabstop' is set to 4, to +make editing easier. + +Unix: Added "link.sh" script, which removes a few unnecessary libraries from +the link command. + +Don't use HPUX digraphs by default, but only when HPUX_DIGRAPHS is defined. +|digraphs-default| + +============================================================================== + BUG FIXES *bug-fixes-5* + +Note: Some of these fixes may only apply to test versions which were + created after version 4.6, but before 5.0. + + +When doing ":bdel", try going to the next loaded buffer. Don't rewind to the +start of the buffer list. + +mch_isdir() for Unix returned TRUE for "" on some systems. + +Win32: 'shell' set to "mksnt/sh.exe" breaks ":!" commands. Don't use +backslashes in the temp file names. + +On linux, with a FAT file system, could get spurious "file xxx changed since +editing started" messages, because the time is rounded off to two seconds +unexpectedly. + +Crash in GUI, when selecting a word (double click) and then extend until an +empty line. + +For systems where isdigit() can't handle characters > 255, get_number() caused +a crash when moving the mouse during the prompt for recovery. + +In Insert mode, "CTRL-O P" left the cursor on the last inserted character. +Now the cursor is left after the last putted character. + +When quickfix found an error type other than 'e' or 'w', it was never printed. + +A setting for 'errorfile' in a .vimrc overruled the "-q errorfile" argument. + +Some systems create a file when generating a temp file name. Filtering would +then create a backup file for this, which was never deleted. Now no backup +file is made when filtering. + +simplify_filename() could remove a ".." after a link, resulting in the wrong +file name. Made simplify_filename also work for MSDOS. Don't use it for +Amiga, since it doesn't have "../". + +otherfile() was unreliable when using links. Could think that reading/writing +was for a different file, when it was the same. + +Pasting with mouse in Replace mode didn't replace anything. + +Window height computed wrong when resizing a window with an autocommand (could +cause a crash). + +":s!foo!bar!" wasn't possible (Vi compatible). + +do_bang() freed memory twice when called recursively, because of autocommands +(test11). Thanks to Electric Fence! + +"v$d" on an empty line didn't remove the "-- VISUAL --" mode message from the +command-line, and inverted the cursor. + +":mkexrc" didn't check for failure to open the file, causing a crash. +(Felderhoff). + +Win32 mch_write() wrote past fixed buffer, causing terminal keys no longer to +be recognized. Both console and GUI version. + +Athena GUI: Crash when removing a menu item. Now Vim doesn't crash, but the +reversing of the menu item is still wrong. + +Always reset 'list' option for the help window. + +When 'scrolloff' is non-zero, a 'showmatch' could cause the shown match to be +in the wrong line and the window to be scrolled (Acevedo). + +After ":set all&", 'lines' and 'ttytype' were still non-default, because the +defaults never got set. Now the defaults for 'lines' and 'columns' are set +after detecting the window size. 'term' and 'ttytype' defaults are set when +detecting the terminal type. + +For (most) non-Unix systems, don't add file names with illegal characters when +expanding. Fixes "cannot open swapfile" error when doing ":e *.burp", when +there is no match. + +In X11 GUI, drawing part of the cursor obscured the text. Now the text is +drawn over the cursor, like when it fills the block. (Seibert) + +when started with "-c cmd -q errfile", the cursor would be left in line 1. +Now a ":cc" is done after executing "cmd". + +":ilist" never ignored case, even when 'ignorecase' set. + +"vim -r file" for a readonly file, then making a change, got ATTENTION message +in insert mode, display mixed up until <Esc> typed. Also don't give ATTENTION +message after recovering a file. + +The abbreviation ":ab #i #include" could not be removed. + +CTRL-L completion (longest common match) on command-line didn't work properly +for case-insensitive systems (MS-DOS, Windows, etc.). (suggested by Richard +Kilgore). + +For terminals that can hide the cursor ("vi" termcap entry), resizing the +window caused the cursor to disappear. + +Using an invalid mark in an Ex address didn't abort the command. + +When 'smarttab' set, would use 'shiftround' when inserting a TAB after a +space. Now it always rounds to a tabstop. + +Set '[ and '] marks for ":copy", ":move", ":append", ":insert", ":substitute" +and ":change". (Acevedo). + +"d$" in an empty line still caused an error, even when 'E' is not in +'cpoptions'. + +Help files were stored in the viminfo buffer list without a path. + +GUI: Displaying cursor was not synchronized with other displaying. Caused +several display errors. For example, when the last two lines in the file +start with spaces, "dd" on the last line copied text to the (then) last line. + +Win32: Needed to type CTRL-SHIFT-- to get CTRL-_. + +GUI: Moving the cursor forwards over bold text would remove one column of bold +pixels. + +X11 GUI: When a bold character in the last column was scrolled up or down, one +column of pixels would not be copied. + +Using <BS> to move the cursor left can sometimes erase a character. Now use +"le" termcap entry for this. + +Keyword completion with regexp didn't work. e.g., for "b.*crat". + +Fixed: With CTRL-O that jumps to another file, cursor could end up just after +the line. + +Amiga: '$' was missing from character recognized as wildcards, causing $VIM +sometimes not to be expanded. + +":change" didn't adjust marks for deleted lines. + +":help [range]" didn't work. Also for [pattern], [count] and [quotex]. + +For 'cindent'ing, typing "class::method" doesn't align like a label when the +second ':' is typed. +When inserting a CR with 'cindent' set (and a bunch of other conditions) the +cursor went to a wrong location. +'cindent' was wrong for a line that ends in '}'. +'cindent' was wrong after "else {". + +While editing the cmdline in the GUI, could not use the mouse to select text +from the command-line itself. + +When deleting lines, marks in tag stack were only adjusted for the current +window, not for other windows on the same buffer. + +Tag guessing could find a function "some_func" instead of the "func" we were +looking for. + +Tags file name relative to the current file didn't work. + +":g/pat2/s//pat2/g", causing the number of subs to be reported, used to cause +a scroll up. Now you no longer have to hit <CR>. + +X11 GUI: Selecting text could cause a crash. + +32 bit DOS version: CTRL-C in external command killed Vim. When SHELL is set +to "sh.exe", external commands didn't work. Removed using of command.com, no +longer need to set 'shellquote'. + +Fixed crash when using ":g/pat/i". + +Fixed (potential) crash for X11 GUI, when using an X selection. Was giving a +pointer on the stack to a callback function, now it's static. + +Using "#" and "*" with an operator didn't work. E.g. "c#". + +Command-line expansion didn't work properly after ":*". (Acevedo) + +Setting 'weirdinvert' caused highlighting to be wrong in the GUI. + +":e +4 #" didn't work, because the "4" was in unallocated memory (could cause +a crash). + +Cursor position was wrong for ":e #", after ":e #" failed, because of changes +to the buffer. + +When doing ":buf N", going to a buffer that was edited with ":view", the +readonly flag was reset. Now make a difference between ":e file" and ":buf +file": Only set/reset 'ro' for the first one. + +Avoid |hit-enter| prompt when not able to write viminfo on exit. + +When giving error messages in the terminal where the GUI was started, GUI +escape codes would be written to the terminal. In an xterm this could be seen +as a '$' after the message. + +Mouse would not work directly after ":gui", because full_screen isn't set, +which causes starttermcap() not to do its work. + +'incsearch' did not scroll the window in the same way as the actual search. +When 'nowrap' set, incsearch didn't show a match when it was off the side of +the screen. Now it also shows the whole match, instead of just the cursor +position (if possible). + +":unmap", ":unab" and ":unmenu" did not accept a double quote, it was seen as +the start of a comment. Now it's Vi compatible. + +Using <Up><Left><Left><Up> in the command-line, when there is no previous +cmdline in the history, inserted a NUL on the command-line. + +"i<Esc>" when on a <Tab> in column 0 left the cursor in the wrong place. + +GUI Motif: When adding a lot of menu items, the menu bar goes into two rows. +Deleting menu items, reducing the number of rows, now also works. + +With ":g/pat/s//foo/c", a match in the first line was scrolled off of the +screen, so you could not see it. +When using ":s//c", with 'nowrap' set, a match could be off the side of the +screen, so you could not see it. + +When 'helpfile' was set to a fixed, non-absolute path in feature.h, Vim would +crash. mch_Fullname can now handle file names in read-only memory. (Lottem) + +When using CTRL-A or CTRL-@ in Insert mode, there could be strange effects +when using CTRL-D next. Also, when repeating inserted text that included "0 +CTRL-D" or "^ CTRL-D" this didn't work. (Acevedo) +Using CTRL-D after using CTRL-E or CTRL-Y in Insert mode that inserted a '0' +or '^', removed the '0' or '^' and more indent. + +The command "2".p" caused the last inserted text to be executed as commands. +(Acevedo) + +Repeating the insert of "CTRL-V 048" resulted in "^@" to be inserted. + +Repeating Insert completion could fail if there are special characters in the +text. (Acevedo) + +":normal /string<CR>" caused the window to scroll. Now all ":normal" commands +are executed without scrolling messages. + +Redo of CTRL-E or CTRL-Y in Insert mode interpreted special characters as +commands. + +Line wrapping for 'tw' was done one character off for insert expansion +inserts. + +buffer_exists() function didn't work properly for buffer names with a symbolic +link in them (e.g. when using buffer_exists(#)). + +Removed the "MOTIF_COMMENT" construction from Makefile. It now works with +FreeBSD make, and probably with NeXT make too. + +Matching the 'define' and 'include' arguments now honor the settings for +'ignorecase'. (Acevedo) + +When one file shown in two windows, Visual selection mixed up cursor position +in current window and other window. + +When doing ":e file" from a help file, the 'isk' option wasn't reset properly, +because of a modeline in the help file. + +When doing ":e!", a cursor in another window on the same buffer could become +invalid, leading to "ml_get: invalid lnum" errors. + +Matching buffer name for when expanded name has a different path from not +expanded name (Brugnara). + +Normal mappings didn't work after an operator. For example, with ":map Q gq", +"QQ" didn't work. + +When ":make" resulted in zero errors, a "No Errors" error message was given +(which breaks mappings). + +When ":sourcing" a file, line length was limited to 1024 characters. CTRL-V +before <EOL> was not handled Vi compatible. (Acevedo) + +Unexpected exit for X11 GUI, caused by SAVE_YOURSELF event. (Heimann) + +CTRL-X CTRL-I only found one match per line. (Acevedo) +When using an illegal CTRL-X key in Insert mode, the CTRL-X mode message +was stuck. + +Finally managed to ignore the "Quit" menu entry of the Window manager! Now +Vim only exists when there are no changed buffers. + +Trying to start the GUI when $DISPLAY is not set resulted in a crash. +When $DISPLAY is not set and gvim starts vim, title was restored to "Thanks +for flying Vim". +When $DISPLAY not set, starting "gvim" (dropping back to vim) and then +selecting text with the mouse caused a crash. + +"J", with 'joinspaces' set, on a line ending in ". ", caused one space too +many to be added. (Acevedo) + +In insert mode, a CTRL-R {regname} which didn't insert anything left the '"' +on the screen. + +":z10" didn't work. (Clapp) + +"Help "*" didn't work. + +Renamed a lot of functions, to avoid clashes with POSIX name space. + +When adding characters to a line, making it wrap, the following lines were +sometimes not shifted down (e.g. after a tag jump). + +CTRL-E, with 'so' set and cursor on last line, now does not move cursor as +long as the last line is on the screen. + +When there are two windows, doing "^W+^W-" in the bottom window could cause +the status line to be doubled (not redrawn correctly). + +This command would hang: ":n `cat`". Now connect stdin of the external +command to /dev/null, when expanding. + +Fixed lalloc(0,) error for ":echo %:e:r". (Acevedo) + +The "+command" argument to ":split" didn't work when there was no file name. + +When selecting text in the GUI, which is the output of a command-line command +or an external command, the inversion would sometimes remain. + +GUI: "-mh 70" argument was broken. Now, when menuheight is specified, it is +not changed anymore. + +GUI: When using the scrollbar or mouse while executing an external command, +this caused garbage characters. + +Showmatch sometimes jumped to the wrong position. Was caused by a call to +findmatch() when redrawing the display (when syntax highlighting is on). + +Search pattern "\(a *\)\{3} did not work correctly, also matched "a a". +Problem with brace_count not being decremented. + +Wildcard expansion added too many non-matching file names. + +When 'iskeyword' contains characters like '~', "*" and "#" didn't work +properly. (Acevedo) + +On Linux, on a FAT file system, modification time can change by one second. +Avoid a "file has changed" warning for a one second difference. + +When using the page-switching in an xterm, Vim would position the cursor on +the last line of the window on exit. Also removed the cursor positioning for +":!" commands. + +":g/pat/p" command (partly) overwrote the command. Now the output is on a +separate line. + +With 'ic' and 'scs' set, a search for "Keyword", ignore-case matches were +highlighted too. + +"^" on a line with only white space, put cursor beyond the end of the line. + +When deleting characters before where insertion started ('bs' == 2), could not +use abbreviations. + +CTRL-E at end of file puts cursor below the file, in Visual mode, when 'so' is +non-zero. CTRL-E didn't work when 'so' is big and the line below the window +wraps. CTRL-E, when 'so' is non-zero, at end of the file, caused jumping +up-down. + +":retab" didn't work well when 'list' is set. + +Amiga: When inserting characters at the last line on the screen, causing it +to wrap, messed up the display. It appears that a '\n' on the last line +doesn't always cause a scroll up. + +In Insert mode "0<C-D><C-D>" deleted an extra character, because Vim thought +that the "0" was still there. (Acevedo) + +"z{count}l" ignored the count. Also for "zh" et. al. (Acevedo) + +"S" when 'autoindent' is off didn't delete leading white space. + +"/<Tab>" landed on the wrong character when 'incsearch' is set. + +Asking a yes/no question could cause a |hit-enter| prompt. + +When the file consists of one long line (>4100 characters), making changes +caused various errors and a crash. + +DJGPP version could not save long lines (>64000) for undo. + +"yw" on the last char in the file didn't work. Also fixed "6x" at the end of +the line. "6X" at the start of a line fails, but does not break a mapping. In +general, a movement for an operator doesn't beep or flush a mapping, but when +there is nothing to operate on it beeps (this is Vi compatible). + +"m'" and "m`" now set the '' mark at the cursor position. + +Unix: Resetting of signals for external program didn't work, because SIG_DFL +and NULL are the same! For "!!yes|dd count=1|, the yes command kept on +running. + +Partly fixed: Unix GUI: Typeahead while executing an external command was lost. +Now it's not lost while the command is producing output. + +Typing <S-Tab> in Insert mode, when it isn't mapped, inserted "<S-Tab>". Now +it works like a normal <Tab>, just like <C-Tab> and <M-Tab>. + +Redrawing ruler didn't check for old value correctly (caused UMR warnings in +Purify). + +Negative array index in finish_viminfo_history(). + +":g/^/d|mo $" deleted all the lines. The ":move" command now removes the +:global mark from the moved lines. + +Using "vG" while the last line in the window is a "@" line, didn't update +correctly. Just the "v" showed "~" lines. + +"daw" on the last char of the file, when it's a space, moved the cursor beyond +the end of the line. + +When 'hlsearch' was set or reset, only the current buffer was redrawn, while +this affects all windows. + +CTRL-^, positioning the cursor somewhere from 1/2 to 1 1/2 screen down the +file, put the cursor at the bottom of the window, instead of halfway. + +When scrolling up for ":append" command, not all windows were updated +correctly. + +When 'hlsearch' is set, and an auto-indent is highlighted, pressing <Esc> +didn't remove the highlighting, although the indent was deleted. + +When 'ru' set and 'nosc', using "$j" showed a wrong ruler. + +Under Xfree 3.2, Shift-Tab didn't work (wrong keysym is used). + +Mapping <S-Tab> didn't work. Changed the key translations to use the shortest +key code possible. This makes the termcode translations and mappings more +consistent. Now all modifiers work in all combinations, not only with <Tab>, +but also with <Space>, <CR>, etc. + +For Unix, restore three more signals. And Vim catches SIGINT now, so CTRL-C +in Ex mode doesn't make Vim exit. + +""a5Y" yanked 25 lines instead of 5. + +"vrxxx<Esc>" in an empty line could not be undone. + +A CTRL-C that breaks ":make" caused the errorfile not to be read (annoying +when you want to handle what ":make" produced so far). + +":0;/pat" didn't find "pat" in line 1. + +Search for "/test/s+1" at first char of file gave bottom-top message, or +didn't work at all with 'nowrapscan'. + +Bug in viminfo history. Could cause a crash on exit. + +":print" didn't put cursor on first non-blank in line. + +":0r !cat </dev/null" left cursor in line zero, with very strange effects. + +With 'showcmd' set and 'timeoutlen' set to a few seconds, trick to position +the cursor leftwards didn't work. + +AIX stty settings were restored to cs5 instead of cs8 (Winn). + +File name completion didn't work for "zsh" versions that put spaces between +file names, instead of NULs. + +Changed "XawChain*" to "XtChain*", should work for more systems. + +Included quite a few fixes for rightleft mode (Lottem). + +Didn't ask to |hit-enter| when GUI is started and error messages are printed. + +When trying to edit a file in a non-existent directory, ended up with editing +"No file". + +"gqap" to format a paragraph did too much redrawing. + +When 'hlsearch' set, only the current window was updated for a new search +pattern. + +Sometimes error messages on startup didn't cause a |hit-enter| prompt, +because of autocommands containing an empty line. + +Was possible to select part of the window in the border, below the command +line. + +'< and '> marks were not at the correct position after linewise Visual +selection. + +When translating a help argument to "CTRL-x", prepend or append a '_', when +applicable. + +Blockwise visual mode wasn't correct when moving vertically over a special +character (displayed as two screen characters). + +Renamed "struct option" to "struct vimoption" to avoid name clash with GNU +getopt(). + +":abclear" didn't work (but ":iabclear" and ":cabclear" did work). + +When 'nowrap' used, screen wasn't always updated correctly. + +"vim -c split file" displayed extra lines. + +After starting the GUI, searched the termcap for a "gui" term. + +When 'hls' used, search for "^$" caused a hang. +When 'hls' was set, an error in the last regexp caused trouble. + +Unix: Only output an extra <EOL> on exit when outputted something in the +alternate screen, or when there is a message that needs to be cleared. + +"/a\{" did strange things, depending on previous search. + +"c}" only redrew one line (with -u NONE). + +For mappings, CTRL-META-A was shown as <M-^A> instead of <MC-A>, while :map +only accepts <MC-A>. Now <M-C-A> is shown. + +Unix: When using full path name in a tags file, which contains a link, and +'hidden' set and jumping to a tag in the current file, would get bogus +ATTENTION message. Solved by always expanding file names, even when starting +with '/'. + +'hlsearch' highlighting of special characters (e.g., a TAB) didn't highlight +the whole thing. + +"r<CR>" didn't work correctly on the last char of a line. + +sometimes a window resize or other signal caused an endless loop, involving +set_winsize(). + +"vim -r" didn't work, it would just hang (using tgetent() while 'term' is +empty). + +"gk" while 'nowrap' set moved two lines up. + +When windows are split, a message that causes a scroll-up messed up one of the +windows, which required a CTRL-L to be typed. + +Possible endless loop when using shell command in the GUI. + +Menus defined in the .vimrc were removed when GUI started. + +Crash when pasting with the mouse in insert mode. + +Crash with ":unmenu *" in .gvimrc for Athena. + +"5>>" shifted 5 lines 5 times, instead of 1 time. + +CTRL-C when getting a prompt in ":global" didn't interrupt. + +When 'so' is non-zero, and moving the scrollbar completely to the bottom, +there was a lot of flashing. + +GUI: Scrollbar ident must be long for DEC Alpha. + +Some functions called vim_regcomp() without setting reg_magic, which could +lead to unpredictable magicness. + +Crash when clicking around the status line, could get a selection with a +backwards range. + +When deleting more than one line characterwise, the last character wasn't +deleted. + +GUI: Status line could be overwritten when moving the scrollbar quickly (or +when 'wd' is non-zero). + +An ESC at the end of a ":normal" command caused a wait for a terminal code to +finish. Now, a terminal code is not recognized when its start comes from a +mapping or ":normal" command. + +Included patches from Robert Webb for GUI. Layout of the windows is now done +inside Vim, instead of letting the layout manager do this. Makes Vim work +with Lesstif! + +UMR warning in set_expand_context(). + +Memory leak: b_winlnum list was never freed. + +Removed TIOCLSET/TIOCLGET code from os_unix.c. Was changing some of the +terminal settings, and looked like it wasn't doing anything good. (suggested +by Juergen Weigert). + +Ruler overwrote "is a directory" message. When starting up, and 'cmdheight' +set to > 1, first message could still be in the last line. + +Removed prototype for putenv() from proto.h, it's already in osdef2.h.in. + +In replace mode, when moving the cursor and then backspacing, wrong characters +were inserted. + +Win32 GUI was checking for a CTRL-C too often, making it slow. + +Removed mappings for MS-DOS that were already covered by commands. + +When visually selecting all lines in a file, cursor at last line, then "J". +Gave ml_get errors. Was a problem with scrolling down during redrawing. + +When doing a linewise operator, and then an operator with a mouse click, it +was also linewise, instead of characterwise. + +When 'list' is set, the column of the ruler was wrong. + +Spurious error message for "/\(b\+\)*". + +When visually selected many lines, message from ":w file" disappeared when +redrawing the screen. + +":set <M-b>=^[b", then insert "^[b", waited for another character. And then +inserted "<M-b>" instead of the real <M-b> character. Was trying to insert +K_SPECIAL x NUL. + +CTRL-W ] didn't use count to set window height. + +GUI: "-font" command-line argument didn't override 'guifont' setting from +.gvimrc. (Acevedo) + +GUI: clipboard wasn't used for "*y". And some more Win32/X11 differences +fixed for the clipboard (Webb). + +Jumping from one help file to another help file, with 'compatible' set, +removed the 'help' flag from the buffer. + +File-writable bit could be reset when using ":w!" for a readonly file. + +There was a wait for CTRL-O n in Insert mode, because the search pattern was +shown. +Reduced wait, to allow reading a message, from 10 to 3 seconds. It seemed +nothing was happening. + +":recover" found same swap file twice. + +GUI: "*yy only worked the second time (when pasting to an xterm)." + +DJGPP version (dos32): The system flags were cleared. + +Dos32 version: Underscores were sometimes replaced with y-umlaut (Levin). + +Version 4.1 of ncurses can't handle tputs("", ..). Avoid calling tputs() with +an empty string. + +<S-Tab> in the command-line worked like CTRL-P when no completion started yet. +Now it does completion, last match first. + +Unix: Could get annoying "can't write viminfo" message after doing "su". Now +the viminfo file is overwritten, and the user set back to the original one. + +":set term=builtin_gui" started the GUI in a wrong way. Now it's not +allowed anymore. But "vim -T gui" does start the GUI correctly now. + +GUI: Triple click after a line only put last char in selection, when it is a +single character word. + +When the window is bigger than the screen, the scrolling up of messages was +wrong (e.g. ":vers", ":hi"). Also when the bottom part of the window was +obscured by another window. + +When using a wrong option only an error message is printed, to avoid that the +usage information makes it scroll off the screen. + +When exiting because of not being able to read from stdin, didn't preserve the +swap files properly. + +Visual selecting all chars in more than one line, then hit "x" didn't leave an +empty line. For one line it did leave an empty line. + +Message for which autocommand is executing messed up file write message (for +FileWritePost event). + +"vim -h" included "-U" even when GUI is not available, and "-l" when lisp is +not available. + +Crash for ":he <C-A>" (command-line longer than screen). + +":s/this/that/gc", type "y" two times, then undo, did reset the modified +option, even though the file is still modified. + +Empty lines in a tags file caused a ":tag" to be aborted. + +When hitting 'q' at the more prompt for ":menu", still scrolled a few lines. + +In an xterm that uses the bold trick a single row of characters could remain +after an erased bold character. Now erase one extra char after the bold char, +like for the GUI. + +":pop!" didn't work. + +When the reading a buffer was interrupted, ":w" should not be able to +overwrite the file, ":w!" is required. + +":cf%" caused a crash. + +":gui longfilename", when forking is enabled, could leave part of the +longfilename at the shell prompt. + +============================================================================== +VERSION 5.1 *version-5.1* + +Improvements made between version 5.0 and 5.1. + +This was mostly a bug-fix release, not many new features. + + +Changed *changed-5.1* +------- + +The expand() function now separates file names with <NL> instead of a space. +This avoids problems for file names with embedded spaces. To get the old +result, use substitute(expand(foo), "\n", " ", "g"). + +For Insert-expanding dictionaries allow a backslash to be used for +wildchars. Allows expanding "ze\kra", when 'isk' includes a backslash. + +New icon for the Win32 GUI. + +":tag", ":tselect" etc. only use the argument as a regexp when it starts +with '/'. Avoids that ":tag xx~" gives an error message: "No previous sub. +regexp". Also, when the :tag argument contained wildcard characters, it was +not Vi compatible. +When using '/', the argument is taken literally too, with a higher priority, +so it's found before wildcard matches. +Only when the '/' is used are matches with different case found, even though +'ignorecase' isn't set. +Changed "g^]" to only do ":tselect" when there is more than on matching tag. + +Changed some of the default colors, because they were not very readable on a +dark background. + +A character offset to a search pattern can move the cursor to the next or +previous line. Also fixes that "/pattern/e+2" got stuck on "pattern" at the +end of a line. + +Double-clicks in the status line do no longer start Visual mode. Dragging a +status line no longer stops Visual mode. + +Perl interface: Buffers() and Windows() now use more logical arguments, like +they are used in the rest of Vim (Moore). + +Init '" mark to the first character of the first line. Makes it possible to +use '" in an autocommand without getting an error message. + + +Added *added-5.1* +----- + +"shell_error" internal variable: result of last shell command. + +":echohl" command: Set highlighting for ":echo". + +'S' flag in 'highlight' and StatusLineNC highlight group: highlighting for +status line of not-current window. Default is to use bold for current +window. + +Added buffer_name() and buffer_number() functions (Aaron). +Added flags argument "g" to substitute() function (Aaron). +Added winheight() function. + +Win32: When an external command starts with "start ", no console is opened +for it (Aaron). + +Win32 console: Use termcap codes for bold/reverse based on the current +console attributes. + +Configure check for "strip". (Napier) + +CTRL-R CTRL-R x in Insert mode: Insert the contents of a register literally, +instead of as typed. + +Made a few "No match" error messages more informative by adding the pattern +that didn't match. + +"make install" now also copies the macro files. + +tools/tcltags, a shell script to generate a tags file from a TCL file. + +"--with-tlib" setting for configure. Easy way to use termlib: "./configure +--with-tlib=termlib". + +'u' flag in 'cino' for setting the indent for contained () parts. + +When Win32 OLE version can't load the registered type library, ask the user +if he wants to register Vim now. (Erhardt) +Win32 with OLE: When registered automatically, exit Vim. +Included VisVim 1.1b, with a few enhancements and the new icon (Heiko +Erhardt). + +Added patch from Vince Negri for Win32s support. Needs to be compiled with +VC 4.1! + +Perl interface: Added $curbuf. Rationalized Buffers() and Windows(). +(Moore) Added "group" argument to Msg(). + +Included Perl files in DOS source archive. Changed Makefile.bor and +Makefile.w32 to support building a Win32 version with Perl included. + +Included new Makefile.w32 from Ken Scott. Now it's able to make all Win32 +versions, including OLE, Perl and Python. + +Added CTRL-W g ] and CTRL-W g ^]: split window and do g] or g^]. + +Added "g]" to always do ":tselect" for the ident under the cursor. +Added ":tjump" and ":stjump" commands. +Improved listing of ":tselect" when tag names are a bit long. + +Included patches for the Macintosh version. Also for Python interface. +(St-Amant) + +":buf foo" now also restores cursor column, when the buffer was used before. + +Adjusted the Makefile for different final destinations for the syntax files +and scripts (for Debian Linux). + +Amiga: $VIM can be used everywhere. When $VIM is not defined, "VIM:" is +used. This fixes that "VIM:" had to be assigned for the help files, and +$VIM set for the syntax files. Now either of these work. + +Some xterms send vt100 compatible function keys F1-F4. Since it's not +possible to detect this, recognize both type of keys and translate them to +<F1> - <F4>. + +Added "VimEnter" autocommand. Executed after loading all the startup stuff. + +BeOS version now also runs on Intel CPUs (Seibert). + + +Fixed *fixed-5.1* +----- + +":ts" changed position in the tag stack when cancelled with <CR>. +":ts" changed the cursor position for CTRL-T when cancelled with <CR>. +":tn" would always jump to the second match. Was using the wrong entry in +the tag stack. +Doing "tag foo", then ":tselect", overwrote the original cursor position in +the tag stack. + +"make install" changed the vim.1 manpage in a wrong way, causing "doc/doc" +to appear for the documentation files. + +When compiled with MAX_FEAT, xterm mouse handling failed. Was caused by DEC +mouse handling interfering. + +Was leaking memory when using selection in X11. + +CTRL-D halfway a command-line left some characters behind the first line(s) +of the listing. + +When expanding directories for ":set path=", put two extra backslashes +before a space in a directory name. + +When 'lisp' set, first line of a function would be indented. Now its indent +is set to zero. And use the indent of the first previous line that is at +the same () level. Added test33. + +"so<Esc>u" in an empty file didn't work. + +DOS: "seek error in swap file write" errors, when using DOS 6.2 share.exe, +because the swap file was made hidden. It's no longer hidden. + +":global" command would sometimes not execute on a matching line. Happened +when a data block is full in ml_replace(). + +For AIX use a tgetent buffer of 2048 bytes, instead of 1024. + +Win32 gvim now only sets the console size for external commands to 25x80 +on Windows 95, not on NT. + +Win32 console: Dead key could cause a crash, because of a missing "WINAPI" +(Deshpande). + +The right mouse button started Visual mode, even when 'mouse' is empty, and +in the command-line, a left click moved the cursor when 'mouse' is empty. +In Visual mode, 'n' in 'mouse' would be used instead of 'v'. + +A blinking cursor or focus change cleared a non-Visual selection. + +CTRL-Home and CTRL-End didn't work for MS-DOS versions. + +Could include NUL in 'iskeyword', causing a crash when doing insert mode +completion. + +Use _dos_commit() to flush the swap file to disk for MSDOS 16 bit version. + +In mappings, CTRL-H was replaced by the backspace key code. This caused +problems when it was used as text, e.g. ":map _U :%s/.^H//g<CR>". + +":set t_Co=0" was not handled like a normal term. Now it's translated into +":set t_Co=", which works. + +For ":syntax keyword" the "transparent" option did work, although not +mentioned in the help. But synID() returned wrong name. + +"gqG" in a file with one-word-per-line (e.g. a dictionary) was very slow and +not interruptable. + +"gq" operator inserted screen lines in the wrong situation. Now screen +lines are inserted or deleted when this speeds up displaying. + +cindent was wrong when an "if" contained "((". + +'r' flag in 'viminfo' was not used for '%'. Could get files in the buffer +list from removable media. + +Win32 GUI with OLE: if_ole_vc.mak could not be converted into a project. +Hand-edited to fix this... + +With 'nosol' set, doing "$kdw" below an empty line positioned the cursor at +the end of the line. + +Dos32 version changed "\dir\file" into "/dir/file", to work around a DJGPP +bug. That bug appears to have been fixed, therefore this translation has +been removed. + +"/^*" didn't work (find '*' in first column). + +"<afile>" was not always set for autocommands. E.g., for ":au BufEnter * +let &tags = expand("<afile>:p:h") . "/tags". + +In an xterm, the window may be a child of the outer xterm window. Use the +parent window when getting the title and icon names. (Smith) + +When starting with "gvim -bg black -fg white", the value of 'background' is +only set after reading the .gvimrc file. This causes a ":syntax on" to use +the wrong colors. Now allow using ":gui" to open the GUI window and set the +colors. Previously ":gui" in a gvimrc crashed Vim. + +tempname() returned the same name all the time, unless the file was actually +created. Now there are at least 26 different names. + +File name used for <afile> was sometimes full path, sometimes file name +relative to current directory. + +When 'background' was set after the GUI window was opened, it could change +colors that were set by the user in the .gvimrc file. Now it only changes +colors that have not been set by the user. + +Ignore special characters after a CSI in the GUI version. These could be +interpreted as special characters in a wrong way. (St-Amant) + +Memory leak in farsi code, when using search or ":s" command. +Farsi string reversing for a mapping was only done for new mappings. Now it +also works for replacing a mapping. + +Crash in Win32 when using a file name longer than _MAX_PATH. (Aaron) + +When BufDelete autocommands were executed, some things for the buffer were +already deleted (esp. Perl stuff). + +Perl interface: Buffer specific items were deleted too soon; fixes "screen +no longer exists" messages. (Moore) + +The Perl functions didn't set the 'modified' flag. + +link.sh did not return an error on exit, which may cause Vim to start +installing, even though there is no executable to install. (Riehm) + +Vi incompatibility: In Vi "." redoes the "y" command. Added the 'y' flag to +'cpoptions'. Only for 'compatible' mode. + +":echohl" defined a new group, when the argument was not an existing group. + +"syn on" and ":syn off" could move the cursor, if there is a hidden buffer +that is shorter that the current cursor position. + +The " mark was not set when doing ":b file". + +When a "nextgroup" is used with "skipwhite" in syntax highlighting, space at +the end of the line made the nextgroup also be found in the next line. + +":he g<CTRL-D>", then ":" and backspace to the start didn't redraw. + +X11 GUI: "gvim -rv" reversed the colors twice on Sun. Now Vim checks if the +result is really reverse video (background darker than foreground). + +"cat link.sh | vim -" didn't set syntax highlighting. + +Win32: Expanding "file.sw?" matched ".file.swp". This is an error of +FindnextFile() that we need to work around. (Kilgore) + +"gqgq" gave an "Invalid lnum" error on the last line. +Formatting with "gq" didn't format the first line after a change of comment +leader. + +There was no check for out-of-memory in win_alloc(). + +"vim -h" didn't mention "-register" and "-unregister" for the OLE version. + +Could not increase 'cmdheight' when the last window is only one line. Now +other windows are also made smaller, when necessary. + +Added a few {} to avoid "suggest braces around" warnings from gcc 2.8.x. +Changed return type of main() from void to int. (Nam) + +Using '~' twice in a substitute pattern caused a crash. + +"syn on" and ":syn off" could scroll the window, if there is a hidden buffer +that is shorter that the current cursor position. + +":if 0 | if 1 | endif | endif" didn't work. Same for ":while" and "elseif". + +With two windows on modified files, with 'autowrite' set, cursor in second +window, ":qa" gave a warning for the file in the first window, but then +auto-wrote the file in the second window. (Webb) + +Win32 GUI scrollbar could only handle 32767 lines. Also makes the +intellimouse wheel use the configurable number of scrolls. (Robinson) + +When using 'patchmode', and the backup file is on another partition, the file +copying messed up the write-file message. + +GUI X11: Alt-Backspace and Alt-Delete didn't work. + +"`0" could put the cursor after the last character in the line, causing +trouble for other commands, like "i". + +When completing tags in insert mode with ^X^], some matches were skipped, +because the compare with other tags was wrong. E.g., when "mnuFileSave" was +already there, "mnuFile" would be skipped. (Negri) + +When scrolling up/down, a syntax item with "keepend" didn't work properly. +Now the flags are also stored for the syntax state a the start of each line. + +When 'ic' was changed while 'hlsearch' is on, there was no redraw to show the +effect. + +Win32 GUI: Don't display "No write since last chance" in a message box, but in +the Vim window. + +============================================================================== +VERSION 5.2 *version-5.2* + +Improvements made between version 5.1 and 5.2. + + +Long lines editable *long-lines* +------------------- + +A single long line that doesn't fit in the window doesn't show a line of @@@ +anymore. Redrawing starts at a character further on in the line, such that +the text around the cursor can be seen. This makes it possible to edit these +long lines when wrapping is on. + + +File browser added *file-browser-5.2* +------------------ + +The Win32, Athena and Motif GUI bring up a file requester if the user asks to +":browse" for the ":e", ":w", ":r", ":so", ":redirect" and +":mkexrc/vimrc/vsess" commands. ::browse e /foo/bar" opens the requester in +the /foo/bar directory, so you can have nice mapping rhs's like ":browse so +$vim/macros". If no initial dir specified for ":browse e", can be compiled to +either begin in the current directory, or that of the current buffer. (Negri +and Kahn) +Added the 'browsedir' option, with value "current", "last" or "buffer". Tells +whether a browse dialog starts in last used dir, dir of current buffer, or +current dir. ":browse w" is unaffected. +The default menus have been changed to use the ":browse" command. + + +Dialogs added *dialogs-added* +------------- + +Added the ":confirm" command. Works on ":e", ":q", ":w", ":cl". Win32, +Athena and Motif GUI uses a window-dialog. All other platforms can use +prompt in command-line. ":confirm qa" offers a choice to save all modified +files. + +confirm() function: allows user access to the confirm engine. + +Added 'v' flag to 'guioptions'. When included, a vertical button layout is +always used for the Win32 GUI dialog. Otherwise, a horizontal layout is +preferred. + +Win32 GUI: ":promptfind" and ":promptrepl" pop up a dialog to find/replace. +To be used from a menu entry. (Negri) + + +Popup menu added *popup-menu-added* +---------------- + +When the 'mousemodel' option is set to "popup", the right mouse button +displays the top level menu headed with "PopUp" as pop-up context menu. The +"PopUp" menu is not displayed in the normal menu bar. This currently only +works for Win32 and Athena GUI. + + +Select mode added *new-Select-mode* +----------------- + +A new mode has been added: "Select mode". It is like Visual mode, but typing +a printable character replaces the selection. +- CTRL-G can be used to toggle between Visual mode and Select mode. +- CTRL-O can be used to switch from Select mode to Visual mode for one command. +- Added 'selectmode' option: tells when to start Select mode instead of Visual + mode. +- Added 'mousemodel' option: Change use of mouse buttons. +- Added 'keymodel' option: tells to use shifted special keys to start a + Visual or Select mode selection. +- Added ":behave". Can be used to quickly set 'selectmode', 'mousemodel' + and 'keymodel' for MS-Windows and xterm behavior. +- The xterm-like selection is now called modeless selection. +- Visual mode mappings and menus are used in Select mode. They automatically + switch to Visual mode first. Afterwards, reselect the area, unless it was + deleted. The "gV" command can be used in a mapping to skip the reselection. +- Added the "gh", "gH" and "g^H" commands: start Select (highlight) mode. +- Backspace in Select mode deletes the selected area. + +"mswin.vim" script. Sets behavior mostly like MS-Windows. + + +Session files added *new-session-files* +------------------- + +":mks[ession]" acts like "mkvimrc", but also writes the full filenames of the +currently loaded buffers and current directory, so that :so'ing the file +re-loads those files and cd's to that directory. Also stores and restores +windows. File names are made relative to session file. +The 'sessionoptions' option sets behavior of ":mksession". (Negri) + + +User defined functions and commands *new-user-defined* +----------------------------------- + +Added user defined functions. Defined with ":function" until ":endfunction". +Called with "Func()". Allows the use of a variable number of arguments. +Included support for local variables "l:name". Return a value with ":return". +See |:function|. +Call a function with ":call". When using a range, the function is called for +each line in the range. |:call| +"macros/justify.vim" is an example of using user defined functions. +User functions do not change the last used search pattern or the command to be +redone with ".". +'maxfuncdepth' option. Restricts the depth of function calls. Avoids trouble +(crash because of out-of-memory) when a function uses endless recursion. + +User definable Ex commands: ":command", ":delcommand" and ":comclear". +(Moore) See |user-commands|. + + +New interfaces *interfaces-5.2* +-------------- + +Tcl interface. (Wilken) See |tcl|. +Uses the ":tcl", ":tcldo" and "tclfile" commands. + +Cscope support. (Kahn) (Sekera) See |cscope|. +Uses the ":cscope" and ":cstag" commands. Uses the options 'cscopeprg', +'cscopetag', 'cscopetagorder' and 'cscopeverbose'. + + +New ports *ports-5.2* +--------- + +Amiga GUI port. (Nielsen) Not tested much yet! + +RISC OS version. (Thomas Leonard) See |riscos|. +This version can run either with a GUI or in text mode, depending upon where +it is invoked. +Deleted the "os_archie" files, they were not working anyway. + + +Multi-byte support *new-multi-byte* +------------------ + +MultiByte support for Win32 GUI. (Baek) +The 'fileencoding' option decides how the text in the file is encoded. +":ascii" works for multi-byte characters. Multi-byte characters work on +Windows 95, even when using the US version. (Aaron) +Needs to be enabled in feature.h. +This has not been tested much yet! + + +New functions *new-functions-5.2* +------------- + +|browse()| puts up a file requester when available. (Negri) +|escape()| escapes characters in a string with a backslash. +|fnamemodify()| modifies a file name. +|input()| asks the user to enter a line. (Aaron) There is a separate + history for lines typed for the input() function. +|argc()| +|argv()| can be used to access the argument list. +|winbufnr()| buffer number of a window. (Aaron) +|winnr()| window number. (Aaron) +|matchstr()| Return matched string. +|setline()| Set a line to a string value. + + +New options *new-options-5.2* +----------- + +'allowrevins' Enable the CTRL-_ command in Insert and Command-line mode. +'browsedir' Tells in which directory a browse dialog starts. +'confirm' when set, :q :w and :e commands always act as if ":confirm" + is used. (Negri) +'cscopeprg' +'cscopetag' +'cscopetagorder' +'cscopeverbose' Set the |cscope| behavior. +'filetype' RISC-OS specific type of file. +'grepformat' +'grepprg' For the |:grep| command. +'keymodel' Tells to use shifted special keys to start a Visual or Select + mode selection. +'listchars' Set character to show in 'list' mode for end-of-line, tabs and + trailing spaces. (partly by Smith) Also sets character to + display if a line doesn't fit when 'nowrap' is set. +'matchpairs' Allows matching '<' with '>', and other single character + pairs. +'mousefocus' Window focus follows mouse (partly by Terhaar). Changing the + focus with a keyboard command moves the pointer to that + window. Also move the pointer when changing the window layout + (split window, change window height, etc.). +'mousemodel' Change use of mouse buttons. +'selection' When set to "inclusive" or "exclusive", the cursor can go one + character past the end of the line in Visual or Select mode. + When set to "old" the old behavior is used. When + "inclusive", the character under the cursor is included in the + operation. When using "exclusive", the new "ve" entry of + 'guicursor' is used. The default is a vertical bar. +'selectmode' Tells when to start Select mode instead of Visual mode. +'sessionoptions' Sets behavior of ":mksession". (Negri) +'showfulltag' When completing a tag in Insert mode, show the tag search + pattern (tidied up) as a choice as well (if there is one). +'swapfile' Whether to use a swap file for a buffer. +'syntax' When it is set, the syntax by that name is loaded. Allows for + setting a specific syntax from a modeline. +'ttymouse' Allows using xterm mouse codes for terminals which name + doesn't start with "xterm". +'wildignore' List of patterns for files that should not be completed at + all. +'wildmode' Can be used to set the type of expansion for 'wildchar'. + Replaces the CTRL-T command for command line completion. + Don't beep when listing all matches. +'winaltkeys' Win32 and Motif GUI. When "yes", ALT keys are handled + entirely by the window system. When "no", ALT keys are never + used by the window system. When "menu" it depends on whether + a key is a menu shortcut. +'winminheight' Minimal height for each window. Default is 1. Set to 0 if + you want zero-line windows. Scrollbar is removed for + zero-height windows. (Negri) + + + +New Ex commands *new-ex-commands-5.2* +--------------- + +|:badd| Add file name to buffer list without side effects. (Negri) +|:behave| Quickly set MS-Windows or xterm behavior. +|:browse| Use file selection dialog. +|:call| Call a function, optionally with a range. +|:cnewer| +|:colder| To access a stack of quickfix error lists. +|:comclear| Clear all user-defined commands. +|:command| Define a user command. +|:continue| Go back to ":while". +|:confirm| Ask confirmation if something unexpected happens. +|:cscope| Execute cscope command. +|:cstag| Use cscope to jump to a tag. +|:delcommand| Delete a user-defined command. +|:delfunction| Delete a user-defined function. +|:endfunction| End of user-defined function. +|:function| Define a user function. +|:grep| Works similar to ":make". (Negri) +|:mksession| Create a session file. +|:nohlsearch| Stop 'hlsearch' highlighting for a moment. +|:Print| This is Vi compatible. Does the same as ":print". +|:promptfind| Search dialog (Win32 GUI). +|:promptrepl| Search/replace dialog (Win32 GUI). +|:return| Return from a user-defined function. +|:simalt| Win32 GUI: Simulate alt-key pressed. (Negri) +|:smagic| Like ":substitute", but always use 'magic'. +|:snomagic| Like ":substitute", but always use 'nomagic'. +|:tcl| Execute TCL command. +|:tcldo| Execute TCL command for a range of lines. +|:tclfile| Execute a TCL script file. +|:tearoff| Tear-off a menu (Win32 GUI). +|:tmenu| +|:tunmenu| Win32 GUI: menu tooltips. (Negri) +|:star| :* Execute a register. + + +Changed *changed-5.2* +------- + +Renamed functions: + buffer_exists() -> bufexists() + buffer_name() -> bufname() + buffer_number() -> bufnr() + file_readable() -> filereadable() + highlight_exists() -> hlexists() + highlightID() -> hlID() + last_buffer_nr() -> bufnr("$") +The old ones are still there, for backwards compatibility. + +The CTRL-_ command in Insert and Command-line mode is only available when the +new 'allowrevins' option is set. Avoids that people who want to type SHIFT-_ +accidentally enter reverse Insert mode, and don't know how to get out. + +When a file name path in ":tselect" listing is too long, remove a part in the +middle and put "..." there. + +Win32 GUI: Made font selector appear inside Vim window, not just any odd +place. (Negri) + +":bn" skips help buffers, unless currently in a help buffer. (Negri) + +When there is a status line and only one window, don't show '^' in the status +line of the current window. + +":*" used to be used for "'<,'>", the Visual area. But in Vi it's used as an +alternative for ":@". When 'cpoptions' includes '*' this is Vi compatible. + +When 'insertmode' is set, using CTRL-O to execute a mapping will work like +'insertmode' was not set. This allows "normal" mappings to be used even when +'insertmode' is set. + +When 'mouse' was set already (e.g., in the .vimrc file), don't automatically +set 'mouse' when the GUI starts. + +Removed the 'N', 'I' and 'A' flags from the 'mouse' option. + +Renamed "toggle option" to "boolean option". Some people thought that ":set +xyz" would toggle 'xyz' on/off each time. + +The internal variable "shell_error" contains the error code from the shell, +instead of just 0 or 1. + +When inserting or replacing, typing CTRL-V CTRL-<CR> used to insert "<C-CR>". +That is not very useful. Now the CTRL key is ignored and a <CR> is inserted. +Same for all other "normal" keys with modifiers. Mapping these modified key +combinations is still possible. +In Insert mode, <C-CR> and <S-Space> can be inserted by using CTRL-K and then +the special character. + +Moved "quotes" file to doc/quotes.txt, and "todo" file to doc/todo.txt. They +are now installed like other documentation files. + +winheight() function returns -1 for a non-existing window. It used to be +zero, but that is a valid height now. + +The default for 'selection' is "inclusive", which makes a difference when +using "$" or the mouse to move the cursor in Visual mode. + +":q!" does not exit when there are changed buffers which are hidden. Use +":qa!" to exit anyway. + +Disabled the Perl/Python/Tcl interfaces by default. Not many people use them +and they make the executable a lot bigger. The internal scripting language is +now powerful enough for most tasks. + +The strings from the 'titlestring' and 'iconstring' options are used +untranslated for the Window title and icon. This allows for including a <CR>. +Previously a <CR> would be shown as "^M" (two characters). + +When a mapping is started in Visual or Select mode which was started from +Insert mode (the mode shows "(insert) Visual"), don't return to Insert mode +until the mapping has ended. Makes it possible to use a mapping in Visual +mode that also works when the Visual mode was started from Select mode. + +Menus in $VIMRUNTIME/menu.vim no longer overrule existing menus. This helps +when defining menus in the .vimrc file, or when sourcing mswin.vim. + +Unix: Use /var/tmp for .swp files, if it exists. Files there survive a +reboot (at least on Linux). + + +Added *added-5.2* +----- + +--with-motif-lib configure argument. Allows for using a static Motif library. + +Support for mapping numeric keypad +,-,*,/ keys. (Negri) +When not mapped, they produce the normal character. + +Win32 GUI: When directory dropped on Gvim, cd there and edit new buffer. +(Negri) + +Win32 GUI: Made CTRL-Break work as interrupt, so that CTRL-C can be +used for mappings. + +In the output of ":map", highlight the "*" to make clear it's not part of the +rhs. (Roemer) + +When showing the Visual area, the cursor is not switched off, so that it can +be located. The Visual area is now highlighted with a grey background in the +GUI. This makes the cursor visible when it's also reversed. + +Win32: When started with single full pathname (e.g. via double-clicked file), +cd to that file's directory. (Negri) + +Win32 GUI: Tear-off menus, with ":tearoff <menu-name>" command. (Negri) +'t' option to 'guioptions': Add tearoff menu items for Win32 GUI and Motif. +It's included by default. +Win32 GUI: tearoff menu with submenus is indicated with a ">>". (Negri) + +Added ^Kaa and ^KAA digraphs. +Added "euro" symbol to digraph.c. (Corry) + +Support for Motif menu shortcut keys, using '&' like MS-Windows (Ollis). +Other GUIs ignore '&' in a menu name. + +DJGPP: Faster screen updating (John Lange). + +Clustering of syntax groups ":syntax cluster" (Bigham). +Including syntax files: ":syntax include" (Bigham). + +Keep column when switching buffers, when 'nosol' is set (Radics). + +Number function for Perl interface. + +Support for Intellimouse in Athena GUI. (Jensen) + +":sleep" also accepts an argument in milliseconds, when "m" is used. + +Added 'p' flag in 'guioptions': Install callbacks for enter/leave window +events. Makes cursor blinking work for Terhaar, breaks it for me. + +"--help" and "--version" command-line arguments. + +Non-text in ":list" output is highlighted with NonText. + +Added text objects: "i(" and "i)" as synonym for "ib". "i{" and "i}" as +synonym for "iB". New: "i<" and "i>", to select <thing>. All this also for +"a" objects. + +'O' flag in 'shortmess': message for reading a file overwrites any previous +message. (Negri) + +Win32 GUI: 'T' flag in 'guioptions': switch toolbar on/off. +Included a list with self-made toolbar bitmaps. (Negri) + +Added menu priority for sub-menus. Implemented for Win32 and Motif GUI. +Display menu priority with ":menu" command. +Default and Syntax menus now include priority for items. Allows inserting +menu items in between the default ones. + +When the 'number' option is on, highlight line numbers with the LineNr group. + +"Ignore" highlight group: Text highlighted with this is made blank. It is +used to hide special characters in the help text. + +Included Exuberant Ctags version 2.3, with C++ support, Java support and +recurse into directories. (Hiebert) + +When a tags file is not sorted, and this is detected (in a simplistic way), an +error message is given. + +":unlet" accepts a "!", to ignore non-existing variables, and accepts more +than one argument. (Roemer) +Completion of variable names for ":unlet". (Roemer) + +When there is an error in a function which is called by another function, show +the call stack in the error message. + +New file name modifiers: +":.": reduce file name to be relative to current dir. +":~": reduce file name to be relative to home dir. +":s?pat?sub?": substitute "pat" with "sub" once. +":gs?pat?sub?": substitute "pat" with "sub" globally. + +New configure arguments: --enable-min-features and --enable-max-features. +Easy way to switch to minimum or maximum features. + +New compile-time feature: modify_fname. For file name modifiers, e.g, +"%:p:h". Can be disabled to save some code (16 bit DOS). + +When using whole-line completion in Insert mode, and 'cindent' is set, indent +the line properly. + +MSDOS and Win32 console: 'guicursor' sets cursor thickness. (Negri) + +Included new set of Farsi fonts. (Shiran) + +Accelerator text now also works in Motif. All menus can be defined with & for +mnemonic and TAB for accelerator text. They are ignored on systems that don't +support them. +When removing or replacing a menu, compare the menu name only up to the <Tab> +before the mnemonic. + +'i' and 'I' flags after ":substitute": ignore case or not. + +"make install" complains if the runtime files are missing. + +Unix: When finding an existing swap file that can't be opened, mention the +owner of the file in the ATTENTION message. + +The 'i', 't' and 'k' options in 'complete' now also print the place where they +are looking for matches. (Acevedo) + +"gJ" command: Join lines without inserting a space. + +Setting 'keywordprg' to "man -s" is handled specifically. The "-s" is removed +when no count given, the count is added otherwise. Configure checks if "man +-s 2 read" works, and sets the default for 'keywordprg' accordingly. + +If you do a ":bd" and there is only one window open, Vim tries to move to a +buffer of the same type (i.e. non-help to non-help, help to help), for +consistent behavior to :bnext/:bprev. (Negri) + +Allow "<Nop>" to be used as the rhs of a mapping. ":map xx <Nop>", maps "xx" +to nothing at all. + +In a ":menu" command, "<Tab>" can be used instead of a real tab, in the menu +path. This makes it more easy to type, no backslash needed. + +POSIX compatible character classes for regexp patterns: [:alnum:], [:alpha:], +[:blank:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:], +[:space:], [:upper:] and [:xdigit:]. (Briscoe) + +regexp character classes (for fast syntax highlight matching): + digits: \d [0-9] \D not digit (Roemer) + hex: \x [0-9a-fA-F] \X not hex + octal: \o [0-7] \O not octal + word: \w [a-zA-Z0-9_] \W not word + head: \h [a-zA-Z_] \H not head + alphabetic: \a [a-zA-Z] \A not alphabetic + lowercase: \l [a-z] \L not lowercase + uppercase: \u [A-Z] \U not uppercase + +":set" now accepts "+=", |^=" and "-=": add or remove parts of a string +option, add or subtract a number from a number option. A comma is +automagically inserted or deleted for options that are a comma separated list. + +Filetype feature, for autocommands. Uses a file type instead of a pattern to +match a file. Currently only used for RISC OS. (Leonard) + +In a pattern for an autocommand, environment variables can be used. They are +expanded when the autocommand is defined. + +"BufFilePre" and "BufFilePost" autocommand evens: Before and after applying +the ":file" command to change the name of a buffer. +"VimLeavePre" autocommand event: before writing the .viminfo file. + +For autocommands argument: <abuf> is buffer number, like <afile>. + +Made syntax highlighting a bit faster when scrolling backwards, by keeping +more syncing context. + +Win32 GUI: Made scrolling faster by avoiding a redraw when deleting or +inserting screen lines. + +GUI: Made scrolling faster by not redrawing the scrollbar when the thumb moved +less than a pixel. + +Included ":highlight" in bugreport.vim. + +Created install.exe program, for simplistic installation on DOS and +MS-Windows. + +New register: '_', the black hole. When writing to it, nothing happens. When +reading from it, it's always empty. Can be used to avoid a delete or change +command to modify the registers, or reduce memory use for big changes. + +CTRL-V xff enters character by hex number. CTRL-V o123 enters character by +octal number. (Aaron) + +Improved performance of syntax highlighting by skipping check for "keepend" +when there isn't any. + +Moved the mode message ("-- INSERT --") to the last line of the screen. When +'cmdheight' is more than one, messages will remain readable. + +When listing matching files, they are also sorted on 'suffixes', such that +they are listed in the same order as CTRL-N retrieves them. + +synIDattr() takes a third argument (optionally), which tells for which +terminal type to get the attributes for. This makes it possible to run +2html.vim outside of gvim (using color names instead of #RRGGBB). + +Memory profiling, only for debugging. Prints at exit, and with "g^A" command. +(Kahn) + +DOS: When using a file in the current drive, remove the drive name: +"A:\dir\file" -> "\dir\file". This helps when moving a session file on a +floppy from "A:\dir" to "B:\dir". + +Increased number of remembered jumps from 30 to 50 per window. + +Command to temporarily disable 'hls' highlighting until the next search: +":nohlsearch". + +"gp" and "gP" commands: like "p" and "P", but leave the cursor just after the +inserted text. Used for the CTRL-V command in MS-Windows mode. + + +Fixed *fixed-5.2* +----- + +Win32 GUI: Could draw text twice in one place, for fake-bold text. Removed +this, Windows will handle the bold text anyway. (Negri) + +patch 5.1.1: Win32s GUI: pasting caused a crash (Negri) + +patch 5.1.2: When entering another window, where characters before the cursor +have been deleted, could have a cursor beyond the end of the line. + +patch 5.1.3: Win32s GUI: Didn't wait for external command to finish. (Negri) + +patch 5.1.4: Makefile.w32 can now also be used to generate the OLE version +(Scott). + +patch 5.1.5: Crashed when using syntax highlighting: cursor on a line that +doesn't fit in the window, and splitting that line in two. + +patch 5.1.6: Visual highlighting bug: After ":set nowrap", go to end of line +(so that the window scrolls horizontally), ":set wrap". Following Visual +selection was wrong. + +patch 5.1.7: When 'tagbsearch' off, and 'ignorecase' off, still could do +binary searching. + +patch 5.1.8: Win32 GUI: dragging the scrollbar didn't update the ruler. + +patch 5.1.9: Using ":gui" in .vimrc, caused xterm cursor to disappear. + +patch 5.1.10: A CTRL-N in Insert mode could cause a crash, when a buffer +without a name exists. + +patch 5.1.11: "make test" didn't work in the shadow directory. Also adjusted +"make shadow" for the links in the ctags directory. + +patch 5.1.12: "buf 123foo" used "123" as a count, instead as the start of a +buffer name. + +patch 5.1.13: When completing file names on the command-line, reallocating the +command-line may go wrong. + +patch 5.1.14: ":[nvci]unmenu" removed menu for all modes, when full menu patch +specified. + +Graceful handling of NULLs in drag-dropped file list. Handle passing NULL to +Fullname_save(). (Negri) + +Win32: ":!start" to invoke a program without opening a console, swapping +screens, or waiting for completion in either console or gui version, e.g. you +can type ":!start winfile". ALSO fixes "can't delete swapfile after spawning +a shell" bug. (enhancement of Aaron patch) (Negri) + +Win32 GUI: Fix CTRL-X default keymapping to be more Windows-like. (Negri) + +Shorten filenames on startup. If in /foo/bar, entering "vim ../bar/bang.c" +displays "bang.c" in status bar, not "/foo/bar/bang.c" (Negri) + +Win32 GUI: No copy to Windows clipboard when it's not desired. + +Win32s: Fix pasting from clipboard - made an assumption not valid under +Win32s. (Negri) + +Win32 GUI: Speed up calls to gui_mch_draw_string() and cursor drawing +functions. (Negri) + +Win32 GUI: Middle mouse button emulation now works in GUI! (Negri) + +Could skip messages when combining commands in one line, e.g.: +":echo "hello" | write". + +Perl interpreter was disabled before executing VimLeave autocommands. Could +not use ":perl" in them. (Aaron) + +Included patch for the Intellimouse (Aaron/Robinson). + +Could not set 'ls' to one, when last window has only one line. (Mitterand) + +Fixed a memory leak when removing menus. + +After ":only" the ruler could overwrite a message. + +Dos32: removed changing of __system_flags. It appears to work better when +it's left at the default value. + +p_aleph was an int instead of along, caused trouble on systems where +sizeof(int) != sizeof(long). (Schmidt) + +Fixed enum problems for Ultrix. (Seibert) + +Small redraw problem: "dd" on last line in file cleared wrong line. + +Didn't interpret "cmd | endif" when "cmd" starts with a range. E.g. "if 0 | +.d | endif". + +Command "+|" on the last line of the file caused ml_get errors. + +Memory underrun in eval_vars(). (Aaron) + +Don't rename files in a difficult way, except on Windows 95 (was also done on +Windows NT). + +Win32 GUI: An external command that produces an error code put the error +message in a dialog box. had to close the window and close the dialog. Now +the error code is displayed in the console. (Negri) + +"comctl32.lib" was missing from the GUI libraries in Makefile.w32. (Battle) + +In Insert mode, when entering a window in Insert mode, allow the cursor to be +one char beyond the text. + +Renamed machine dependent rename() to mch_rename(). Define mch_rename() to +rename() when it works properly. + +Rename vim_chdir() to mch_chdir(), because it's machine dependent. + +When using an arglist, and editing file 5 of 4, ":q" could cause "-1 more +files to edit" error. + +In if_python.c, VimCommand() caused an assertion when a do_cmdline() failed. +Moved the Python_Release_Vim() to before the VimErrorCheck(). (Harkins) + +Give an error message for an unknown argument after "--". E.g. for "vim +--xyz". + +The FileChangedShell autocommand didn't set <afile> to the name of the changed +file. + +When doing ":e file", causing the attention message, there sometimes was no +hit-enter prompt. Caused by empty line or "endif" at end of sourced file. + +A large number of patches for the VMS version. (Hunsaker) + +When CTRL-L completion (find longest match) results in a shorter string, no +completion is done (happens with ":help"). + +Crash in Win32 GUI version, when using an Ex "@" command, because +LinePointers[] was used while not initialized. + +Win32 GUI: allow mapping of Alt-Space. + +Output from "vim -h" was sent to stderr. Sending it to stdout is better, so +one can use "vim -h | more". + +In command-line mode, ":vi[!]" should reload the file, just like ":e[!]". +In Ex mode, ":vi" stops Ex mode, but doesn't reload the file. This is Vi +compatible. + +When using a ":set ls=1" in the .gvimrc file, would get a status line for a +single window. (Robinson) + +Didn't give an error message for ":set ai,xx". (Roemer) +Didn't give an error message for ":set ai?xx", ":set ai&xx", ":set ai!xx". + +Non-Unix systems: That a file exists but is unreadable is recognized as "new +file". Now check for existence when file can't be opened (like Unix). + +Unix: osdef.sh didn't handle declarations where the function name is at the +first column of the line. + +DJGPP: Shortening of file names didn't work properly, because get_cwd() +returned a path with backslashes. (Negri) + +When using a 'comments' part where a space is required after the middle part, +always insert a space when starting a new line. Helps for C comments, below a +line with "/****". + +Replacing path of home directory with "~/" could be wrong for file names +with embedded spaces or commas. + +A few fixes for the Sniff interface. (Leherbauer) + +When asking to hit 'y' or 'n' (e.g. for ":3,1d"), using the mouse caused +trouble. Same for ":s/x/y/c" prompt. + +With 'nowrap' and 'list', a Tab halfway on the screen was displayed as blanks, +instead of the characters specified with 'listchars'. Also for other +characters that take more than one screen character. + +When setting 'guifont' to an unknown font name, the previous font was lost and +a default font would be used. (Steed) + +DOS: Filenames in the root directory didn't get shortened properly. (Negri) + +DJGPP: making a full path name out of a file name didn't work properly when +there is no _fullpath() function. (Negri) + +Win32 console: ":sh" caused a crash. (Negri) + +Win32 console: Setting 'lines' and/or 'columns' in the _vimrc failed miserably +(could hang Windows 95). (Negri) + +Win32: The change-drive function was not correct, went to the wrong drive. +(Tsindlekht) + +GUI: When editing a command line in Ex mode, Tabs were sometimes not +backspaced properly, and unprintable characters were displayed directly. +non-GUI can still be wrong, because a system function is called for this. + +":set" didn't stop after an error. For example ":set no ai" gave an error for +"no", but still set "ai". Now ":set" stops after the first error. + +When running configure for ctags, $LDFLAGS wasn't passed to it, causing +trouble for IRIX. + +"@%" and "@#" when file name not set gave an error message. Now they just +return an empty string. (Steed) + +CTRL-X and CTRL-A didn't work correctly with negative hex and octal numbers. +(Steed) + +":echo" always started with a blank. + +Updating GUI cursor shape didn't always work (e.g., when blinking is off). + +In silent Ex mode ("ex -s" or "ex <file") ":s///p" didn't print a line. Also +a few other commands that explicitly print a text line didn't work. Made this +Vi compatible. + +Win32 version of _chdrive() didn't return correct value. (Tsindlekht) + +When using 't' in 'complete' option, no longer give an error message for a +missing tags file. + +Unix: tgoto() can return NULL, which was not handled correctly in configure. + +When doing ":help" from a buffer where 'binary' is set, also edited the help +file in binary mode. Caused extra ^Ms for DOS systems. + +Cursor position in a file was reset to 1 when closing a window. + +":!ls" in Ex mode switched off echo. + +When doing a double click in window A, while currently in window B, first +click would reset double click time, had to click three times to select a +word. + +When using <F11> in mappings, ":mkexrc" produced an exrc file that can't be +used in Vi compatible mode. Added setting of 'cpo' to avoid this. Also, add +a CTRL-V in front of a '<', to avoid a normal string to be interpreted as a +special key name. + +Gave confusing error message for ":set guifont=-*-lucida-*": first "font is +not fixed width", then "Unknown font". + +Some options were still completely left out, instead of included as hidden +options. + +While running the X11 GUI, ignore SIGHUP signals. Avoids a crash after +executing an external command (in rare cases). + +In os_unixx.h, signal() was defined to sigset(), while it already was. + +Memory leak when executing autocommands (was reported as a memory leak in +syntax highlighting). + +Didn't print source of error sometimes, because pointers were the same, +although names were different. + +Avoid a number of UMR errors from Purify (third argument to open()). + +A swap file could still be created just after setting 'updatecount' to zero, +when there is an empty buffer and doing ":e file". (Kutschera) + +Test 35 failed on 64 bit machines. (Schild) + +With "p" and "P" commands, redrawing was slow. + +Awk script for html documentation didn't work correctly with AIX awk. +Replaced "[ ,.);\] ]" with "[] ,.); ]". (Briscoe) +The makehtml.awk script had a small problem, causing extra lines to be +inserted. (Briscoe) + +"gqgq" could not be repeated. Repeating for "gugu" and "gUgU" worked in a +wrong way. Also made "gqq" work to be consistent with "guu". + +C indent was wrong after "case ':':". + +":au BufReadPre *.c put": Line from put text was deleted, because the buffer +was still assumed to be empty. + +Text pasted with the Edit/Paste menu was subject to 'textwidth' and +'autoindent'. That was inconsistent with using the mouse to paste. Now "*p +is used. + +When using CTRL-W CTRL-] on a word that's not a tag, and then CTRL-] on a tag, +window was split. + +":ts" got stuck on a tags line that has two extra fields. + +In Insert mode, with 'showmode' on, <C-O><C-G> message was directly +overwritten by mode message, if preceded with search command warning message. + +When putting the result of an expression with "=<expr>p, newlines were +inserted like ^@ (NUL in the file). Now the string is split up in lines at +the newline. + +putenv() was declared with "const char *" in pty.c, but with "char *" in +osdef2.h.in. Made the last one also "const char *". + +":help {word}", where +{word} is a feature, jumped to the feature list instead +of where the command was explained. E.g., ":help browse", ":help autocmd". + +Using the "\<xx>" form in an expression only got one byte, even when using a +special character that uses several bytes (e.g., "\<F9>"). +Changed "\<BS>" to produce CTRL-H instead of the special key code for the +backspace key. "\<Del>" produces 0x7f. + +":mkvimrc" didn't write a command to set 'compatible' or 'nocompatible'. + +The shell syntax didn't contain a "syn sync maxlines" setting. In a long file +without recognizable items, syncing took so long it looked like Vim hangs. +Added a maxlines setting, and made syncing interruptable. + +The "gs" command didn't flush output before waiting. + +Memory leaks for: + ":if 0 | let a = b . c | endif" + "let a = b[c]" + ":so {file}" where {file} contains a ":while" + +GUI: allocated fonts were never released. (Leonard) + +Makefile.bor: +- Changed $(DEFINES) into a list of "-D" options, so that it can also be used + for the resource compiler. (not tested!) +- "bcc.cfg" was used for all configurations. When building for another + configuration, the settings for the previous one would be used. Moved + "bcc.cfg" to the object directory. (Geddes) +- Included targets for vimrun, install, ctags and xxd. Changed the default to + use the Borland DLL Runtime Library, makes Vim.exe a log smaller. (Aaron) + +"2*" search for the word under the cursor with "2" prepended. (Leonard) + +When deleting into a specific register, would still overwrite the non-Win32 +GUI selection. Now ""x"*P works. + +When deleting into the "" register, would write to the last used register. +Now ""x always writes to the unnamed register. + +GUI Athena: A submenu with a '.' in it didn't work. E.g., +":amenu Syntax.XY\.Z.foo lll". + +When first doing ":tag foo" and then ":tnext" and/or ":tselect" the order of +matching tags could change, because the current file is different. Now the +existing matches are kept in the same order, newly found matches are added +after them, not matter what the current file is. + +":ta" didn't find the second entry in a tags file, if the second entry was +longer than the first one. + +When using ":set si tw=7" inserting "foo {^P}" made the "}" inserted at the +wrong position. can_si was still TRUE when the cursor is not in the indent of +the line. + +Running an external command in Win32 version had the problem that Vim exits +when the X on the console is hit (and confirmed). Now use the "vimrun" +command to start the external command indirectly. (Negri) + +Win32 GUI: When running an external filter, do it in a minimized DOS box. +(Negri) + +":let" listed variables without translation into printable characters. + +Win32 console: When resizing the window, switching back to the old size +(when exiting or executing an external command) sometimes failed. (Negri) +This appears to also fix a "non fixable" problem: +Win32 console in NT 4.0: When running Vim in a cmd window with a scrollbar, +the scrollbar disappeared and was not restored when Vim exits. This does work +under NT 3.51, it appears not to be a Vim problem. + +When executing BufDelete and BufUnload autocommands for a buffer without a +name, the name of the current buffer was used for <afile>. + +When jumping to a tag it reported "tag 1 of >2", while in fact there could be +only two matches. Changed to "tag 1 of 2 or more". + +":tjump tag" did a linear search in the tags file, which can be slow. + +Configure didn't find "LibXm.so.2.0", a Xm library with a version number. + +Win32 GUI: When using a shifted key with ALT, the shift modifier would remain +set, even when it was already used by changing the used key. E.g., "<M-S-9>" +resulted in "<M-S-(>", but it should be "<M-(>". (Negri) + +A call to ga_init() was often followed by setting growsize and itemsize. +Created ga_init2() for this, which looks better. (Aaron) + +Function filereadable() could call fopen() with an empty string, which might +be illegal. + +X Windows GUI: When executing an external command that outputs text, could +write one character beyond the end of a buffer, which caused a crash. (Kohan) + +When using "*" or "#" on a string that includes '/' or '?' (when these are +included in 'isk'), they were not escaped. (Parmelan) + +When adding a ToolBar menu in the Motif GUI, the submenu_id field was not +cleared, causing random problems. + +When adding a menu, the check if this menu (or submenu) name already exists +didn't compare with the simplified version (no mnemonic or accelerator) of the +new menu. Could get two menus with the same name, e.g., "File" and "&File". + +Breaking a line because of 'textwidth' at the last line in the window caused a +redraw of the whole window instead of a scroll. Speeds up normal typing with +'textwidth' a lot for slow terminals. + +An invalid line number produced an "invalid range" error, even when it wasn't +to be executed (inside "if 0"). + +When the unnamed, first buffer is re-used, the "BufDelete" autocommand was +not called. It would stick in a buffer list menu. + +When doing "%" on the NUL after the line, a "{" or "}" in the last character +of the line was not found. + +The Insert mode menu was not used for the "s" command, the Operator-pending +menu was used instead. + +With 'compatible' set, some syntax highlighting was not correct, because of +using "[\t]" for a search pattern. Now use the regexps for syntax +highlighting like the 'cpoptions' option is empty (as was documented already). + +When using "map <M-Space> ms" or "map <Space> sss" the output of ":map" didn't +show any lhs for the mapping (if 'isprint' includes 160). Now always use +<Space> and <M-Space>, even when they are printable. + +Adjusted the Syntax menu, so that the lowest entry fits on a small screen (for +Athena, where menus don't wrap). + +When using CTRL-E or CTRL-Y in Insert mode for characters like 'o', 'x' and +digits, repeating the insert didn't work. + +The file "tools/ccfilter.README.txt" could not be unpacked when using short +file names, because of the two dots. Renamed it to +"tools/ccfilter_README.txt". + +For a dark 'background', using Blue for Directory and SpecialKey highlight +groups is not very readable. Use Cyan instead. + +In the function uc_scan_attr() in ex_docmd.c there was a goto that jumped into +a block with a local variable. That's illegal for some compilers. + +Win32 GUI: There was a row of pixels at the bottom of the window which was not +drawn. (Aaron) + +Under DOS, editing "filename/" created a swap file of "filename/.swp". Should +be "filename/_swp". + +Win32 GUI: pointer was hidden when executing an external command. + +When 'so' is 999, "J" near the end of the file didn't redisplay correctly. + +":0a" inserted after the first line, instead of before the first line. + +Unix: Wildcard expansion didn't handle single quotes and {} patterns. Now +":file 'window.c'" removes the quotes and ":e 'main*.c'" works (literal '*'). +":file {o}{n}{e}" now results in file name "one". + +Memory leak when setting a string option back to its default value. + +============================================================================== +VERSION 5.3 *version-5.3* + +Version 5.3 was a bug-fix version of 5.2. There are not many changes. +Improvements made between version 5.2 and 5.3: + +Changed *changed-5.3* +------- + +Renamed "IDE" menu to "Tools" menu. + + +Added *added-5.3* +----- + +Win32 GUI: Give a warning when Vim is activated, and one of the files changed +since editing started. (Negri) + + +Fixed *fixed-5.3* +----- + +5.2.1: Win32 GUI: space for external command was not properly allocated, could +cause a crash. (Aaron) This was the reason to bring out 5.3 quickly after +5.2. + +5.2.2: Some commands didn't complain when used without an argument, although +they need one: ":badd", ":browse", ":call", ":confirm", ":behave", +":delfunction", ":delcommand" and ":tearoff". +":endfunction" outside of a function gave wrong error message: "Command not +implemented". Should be ":endfunction not inside a function". + +5.2.3: Win32 GUI: When gvim was installed in "Program files", or another path +with a space in it, executing external commands with vimrun didn't work. + +5.2.4: Pasting with the mouse in Insert mode left the cursor on the last +pasted character, instead of behind it. + +5.2.5: In Insert mode, cursor after the end of the line, a shift-cursor-left +didn't include the last character in the selection. + +5.2.6: When deleting text from Insert mode (with "<C-O>D" or the mouse), which +includes the last character in the line, the cursor could be left on the last +character in the line, instead of just after it. + +5.2.7: Win32 GUI: scrollbar was one pixel too big. + +5.2.8: Completion of "PopUp" menu showed the derivates "PopUpc", "PopUPi", +etc. ":menu" also showed these. + +5.2.9: When using two input() functions on a row, the prompt would not be +drawn in column 0. + +5.2.10: A loop with input() could not be broken with CTRL-C. + +5.2.11: ":call asdf" and ":call asdf(" didn't give an error message. + +5.2.12: Recursively using ":normal" crashes Vim after a while. E.g.: +":map gq :normal gq<CR>" + +5.2.13: Syntax highlighting used 'iskeyword' from wrong buffer. When using +":help", then "/\k*" in another window with 'hlsearch' set. + +5.2.14: When using ":source" from a function, global variables would not be +available unless "g:" was used. + +5.2.15: XPM files can have the extension ".pm", which is the same as for Perl +modules. Added "syntax/pmfile.vim" to handle this. + +5.2.16: On Win32 and Amiga, "echo expand("%:p:h")" removed one dirname in an +empty buffer. mch_Fullname() didn't append a slash at the end of a directory +name. + +Should include the character under the cursor in the Visual area when using +'selection' "exclusive". This wasn't done for "%", "e", "E", "t" and "f". + +""p would always put register 0, instead of the unnamed (last used) register. +Reverse the change that ""x doesn't write in the unnamed (last used) register. +It would always write in register 0, which isn't very useful. Use "-x for the +paste mappings in Visual mode. + +When there is one long line on the screen, and 'showcmd' is off, "0$" didn't +redraw the screen. + +Win32 GUI: When using 'mousehide', the pointer would flicker when the cursor +shape is changed. (Negri) + +When cancelling Visual mode, and the cursor moves to the start, the wanted +column wasn't set, "k" or "j" moved to the wrong column. + +When using ":browse" or ":confirm", was checking for a comment and separating +bar, which can break some commands. + +Included fixes for Macintosh. (Kielhorn) + +============================================================================== +VERSION 5.4 *version-5.4* + +Version 5.4 adds new features, useful changes and a lot of bug fixes. + + +Runtime directory introduced *new-runtime-dir* +---------------------------- + +The distributed runtime files are now in $VIMRUNTIME, the user files in $VIM. +You normally don't set $VIMRUNTIME but let Vim find it, by using +$VIM/vim{version}, or use $VIM when that doesn't exist. This allows for +separating the user files from the distributed files and makes it more easy to +upgrade to another version. It also makes it possible to keep two versions of +Vim around, each with their own runtime files. + +In the Unix distribution the runtime files have been moved to the "runtime" +directory. This makes it possible to copy all the runtime files at once, +without the need to know what needs to be copied. + +The archives for DOS, Windows, Amiga and OS/2 now have an extra top-level +"vim" directory. This is to make clear that user-modified files should be put +here. The directory that contains the executables doesn't have '-' or '.' +characters. This avoids strange extensions. + +The $VIM and $VIMRUNTIME variables are set when they are first used. This +allows them to be used by Perl, for example. + +The runtime files are also found in a directory called "$VIM/runtime". This +helps when running Vim after just unpacking the runtime archive. When using +an executable in the "src" directory, Vim checks if "vim54" or "runtime" can +be added after removing it. This make the runtime files be found just after +compiling. + +A default for $VIMRUNTIME can be given in the Unix Makefile. This is useful +if $VIM doesn't point to above the runtime directory but to e.g., "/etc/". + + +Filetype introduced *new-filetype-5.4* +------------------- + +Syntax files are now loaded with the new FileType autocommand. Old +"mysyntaxfile" files will no longer work. |filetypes| + +The scripts for loading syntax highlighting have been changed to use the +new Syntax autocommand event. + +This combination of Filetype and Syntax events allows tuning the syntax +highlighting a bit more, also when selected from the Syntax menu. The +FileType autocommand can also be used to set options and mappings specifically +for that type of file. + +The "$VIMRUNTIME/filetype.vim" file is not loaded automatically. The +":filetype on" command has been added for this. ":syntax on" also loads it. + +The 'filetype' option has been added. It is used to trigger the FileType +autocommand event, like the 'syntax' option does for the Syntax event. + +":set syntax=OFF" and ":set syntax=ON" can be used (in a modeline) to switch +syntax highlighting on/off for the current file. + +The Syntax menu commands have been moved to $VIMRUNTIME/menu.vim. The Syntax +menu is included both when ":filetype on" and when ":syntax manual" is used. + +Renamed the old 'filetype' option to 'osfiletype'. It was only used for +RISCOS. 'filetype' is now used for the common file type. + +Added the ":syntax manual" command. Allows manual selection of the syntax to +be used, e.g., from a modeline. + + +Vim script line continuation *new-line-continuation* +---------------------------- + +When an Ex line starts with a backslash, it is concatenated to the previous +line. This avoids the need for long lines. |line-continuation| (Roemer) +Example: > + if has("dialog_con") || + \ has("dialog_gui") + :let result = confirm("Enter your choice", + \ "&Yes\n&No\n&Maybe", + \ 2) + endif + + +Improved session files *improved-sessions* +---------------------- + +New words for 'sessionoptions': +- "help" Restore the help window. +- "blank" Restore empty windows. +- "winpos" Restore the Vim window position. Uses the new ":winpos" + command +- "buffers" Restore hidden and unloaded buffers. Without it only the + buffers in windows are restored. +- "slash" Replace backward by forward slashes in file names. +- "globals" Store global variables. +- "unix" Use unix file format (<NL> instead of <CR><NL>) + +The ":mksession" and 'sessionoptions' are now in the +mksession feature. + +The top line of the window is also restored when using a session file. + +":mksession" and ":mkvimrc" don't store 'fileformat', it should be detected +when loading a file. + +(Most of this was done by Vince Negri and Robert Webb) + + +Autocommands improved *improved-autocmds-5.4* +--------------------- + +New events: +|FileType| When the file type has been detected. +|FocusGained| When Vim got input focus. (Negri) +|FocusLost| When Vim lost input focus. (Negri) +|BufCreate| Called just after a new buffer has been created or has been + renamed. (Madsen) +|CursorHold| Triggered when no key has been typed for 'updatetime'. Can be + used to do something with the word under the cursor. (Negri) + Implemented CursorHold autocommand event for Unix. (Zellner) + Also for Amiga and MS-DOS. +|GUIEnter| Can be used to do something with the GUI window after it has + been created (e.g., a ":winpos 100 50"). +|BufHidden| When a buffer becomes hidden. Used to delete the + option-window when it becomes hidden. + +Also trigger |BufDelete| just before a buffer is going to be renamed. (Madsen) + +The "<amatch>" pattern can be used like "<afile>" for autocommands, except +that it is the matching value for the FileType and Syntax events. + +When ":let @/ = <string>" is used in an autocommand, this last search pattern +will be used after the autocommand finishes. + +Made loading autocommands a bit faster. Avoid doing strlen() on each exiting +pattern for each new pattern by remembering the length. + + +Encryption *new-encryption* +---------- + +Files can be encrypted when writing and decrypted when reading. Added the +'key' option, "-x" command line argument and ":X" command. |encryption| (based +on patch from Mohsin Ahmed) + +When reading a file, there is an automatic detection whether it has been +crypted. Vim will then prompt for the key. + +Note that the encryption method is not compatible with Vi. The encryption is +not unbreakable. This allows it to be exported from the US. + + +GTK GUI port *new-GTK-GUI* +------------ + +New GUI port for GTK+. Includes a toolbar, menu tearoffs, etc. |gui-gtk| +Added the |:helpfind| command. (Kahn and Dalecki) + + +Menu changes *menu-changes-5.4* +------------ + +Menus can now also be used in the console. It is enabled by the new +'wildmenu' option. This shows matches for command-line completion like a +menu. This works as a minimal file browser. + +The new |:emenu| command can be used to execute a menu item. + +Uses the last status line to list items, or inserts a line just above the +command line. (Negri) + +The 'wildcharx' option can be used to trigger 'wildmenu' completion from a +mapping. + +When compiled without menus, this can be detected with has("menu"). Also show +this in the ":version" output. Allow compiling GUI versions without menu +support. Only include toolbar support when there is menu support. + +Moved the "Window" menu all the way to the right (priority 70). Looks more +familiar for people working with MS-Windows, shouldn't matter for others. + +Included "Buffers" menu. Works with existing autocommands and functions. It +can be disabled by setting the "no_buffers_menu" variable. (Aaron and Madsen) + +Win32 supports separators in a menu: "-.*-". (Geddes) +Menu separators for Motif now work too. + +Made Popup menu for Motif GUI work. (Madsen) + +'M' flag in 'guioptions': Don't source the system menu. + +All the menu code has been moved from gui.c to menu.c. + + +Viminfo improved *improved-viminfo* +---------------- + +New flags for 'viminfo': +'!' Store global variables in the viminfo file if they are in uppercase + letters. (Negri) +'h' Do ":nohlsearch" when loading a viminfo file. + +Store search patterns in the viminfo file with their offset, magic, etc. Also +store the flag whether 'hlsearch' highlighting is on or off (which is not used +if the 'h' flag is in 'viminfo'). + +Give an error message when setting 'viminfo' without commas. + + +Various new commands *new-commands-5.4* +-------------------- + +Operator |g?|: rot13 encoding. (Negri) + +|zH| and |zL| commands: Horizontal scrolling by half a page. +|gm| move cursor to middle of screen line. (Ideas by Campbell) + +Operations on Visual blocks: |v_b_I|, |v_b_A|, |v_b_c|, |v_b_C|, |v_b_r|, +|v_b_<| and |v_b_>|. (Kelly) + +New command: CTRL-\ CTRL-N, which does nothing in Normal mode, and goes to +Normal mode when in Insert or Command-line mode. Can be used by VisVim or +other OLE programs to make sure Vim is in Normal mode, without causing a beep. +|CTRL-\_CTRL-N| + +":cscope kill" command to use the connection filename. |:cscope| (Kahn) + +|:startinsert| command: Start Insert mode next. + +|:history| command, to show all four types of histories. (Roemer) + +|[m|, |[M|, |]m| and |]M| commands, for jumping backward/forward to start/end +of method in a (Java) class. + +":@*" executes the * register. |:@| (Acevedo) + +|go| and |:goto| commands: Jump to byte offset in the file. + +|gR| and |gr| command: Virtual Replace mode. Replace characters without +changing the layout. (Webb) + +":cd -" changes to the directory from before the previous ":cd" command. +|:cd-| (Webb) + +Tag preview commands |:ptag|. Shows the result of a ":tag" in a dedicated +window. Can be used to see the context of the tag (e.g., function arguments). +(Negri) +|:pclose| command, and CTRL-W CTRL-Z: Close preview window. (Moore) +'previewheight' option, height for the preview window. +Also |:ppop|, |:ptnext|, |:ptprevious|, |:ptNext|, |:ptrewind|, |:ptlast|. + +|:find| and |:sfind| commands: Find a file in 'path', (split window) and edit +it. + +The |:options| command opens an option window that shows the current option +values. Or use ":browse set" to open it. Options are grouped by function. +Offers short help on each option. Hit <CR> to jump to more help. Edit the +option value and hit <CR> on a "set" line to set a new value. + + +Various new options *new-options-5.4* +------------------- + +Scroll-binding: 'scrollbind' and 'scrollopt' options. Added |:syncbind| +command. Makes windows scroll the same amount (horizontally and/or +vertically). (Ralston) + +'conskey' option for MS-DOS. Use direct console I/O. This should work with +telnet (untested!). + +'statusline' option: Configurable contents of the status line. Also allows +showing the byte offset in the file. Highlighting with %1* to %9*, using the +new highlight groups User1 to User9. (Madsen) + +'rulerformat' option: Configurable contents of the ruler, like 'statusline'. +(Madsen) + +'write' option: When off, writing files is not allowed. Avoids overwriting a +file even with ":w!". The |-m| command line option resets 'write'. + +'clipboard' option: How the clipboard is used. Value "unnamed": Use unnamed +register like "*. (Cortopassi) Value "autoselect": Like what 'a' in +'guioptions' does but works in the terminal. + +'guifontset' option: Specify fonts for the +fontset feature, for the X11 GUI +versions. Allows using normal fonts when vim is compiled with this feature. +(Nam) + +'guiheadroom' option: How much room to allow above/below the GUI window. +Used for Motif, Athena and GTK. + +Implemented 'tagstack' option: When off, pushing tags onto the stack is +disabled (Vi compatible). Useful for mappings. + +'shellslash' option. Only for systems that use a backslash as a file +separator. This option will use a forward slash in file names when expanding +it. Useful when 'shell' is sh or csh. + +'pastetoggle' option: Key sequence that toggles 'paste'. Works around the +problem that mappings don't work in Insert mode when 'paste' is set. + +'display' option: When set to "lastline", the last line fills the window, +instead of being replaced with "@" lines. Only the last three characters are +replaced with "@@@", to indicate that the line has not finished yet. + +'switchbuf' option: Allows re-using existing windows on a buffer that is being +jumped to, or split the window to open a new buffer. (Roemer) + +'titleold' option. Replaces the fixed string "Thanks for flying Vim", which +is used to set the title when exiting. (Schild) + + +Vim scripts *new-script-5.4* +----------- + +The |exists()| function can also check for existence of a function. (Roemer) +An internal function is now found with a binary search, should be a bit +faster. (Roemer) + +New functions: +- |getwinposx()| and |getwinposy()|: get Vim window position. (Webb) +- |histnr()|, |histadd()|, |histget()| and |histdel()|: Make history + available. (Roemer) +- |maparg()|: Returns rhs of a mapping. Based on a patch from Vikas. +- |mapcheck()|: Check if a map name matches with an existing one. +- |visualmode()|: Return type of last Visual mode. (Webb) +- |libcall()|: Call a function in a library. Currently only for Win32. (Negri) +- |bufwinnr()|: find window that contains the specified buffer. (Roemer) +- |bufloaded()|: Whether a buffer exists and is loaded. +- |localtime()| and |getftime()|: wall clock time and last modification time + of a file (Webb) +- |glob()|: expand file name wildcards only. +- |system()|: get the raw output of an external command. (based on a patch + from Aaron). +- |strtrans()|: Translate String into printable characters. Used for + 2html.vim script. +- |append()|: easy way to append a line of text in a buffer. + +Changed functions: +- Optional argument to |strftime()| to give the time in seconds. (Webb) +- |expand()| now also returns names for files that don't exist. + +Allow numbers in the name of a user command. (Webb) + +Use "v:" for internal Vim variables: "v:errmsg", "v:shell_error", etc. The +ones from version 5.3 can be used without "v:" too, for backwards +compatibility. + +New variables: +"v:warningmsg" and "v:statusmsg" internal variables. Contain the last given +warning and status message. |v:warningmsg| |v:statusmsg| (Madsen) +"v:count1" variable: like "v:count", but defaults to one when no count is +used. |v:count1| + +When compiling without expression evaluation, "if 1" can be used around the +not supported commands to avoid it being executed. Works like in Vim 4.x. +Some of the runtime scripts gave errors when used with a Vim that was compiled +with minimal features. Now "if 1" is used around code that is not always +supported. + +When evaluating an expression with && and ||, skip the parts that will not +influence the outcome. This makes it faster and avoids error messages. (Webb) +Also optimized the skipping of expressions inside an "if 0". + + +Avoid hit-enter prompt *avoid-hit-enter* +----------------------- + +Added 'T' flag to 'shortmess': Truncate all messages that would cause the +hit-enter prompt (unless that would happen anyway). +The 'O' flag in 'shortmess' now also applies to quickfix messages, e.g., from +the ":cn" command. + +The default for 'shortmess' is now "filnxtToO", to make most messages fit on +the command line, and not cause the hit-enter prompt. + +Previous messages can be viewed with the new |:messages| command. + +Some messages are shown fully, even when 'shortmess' tells to shorten +messages, because the user is expected to want to see them in full: CTRL-G and +some quickfix commands. + + +Improved quickfix *improved-quickfix* +----------------- + +Parse change-directory lines for gmake: "make[1]: Entering directory 'name'". +Uses "%D" and "%X" in 'errorformat'. +Also parse "Making {target} in {dir}" messages from make. Helps when not +using GNU make. (Schandl) + +Use 'isfname' for "%f" in 'errorformat'. + +Parsing of multi-line messages. |errorformat-multi-line| + +Allow a range for the |:clist| command. (Roemer) + +Support for "global" file names, for error formats that output the file name +once for several errors. (Roemer) + +|:cnfile| jumps to first error in next file. + +"$*" in 'makeprg' is replaced by arguments to ":make". (Roemer) + + +Regular expressions *regexp-changes-5.4* +------------------- + +In a regexp, a '$' before "\)" is also considered to be an end-of-line. |/$| +In patterns "^" after "\|" or "\(" is a start-of-line. |/^| (Robinson) + +In a regexp, in front of "\)" and "\|" both "$" and "\$" were considered +end-of-line. Now use "$" as end-of-line and "\$" for a literal dollar. Same +for '^' after "\(" and "\|". |/\$| |/\^| + +Some search patterns can be extremely slow, even though they are not really +illegal. For example: "\([^a-z]\+\)\+Q". Allow interrupting any regexp +search with CTRL-C. + +Register "/: last search string (read-only). (Kohan) Changed to use last used +search pattern (like what 'hlsearch' uses). Can set the search pattern with +":let @/ = {expr}". + +Added character classes to search patterns, to avoid the need for removing the +'l' flag from 'cpoptions': |[:tab:]|, |[:return:]|, |[:backspace:]| and +|[:escape:]|. + +By adding a '?' after a comparative operator in an expression, the comparison +is done by ignoring case. |expr-==?| + + +Other improvements made between version 5.3 and 5.4 +--------------------------------------------------- + +Changed *changed-5.4* +------- + +Unix: Use $TMPDIR for temporary files, if it is set and exists. + +Removed "Empty buffer" message. It isn't useful and can cause a hit-enter +prompt. (Negri) + +"ex -" now reads commands from stdin and works in silent mode. This is to be +compatible with the original "ex" command that is used for scripts. + +Default range for ":tcldo" is the whole file. + +Cancelling Visual mode with ESC moved the cursor. There appears to be no +reason for this. Now leave the cursor where it is. + +The ":grep" and ":make" commands see " as part of the arguments, instead of +the start of a comment. + +In expressions the "=~" and "!~" operators no longer are affected by +'ignorecase'. + +Renamed vimrc_example to vimrc_example.vim and gvimrc_example to +gvimrc_example.vim. Makes them being recognized as vim scripts. + +"gd" no longer starts searching at the end of the previous function, but at +the first blank line above the start of the current function. Avoids that +using "gd" in the first function finds global a variable. + +Default for 'complete' changed from ".,b" to ".,w,b,u,t,i". Many more matches +will be found, at the cost of time (the search can be interrupted). + +It is no longer possible to set 'shell*' options from a modeline. Previously +only a warning message was given. This reduces security risks. + +The ordering of the index of documentation files was changed to make it more +easy to find a subject. + +On MS-DOS and win32, when $VIM was not set, $HOME was used. This caused +trouble if $HOME was set to e.g., "C:\" for some other tool, the runtime files +would not be found. Now use $HOME only for _vimrc, _gvimrc, etc., not to find +the runtime file. + +When 'tags' is "./{fname}" and there is no file name for the current buffer, +just use it. Previously it was skipped, causing "vim -t {tag}" not to find +many tags. + +When trying to select text in the 'scrolloff' area by mouse dragging, the +resulting scrolling made this difficult. Now 'scrolloff' is temporarily set +to 0 or 1 to avoid this. But still allow scrolling in the top line to extend +to above the displayed text. + +Default for 'comments' now includes "sl:/*,mb: *,ex:*/", to make javadoc +comments work. Also helps for C comments that start with "/*******". + +CTRL-X CTRL-] Insert mode tag expansion tried to expand to all tags when used +after a non-ID character, which can take a very long time. Now limit this to +200 matches. Also used for command-line tag completion. + +The OS/2 distribution has been split in two files. It was too big to fit on a +floppy. The same runtime archive as for the PC is now used. + +In the documentation, items like <a-z> have been replaced with {a-z} for +non-optional arguments. This avoids confusion with key names: <C-Z> is a +CTRL-Z, not a character between C and Z, that is {C-Z}. + + +Added *added-5.4* +----- + +Color support for the iris-ansi builtin termcap entry. (Tubman) + +Included VisVim version 1.3a. (Erhardt) + +Win32 port for SNiFF+ interface. (Leherbauer) +Documentation file for sniff interface: if_sniff.txt. (Leherbauer) + +Included the "SendToVim" and "OpenWithVim" programs in the OleVim directory. +To be used with the OLE version of gvim under MS-Windows. (Schaller) + +Included Exuberant Ctags version 3.2.4 with Eiffel support. (Hiebert) + +When a file that is being edited is deleted, give a warning (like when the +time stamp changed). + +Included newer versions of the HTML-generating Awk and Perl scripts. (Colombo) + +Linux console mouse support through "gpm". (Tsindlekht) + +Security fix: Disallow changing 'secure' and 'exrc' from a modeline. When +'secure' is set, give a warning for changing options that contain a program +name. + +Made the Perl interface work with Perl 5.005 and threads. (Verdoolaege) + +When giving an error message for an ambiguous mapping, include the offending +mapping. (Roemer) + +Command line editing: +- Command line completion of mappings. (Roemer) +- Command line completion for ":function", ":delfunction", ":let", ":call", + ":if", etc. (Roemer) +- When using CTRL-D completion for user commands that have + "-complete=tag_listfiles" also list the file names. (Madsen) +- Complete the arguments of the ":command" command. (Webb) +- CTRL-R . in command line inserts last inserted text. CTRL-F, CTRL-P, CTRL-W + and CTRL-A after CTRL-R are used to insert an object from under the cursor. + (Madsen) + +Made the text in uganda.txt about copying Vim a bit more clear. + +Updated the Vim tutor. Added the "vimtutor" command, which copies the tutor +and starts Vim on it. "make install" now also copies the tutor. + +In the output of ":clist" the current entry is highlighted, with the 'i' +highlighting (same as used for 'incsearch'). + +For the ":clist" command, you can scroll backwards with "b" (one screenful), +"u" (half a screenful) and "k" (one line). + +Multi-byte support: +- X-input method for multi-byte characters. And various fixes for multi-byte + support. (Nam) +- Hangul input method feature: |hangul|. (Nam) +- Cleaned up configuration of multi-byte support, XIM, fontset and Hangul + input. Each is now configurable separately. +- Changed check for GTK_KEYBOARD to HANGUL_KEYBOARD_TYPE. (Nam) +- Added doc/hangulin.txt: Documentation for the Hangul input code. (Nam) +- XIM support for GTK+. (Nam) +- First attempt to include support for SJIS encoding. (Nagano) +- When a double-byte character doesn't fit at the end of the line, put a "~" + there and print it on the next line. +- Optimize output of multi-byte text. (Park) +- Win32 IME: preedit style is like over-the-spot. (Nagano) +- Win32 IME: IME mode change now done with ImmSetOpenStatus. (Nagano) +- GUI Athena: file selection dialog can display multi-byte characters. + (Nagano) +- Selection reply for XA_TEXT as XA_STRING. (Nagano) + +"runtime/macros/diffwin.vim". Mappings to make a diff window. (Campbell) + +Added ".obj" to the 'suffixes' option. + +Reduced size of syntax/synload.vim by using the ":SynAu" user command. +Automated numbering of Syntax menu entries in menu.vim. +In the Syntax menu, insert separators between syntax names that start with +a different letter. (Geddes) + +Xterm: +- Clipboard support when using the mouse in an xterm. (Madsen) +- When using the xterm mouse, track dragging of the mouse. Use xterm escape + sequences when possible. It is more precise than other methods, but + requires a fairly recent xterm version. It is enabled with "xterm2" in + 'ttymouse'. (Madsen) +- Check xterm patch level, to set the value of 'ttymouse'. Has only been + added to xterm recently (patch level > 95). Uses the new 't_RV' termcap + option. Set 'ttymouse' to "xterm2" when a correct response is recognized. + Will make xterm mouse dragging work better. +- Support for shifted function keys on xterm. Changed codes for shifted + cursor keys to what the xterm actually produces. Added codes for shifted + <End> and <Home>. +- Added 't_WP' to set the window position in pixels and 't_WS' to set the + window size in characters. Xterm can now move (used for ":winpos") and + resize (use for ":set lines=" and ":set columns="). + +X11: +- When in Visual mode but not owning the selection, display the Visual area + with the VisualNOS group to show this. (Madsen) +- Support for requesting the type of clipboard support. Used for AIX and + dtterm. (Wittig) +- Support compound_text selection (even when compiled without multi-byte). + +Swap file: +- New variation for naming swap files: Replace path separators into %, place + all swap files in one directory. Used when a name in 'dir' ends in two path + separators. (Madsen) +- When a swap file is found, show whether it contains modifications or not in + the informative message. (Madsen) +- When dialogs are supported, use a dialog to ask the user what to do when a + swapfile already exists. + +"popup_setpos" in 'mousemodel' option. Allows for moving the cursor when +using the right mouse button. + +When a buffer is deleted, the selection for which buffer to display instead +now uses the most recent entry from the jump list. (Madsen) + +When using CTRL-O/CTRL-I, skip deleted buffers. + +A percentage is shown in the ruler, when there is room. + +Used autoconf 1.13 to generate configure. + +Included get_lisp_indent() from Dirk van Deun. Does better Lisp indenting +when 'p' flag in 'cpoptions' is not included. + +Made the 2html.vim script quite a bit faster. (based on ideas from Geddes) + +Unix: +- Included the name of the user that compiled Vim and the system name it was + compiled on in the version message. +- "make install" now also installs the "tools" directory. Makes them + available for everybody. +- "make check" now does the same as "make test". "make test" checks for + Visual block mode shift, insert, replace and change. +- Speed up comparing a file name with existing buffers by storing the + device/inode number with the buffer. +- Added configure arguments "--disable-gtk", "--disable-motif" and + "--disable-athena", to be able to disable a specific GUI (when it doesn't + work). +- Renamed the configure arguments for disabling the check for specific GUIs. + Should be clearer now. (Kahn) +- On a Digital Unix system ("OSF1") check for the curses library before + termlib and termcap. (Schild) +- "make uninstall_runtime" will only delete the version-specific files. Can + be used to delete the runtime files of a previous version. + +Macintosh: (St-Amant) +- Dragging the scrollbar, like it's done for the Win32 GUI. Moved common code + from gui_w32.c to gui.c +- Added dialogs and file browsing. +- Resource fork preserved, warning when it will be lost. +- Copy original file attributes to newly written file. +- Set title/notitle bug solved. +- Filename completion improved. +- Grow box limit resize to a char by char size. +- Use of rgb.txt for more colors (but give back bad color). +- Apple menu works (beside the about...). +- Internal border now vim compliant. +- Removing a menu doesn't crash anymore. +- Weak-linking of Python 1.5.1 (only on PPC). Python is supported when the + library is available. +- If an error is encountered when sourcing the users .vimrc, the alert box now + shows right away with the OK button defaulted. There's no more "Delete"-key + sign at the start of each line +- Better management of environment variables. Now $VIM is calculated only + once, not regenerated every time it is used. +- No more CPU hog when in background. +- In a sourced Vim script the Mac file format can be recognized, just like DOS + file format is. + +When both "unix" and "mac" are present in 'fileformats', prefer "mac" format +when there are more CR than NL characters. +When using "mac" fileformat, use CR instead of a NL, because NL is used for +NUL. Will preserve all characters in a file. (Madsen) + +The DOS install.exe now contains checks for an existing installation. It +avoids setting $VIM and $PATH again. +The install program for Dos/Windows can now install Vim in the popup menu, by +adding two registry keys. + +Port to EGCS/mingw32. New Makefile.ming. (Aaron) + +DOS 16 bit: Don't include cursor shape stuff. Save some bytes. + +TCL support to Makefile.w32. (Duperval) + +OS/2: Use argv[0] to find runtime files. + +When using "gf" to go to a buffer that has already been used, jump to the +line where the cursor last was. + +Colored the output of ":tselect" a bit more. Different highlighting between +tag name and file name. Highlight field name ("struct:") separately from +argument. + +Backtick expansion for non-Unix systems. Based on a patch from Aaron. +Allows the use of things like ":n `grep -l test *.c`" and +"echo expand('`ls m*`')". + +Check for the 'complete' option when it is set. (Acevedo) +'d' flag in 'complete' searches for defined names or macros. +While searching for Insert mode completions in include files and tags files, +check for typeahead, so that you can use matches early. (Webb) +The '.' flag in 'complete' now scans the current buffer completely, ignoring +'nowrapscan'. (Webb) + +Added '~' flag to 'whichwrap'. (Acevedo) + +When ending the Visual mode (e.g., with ESC) don't grab ownership of the +selection. + +In a color terminal, "fg" and "bg" can be used as color names. They stand for +the "Normal" colors. + +A few cscope cleanups. (Kahn) + +Included changed vimspell.sh from Schemenauer. + +Concatenation of strings in an expression with "." is a bit faster. (Roemer) + +The ":redir" command can now redirect to a register: ":redir @r". (Roemer) + +Made the output of ":marks" and ":jumps" look similar. When the mark is in +the current file, show the text at the mark. Also for ":tags". + +When configure finds ftello() and fseeko(), they are used in tag.c (for when +you have extremely big tags files). + +Configure check for "-FOlimit,2000" argument for the compiler. (Borsenkow) + +GUI: +- When using ":gui" in a non-GUI Vim, give a clear error message. +- "gvim -v" doesn't start the GUI (if console support is present). +- When in Ex mode, use non-Visual selection for the whole screen. +- When starting with "gvim -f" and using ":gui" in the .gvimrc file, Vim + forked anyway. Now the "-f" flag is remembered for ":gui". Added "gui -b" + to run gvim in the background anyway. + +Motif GUI: +- Check for "-lXp" library in configure (but it doesn't work yet...). +- Let configure check for Lesstif in "/usr/local/Lesstif/Motif*". Changed the + order to let a local Motif version override a system standard version. + +Win32 GUI: +- When using "-register" or "-unregister" in the non-OLE version, give an + error message. +- Use GTK toolbar icons. Make window border look better. Use sizing handles + on the lower left&right corners of the window. (Negri) +- When starting an external command with ":!start" and the command can not be + executed, give an error message. (Webb) +- Use sizing handles for the grey rectangles below the scrollbars. Can draw + toolbar in flat mode now, looks better. (Negri) +- Preparations for MS-Windows 3.1 addition. Mostly changing WIN32 to MSWIN + and USE_GUI_WIN32 to USE_GUI_MSWIN. (Negri) + +Avoid allocating the same string four times in buflist_findpat(). (Williams) + +Set title and icon text with termcap options 't_ts', 't_fs', 't_IS' and +'t_IE'. Allows doing this on any terminal that supports setting the title +and/or icon text. (Schild) + +New 'x' flag in 'comments': Automatically insert the end part when its last +character is typed. Helps to close a /* */ comment in C. (Webb) + +When expand() has a second argument which is non-zero, don't use 'suffixes' +and 'wildignore', return all matches. + +'O' flag in 'cpoptions: When not included, Vim will not overwrite a file, if +it didn't exist when editing started but it does exist when the buffer is +written to the file. The file must have been created outside of Vim, possibly +without the user knowing it. When this is detected after a shell command, +give a warning message. + +When editing a new file, CTRL-G will show [New file]. When there were errors +while reading the file, CTRL-G will show [Read errors]. + +":wall" can now use a dialog and file-browsing when needed. + +Grouped functionality into new features, mainly to reduce the size of the +minimal version: ++linebreak: 'showbreak', 'breakat' and 'linebreak' ++visualextra: "I"nsert and "A"ppend in Visual block mode, "c"hange all lines + in a block, ">" and "<": Shifting a block, "r": Replacing a + Visual area with one character. ++comments: 'comments' ++cmdline_info: 'ruler' and 'showcmd'. Replaces +showcmd. +"+title" Don't add code to set title or icon for MSDOS, this was not + possible anyway. ++cmdline_compl Disable commandline completion at compile time, except for + files, directories and help items. + +Moved features from a list of function calls into an array. Should save a bit +of space. + +While entering the body of a function, adjust indent according to "if" and +"while" commands. + +VMS: Adjusted os_vms.mms a bit according to suggestions from Arpadffy. + +The flags in the 'comments' option can now include an offset. This makes it +possible to align "/*****", "/* xxx" and "/*" comments with the same +'comments' setting. The default value for 'comments' uses this. +Added 'O' flag: Don't use this part for the "O" command. Useful for "set +com=sO:*\ -,mO:*\ \ ,exO:*/" + +FileType autocommands recognize ".bak", ".orig" and "~" extensions and remove +them to find the relevant extension. + +The tutorial for writing a Vim script file has been extended. + +Some more highlighting in help files, for items that are not typed literally. + +Can use "CTRL-W CTRL-G" like "CTRL-W g". + +"make test" for OS/2. + +Adjusted configure to automatically use the GUI for BeOS. + + +Fixed *fixed-5.4* +----- + +5.3.1: When using an autocommand for BufWritePre that changes the name of the +buffer, freed memory would be used. (Geddes) + +Mac: Compiler didn't understand start of skip_class_name(). + +Win32 GUI: +- When cancelling the font requester, don't give an error message. +- When a tearoff-menu is open and its menu is deleted, Vim could crash. + (Negri) +- There was a problem on Windows 95 with (un)maximizing the window. + (Williams) +- when 'mousehide' is set, the mouse would stay hidden when a menu is dropped + with the keyboard. (Ralston) +- The tempname() function already created the file. Caused problems when + using ":w". Now the file is deleted. +- Cursor disappeared when ending up in the top-left character on the screen + after scrolling. (Webb) +- When adding a submenu for a torn-off menu, it was not updated. +- Menu tooltip was using the toolbar tooltip. (Negri) +- Setting 'notitle' didn't remove the title. (Steed) +- Using ":!start cmd" scrolled the screen one line up, and didn't wait for + return when the command wasn't found. + +Cscope interface: Sorting of matches was wrong. Starting the interface could +fail. (Kahn) + +Motif GUI: Could not compile with Motif 1.1, because some tear-off +functionality was not in #ifdefs. + +Configure could sometimes not compile or link the test program for sizeof(int) +properly. This caused alignment problems for the undo structure allocations. +Added a safety check that SIZEOF_INT is not zero. + +Added configure check to test if strings.h can be included after string.h. +Some systems can't handle it. +Some systems need both string.h and strings.h included. Adjusted vim.h for +that. Removed including string.h from os_unixx.h, since it's already in +vim.h. (Savage) +AIX: defining _NO_PROTO in os_unix.h causes a conflict between string.h and +strings.h, but after the configure check said it was OK. Also define +_NO_PROTO for AIX in the configure check. (Winn) + +When closing a window with CTRL-W c, the value of 'hidden' was not taken into +account, the buffer was always unloaded. (Negri) + +Unix Makefile: "make install" always tried to rename an older executable and +remove it. This caused an error message when it didn't exit. Added a check +for the existence of an old executable. +The command line for "make install" could get too long, because of the many +syntax files. Now first do a "cd" to reduce the length. + +On RISCOS and MSDOS, reading a file could fail, because the short filename was +used, which can be wrong after a ":!cd". + +In the DOS versions, the wrong install.exe was included (required Windows). +Now the install.exe version is included that is the same as the Vim version. +This also supports long file names where possible. + +When recording, and stopping while in Insert mode with CTRL-O q, the CTRL-O +would also be recorded. + +32bit DOS version: "vim \file", while in a subdirectory, resulted in "new +file" for "file" in the local directory, while "\file" did exist. When +"file" in the current directory existed, this didn't happen. + +MSDOS: Mouse could not go beyond 80 columns in 132 columns mode. (Young) + +"make test" failed in the RedHat RPM, because compatible is off by default. + +In Insert mode <C-O><C-W><C-W> changes to other window, but the status bars +were not updated until another character was typed. + +MSDOS: environment options in lowercase didn't work, although they did in the +Win32 versions. (Negri) + +After ":nohlsearch", a tag command switched highlighting back on. + +When using "append" command as the last line in an autocommand, Vim would +crash. + +RISCOS: The scroll bumpers (?) were not working properly. (Leonard) + +"zl" and "zh" could move the cursor, but this didn't set the column in which +e.g., "k" would move the cursor. + +When doing ":set all&" the value of 'scroll' was not set correctly. This +caused an error message when later setting any other number option. + +When 'hlsearch' highlighting has been disabled with ":nohlsearch", +incremental searching would switch it back on too early. + +When listing tags for ":tselect", and using a non-search command, and the last +character was equal to the first (e.g., "99"), the last char would not be +shown. + +When searching for tags with ":tag" Vim would assume that all matches had been +found when there were still more (e.g. from another tags file). + +Win32: Didn't recognize "c:\" (e.g., in tags file) as absolute path when +upper/lowercase was different. + +Some xterms (Debian) send <Esc>OH for HOME and <Esc>OF for END. Added these +to the builtin-xterm. + +In ex mode, any CR was seen as the end of the line. Only a NL should be +handled that way. broke ":s/foo/some^Mtext/". + +In menu.vim, a vmenu was used to override an amenu. That didn't work, because +the system menu file doesn't overwrite existing menus. Added explicit vunmenu +to solve this. + +Configure check for terminal library could find a library that doesn't work at +runtime (Solaris: shared library not found). Added a check that a program +with tgoto() can run correctly. + +Unix: "echo -n" in the Makefile doesn't work on all systems, causing errors +compiling pathdef.c. Replaced it with "tr". + +Perl: DO_JOIN was redefined by Perl. Undefined it in the perl files. + +Various XIM and multi-byte fixes: +- Fix user cannot see his language while he is typing his language with + off-the-spot method. (Nagano) +- Fix preedit position using text/edit area (using gui.wid). (Nagano) +- remove 'fix dead key' codes. It was needed since XNFocusWindow was + "x11_window", XNFocusWindow is now gui.wid. (Nagano) +- Remove some compile warnings and fix typos. (Namsh) +- For status area, check the gtk+ version while Vim runs. I believe it is + better than compile time check. (Namsh) +- Remove one FIXME for gtk+-xim. (Namsh) +- XIM: Dead keys didn't work for Czech. (Vyskovsky) +- Multibyte: If user input only 3byte such as mb1_mb2_eng or eng_mb1_mb2 VIM + could convert it to special character. (Nam) +- Athena/Motif with XIM: fix preedit area. (Nam) +- XIM: Composed strings were sometimes ignored. Vim crashed when compose + string was longer than 256 bytes. IM's geometry control is fixed. (Nam, + Nagano) +- Win32 multi-byte: hollowed cursor width on a double byte char was wrong. + (Nagano) +- When there is no GUI, selecting XIM caused compilation problems. + Automatically disable XIM when there is no GUI in configure. +- Motif and Athena: When compiled with XIM, but the input method was not + enabled, there would still be a status line. Now the status line is gone if + the input method doesn't work. (Nam) + +Win32: tooltip was not removed when selecting a parent menu (it was when +selecting a menu entry). (Negri) + +Unix with X: Some systems crash on exit, because of the XtCloseDisplay() call. +Removed it, it should not be necessary when exiting. + +Win32: Crash on keypress when compiled with Borland C++. (Aaron) + +When checking for Motif library files, prefer the same location as the include +files (with "include" replaced with "lib") above another entry. + +Athena GUI: Changed "XtOffset()" in gui_at_fs.c to "XtOffsetOf()", like it's +used in gui_x11.c. + +Win32: When testing for a timestamp of a file on floppy, would get a dialog +box when the floppy has been removed. Now return with an error. (Negri) + +Win32 OLE: When forced to come to the foreground, a minimized window was still +minimized, now it's restored. (Zivkov) + +There was no check for a positive 'shiftwidth'. A negative value could cause +a hangup, a zero value a crash. + +Athena GUI: horizontal scrollbar wasn't updated correctly when clicking right +or left of the thumb. + +When making a Visual-block selection in one window, and trying to scroll +another, could cause errors for accessing non-existent line numbers. + +When 'matchpairs' contains "`:'", jumping from the ` to the ' didn't work +properly. + +Changed '\"' to '"' to make it compatible with old C compilers. + +The command line expansion for mappings caused a script with a TAB between lhs +and rhs of a map command to fail. Assume the TAB is to separate lhs and rhs +when there are no mappings to expand. + +When editing a file with very long lines with 'scrolloff' set, "j" would +sometimes end up in a line which wasn't displayed. + +When editing a read-only file, it was completely read into memory, even when +it would not fit. Now create a swap file for a read-only file when running +out of memory while reading the file. + +When using ":set cino={s,e-s", a line after "} else {" was not indented +properly. Also added a check for this in test3.in. + +The Hebrew mapping for the command line was remembered for the next command +line. That isn't very useful, a command is not Hebrew. (Kol) + +When completing file names with embedded spaces, like "Program\ files", this +didn't work. Also for user commands. Moved backslash_halve() down to +mch_expandpath(). + +When using "set mouse=a" in Ex mode, mouse events were handled like typed +text. Then typing "quit" screwed up the mouse behavior of the xterm. + +When repeating an insert with "." that contains a CTRL-Y, a number 5 was +inserted as "053". + +Yanking a Visual area, with the cursor past the line, didn't move the cursor +back onto the line. Same for "~", "u", "U" and "g?" + +Win32: Default for 'grepprg' could be "findstr /n" even though there is no +findstr.exe (Windows 95). Check if it exists, and fall back to "grep -n" if +it doesn't. + +Because gui_mouse_moved() inserted a leftmouse click in the input buffer, +remapping a leftmouse click caused strange effects. Now Insert another code +in the input buffer. Also insert a leftmouse release, to avoid the problem +with ":map <LeftMouse> l" that the next release is seen as the release for the +focus click. + +With 'wrap' on, when using a line that doesn't fit on the screen, if the start +of the Visual area is before the start of the screen, there was no +highlighting. Also, 'showbreak' doesn't work properly. + +DOS, Win32: A pattern "[0-9]\+" didn't work in autocommands. + +When creating a swap file for a buffer which isn't the current buffer, could +get a mixup of short file name, resulting in a long file name when a short +file name was required. makeswapname() was calling modname() instead of +buf_modname(). + +When a function caused an error, and the error message was very long because +of recursiveness, this would cause a crash. + +'suffixes' were always compared with matching case. For MS-DOS, Win32 and +OS/2 case is now ignored. + +The use of CHARBITS in regexp.c didn't work on some Linux. Don't use it. + +When generating a script file, 'cpo' was made empty. This caused backslashes +to disappear from mappings. Set it to "B" to avoid that. + +Lots of typos in the documentation. (Campbell) + +When editing an existing (hidden) buffer, jump to the last used cursor +position. (Madsen) + +On a Sun the xterm screen was not restored properly when suspending. (Madsen) + +When $VIMINIT is processed, 'nocompatible' was only set after processing it. + +Unix: Polling for a character wasn't done for GPM, Sniff and Xterm clipboard +all together. Cleaned up the code for using select() too. + +When executing external commands from the GUI, some typeahead was lost. Added +some code to regain as much typeahead as possible. + +When the window height is 5 lines or fewer, <PageDown> didn't use a one-line +overlap, while <PageUp> does. Made sure that <PageUp> uses the same overlap +as <PageDown>, so that using them both always displays the same lines. + +Removed a few unused functions and variables (found with lint). + +Dictionary completion didn't use 'infercase'. (Raul) + +Configure tests failed when the Perl library was not in LD_LIBRARY_PATH. +Don't use the Perl library for configure tests, add it to the linker line only +when linking Vim. + +When using ncurses/terminfo, could get a 't_Sf' and 't_Sb' termcap entry that +has "%d" instead of "%p1%d". The light background colors didn't work then. + +GTK GUI with ncurses: Crashed when starting up in tputs(). Don't use tputs() +when the GUI is active. + +Could use the ":let" command to set the "count", "shell_error" and "version" +variables, but that didn't work. Give an error message when trying to set +them. + +On FreeBSD 3.0, tclsh is called tclsh8.0. Adjusted configure.in to find it. + +When Vim is linked with -lncurses, but python uses -ltermcap, this causes +trouble: "OOPS". Configure now removes the -ltermcap. + +:@" and :*" didn't work properly, because the " was recognized as the start of +a comment. + +Win32s GUI: Minimizing the console where a filter command runs in caused +trouble for detecting that the filter command has finished. (Negri) + +After executing a filter command from an xterm, the mouse would be disabled. +It would work again after changing the mode. + +Mac GUI: Crashed in newenv(). (St-Amant) + +The menus and mappings in mswin.vim didn't handle text ending in a NL +correctly. (Acevedo) + +The ":k" command didn't check if it had a valid argument or extra characters. +Now give a meaningful error message. (Webb) + +On SGI, the signal function doesn't always have three arguments. Check for +struct sigcontext to find out. Might still be wrong... + +Could crash when using 'hlsearch' and search pattern is "^". + +When search patterns were saved and restored, status of no_hlsearch was not +also saved and restored (from ":nohlsearch" command). + +When using setline() to make a line shorter, the cursor position was not +adjusted. + +MS-DOS and Win95: When trying to edit a file and accidentally adding a slash +or backslash at the end, the file was deleted. Probably when trying to create +the swap file. Explicitly check for a trailing slash or backslash before +trying to read a file. + +X11 GUI: When starting the GUI failed and received a deadly signal while +setting the title, would lock up when trying to exit, because the title is +reset again. Avoid using mch_settitle() recursively. + +X11 GUI: When starting the GUI fails, and then trying it again, would crash, +because argv[] has been freed and x11_display was reset to NULL. + +Win32: When $HOME was set, would put "~user" in the swap file, which would +never compare with a file name, and never cause the attention message. Put +the full path in the swap file instead. + +Win32 console: There were funny characters at the end of the "vim -r" swap +files message (direct output of CR CR LF). + +DOS 32 bit: "vim -r" put the text at the top of the window. + +GUI: With 'mousefocus' set, got mouse codes as text with "!sleep 100" or "Q". + +Motif and Win32 GUI: When changing 'guifont' to a font of the same size the +screen wasn't redrawn. + +Unix: When using ":make", jumping to a file b.c, which is already open as a +symbolic link a.c, opened a new buffer instead of using the existing one. + +Inserting text in the current buffer while sourcing the .vimrc file would +cause a crash or hang. The memfile for the current buffer was never +allocated. Now it's allocated as soon as something is written in the buffer. + +DOS 32 bit: "lightblue" background worked for text, but not drawn parts were +black. + +DOS: Colors of console were not restored upon exiting. + +When recording, with 'cmdheight' set to 2 and typing Esc> in Insert mode +caused the "recording" message to be doubled. + +Spurious "file changed" messages could happen on Windows. Now tolerate a one +second difference, like for Linux. + +GUI: When returning from Ex mode, scrollbars were not updated. + +Win32: Copying text to the clipboard containing a <CR>, pasting it would +replace it with a <NL> and drop the next character. + +Entering a double byte character didn't work if the second byte is in [xXoO]. +(Eric Lee) + +vim_realloc was both defined and had a prototype in proto/misc2.pro. Caused +conflicts on Solaris. + +A pattern in an autocommand was treated differently on DOS et al. than on +Unix. Now it's the same, also when using backslashes. + +When using <Tab> twice for command line completion, without a match, the <Tab> +would be inserted. (Negri) + +Bug in MS-Visual C++ 6.0 when compiling ex_docmd.c with optimization. (Negri) + +Testing the result of mktemp() for failure was wrong. Could cause a crash. +(Peters) + +GUI: When checking for a ".gvimrc" file in the current directory, didn't check +for a "_gvimrc" file too. + +Motif GUI: When using the popup menu and then adding an item to the menu bar, +the menu bar would get very high. + +Mouse clicks and special keys (e.g. cursor keys) quit the more prompt and +dialogs. Now they are ignored. + +When at the more-prompt, xterm selection didn't work. Now use the 'r' flag in +'mouse' also for the more-prompt. + +When selecting a Visual area of more than 1023 lines, with 'guioptions' set to +"a", could mess up the display because of a message in free_yank(). Removed +that message, except for the Amiga. + +Moved auto-selection from ui_write() to the screen update functions. Avoids +unexpected behavior from a low-level function. Also makes the different +feedback of owning the selection possible. + +Vi incompatibility: Using "i<CR>" in an indent, with 'ai' set, used the +original indent instead of truncating it at the cursor. (Webb) + +":echo x" didn't stop at "q" for the more prompt. + +Various fixes for Macintosh. (St-Amant) + +When using 'selectmode' set to "exclusive", selecting a word and then using +CTRL-] included the character under the cursor. + +Using ":let a:name" in a function caused a crash. (Webb) + +When using ":append", an empty line didn't scroll up. + +DOS etc.: A file name starting with '!' didn't work. Added '!' to default for +'isfname'. + +BeOS: Compilation problem with prototype of skip_class_name(). (Price) + +When deleting more than one line, e.g., with "de", could still use "U" +command, which didn't work properly then. + +Amiga: Could not compile ex_docmd.c, it was getting too big. Moved some +functions to ex_cmds.c. + +The expand() function would add a trailing slash for directories. + +Didn't give an error message when trying to assign a value to an argument of a +function. (Webb) + +Moved including sys/ptem.h to after termios.h. Needed for Sinix. + +OLE interface: Don't delete the object in CVimCF::Release() when the reference +count becomes zero. (Cordell) +VisVim could still crash on exit. (Erhardt) + +"case a: case b:" (two case statements in one line) aligned with the second +case. Now it uses one 'sw' for indent. (Webb) + +Font initialisation wasn't right for Athena/Motif GUI. Moved the call to +highlight_gui_started() gui_mch_init() to gui_mch_open(). (Nam) + +In Replace mode, backspacing over a TAB before where the replace mode started +while 'sts' is different from 'ts', would delete the TAB. + +Win32 console: When executing external commands and switching between the two +console screens, Vim would copy the text between the buffers. That caused the +screen to be messed up for backtick expansion. + +":winpos -1" then ":winpos" gave wrong error message. + +Windows commander creates files called c:\tmp\$wc\abc.txt. Don't remove the +backslash before the $. Environment variables were not expanded anyway, +because of the backslash before the dollar. + +Using "-=" with ":set" could remove half a part when it contains a "\,". +E.g., ":set path+=a\\,b" and then "set path-=b" removed ",b". + +When Visually selecting lines, with 'selection' set to "inclusive", including +the last char of the line, "<<" moved an extra line. Also for other operators +that always work on lines. + +link.sh changed "-lnsl_s" to "_s" when looking for "nsl" to be removed. +Now it only remove whole words. + +When jumped to a mark or using "fz", and there is an error, the current column +was lost. E.g. when using "$fzj". + +The "g CTRL-G" command could not be interrupted, even though it can take a +long time. + +Some terminals do have <F4> and <xF4>. <xF4> was always interpreted as <F4>. +Now map <xF4> to <F4>, so that the user can override this. + +When compiling os_win32.c with MIN_FEAT the apply_autocmds() should not be +used. (Aaron) + +This autocommand looped forever: ":au FileChangedShell * nested e <afile>" +Now FileChangeShell never nests. (Roemer) + +When evaluating an ":elseif" that was not going to matter anyway, ignore +errors. (Roemer) + +GUI Lesstif: Tearoff bar was the last item, instead of the first. + +GUI Motif: Colors of tear-off widgets was wrong when 't' flag added to +'guioptions' afterwards. When 't' flag in 'guioptions' is excluded, would +still get a tearoff item in a new menu. + +An inode number can be "long long". Use ino_t instead of long. Added +configure check for ino_t. + +Binary search for tags was using a file offset "long" instead of "off_t". + +Insert mode completion of tags was not using 'ignorecase' properly. + +In Insert mode, the <xFn> keys were not properly mapped to <Fn> for the +default mappings. Also caused errors for ":mkvimrc" and ":mksession". + +When jumping to another window while in Insert mode, would get the "warning: +changing readonly file" even when not making a change. + +A '(' or '{' inside a trailing "//" comment would disturb C-indenting. +When using two labels below each other, the second one was not indented +properly. Comments could mess up C-indenting in many places. (Roemer) + +Could delete or redefine a function while it was being used. Could cause a +crash. +In a function it's logical to prepend "g:" to a system variable, but this +didn't work. (Roemer) + +Hangul input: Buffer would overflow when user inputs invalid key sequence. +(Nam) + +When BufLoad or BufEnter autocommands change the topline of the buffer in the +window, it was overruled and the cursor put halfway the window. Now only put +the cursor halfway if the autocommands didn't change the topline. + +Calling exists("&option") always returned 1. (Roemer) + +Win32: Didn't take actually available memory into account. (Williams) + +White space after an automatically inserted comment leader was not removed +when 'ai' is not set and <CR> hit just after inserting it. (Webb) + +A few menus had duplicated accelerators. (Roemer) + +Spelling errors in documentation, quite a few "the the". (Roemer) + +Missing prototypes for Macintosh. (Kielhorn) + +Win32: When using 'shellquote' or 'shellxquote', the "!start cmd" wasn't +executed in a disconnected process. + +When resizing the window, causing a line before the cursor to wrap or unwrap, +the cursor was displayed in the wrong position. + +There was quite a bit of dead code when compiling with minimal features. + +When doing a ":%s///" command that makes lines shorter, such that lines above +the final cursor position no longer wrap, the cursor position was not updated. + +get_id_list() could allocate an array one too small, when a "contains=" item +has a wildcard that matches a group name that is added just after it. E.g.: +"contains=a.*b,axb". Give an error message for it. + +When yanking a Visual area and using the middle mouse button -> crash. When +clipboard doesn't work, now make "* always use "". + +Win32: Using ":buf a\ b\file" didn't work, it was interpreted as "ab\file". + +Using ":ts ident", then hit <CR>, with 'cmdheight' set to 2: command line was +not cleared, the tselect prompt was on the last but one line. + +mksession didn't restore the cursor column properly when it was after a tab. +Could not get all windows back when using a smaller terminal screen. Didn't +restore all windows when "winsize" was not in 'sessionoptions'. (Webb) + +Command line completion for ":buffer" depended on 'ignorecase' for Unix, but +not for DOS et al.. Now don't use 'ignorecase', but let it depend on whether +file names are case sensitive or not (like when expanding file names). + +Win32 GUI: (Negri) +- Redrawing the background caused flicker when resizing the window. Removed + _OnEraseBG(). Removed CS_HREDRAW and CS_VREDRAW flags from the + sndclass.style. +- Some parts of the window were drawn in grey, instead of using the color from + the user color scheme. +- Dropping a file on gvim didn't activate the window. +- When there is no menu ('guioptions' excludes 'm'), never use the ALT key for + it. + +GUI: When resizing the window, would make the window height a bit smaller. +Now round off to the nearest char cell size. (Negri) + +In Vi the ")" and "(" commands don't stop at a single space after a dot. +Added 'J' flag in 'cpoptions' to make this behave Vi compatible. (Roemer) + +When saving a session without any buffers loaded, there would be a ":normal" +command without arguments in it. (Webb) + +Memory leaks fixed: (Madsen) +- eval.c: forgot to release func structure when func deleted +- ex_docmd.c: forgot to release string after "<sfile>" +- misc1.c: leak when completion pattern had no matches. +- os_unix.c: forgot to release regexp after file completions + +Could crash when using a buffer without a name. (Madsen) +Could crash when doing file name completion, because of backslash_halve(). +(Madsen) + +":@a" would do mappings on register a, which is not Vi compatible. (Roemer) + +":g/foo.*()/s/foobar/_&/gc" worked fine, but then "n" searched for "foobar" +and displayed "/foo.*()". (Roemer) + +OS/2: get_cmd_output() was not included. Didn't check for $VIM/.vimrc file. + +Command line completion of options didn't work after "+=" and "-=". + +Unix configure: Test for memmove()/bcopy()/memcpy() tried redefining these +functions, which could fail if they are defined already. Use mch_memmove() to +redefine. + +Unix: ":let a = expand("`xterm`&")" started an xterm asynchronously, but +":let a = expand("`xterm&`")" generated an error message, because the +redirection was put after the '&'. + +Win32 GUI: Dialog buttons could not be selected properly with cursor keys, +when the default is not the first button. (Webb) + +The "File has changed since editing started" (when regaining focus) could not +always be seen. (Webb) + +When starting with "ex filename", the file message was overwritten with +the "entering Ex mode" message. + +Output of ":tselect" listed name of file directly from the tags file. Now it +is corrected for the position of the tags file. + +When 'backspace' is 0, could backspace over autoindent. Now it is no longer +allowed (Vi compatible). + +In Replace mode, when 'noexpandtab' and 'smarttab' were set, and inserting +Tabs, backspacing didn't work correctly for Tabs inserted at the start of the +line (unless 'sts' was set too). Also, when replacing the first non-blank +after which is a space, rounding the indent was done on the first non-blank +instead of on the character under the cursor. + +When 'sw' at 4, 'ts' at 8 and 'smarttab' set: When a tab was appended after +four spaces (they are replaced with a tab) couldn't backspace over the tab. + +In Insert mode, with 'bs' set to 0, couldn't backspace to before autoindent, +even when it was removed with CTRL-D. + +When repeating an insert command where a <BS>, <Left> or other key causes an +error, would flush buffers and remain in Insert mode. No longer flush +buffers, only beep and continue with the insert command. + +Dos and Win32 console: Setting t_me didn't work to get another color. Made +this works backwards compatible. + +For Turkish (LANG = "tr") uppercase 'i' is not an 'I'. Use ASCII uppercase +translation in vim_strup() to avoid language problems. (Komur) + +Unix: Use usleep() or nanosleep() for mch_delay() when available. Hopefully +this avoids a hangup in select(0, ..) for Solaris 2.6. + +Vim would crash when using a script file with 'let &sp = "| tee"', starting +vim with "vim -u test", then doing ":set sp=". The P_WAS_SET flag wasn't set +for a string option, could cause problems with any string option. + +When using "cmd | vim -", stdin is not a terminal. This gave problems with +GPM (Linux console mouse) and when executing external commands. Now close +stdin and re-open it as a copy of stderr. + +Syntax highlighting: A "nextgroup" item was not properly stored in the state +list. This caused missing of next groups when not redrawing from start to +end, but starting halfway. + +Didn't check for valid values of 'ttymouse'. + +When executing an external command from the GUI, waiting for the child to +terminate might not work, causing a hang. (Parmelan) + +"make uninstall" didn't delete the vimrc_example.vim and gvimrc_example.vim +files and the vimtutor. + +Win32: "expand("%:p:h")" with no buffer name removed the directory name. +"fnamemodify("", ":p")" did not add a trailing slash, fname_case() removed it. + +Fixed: When 'hlsearch' was set and the 'c' flag was not in 'cpoptions': +highlighting was not correct. Now overlapping matches are handled correctly. + +Athena, Motif and GTK GUI: When started without focus, cursor was shown as if +with focus. + +Don't include 'shellpipe' when compiled without quickfix, it's not used. +Don't include 'dictionary' option when compiled without the +insert_expand +feature. +Only include the 'shelltype' option for the Amiga. + +When making a change to a line, with 'hlsearch' on, causing it to wrap, while +executing a register, the screen would not be updated correctly. This was a +generic problem in update_screenline() being called while must_redraw is +VALID. + +Using ":bdelete" in a BufUnload autocommand could cause a crash. The window +height was added to another window twice in close_window(). + +Win32 GUI: When removing a menu item, the tearoff wasn't updated. (Negri) + +Some performance bottlenecks removed. Allocating memory was not efficient. +For Win32 checking for available memory was slow, don't check it every time +now. On NT obtaining the user name takes a long time, cache the result (for +all systems). + +fnamemodify() with an argument ":~:." or ":.:~" didn't work properly. + +When editing a new file and exiting, the marks for the buffer were not saved +in the viminfo file. + +":confirm only" didn't put up a dialog. + +These text objects didn't work when 'selection' was "exclusive": va( vi( va{ +vi{ va< vi< vi[ va[. + +The dialog for writing a readonly file didn't have a valid default. (Negri) + +The line number used for error messages when sourcing a file was reset when +modelines were inspected. It was wrong when executing a function. + +The file name and line number for an error message wasn't displayed when it +was the same as for the last error, even when this was long ago. Now reset +the name/lnum after a hit-enter prompt. + +In a session file, a "%" in a file name caused trouble, because fprintf() was +used to write it to the file. + +When skipping statements, a mark in an address wasn't skipped correctly: +"ka|if 0|'ad|else|echo|endif". (Roemer) + +":wall" could overwrite a not-edited file without asking. + +GUI: When $DISPLAY was not set or starting the GUI failed in another way, the +console mode then started with wrong colors and skipped initializations. Now +do an early check if the GUI can be started. Don't source the menu.vim or +gvimrc when it will not. Also do normal terminal initializations if the GUI +might not start. + +When using a BufEnter autocommand to position the cursor and scroll the +window, the cursor was always put at the last used line and halfway the window +anyhow. + +When 'wildmode' was set to "longest,list:full", ":e *.c<Tab><Tab>" didn't list +the matches. Also avoid that listing after a "longest" lists the wrong +matches when the first expansion changed the string in front of the cursor. + +When using ":insert", ":append" or ":change" inside a while loop, was not able +to break out of it with a CTRL-C. + +Win32: ":e ." took an awful long time before an error message when used in +"C:\". Was caused by adding another backslash and then trying to get the full +name for "C:\\". + +":winpos -10 100" was working like ":winpos -10 -10", because a pointer was +not advanced past the '-' sign. + +When obtaining the value of a hidden option, would give an error message. Now +just use a zero value. + +OS/2: Was using argv[0], even though it was not a useful name. It could be +just "vim", found in the search path. + +Xterm: ":set columns=78" didn't redraw properly (when lines wrap/unwrap) until +after a delay of 'updatetime'. Didn't check for the size-changed signal. + +'scrollbind' didn't work in Insert mode. +Horizontal scrollbinding didn't always work for "0" and "$" commands (e.g., +when 'showcmd' was off). + +When compiled with minimal features but with GUI, switching on the mouse in an +xterm caused garbage, because the mouse codes were not recognized. Don't +enable the mouse when it can't be recognized. In the GUI it also didn't work, +the arguments to the mouse code were not interpreted. + +When 'showbreak' used, in Insert mode, when the cursor is just after the last +character in the line, which is also the in the rightmost column, the cursor +position would be like the 'showbreak' string is shown, but it wasn't. + +Autocommands could move the cursor in a new file, so that CTRL-W i didn't show +the right line. Same for when using a filemark to jump to another file. + +When redefining the argument list, the title used for other windows could be +showing the wrong info about the position in the argument list. Also update +this for a ":split" command without arguments. + +When editing file 97 of 13, ":Next" didn't work. Now it goes to the last +file in the argument list. + +Insert mode completion (for dictionaries or included files) could not be +interrupted by typing an <Esc>. Could get hit-enter prompt after line +completion, or whenever the informative message would get too long. + +When using the ":edit" command to re-edit the same file, an autocommand to +jump to the last cursor position caused the cursor to move. Now set the last +used cursor position to avoid this. + +When 'comments' has a part that starts with white space, formatting the +comment didn't work. + +At the ":tselect" prompt Normal mode mappings were used. That has been +disabled. + +When 'selection' is not "old", some commands still didn't allow the cursor +past the end-of-line in Visual mode. + +Athena: When a menu was deleted, it would appear again (but not functional) +when adding another menu. Now they don't reappear anymore (although they are +not really deleted either). + +Borland C++ 4.x had an optimizer problem in fill_breakat_flags(). (Negri) + +"ze" didn't work when 'number' was on. (Davis) + +Win32 GUI: Intellimouse code didn't work properly on Windows 98. (Robinson) + +A few files were including proto.h a second time, after vim.h had already done +that, which could cause problems with the vim_realloc() macro. + +Win32 console: <M-x> or ALT-x was not recognized. Also keypad '+', '-' and +'*'. (Negri) +MS-DOS: <M-x> didn't work, produced a two-byte code. Now the alphabetic and +number keys work. (Negri) + +When finding a lot of matches for a tag completion, the check for avoiding +double matches could take a lot of time. Add a line_breakcheck() to be able +to interrupt this. (Deshpande) + +When the command line was getting longer than the screen, the more-prompt +would be given regularly, and the cursor position would be wrong. Now only +show the part of the command line that fits on the screen and force the cursor +to be positioned on the visible part. There can be text after the cursor +which isn't editable. + +At the more prompt and with the console dialog, a cursor key was interpreted +as <Esc> and OA. Now recognize special keys in get_keystroke(). Ignore mouse +and scrollbar events. + +When typing a BS after inserting a middle comment leader, typing the last char +of the end comment leader still changed it into the end comment leader. (Webb) + +When a file system is full, writing to a swap file failed. Now first try to +write one block to the file. Try next entry in 'dir' if it fails. + +When "~" is in 'whichwrap', doing "~" on last char of a line didn't update the +display. + +Unix: Expanding wildcards for ":file {\\}" didn't work, because "\}" was +translated to "}" before the shell got it. Now don't remove backslashes when +wildcards are going to be expanded. + +Unix: ":e /tmp/$uid" didn't work. When expanding environment variables in a +file name doesn't work, use the shell to expand the file name. ":e /tmp/$tty" +still doesn't work though. + +"make test" didn't always work on DOS/Windows for test30, because it depended +on the external "echo" command. + +The link.sh script used "make" instead of $MAKE from the Makefile. Caused +problems for generating pathdef.c when "make" doesn't work properly. + +On versions that can do console and GUI: In the console a typed CSI code could +cause trouble. + +The patterns in expression evaluation didn't ignore the 'l' flag in +'cpoptions'. This broke the working of <CR> in the options window. + +When 'hls' off and 'ai' on, "O<Esc>" did remove the indent, but it was still +highlighted red for trailing space. + +Win32 GUI: Dropping an encrypted file on a running gvim didn't work right. Vim +would loop while outputting "*" characters. vgetc() was called recursively, +thus it returns NUL. Added safe_vgetc(), which reads input directly from the +user in this situation. + +While reading text from stdin, only an empty screen was shown. Now show that +Vim is reading from stdin. + +The cursor shape wasn't set properly when returning to Insert mode, after +using a CTRL-O /asdf command which fails. It would be OK after a few seconds. +Now it's OK right away. + +The 'isfname' default for DOS/Windows didn't include the '@' character. File +names that contained "dir\@file" could not be edited. + +Win32 console: <C-S-Left> could cause a crash when compiled with Borland or +egcs. (Aaron) + +Unix and VMS: "#if HAVE_DIRENT_H" caused problems for some compilers. Use +"#ifdef HAVE_DIRENT_H" instead. (Jones) + +When a matching tag is in the current file but has a search pattern that +doesn't match, the cursor would jump to the first line. + +Unix: Dependencies for pty.c were not included in Makefile. Dependency of +ctags/config.h was not included (only matters for parallel make). + +Removed a few Uninitialized Memory Reads (potential crashes). In do_call() +calling clear_var() when not evaluating. In win32_expandpath() and +dos_expandpath() calling backslash_halve() past the end of a file name. + +Removed memory leaks: Set_vim_var_string() never freed the value. The +next_list for a syntax keyword was never freed. + +On non-Unix systems, using a file name with wildcards without a match would +silently fail. E.g., ":e *.sh". Now give a "No match" error message. + +The life/life.mac, urm/urm.mac and hanoi/hanoi.mac files were not recognized +as Vim scripts. Renamed them to *.vim. + +[Note: some numbered patches are not relevant when upgrading from version 5.3, +they have been removed] + +Patch 5.4m.1 +Problem: When editing a file with a long name, would get the hit-enter + prompt, even though all settings are such that the name should be + truncated to avoid that. filemess() was printing the file name + without truncating it. +Solution: Truncate the message in filemess(). Use the same code as for + msg_trunc_attr(), which is moved to the new function + msg_may_trunc(). +Files: src/message.c, src/proto/message.pro, src/fileio.c + +Patch 5.4m.3 +Problem: The Motif libraries were not found by configure for Digital Unix. +Solution: Add "/usr/shlib" to the search path. (Andy Kahn) +Files: src/configure.in, src/configure + +Patch 5.4m.5 +Problem: Win32 GUI: When using the Save-As menu entry and selecting an + existing file in the file browser, would get a dialog to confirm + overwriting twice. (Ed Krall) +Solution: Removed the dialog from the file browser. It would be nicer to + set the "forceit" flag and skip Vim's ":confirm" dialog, but it + requires quite a few changes to do that. +Files: src/gui_w32.c + +Patch 5.4m.6 +Problem: Win32 GUI: When reading text from stdin, e.g., "cat foo | gvim -", + a message box would pop up with "-stdin-" (when exiting). (Michael + Schaap) +Solution: Don't switch off termcap mode for versions that are GUI-only. + They use another terminal to read from stdin. +Files: src/main.c, src/fileio.c + +Patch 5.4m.7 +Problem: Unix: running configure with --enable-gtk-check, + --enable-motif-check, --enable-athena-check or --enable-gtktest + had the reverse effect. (Thomas Koehler) +Solution: Use $enable_gtk_check variable correctly in AC_ARG_ENABLE(). +Files: src/configure.in, src/configure + +Patch 5.4m.9 +Problem: Multi-byte: With wrapping lines, the cursor was sometimes 2 + characters to the left. Syntax highlighting was wrong when a + double-byte character was split for a wrapping line. When + 'showbreak' was on the splitting also didn't work. +Solution: Adjust getvcol() and win_line(). (Chong-Dae Park) +Files: src/charset.c, src/screen.c + +Patch 5.4m.11 +Problem: The ":call" command didn't check for illegal trailing characters. + (Stefan Roemer) +Solution: Add the check in do_call(). +Files: src/eval.c + +Patch 5.4m.13 +Problem: With the ":s" command: + 1. When performing a substitute command, the mouse would be + disabled and enabled for every substitution. + 2. The cursor position could be beyond the end of the line. + Calling line_breakcheck() could try to position the cursor, + which causes a crash in the Win32 GUI. + 3. When using ":s" in a ":g" command, the cursor was not put on + the first non-white in the line. + 4. There was a hit-enter prompt when confirming the substitution + and the replacement was a bit longer. +Solution: 1. Only disable/enable the mouse when asking for confirmation. + 2. Always put the cursor on the first character, it is going to be + moved to the first non-blank anyway. + Don't use the cursor position in gui_mch_draw_hollow_cursor(), + get the character from the screen buffer. + 3. Added global_need_beginline flag to call beginline() after ":g" + has finished all substitutions. + 4. Clear the need_wait_return flag after prompting the user. +Files: src/ex_cmds.c, src/gui_w32.c + +Patch 5.4m.14 +Problem: When doing "vim xxx", ":opt", ":only" and then ":e xxx" we end + up with two swapfiles for "xxx". That is caused by the ":bdel" + command which is executed when unloading the option-window. + Also, there was no check if closing a buffer made the new one + invalid, this could cause a crash. +Solution: When closing a buffer causes the current buffer to be deleted, + use the new buffer to replace it. Also detect that the new buffer + has become invalid as a side effect of closing the current one. + Make autocommand that calls ":bdel" in optwin.vim nested, so that + the buffer loading it triggers also executes autocommands. + Also added a test for this in test13. +Files: runtime/optwin.vim, src/buffer.c, src/ex_cmds.c, src/globals.h + src/testdir/test13.in, src/testdir/test13.ok + +Patch 5.4m.15 +Problem: When using a BufEnter autocommand to reload the syntax file, + conversion to HTML caused a crash. (Sung-Hyun Nam) +Solution: When using ":syntax clear" the current stack of syntax items was + not cleared. This will cause memory to be used that has already + been freed. Added call to invalidate_current_state() in + syntax_clear(). +Files: src/syntax.c + +Patch 5.4m.17 +Problem: When omitting a ')' in an expression it would not be seen as a + failure. + When detecting an error inside (), there would be an error message + for a missing ')' too. + When using ":echo 1+|echo 2" there was no error message. (Roemer) + When using ":exe 1+" there was no error message. + When using ":return 1+" there was no error message. +Solution: Fix do_echo(), do_execute() and do_return() to give an error + message when eval1() returns FAIL. + Fix eval6() to handle trailing ')' correctly and return FAIL when + it's missing. +Files: src/eval.c + +Patch 5.4m.18 +Problem: When using input() from inside an expression entered with + "CTRL-R =" on the command line, there could be a crash. And the + resulting command line was wrong. +Solution: Added getcmdline_prompt(), which handles recursive use of + getcmdline() correctly. It also sets the command line prompt. + Removed cmdline_prompt(). Also use getcmdline_prompt() for + getting the crypt key in get_crypt_key(). +Files: src/proto/ex_getln.pro, src/ex_getln.c, src/eval.c, src/misc2.c + +Patch 5.4m.21 +Problem: When starting up, the screen structures were first allocated at + the minimal size, then initializations were done with Rows + possibly different from screen_Rows. Caused a crash in rare + situations (GTK with XIM and fontset). +Solution: Call screenalloc() in main() only after calling ui_get_winsize(). + Also avoids a potential delay because of calling screenclear() + while "starting" is non-zero. +Files: src/main.c + +Patch 5.4m.22 +Problem: In the GUI it was possible that the screen was resized and the + screen structures re-allocated while redrawing the screen. This + could cause a crash (hard to reproduce). The call sequence goes + through update_screen() .. syntax_start() .. ui_breakcheck() .. + gui_resize_window() .. screenalloc(). +Solution: Set updating_screen while redrawing. If the window is resized + remember the new size and handle it only after redrawing is + finished. + This also fixes that resizing the screen while still redrawing + (slow syntax highlighting) would not work properly. + Also disable display_hint, it was never used. +Files: src/globals.h, src/gui.c, src/screen.c, src/proto/gui.pro + +Patch 5.4m.23 +Problem: When using expand("<cword>") when there was no word under the + cursor, would get an error message. Same for <cWORD> and <cfile>. +Solution: Don't give an error message, return an empty string. +Files: src/eval.c + +Patch 5.4m.24 +Problem: ":help \|" didn't find anything. It was translated to "/\\|". +Solution: Translate "\|" into "\\bar". First check the table for specific + translations before checking for "\x". +Files: src/ex_cmds.c + +Patch 5.4m.25 +Problem: Unix: When using command line completion on files that contain + ''', '"' or '|' the file name could not be used. + Adding this file name to the Buffers menu caused an error message. +Solution: Insert a backslash before these three characters. + Adjust Mungename() function to insert a backslash before '|'. +Files: src/ex_getln.c, runtime/menu.vim + +Patch 5.4m.26 +Problem: When using a mapping of two function keys, e.g., <F1><F1>, and + only the first char of the second key has been read, the mapping + would not be recognized. Noticed on some Unix systems with xterm. +Solution: Add 'K' flag to 'cpoptions' to wait for the whole key code, even + when halfway a mapping. +Files: src/option.h, src/term.c + +Patch 5.4m.27 +Problem: When making test33 without the lisp feature it hangs. Interrupting + the execution of the script then might cause a crash. +Solution: In inchar(), after closing a script, don't use buf[] anymore. + closescript() has freed typebuf[] and buf[] might be pointing + inside typebuf[]. + Avoid that test33 hangs when the lisp feature is missing. +Files: src/getchar.c src/testdir/test33.in + +"os2" was missing from the feature list. Useful for has("os2"). + +BeOS: +- Included patches from Richard Offer for BeOS R4.5. +- menu code didn't work right. Crashed in the Buffers menu. The window title + wasn't set. (Offer) + +Patch 5.4n.3 +Problem: C-indenting was wrong after " } else". The white space was not + skipped. Visible when 'cino' has "+10". +Solution: Skip white space before calling cin_iselse(). (Norbert Zeh) +Files: src/misc1.c + +Patch 5.4n.4 +Problem: When the 't' flag in 'cpoptions' is included, after a + ":nohlsearch" the search highlighting would not be enabled again + after a tag search. (Norbert Zeh) +Solution: When setting the new search pattern in jumpto_tag(), don't restore + no_hlsearch. +Files: src/tag.c + +Patch 5.4n.5 +Problem: When using ":normal" from a CursorHold autocommand Vim hangs. The + autocommand is executed down from vgetc(). Calling vgetc() + recursively to execute the command doesn't work then. +Solution: Forbid the use of ":normal" when vgetc_busy is set. Give an error + message when this happens. +Files: src/ex_docmd.c, runtime/doc/autocmd.txt + +Patch 5.4n.6 +Problem: "gv" could reselect a Visual that starts and/or ends past the end + of a line. (Robert Webb) +Solution: Check that the start and end of the Visual area are on a valid + character by calling adjust_cursor(). +Files: src/normal.c + +Patch 5.4n.8 +Problem: When a mark was on a non existing line (e.g., when the .viminfo + was edited), jumping to it caused ml_get errors. (Alexey + Marinichev). +Solution: Added check_cursor_lnum() in nv_gomark(). +Files: src/normal.c + +Patch 5.4n.9 +Problem: ":-2" moved the cursor to a negative line number. (Ralf Schandl) +Solution: Give an error message for a negative line number. +Files: src/ex_docmd.c + +Patch 5.4n.10 +Problem: Win32 GUI: At the hit-enter prompt, it was possible to scroll the + text. This erased the prompt and made Vim look like it is in + Normal mode, while it is actually still waiting for a <CR>. +Solution: Disallow scrolling at the hit-enter prompt for systems that use + on the fly scrolling. +Files: src/message.c + +Patch 5.4n.14 +Problem: Win32 GUI: When using ":winsize 80 46" and the height is more than + what fits on the screen, the window size was made smaller than + asked for (that's OK) and Vim crashed (that's not OK)> +Solution: Call check_winsize() from gui_set_winsize() to resize the windows. +Files: src/gui.c + +Patch 5.4n.16 +Problem: Win32 GUI: The <F10> key both selected the menu and was handled as + a key hit. +Solution: Apply 'winaltkeys' to <F10>, like it is used for Alt keys. +Files: src/gui_w32.c + +Patch 5.4n.17 +Problem: Local buffer variables were freed when the buffer is unloaded. + That's not logical, since options are not freed. (Ron Aaron) +Solution: Free local buffer variables only when deleting the buffer. +Files: src/buffer.c + +Patch 5.4n.19 +Problem: Doing ":e" (without argument) in an option-window causes trouble. + The mappings for <CR> and <Space> are not removed. When there is + another buffer loaded, the swap file for it gets mixed up. + (Steve Mueller) +Solution: Also remove the mappings at the BufUnload event, if they are still + present. + When re-editing the same file causes the current buffer to be + deleted, don't try editing it. + Also added a test for this situation. +Files: runtime/optwin.vim, src/ex_cmds.c, src/testdir/test13.in, + src/testdir/test13.ok + +Patch 5.4n.24 +Problem: BeOS: configure never enabled the GUI, because $with_x was "no". + Unix prototypes caused problems, because Display and Widget are + undefined. + Freeing fonts on exit caused a crash. +Solution: Only disable the GUI when $with_x is "no" and $BEOS is not "yes". + Add dummy defines for Display and Widget in proto.h. + Don't free the fonts in gui_exit() for BeOS. +Files: src/configure.in, src/configure, src/proto.h, src/gui.c. + + +The runtime/vim48x48.xpm icon didn't have a transparent background. (Schild) + +Some versions of the mingw32/egcs compiler didn't have WINBASEAPI defined. +(Aaron) + +VMS: +- mch_setenv() had two arguments instead of three. +- The system vimrc and gvimrc files were called ".vimrc" and ".gvimrc". + Removed the dot. +- call to RealWaitForChar() had one argument too many. (Campbell) +- WaitForChar() is static, removed the prototype from proto/os_vms.pro. +- Many file accesses failed, because Unix style file names were used. + Translate file names to VMS style by using vim_fopen(). +- Filtering didn't work, because the temporary file name was generated wrong. +- There was an extra newline every 9192 characters when writing a file. Work + around it by writing line by line. (Campbell) +- os_vms.c contained "# typedef int DESC". Should be "typedef int DESC;". + Only mattered for generating prototypes. +- Added file name translation to many places. Made easy by defining macros + mch_access(), mch_fopen(), mch_fstat(), mch_lstat() and mch_stat(). +- Set default for 'tagbsearch' to off, because binary tag searching apparently + doesn't work for VMS. +- make mch_get_host_name() work with /dec and /standard=vaxc. (Campbell) + + +Patch 5.4o.2 +Problem: Crash when using "gf" on "file.c://comment here". (Scott Graham) +Solution: Fix wrong use of pointers in get_file_name_in_path(). +Files: src/window.c + +Patch 5.4o.3 +Problem: The horizontal scrollbar was not sized correctly when 'number' is + set and 'wrap' not set. + Athena: Horizontal scrollbar wasn't updated when the cursor was + positioned with a mouse click just after dragging. +Solution: Subtract 8 from the size when 'number' set and 'wrap' not set. + Reset gui.dragged_sb when a mouse click is received. +Files: src/gui.c + +Patch 5.4o.4 +Problem: When running in an xterm and $WINDOWID is set to an illegal value, + Vim would exit with "Vim: Got X error". +Solution: When using the display which was opened for the xterm clipboard, + check if x11_window is valid by trying to obtain the window title. + Also add a check in setup_xterm_clip(), for when using X calls to + get the pointer position in an xterm. +Files: src/os_unix.c + +Patch 5.4o.5 +Problem: Motif version with Lesstif: When removing the menubar and then + using a menu shortcut key, Vim would crash. (raf) +Solution: Disable the menu mnemonics when the menu bar is removed. +Files: src/gui_motif.c + +Patch 5.4o.9 +Problem: The DOS install.exe program used the "move" program. That doesn't + work on Windows NT, where "move" is internal to cmd.exe. +Solution: Don't use an external program for moving the executables. Use C + functions to copy the file and delete the original. +Files: src/dosinst.c + +Motif and Athena obtained the status area height differently from GTK. Moved +status_area_enabled from global.h to gui_x11.c and call +xim_get_status_area_height() to get the status area height. + +Patch 5.4p.1 +Problem: When using auto-select, and the "gv" command is used, would not + always obtain ownership of the selection. Caused by the Visual + area still being the same, but ownership taken away by another + program. +Solution: Reset the clipboard Visual mode to force updating the selection. +Files: src/normal.c + +Patch 5.4p.2 +Problem: Motif and Athena with XIM: Typing 3-byte + <multibyte><multibyte><space> doesn't work correctly with Ami XIM. +Solution: Avoid using key_sym XK_VoidSymbol. (Nam) +Files: src/multbyte.c, src/gui_x11.c + +Patch 5.4p.4 +Problem: Win32 GUI: The scrollbar values were reduced for a file with more + than 32767 lines. But this info was kept global for all + scrollbars, causing a mixup between the windows. + Using the down arrow of a scrollbar in a large file didn't work. + Because of round-off errors there is no scroll at all. +Solution: Give each scrollbar its own scroll_shift field. When the down + arrow is used, scroll several lines. +Files: src/gui.h, src/gui_w32.c + +Patch 5.4p.5 +Problem: When changing buffers in a BufDelete autocommand, there could be + ml_line errors and/or a crash. (Schandl) Was caused by deleting + the current buffer. +Solution: When the buffer to be deleted unexpectedly becomes the current + buffer, don't delete it. + Also added a check for this in test13. +Files: src/buffer.c, src/testdir/test13.in, src/testdir/test13.ok + +Patch 5.4p.7 +Problem: Win32 GUI: When using 'mousemodel' set to "popup_setpos" and + clicking the right mouse button outside of the selected area, the + selected area wasn't removed until the popup menu has gone. + (Aaron) +Solution: Set the cursor and update the display before showing the popup + menu. +Files: src/normal.c + +Patch 5.4p.8 +Problem: The generated bugreport didn't contain information about + $VIMRUNTIME and whether runtime files actually exist. +Solution: Added a few checks to the bugreport script. +Files: runtime/bugreport.vim + +Patch 5.4p.9 +Problem: The windows install.exe created a wrong entry in the popup menu. + The "%1" was "". The full directory was included, even when the + executable had been moved elsewhere. (Ott) +Solution: Double the '%' to get one from printf. Only include the path to + gvim.exe when it wasn't moved and it's not in $PATH. +Files: src/dosinst.c + +Patch 5.4p.10 +Problem: Win32: On top of 5.4p.9: The "Edit with Vim" entry sometimes used + a short file name for a directory. +Solution: Change the "%1" to "%L" in the registry entry. +Files: src/dosinst.c + +Patch 5.4p.11 +Problem: Motif, Athena and GTK: When closing the GUI window when there is a + changed buffer, there was only an error message and Vim would not + exit. +Solution: Put up a dialog, like for ":confirm qa". Uses the code that was + already used for MS-Windows. +Files: src/gui.c, src/gui_w32.c + +Patch 5.4p.12 +Problem: Win32: Trying to expand a string that is longer than 256 + characters could cause a crash. (Steed) +Solution: For the buffer in win32_expandpath() don't use a fixed size array, + allocate it. +Files: src/os_win32.c + +MSDOS: Added "-Wall" to Makefile.djg compile flags. Function prototypes for +fname_case() and mch_update_cursor() were missing. "fd" was unused in +mf_sync(). "puiLocation" was unused in myputch(). "newcmd" unused in +mch_call_shell() for DJGPP version. + +============================================================================== +VERSION 5.5 *version-5.5* + +Version 5.5 is a bug-fix version of 5.4. + + +Changed *changed-5.5* +------- + +The DJGPP version is now compiled with "-O2" instead of "-O4" to reduce the +size of the executables. + +Moved the src/STYLE file to runtime/doc/develop.txt. Added the design goals +to it. + +'backspace' is now a string option. See patch 5.4.15. + + +Added *added-5.5* +----- + +Included Exuberant Ctags version 3.3. (Darren Hiebert) + +In runtime/mswin.vim, map CTRL-Q to CTRL-V, so that CTRL-Q can be used +everywhere to do what CTRL-V used to do. + +Support for decompression of bzip2 files in vimrc_example.vim. + +When a patch is included, the patch number is entered in a table in version.c. +This allows skipping a patch without breaking a next one. + +Support for mouse scroll wheel in X11. See patch 5.5a.14. + +line2byte() can be used to get the size of the buffer. See patch 5.4.35. + +The CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert mode are used to +insert a register literally. See patch 5.4.48. + +Uninstall program for MS-Windows. To be able to remove the registry entries +for "Edit with Vim". It is registered to be run from the "Add/Remove +programs" application. See patch 5.4.x7. + + +Fixed *fixed-5.5* +----- + +When using vimrc_example.vim: An error message when the cursor is on a line +higher than the number of lines in the compressed file. Move the autocommand +for jumping to the last known cursor position to after the decompressing +autocommands. + +":mkexrc" and ":mksession" wrote the current value of 'textmode'. That may +mark a file as modified, which causes problems. This is a buffer-specific +setting, it should not affect all files. + +"vim --version" wrote two empty lines. + +Unix: The alarm signal could kill Vim. It is generated by the Perl alarm() +function. Ignore SIGALRM. + +Win32 GUI: Toolbar still had the yellow bitmap for running a Vim script. + +BeOS: "tmo" must be bigtime_t, instead of double. (Seibert) + +Patch 5.4.1 +Problem: Test11 fails when $GZIP is set to "-v". (Matthew Jackson) +Solution: Set $GZIP to an empty string. +Files: src/testdir/test11.in + +Patch 5.4.2 +Problem: Typing <Esc> at the crypt key prompt caused a crash. (Kallingal) +Solution: Check for a NULL pointer returned from get_crypt_key(). +Files: src/fileio.c + +Patch 5.4.3 +Problem: Python: Trying to use the name of an unnamed buffer caused a + crash. (Daniel Burrows) +Solution: Check for b_fname being a NULL pointer. +Files: src/if_python.c + +Patch 5.4.4 +Problem: Win32: When compiled without toolbar, but the 'T' flag is in + 'guioptions', there would be an empty space for the toolbar. +Solution: Add two #ifdefs where checking for the 'T' flag. (Vince Negri) +Files: src/gui.c + +Patch 5.4.5 +Problem: Athena GUI: Using the Buffers.Refresh menu entry caused a crash. + Looks like any ":unmenu" command may cause trouble. +Solution: Disallow ":unmenu" in the Athena version. Disable the Buffers + menu, because the Refresh item would not work. +Files: src/menu.c, runtime/menu.vim + +Patch 5.4.6 +Problem: GTK GUI: Using ":gui" in the .gvimrc file caused an error. Only + happens when the GUI forks. +Solution: Don't fork in a recursive call of gui_start(). +Files: src/gui.c + +Patch 5.4.7 +Problem: Typing 'q' at the more prompt for the ATTENTION message causes the + file loading to be interrupted. (Will Day) +Solution: Reset got_int after showing the ATTENTION message. +Files: src/memline.c + +Patch 5.4.8 +Problem: Edit some file, ":he", ":opt": options from help window are shown, + but pressing space updates from the other window. (Phillipps) + Also: When there are changes in the option-window, ":q!" gives an + error message. +Solution: Before creating the option-window, go to a non-help window. + Use ":bdel!" to delete the buffer. +Files: runtime/optwin.vim + +Patch 5.4.9 + Just updates version.h. The real patch has been moved to 5.4.x1. + This patch is just to keep the version number correct. + +Patch 5.4.10 +Problem: GTK GUI: When $DISPLAY is invalid, "gvim -f" just exits. It + should run in the terminal. +Solution: Use gtk_init_check() instead of gtk_init(). +Files: src/gui_gtk_x11.c + +Patch 5.4.11 +Problem: When using the 'S' flag in 'cpoptions', 'tabstop' is not copied to + the next buffer for some commands, e.g., ":buffer". +Solution: When the BCO_NOHELP flag is given to buf_copy_options(), still + copy the options used by do_help() when neither the "from" or "to" + buffer is a help buffer. +Files: src/option.c + +Patch 5.4.12 +Problem: When using 'smartindent', there would be no extra indent if the + current line did not have any indent already. (Hanus Adler) +Solution: There was a wrongly placed "else", that previously matched with + the "if" that set trunc_line. Removed the "else" and added a + check for trunc_line to be false. +Files: src/misc1.c + +Patch 5.4.13 +Problem: New SGI C compilers need another option for optimisation. +Solution: Add a check in configure for "-OPT:Olimit". (Chin A Young) +Files: src/configure.in, src/configure + +Patch 5.4.14 +Problem: Motif GUI: When the popup menu is present, a tiny window appears + on the desktop for some users. +Solution: Set the menu widget ID for a popup menu to 0. (Thomas Koehler) +Files: src/gui_motif.c + +Patch 5.4.15 +Problem: Since 'backspace' set to 0 has been made Vi compatible, it is no + longer possible to only allow deleting autoindent. +Solution: Make 'backspace' a list of parts, to allow each kind of + backspacing separately. +Files: src/edit.c, src/option.c, src/option.h, src/proto/option.pro, + runtime/doc/option.txt, runtime/doc/insert.txt + +Patch 5.4.16 +Problem: Multibyte: Locale zh_TW.Big5 was not checked for in configure. +Solution: Add zh_TW.Big5 to configure check. (Chih-Tsun Huang) +Files: src/configure.in, src/configure + +Patch 5.4.17 +Problem: GUI: When started from inside gvim with ":!gvim", Vim would not + start. ":!gvim -f" works fine. +Solution: After forking, wait a moment in the parent process, to give the + child a chance to set its process group. +Files: src/gui.c + +Patch 5.4.18 +Problem: Python: The clear_history() function also exists in a library. +Solution: Rename clear_history() to clear_hist(). +Files: src/ex_getln.c, src/eval.c, src/proto/ex_getln.pro + +Patch 5.4.19 +Problem: In a terminal with 25 lines, there is a more prompt after the + ATTENTION message. When hitting 'q' here the dialog prompt + doesn't appear and file loading is interrupted. (Will Day) +Solution: Don't allow quitting the printing of a message for the dialog + prompt. Added the msg_noquit_more flag for this. +Files: src/message.c + +Patch 5.4.20 +Problem: GTK: When starting gvim, would send escape sequences to the + terminal to switch the cursor off and on. +Solution: Don't call msg_start() if the GUI is expected to start. +Files: src/main.c + +Patch 5.4.21 +Problem: Motif: Toplevel menu ordering was wrong when using tear-off items. +Solution: Don't add one to the index for a toplevel menu. +Files: src/gui_motif.c + +Patch 5.4.22 +Problem: In Insert mode, <C-Left>, <S-Left>, <C-Right> and <S-Right> didn't + update the column used for vertical movement. +Solution: Set curwin->w_set_curswant for those commands. +Files: src/edit.c + +Patch 5.4.23 +Problem: When a Visual selection is lost to another program, and then the + same text is Visually selected again, the clipboard ownership + wasn't regained. +Solution: Set clipboard.vmode to NUL to force regaining the clipboard. +Files: src/normal.c + +Patch 5.4.24 +Problem: Encryption: When using ":r file" while 'key' has already entered, + the 'key' option would be messed up. When writing the file it + would be encrypted with an unknown key and lost! (Brad Despres) +Solution: Don't free cryptkey when it is equal to the 'key' option. +Files: src/fileio.c + +Patch 5.4.25 +Problem: When 'cindent' is set, but 'autoindent' isn't, comments are not + properly indented when starting a new line. (Mitterand) +Solution: When there is a comment leader for the new line, but 'autoindent' + isn't set, do C-indenting. +Files: src/misc1.c + +Patch 5.4.26 +Problem: Multi-byte: a multi-byte character is never recognized in a file + name, causing a backslash before it to be removed on Windows. +Solution: Assume that a leading-byte character is a file name character in + vim_isfilec(). +Files: src/charset.c + +Patch 5.4.27 +Problem: Entries in the PopUp[nvic] menus were added for several modes, but + only deleted for the mode they were used for. This resulted in + the entry remaining in the PopUp menu. + When removing a PopUp[nvic] menu, the name had been truncated, + could result in greying-out the whole PopUp menu. +Solution: Remove entries for all modes from the PopUp[nvic] menus. Remove + the PopUp[nvic] menu entries first, before the name is changed. +Files: src/menu.c + +Patch 5.4.28 +Problem: When using a BufWritePre autocommand to change 'fileformat', the + new value would not be used for writing the file. +Solution: Check 'fileformat' after executing the autocommands instead of + before. +Files: src/fileio.c + +Patch 5.4.29 +Problem: Athena GUI: When removing the 'g' flag from 'guioptions', using a + menu can result in a crash. +Solution: Always grey-out menus for Athena, don't hide them. +Files: src/menu.c + +Patch 5.4.30 +Problem: BeOS: Suspending Vim with CTRL-Z didn't work (killed Vim). The + first character typed after ":sh" goes to Vim, instead of the + started shell. +Solution: Don't suspend Vim, start a new shell. Kill the async read thread + when starting a new shell. It will be restarted later. (Will Day) +Files: src/os_unix.c, src/ui.c + +Patch 5.4.31 +Problem: GUI: When 'mousefocus' is set, moving the mouse over where a + window boundary was, causes a hit-enter prompt to be finished. + (Jeff Walker) +Solution: Don't use 'mousefocus' at the hit-enter prompt. Also ignore it + for the more prompt and a few other situations. When an operator + is pending, abort it first. +Files: src/gui.c + +Patch 5.4.32 +Problem: Unix: $LDFLAGS was not passed to configure. +Solution: Pass $LDFLAGS to configure just like $CFLAGS. (Jon Miner) +Files: src/Makefile + +Patch 5.4.33 +Problem: Unix: After expanding an environment variable with the shell, the + next expansion would also use the shell, even though it is not + needed. +Solution: Reset "recursive" before returning from gen_expand_wildcards(). +Files: src/misc1.c + +Patch 5.4.34 (also see 5.4.x5) +Problem: When editing a file, and the file name is relative to a directory + above the current directory, the file name was made absolute. + (Gregory Margo) +Solution: Add an argument to shorten_fnames() which indicates if all file + names should be shortened, or only absolute names. In main() only + use shorten_fnames() to shorten absolute names. +Files: src/ex_docmd.c, src/fileio.c, src/main.c, src/proto/fileio.pro + +Patch 5.4.35 +Problem: There is no function to get the current file size. +Solution: Allow using line2byte() with the number of lines in the file plus + one. This returns the offset of the line past the end of the + file, which is the file size plus one. +Files: src/eval.c, runtime/doc/eval.txt + +Patch 5.4.36 +Problem: Comparing strings while ignoring case didn't work correctly for + some machines. (Mide Steed) +Solution: vim_stricmp() and vim_strnicmp() only returned 0 or 1. Changed + them to return -1 when the first argument is smaller. +Files: src/misc2.c + +Patch 5.4.37 (also see 5.4.40 and 5.4.43) +Problem: Long strings from the viminfo file are truncated. +Solution: When writing a long string to the viminfo file, first write a line + with the length, then the string itself in a second line. +Files: src/eval.c, src/ex_cmds.c, src/ex_getln.c, src/mark.c, src/ops.c, + src/search.c, src/proto/ex_cmds.pro, runtime/syntax/viminfo.vim + +Patch 5.4.38 +Problem: In the option-window, ":set go&" resulted in 'go' being handled + like a boolean option. + Mappings for <Space> and <CR> were overruled by the option-window. +Solution: When the value of an option isn't 0 or 1, don't handle it like a + boolean option. + Save and restore mappings for <Space> and <CR> when entering and + leaving the option-window. +Files: runtime/optwin.vim + +Patch 5.4.39 +Problem: When setting a hidden option, spaces before the equal sign were + not skipped and cause an error message. E.g., ":set csprg =cmd". +Solution: When skipping over a hidden option, check for a following "=val" + and skip it too. +Files: src/option.c + +Patch 5.4.40 (depends on 5.4.37) +Problem: Compiler error for "atol(p + 1)". (Axel Kielhorn) +Solution: Add a typecast: "atol((char *)p + 1)". +Files: src/ex_cmds.c + +Patch 5.4.41 +Problem: Some commands that were not included would give an error message, + even when after "if 0". +Solution: Don't give an error message for an unsupported command when not + executing the command. +Files: src/ex_docmd.c + +Patch 5.4.42 +Problem: ":w" would also cause a truncated message to appear in the message + history. +Solution: Don't put a kept message in the message history when it starts + with "<". +Files: src/message.c + +Patch 5.4.43 (depends on 5.4.37) +Problem: Mixing long lines with multiple lines in a register causes errors + when writing the viminfo file. (Robinson) +Solution: When reading the viminfo file to skip register contents, skip + lines that start with "<". +Files: src/ops.c + +Patch 5.4.44 +Problem: When 'whichwrap' includes '~', a "~" command that goes on to the + next line cannot be properly undone. (Zellner) +Solution: Save each line for undo in n_swapchar(). +Files: src/normal.c + +Patch 5.4.45 (also see 5.4.x8) +Problem: When expand("$ASDF") fails, there is an error message. +Solution: Remove the global expand_interactively. Pass a flag down to skip + the error message. + Also: expand("$ASDF") returns an empty string if $ASDF isn't set. + Previously it returned "$ASDF" when 'shell' is "sh". + Also: system() doesn't print an error when the command returns an + error code. +Files: many + +Patch 5.4.46 +Problem: Backspacing did not always use 'softtabstop' after hitting <CR>, + inserting a register, moving the cursor, etc. +Solution: Reset inserted_space much more often in edit(). +Files: src/edit.c + +Patch 5.4.47 +Problem: When executing BufWritePre or BufWritePost autocommands for a + hidden buffer, the cursor could be moved to a non-existing + position. (Vince Negri) +Solution: Save and restore the cursor and topline for the current window + when it is going to be used to execute autocommands for a hidden + buffer. Use an existing window for the buffer when it's not + hidden. +Files: src/fileio.c + +Patch 5.4.48 +Problem: A paste with the mouse in Insert mode was not repeated exactly the + same with ".". For example, when 'autoindent' is set and pasting + text with leading indent. (Perry) +Solution: Add the CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert + mode, which insert the contents of a register literally. +Files: src/edit.c, src/normal.c, runtime/doc/insert.txt + +Patch 5.4.49 +Problem: When pasting text with [ <MiddleMouse>, the cursor could end up + after the last character of the line. +Solution: Correct the cursor position for the change in indent. +Files: src/ops.c + +Patch 5.4.x1 (note: Replaces patch 5.4.9) +Problem: Win32 GUI: menu hints were never used, because WANT_MENU is not + defined until vim.h is included. +Solution: Move the #ifdef WANT_MENU from where MENUHINTS is defined to where + it is used. +Files: src/gui_w32.c + +Patch 5.4.x2 +Problem: BeOS: When pasting text, one character was moved to the end. +Solution: Re-enable the BeOS code in fill_input_buf(), and fix timing out + with acquire_sem_etc(). (Will Day) +Files: src/os_beos.c, src/ui.c + +Patch 5.4.x3 +Problem: Win32 GUI: When dropping a directory on a running gvim it crashes. +Solution: Avoid using a NULL file name. Also display a message to indicate + that the current directory was changed. +Files: src/gui_w32.c + +Patch 5.4.x4 +Problem: Win32 GUI: Removing an item from the popup menu doesn't work. +Solution: Don't remove the item from the menubar, but from the parent popup + menu. +Files: src/gui_w32.c + +Patch 5.4.x5 (addition to 5.4.34) +Files: src/gui_w32.c + +Patch 5.4.x6 +Problem: Win32: Expanding (dir)name starting with a dot doesn't work. + (McCormack) Only when there is a path before it. +Solution: Fix the check, done before expansion, if the file name pattern + starts with a dot. +Files: src/os_win32.c + +Patch 5.4.x7 +Problem: Win32 GUI: Removing "Edit with Vim" from registry is difficult. +Solution: Add uninstall program to remove the registry keys. It is installed + in the "Add/Remove programs" list for ease of use. + Also: don't set $VIM when the executable is with the runtime files. + Also: Add a text file with a step-by-step description of how to + uninstall Vim for DOS and Windows. +Files: src/uninstal.c, src/dosinst.c, src/Makefile.w32, uninstal.txt + +Patch 5.4.x8 (addition to 5.4.45) +Files: many + +Patch 5.4.x9 +Problem: Win32 GUI: After executing an external command, focus is not + always regained (when using focus-follows-mouse). +Solution: Add SetFocus() in mch_system(). (Mike Steed) +Files: src/os_win32.c + + +Patch 5.5a.1 +Problem: ":let @* = @:" did not work. The text was not put on the + I clipboard. (Fisher) +Solution: Own the clipboard and put the text on it. +Files: src/ops.c + +Patch 5.5a.2 +Problem: append() did not mark the buffer modified. Marks below the + new line were not adjusted. +Solution: Fix the f_append() function. +Files: src/eval.c + +Patch 5.5a.3 +Problem: Editing compressed ".gz" files doesn't work on non-Unix systems, + because there is no "mv" command. +Solution: Add the rename() function and use it instead of ":!mv". + Also: Disable the automatic jump to the last position, because it + changes the jumplist. +Files: src/eval.c, runtime/doc/eval.txt, runtime/vimrc_example.vim + +Patch 5.5a.4 +Problem: When using whole-line completion in insert mode while the cursor + is in the indent, get "out of memory" error. (Stekrt) +Solution: Don't allocate a negative amount of memory in ins_complete(). +Files: src/edit.c + +Patch 5.5a.5 +Problem: Win32: The 'path' option can hold only up to 256 characters, + because _MAX_PATH is 256. (Robert Webb) +Solution: Use a fixed path length of 1024. +Files: src/os_win32.h + +Patch 5.5a.6 +Problem: Compiling with gcc on Win32, using the Unix Makefile, didn't work. +Solution: Add $(SUFFIX) to all places where an executable is used. Also + pass it to ctags. (Reynolds) +Files: src/Makefile + +Patch 5.5a.7 +Problem: When using "cat | vim -" in an xterm, the xterm version reply + would end up in the file. +Solution: Read the file from stdin before switching the terminal to RAW + mode. Should also avoid problems with programs that use a + specific terminal setting. + Also: when using the GUI, print "Reading from stdin..." in the GUI + window, to give a hint why it doesn't do anything. +Files: src/main.c, src/fileio.c + +Patch 5.5a.8 +Problem: On multi-threaded Solaris, suspending doesn't work. +Solution: Call pause() when the SIGCONT signal was not received after + sending the SIGTSTP signal. (Nagano) +Files: src/os_unix.c + +Patch 5.5a.9 +Problem: 'winaltkeys' could be set to an empty argument, which is illegal. +Solution: Give an error message when doing ":set winaltkeys=". +Files: src/option.c + +Patch 5.5a.10 +Problem: Win32 console: Using ALTGR on a German keyboard to produce "}" + doesn't work, because the 8th bit is set when ALT is pressed. +Solution: Don't set the 8th bit when ALT and CTRL are used. (Leipert) +Files: src/os_win32.c + +Patch 5.5a.11 +Problem: Tcl: Configure always uses tclsh8.0. + Also: Loading a library doesn't work. +Solution: Add "--with-tclsh" configure argument to allow specifying another + name for the tcl shell. + Call Tcl_Init() in tclinit() to make loading libraries work. + (Johannes Zellner) +Files: src/configure.in, src/configure, src/if_tcl.c + +Patch 5.5a.12 +Problem: The "user_commands" feature is called "user-commands". +Solution: Replace "user-commands" with "user_commands". (Kim Sung-bom) + Keep "user-commands" for the has() function, to remain backwards + compatible with 5.4. +Files: src/eval.c, src/version.c + +Patch 5.5a.13 +Problem: OS/2: When $HOME is not defined, "C:/" is used for the viminfo + file. That is very wrong when OS/2 is on another partition. +Solution: Use $VIM for the viminfo file when it is defined, like for MSDOS. + Also: Makefile.os2 didn't depend on os_unix.h. +Files: src/os_unix.h, src/Makefile.os2 + +Patch 5.5a.14 +Problem: Athena, Motif and GTK: The Mouse scroll wheel doesn't work. +Solution: Interpret a click of the wheel as a key press of the <MouseDown> + or <MouseUp> keys. Default behavior is to scroll three lines, or + a full page when Shift is used. +Files: src/edit.c, src/ex_getln.c, src/gui.c, src/gui_gtk_x11.c, + src/gui_x11.c, src/keymap.h, src/message.c, src/misc1.c, + src/misc2.c, src/normal.c, src/proto/normal.pro, src/vim.h, + runtime/doc/scroll.txt + +Patch 5.5a.15 +Problem: Using CTRL-A in Insert mode doesn't work correctly when the insert + started with the <Insert> key. (Andreas Rohrschneider) +Solution: Replace <Insert> with "i" before setting up the redo buffer. +Files: src/normal.c + +Patch 5.5a.16 +Problem: VMS: GUI does not compile and run. +Solution: Various fixes. (Zoltan Arpadffy) + Moved functions from os_unix.c to ui.c, so that VMS can use them + too: open_app_context(), x11_setup_atoms() and clip_x11* functions. + Made xterm_dpy global, it's now used by ui.c and os_unix.c. + Use gethostname() always, sys_hostname doesn't exist. +Files: src/globals.h, src/gui_x11.c, src/os_vms.mms, src/os_unix.c, + src/os_vms.c, src/ui.c, src/proto/os_unix.pro, src/proto/ui.pro + +Renamed AdjustCursorForMultiByteCharacter() to AdjustCursorForMultiByteChar() +to avoid symbol length limit of 31 characters. (Steve P. Wall) + +Patch 5.5b.1 +Problem: SASC complains about dead assignments and implicit type casts. +Solution: Removed the dead assignments. Added explicit type casts. +Files: src/buffer.c, src/edit.c, src/eval.c, src/ex_cmds.c, + src/ex_getln.c, src/fileio.c, src/getchar.c, src/memline.c, + src/menu.c, src/misc1.c, src/normal.c, src/ops.c, src/quickfix.c, + src/screen.c + +Patch 5.5b.2 +Problem: When using "CTRL-O O" in Insert mode, hit <Esc> and then "o" in + another line truncates that line. (Devin Weaver) +Solution: When using a command that starts Insert mode from CTRL-O, reset + "restart_edit" first. This avoids that edit() is called with a + mix of starting a new edit command and restarting a previous one. +Files: src/normal.c + +============================================================================== +VERSION 5.6 *version-5.6* + +Version 5.6 is a bug-fix version of 5.5. + + +Changed *changed-5.6* +------- + +Small changes to OleVim files. (Christian Schaller) + +Inserted "/**/" between patch numbers in src/version.c. This allows for one +line of context, which some versions of patch need. + +Reordered the Syntax menu to avoid long submenus. Removed keyboard shortcuts +for alphabetical items to avoid a clash with fixed items. + + +Added *added-5.6* +----- + +Included Exuberant Ctags version 3.4. (Darren Hiebert) + +OpenWithVim in Python. (Christian Schaller) + +Win32 GUI: gvimext.dll, for the context menu "Edit with Vim" entry. Avoids +the reported problems with the MS Office taskbar. Now it's a Shell Extension. +(Tianmiao Hu) + +New syntax files: +abel Abel (John Cook) +aml Arc Macro Language (Nikki Knuit) +apachestyle Apache-style config file (Christian Hammers) +cf Cold Fusion (Jeff Lanzarotta) +ctrlh files with CTRL-H sequences (Bram Moolenaar) +cupl CUPL (John Cook) +cuplsim CUPL simulation (John Cook) +erlang Erlang (Kresimir Marzic) +gedcom Gedcom (Paul Johnson) +icon Icon (Wendell Turner) +ist MakeIndex style (Peter Meszaros) +jsp Java Server Pages (Rafael Garcia-Suarez) +rcslog Rcslog (Joe Karthauser) +remind Remind (Davide Alberani) +sqr Structured Query Report Writer (Paul Moore) +tads TADS (Amir Karger) +texinfo Texinfo (Sandor Kopanyi) +xpm2 X Pixmap v2 (Steve Wall) + +The 'C' flag in 'cpoptions' can be used to switch off concatenation for +sourced lines. See patch 5.5.013 below. |line-continuation| + +"excludenl" argument for the ":syntax" command. See patch 5.5.032 below. +|:syn-excludenl| + +Implemented |z+| and |z^| commands. See patch 5.5.050 below. + +Vim logo in Corel Draw format. Can be scaled to any resolution. + + +Fixed *fixed-5.6* +----- + +Using this mapping in Select mode, terminated completion: +":vnoremap <C-N> <Esc>a<C-N>" (Benji Fisher) +Ignore K_SELECT in ins_compl_prep(). + +VMS (Zoltan Arpadffy, David Elins): +- ioctl() in pty.c caused trouble, #ifndef VMS added. +- Cut & paste mismatch corrected. +- Popup menu line crash corrected. (Patch 5.5.047) +- Motif directories during open and save as corrected. +- Handle full file names with version numbers. (Patch 5.5.046) +- Directory handling (CD command etc.) +- Corrected file name conversion VMS to Unix and v.v. +- Recovery was not working. +- Terminal and signal handling was outdated compared to os_unix.c. +- Improved os_vms.txt. + +Configure used fprintf() instead of printf() to check for __DATE__ and +__TIME__. (John Card II) + +BeOS: Adjust computing the char_height and char_ascent. Round them up +separately, avoids redrawing artifacts. (Mike Steed) + +Fix a few multi-byte problems in menu_name_skip(), set_reg_ic(), searchc() and +findmatchlimit(). (Taro Muraoka) + +GTK GUI: +- With GTK 1.2.5 and later the scrollbars were not redrawn correctly. +- Adjusted the gtk_form_draw() function. +- SNiFF connection didn't work. +- 'mousefocus' was not working. (Dalecki) +- Some keys were not working with modifiers: Shift-Tab, Ctrl-Space and CTRL-@. + + +Patch 5.5.001 +Problem: Configure in the top directory did not pass on an argument with a + space correctly. For example "./configure --previs="/My home". + (Stephane Chazelas) +Solution: Use '"$@"' instead of '$*' to pass on the arguments. +Files: configure + +Patch 5.5.002 +Problem: Compilation error for using "fds[] & POLLIN". (Jeff Walker) +Solution: Use "fds[].revents & POLLIN". +Files: src/os_unix.c + +Patch 5.5.003 +Problem: The autoconf check for sizeof(int) is wrong on machines where + sizeof(size_t) != sizeof(int). +Solution: Use our own configure check. Also fixes the warning for + cross-compiling. +Files: src/configure.in, src/configure + +Patch 5.5.004 +Problem: On Unix it's not possible to interrupt ":sleep 100". +Solution: Switch terminal to cooked mode while asleep, to allow a SIGINT to + wake us up. But switch off echo, added TMODE_SLEEP. +Files: src/term.h, src/os_unix.c + +Patch 5.5.005 +Problem: When using <f-args> with a user command, an empty argument to the + command resulted in one empty string, while no string was + expected. +Solution: Catch an empty argument and pass no argument to the function. + (Paul Moore) +Files: src/ex_docmd.c + +Patch 5.5.006 +Problem: Python: When platform-dependent files are in another directory + than the platform-independent files it doesn't work. +Solution: Also check the executable directory, and add it to CFLAGS. (Tessa + Lau) +Files: src/configure.in, src/configure + +Patch 5.5.007 (extra) +Problem: Win32 OLE: Occasional crash when exiting while still being used + via OLE. +Solution: Move OleUninitialize() to before deleting the application object. + (Vince Negri) +Files: src/if_ole.cpp + +Patch 5.5.008 +Problem: 10000@@ takes a long time and cannot be interrupted. +Solution: Check for CTRL-C typed while in the loop to push the register. +Files: src/normal.c + +Patch 5.5.009 +Problem: Recent Sequent machines don't link with "-linet". (Kurtis Rader) +Solution: Remove configure check for Sequent. +Files: src/configure.in, src/configure + +Patch 5.5.010 +Problem: Ctags freed a memory block twice when exiting. When out of + memory, a misleading error message was given. +Solution: Update to ctags 3.3.2. Also fixes a few other problems. (Darren + Hiebert) +Files: src/ctags/* + +Patch 5.5.011 +Problem: After "CTRL-V s", the cursor jumps back to the start, while all + other operators leave the cursor on the last changed character. + (Xiangjiang Ma) +Solution: Position cursor on last changed character, if possible. +Files: src/ops.c + +Patch 5.5.012 +Problem: Using CTRL-] in Visual mode doesn't work when the text includes a + space (just where it's useful). (Stefan Bittner) +Solution: Don't escape special characters in a tag name with a backslash. +Files: src/normal.c + +Patch 5.5.013 +Problem: The ":append" and ":insert" commands allow using a leading + backslash in a line. The ":source" command concatenates those + lines. (Heinlein) +Solution: Add the 'C' flag in 'cpoptions' to switch off concatenation. +Files: src/ex_docmd.c, src/option.h, runtime/doc/options.txt, + runtime/filetype.vim, runtime/scripts.vim + +Patch 5.5.014 +Problem: When executing a register with ":@", the ":append" command would + get text lines with a ':' prepended. (Heinlein) +Solution: Remove the ':' characters. +Files: src/ex_docmd.c, src/ex_getln.c, src/globals.h + +Patch 5.5.015 +Problem: When using ":g/pat/p", it's hard to see where the output starts, + the ":g" command is overwritten. Vi keeps the ":g" command. +Solution: Keep the ":g" command, but allow overwriting it with the report + for the number of changes. +Files: src/ex_cmds.c + +Patch 5.5.016 (extra) +Problem: Win32: Using regedit to install Vim in the popup menu requires the + user to confirm this in a dialog. +Solution: Use "regedit /s" to avoid the dialog +Files: src/dosinst.c + +Patch 5.5.017 +Problem: If an error occurs when closing the current window, Vim could get + stuck in the error handling. +Solution: Don't set curwin to NULL when closing the current window. +Files: src/window.c + +Patch 5.5.018 +Problem: Absolute paths in shell scripts do not always work. +Solution: Use /usr/bin/env to find out the path. +Files: runtime/doc/vim2html.pl, runtime/tools/efm_filter.pl, + runtime/tools/shtags.pl + +Patch 5.5.019 +Problem: A function call in 'statusline' stops using ":q" twice from + exiting, when the last argument hasn't been edited. +Solution: Don't decrement quitmore when executing a function. (Madsen) +Files: src/ex_docmd.c + +Patch 5.5.020 +Problem: When the output of CTRL-D completion in the commandline goes all + the way to the last column, there is an empty line. +Solution: Don't add a newline when the cursor wrapped already. (Madsen) +Files: src/ex_getln.c + +Patch 5.5.021 +Problem: When checking if a file name in the tags file is relative, + environment variables were not expanded. +Solution: Expand the file name before checking if it is relative. (Madsen) +Files: src/tag.c + +Patch 5.5.022 +Problem: When setting or resetting 'paste' the ruler wasn't updated. +Solution: Update the status lines when 'ruler' changes because of 'paste'. +Files: src/option.c + +Patch 5.5.023 +Problem: When editing a new file and autocommands change the cursor + position, the cursor was moved back to the first non-white, unless + 'startofline' was reset. +Solution: Keep the new column, just like the line number. +Files: src/ex_cmds.c + +Patch 5.5.024 (extra) +Problem: Win32 GUI: When using confirm() to put up a dialog without a + default button, the dialog would not have keyboard focus. + (Krishna) +Solution: Always set focus to the dialog window. Only set focus to a button + when a default one is specified. +Files: src/gui_w32.c + +Patch 5.5.025 +Problem: When using "keepend" in a syntax region, a contained match that + includes the end-of-line could still force that region to + continue, if there is another contained match in between. +Solution: Check the keepend_level in check_state_ends(). +Files: src/syntax.c + +Patch 5.5.026 +Problem: When starting Vim in a white-on-black xterm, with 'bg' set to + "dark", and then starting the GUI with ":gui", setting 'bg' to + "light" in the gvimrc, the highlighting isn't set. (Tsjokwing) +Solution: Set the highlighting when 'bg' is changed in the gvimrc, even + though full_screen isn't set. +Files: src/option.c + +Patch 5.5.027 +Problem: Unix: os_unix.c doesn't compile when XTERM_CLIP is used but + WANT_TITLE isn't. (Barnum) +Solution: Move a few functions that are used by the X11 title and clipboard + and put another "#if" around it. +Files: src/os_unix.c + +Patch 5.5.028 (extra) +Problem: Win32 GUI: When a file is dropped on Win32 gvim while at the ":" + prompt, the file is edited but the command line is actually still + there, the cursor goes back to command line on the next command. + (Krishna) +Solution: When dropping a file or directory on gvim while at the ":" prompt, + insert the name of the file/directory. Allows using the + file/directory name for any Ex command. +Files: src/gui_w32.c + +Patch 5.5.029 +Problem: "das" at the end of the file didn't delete the last character of + the sentence. +Solution: When there is no character after the sentence, make the operation + inclusive in current_sent(). +Files: src/search.c + +Patch 5.5.030 +Problem: Unix: in os_unix.c, "term_str" is used, which is also defined in + vim.h as a macro. (wuxin) +Solution: Renamed "term_str" to "buf" in do_xterm_trace(). +Files: src/os_unix.c + +Patch 5.5.031 (extra) +Problem: Win32 GUI: When exiting Windows, gvim will leave swap files behind + and will be killed ungracefully. (Krishna) +Solution: Catch the WM_QUERYENDSESSION and WM_ENDSESSION messages and try to + exit gracefully. Allow the user to cancel the shutdown if there + is a changed buffer. +Files: src/gui_w32.c + +Patch 5.5.032 +Problem: Patch 5.5.025 wasn't right. And C highlighting was still not + working correctly for a #define. +Solution: Added "excludenl" argument to ":syntax", to be able not to extend + a containing item when there is a match with the end-of-line. +Files: src/syntax.c, runtime/doc/syntax.txt, runtime/syntax/c.vim + +Patch 5.5.033 +Problem: When reading from stdin, a long line in viminfo would mess up the + file message. readfile() uses IObuff for keep_msg, which could be + overwritten by anyone. +Solution: Copy the message from IObuff to msg_buf and set keep_msg to that. + Also change vim_fgets() to not use IObuff any longer. +Files: src/fileio.c + +Patch 5.5.034 +Problem: "gvim -rv" caused a crash. Using 't_Co' before it's set. +Solution: Don't try to initialize the highlighting before it has been + initialized from main(). +Files: src/syntax.c + +Patch 5.5.035 +Problem: GTK with XIM: Resizing with status area was messy, and + ":set guioptions+=b" didn't work. +Solution: Make status area a separate widget, but not a separate window. + (Chi-Deok Hwang) +Files: src/gui_gtk_f.c, src/gui_gtk_x11.c, src/multbyte.c + +Patch 5.5.036 +Problem: The GZIP_read() function in $VIMRUNTIME/vimrc_example.vim to + uncompress a file did not do detection for 'fileformat'. This is + because the filtering is done with 'binary' set. +Solution: Split the filtering into separate write, filter and read commands. +Files: runtime/vimrc_example.vim + +Patch 5.5.037 +Problem: The "U" command didn't mark the buffer as changed. (McCormack) +Solution: Set the 'modified' flag when using "U". +Files: src/undo.c + +Patch 5.5.038 +Problem: When typing a long ":" command, so that the screen scrolls up, + causes the hit-enter prompt, even though the user just typed + return to execute the command. +Solution: Reset need_wait_return if (part of) the command was typed in + getcmdline(). +Files: src/ex_getln.c + +Patch 5.5.039 +Problem: When using a custom status line, "%a" (file # of #) reports the + index of the current window for all windows. +Solution: Pass a window pointer to append_arg_number(), and pass the window + being updated from build_stl_str_hl(). (Stephen P. Wall) +Files: src/buffer.c, src/screen.c, src/proto/buffer.pro + +Patch 5.5.040 +Problem: Multi-byte: When there is some error in xim_real_init(), it can + close XIM and return. After this there can be a segv. +Solution: Test "xic" for being non-NULL, don't set "xim" to NULL. Also try + to find more matches for supported styles. (Sung-Hyun Nam) +Files: src/multbyte.c + +Patch 5.5.041 +Problem: X11 GUI: CTRL-_ requires the SHIFT key only on some machines. +Solution: Translate CTRL-- to CTRL-_. (Robert Webb) +Files: src/gui_x11.c + +Patch 5.5.042 +Problem: X11 GUI: keys with ALT were assumed to be used for the menu, even + when the menu has been disabled by removing 'm' from 'guioptions'. +Solution: Ignore keys with ALT only when gui.menu_is_active is set. (Raf) +Files: src/gui_x11.c + +Patch 5.5.043 +Problem: GTK: Handling of fontset fonts was not right when 'guifontset' + contains exactly 14 times '-'. +Solution: Avoid setting fonts when working with a fontset. (Sung-Hyun Nam) +Files: src/gui_gtk_x11.c + +Patch 5.5.044 +Problem: pltags.pl contains an absolute path "/usr/local/bin/perl". That + might not work everywhere. +Solution: Use "/usr/bin/env perl" instead. +Files: runtime/tools/pltags.pl + +Patch 5.5.045 +Problem: Using "this_session" variable does not work, requires preceding it + with "v:". Default filename for ":mksession" isn't mentioned + in the docs. (Fisher) +Solution: Support using "this_session" to be backwards compatible. +Files: src/eval.c, runtime/doc/options.txt + +Patch 5.5.046 (extra) +Problem: VMS: problems with path and filename. +Solution: Truncate file name at last ';', etc. (Zoltan Arpadffy) +Files: src/buffer.c, src/fileio.c, src/gui_motif.c, src/os_vms.c, + src/proto/os_vms.pro + +Patch 5.5.047 +Problem: VMS: Crash when using the popup menu +Solution: Turn the #define MENU_MODE_CHARS into an array. (Arpadffy) +Files: src/structs.h, src/menu.c + +Patch 5.5.048 +Problem: HP-UX 11: Compiling doesn't work, because both string.h and + strings.h are included. (Squassabia) +Solution: The configure test for including both string.h and strings.h + must include <Xm/Xm.h> first, because it causes problems. +Files: src/configure.in, src/configure, src/config.h.in + +Patch 5.5.049 +Problem: Unix: When installing Vim, the protection bits of files might be + influenced by the umask. +Solution: Add $(FILEMOD) to Makefile. (Shetye) +Files: src/Makefile + +Patch 5.5.050 +Problem: "z+" and "z^" commands are missing. +Solution: Implemented "z+" and "z^". +Files: src/normal.c, runtime/doc/scroll.txt, runtime/doc/index.txt + +Patch 5.5.051 +Problem: Several Unix systems have a problem with the optimization limits + check in configure. +Solution: Removed the configure check, let the user add it manually in + Makefile or the environment. +Files: src/configure.in, src/configure, src/Makefile + +Patch 5.5.052 +Problem: Crash when using a cursor key at the ATTENTION prompt. (Alberani) +Solution: Ignore special keys at the console dialog. Also ignore characters + > 255 for other uses of tolower() and toupper(). +Files: src/menu.c, src/message.c, src/misc2.c + +Patch 5.5.053 +Problem: Indenting is wrong after a function when 'cino' has "fs". Another + problem when 'cino' has "{s". +Solution: Put line after closing "}" of a function at the left margin. + Apply ind_open_extra in the right way after a '{'. +Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok + +Patch 5.5.054 +Problem: Unix: ":e #" doesn't work if the alternate file name contains a + space or backslash. (Hudacek) +Solution: When replacing "#", "%" or other items that stand for a file name, + prepend a backslash before special characters. +Files: src/ex_docmd.c + +Patch 5.5.055 +Problem: Using "<C-V>$r-" in blockwise Visual mode replaces one character + beyond the end of the line. (Zivkov) +Solution: Only replace existing characters. +Files: src/ops.c + +Patch 5.5.056 +Problem: After "z20<CR>" messages were printed at the old command line + position once. (Veselinovic) +Solution: Set msg_row and msg_col when changing cmdline_row in + win_setheight(). +Files: src/window.c + +Patch 5.5.057 +Problem: After "S<Esc>" it should be possible to restore the line with "U". + (Veselinovic) +Solution: Don't call u_clearline() in op_delete() when changing only one + line. +Files: src/ops.c + +Patch 5.5.058 +Problem: Using a long search pattern and then "n" causes the hit-enter + prompt. (Krishna) +Solution: Truncate the echoed pattern, like other messages. Moved code for + truncating from msg_attr() to msg_strtrunc(). +Files: src/message.c, src/proto/message.pro, src/search.c + +Patch 5.5.059 +Problem: GTK GUI: When $term is invalid, using "gvim" gives an error + message, even though $term isn't really used. (Robbins) +Solution: When the GUI is about to start, skip the error messages for a + wrong $term. +Files: src/term.c + +Patch 5.5.060 (extra) +Problem: Dos 32 bit: When a directory in 'backupdir' doesn't exist, ":w" + causes the file to be renamed to "axlqwqhy.ba~". (Matzdorf) +Solution: The code to work around a LFN bug in Windows 95 doesn't handle a + non-existing target name correctly. When renaming fails, make + sure the file has its original name. Also do this for the Win32 + version, although it's unlikely that it runs into this problem. +Files: src/os_msdos.c, src/os_win32.c + +Patch 5.5.061 +Problem: When using "\:" in a modeline, the backslash is included in the + option value. (Mohsin) +Solution: Remove one backslash before the ':' in a modeline. +Files: src/buffer.c, runtime/doc/options.txt + +Patch 5.5.062 (extra) +Problem: Win32 console: Temp files are created in the root of the current + drive, which may be read-only. (Peterson) +Solution: Use the same mechanism of the GUI version: Use $TMP, $TEMP or the + current directory. Cleaned up vim_tempname() a bit. +Files: src/fileio.c, src/os_win32.h, runtime/doc/os_dos.txt + +Patch 5.5.063 +Problem: When using whole-line completion in Insert mode, 'cindent' is + applied, even after changing the indent of the line. +Solution: Don't reindent the completed line after inserting/removing indent. + (Robert Webb) +Files: src/edit.c + +Patch 5.5.064 +Problem: has("sniff") doesn't work correctly. +Solution: Return 1 when Vim was compiled with the +sniff feature. (Pruemmer) +Files: src/eval.c + +Patch 5.5.065 +Problem: When dropping a file on Vim, the 'shellslash' option is not + effective. (Krishna) +Solution: Fix the slashes in the dropped file names according to + 'shellslash'. +Files: src/ex_docmd.c, runtime/doc/options.txt + +Patch 5.5.066 +Problem: For systems with backslash in file name: Setting a file name + option to a value starting with "\\machine" removed a backslash. +Solution: Keep the double backslash for "\\machine", but do change + "\\\\machine" to "\\machine" for backwards compatibility. +Files: src/option.c, runtime/doc/options.txt + +Patch 5.5.067 +Problem: With 'hlsearch' set, the pattern "\>" doesn't highlight the first + match in a line. (Benji Fisher) +Solution: Fix highlighting an empty match. Also highlight the first + character in an empty line for "$". +Files: src/screen.c + +Patch 5.5.068 +Problem: Crash when a ":while" is used with an argument that has an error. + (Sylvain Viart) +Solution: Was using an uninitialized index in the cs_line[] array. The + crash only happened when the index was far off. Made sure the + uninitialized index isn't used. +Files: src/ex_docmd.c + +Patch 5.5.069 +Problem: Shifting lines in blockwise Visual mode didn't set the 'modified' + flag. +Solution: Do set the 'modified' flag. +Files: src/ops.c + +Patch 5.5.070 +Problem: When editing a new file, creating that file outside of Vim, then + editing it again, ":w" still warns for overwriting an existing + file. (Nam) +Solution: The BF_NEW flag in the "b_flags" field wasn't cleared properly. +Files: src/buffer.c, src/fileio.c + +Patch 5.5.071 +Problem: Using a matchgroup in a ":syn region", which is the same syntax + group as the region, didn't stop a contained item from matching in + the start pattern. +Solution: Also push an item on the stack when the syntax ID of the + matchgroup is the same as the syntax ID of the region. +Files: src/syntax.c + +Patch 5.5.072 (extra) +Problem: Dos 32 bit: When setting 'columns' to a too large value, Vim may + crash, and the DOS console too. +Solution: Check that the value of 'columns' isn't larger than the number of + columns that the BIOS reports. +Files: src/os_msdos.c, src/proto/os_msdos.pro, src/option.c + +Patch 5.5.073 (extra) +Problem: Win 32 GUI: The Find and Find/Replace dialogs didn't show the + "match case" checkbox. The Find/Replace dialog didn't handle the + "match whole word" checkbox. +Solution: Support the "match case" and "match whole word" checkboxes. +Files: src/gui_w32.c + +Patch 5.6a.001 +Problem: Using <C-End> with a count doesn't work like it does with "G". + (Benji Fisher) +Solution: Accept a count for <C-End> and <C-Home>. +Files: src/normal.c + +Patch 5.6a.002 +Problem: The script for conversion to HTML was an older version. +Solution: Add support for running 2html.vim on a color terminal. +Files: runtime/syntax/2html.vim + +Patch 5.6a.003 +Problem: Defining a function inside a function didn't give an error + message. A missing ":endfunction" doesn't give an error message. +Solution: Allow defining a function inside a function. +Files: src/eval.c, runtime/doc/eval.txt + +Patch 5.6a.004 +Problem: A missing ":endwhile" or ":endif" doesn't give an error message. + (Johannes Zellner) +Solution: Check for missing ":endwhile" and ":endif" in sourced files. + Add missing ":endif" in file selection macros. +Files: src/ex_docmd.c, runtime/macros/file_select.vim + +Patch 5.6a.005 +Problem: 'hlsearch' was not listed alphabetically. The value of 'toolbar' + was changed when 'compatible' is set. +Solution: Moved entry of 'hlsearch' in options[] table down. + Don't reset 'toolbar' option to the default value when + 'compatible' is set. +Files: src/option.c + +Patch 5.6a.006 +Problem: Using a backwards range inside ":if 0" gave an error message. +Solution: Don't complain about a range when it is not going to be used. + (Stefan Roemer) +Files: src/ex_docmd.c + +Patch 5.6a.007 +Problem: ":let" didn't show internal Vim variables. (Ron Aaron) +Solution: Do show ":v" variables for ":let" and ":let v:name". +Files: src/eval.c + +Patch 5.6a.008 +Problem: Selecting a syntax from the Syntax menu gives an error message. +Solution: Replace "else if" in SetSyn() with "elseif". (Ronald Schild) +Files: runtime/menu.vim + +Patch 5.6a.009 +Problem: When compiling with +extra_search but without +syntax, there is a + compilation error in screen.c. (Axel Kielhorn) +Solution: Adjust the #ifdef for declaring and initializing "line" in + win_line(). Also solve compilation problem when +statusline is + used without +eval. Another one when +cmdline_compl is used + without +eval. +Files: src/screen.c, src/misc2.c + +Patch 5.6a.010 +Problem: In a function, ":startinsert!" does not append to the end of the + line if a ":normal" command was used to move the cursor. (Fisher) +Solution: Reset "w_set_curswant" to avoid that w_curswant is changed again. +Files: src/ex_docmd.c + +Patch 5.6a.011 (depends on 5.6a.004) +Problem: A missing ":endif" or ":endwhile" in a function doesn't give an + error message. +Solution: Give that error message. +Files: src/ex_docmd.c + +Patch 5.6a.012 (depends on 5.6a.008) +Problem: Some Syntax menu entries caused a hit-enter prompt. +Solution: Call a function to make the command shorter. Also rename a few + functions to avoid name clashes. +Files: runtime/menu.vim + +Patch 5.6a.013 +Problem: Command line completion works different when another completion + was done earlier. (Johannes Zellner) +Solution: Reset wim_index when starting a new completion. +Files: src/ex_getln.c + +Patch 5.6a.014 +Problem: Various warning messages when compiling and running lint with + different combinations of features. +Solution: Fix the warning messages. +Files: src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/gui_gtk_x11.c, + src/option.c, src/screen.c, src/search.c, src/syntax.c, + src/feature.h, src/globals.h + +Patch 5.6a.015 +Problem: The vimtutor command doesn't always know the value of $VIMRUNTIME. +Solution: Let Vim expand $VIMRUNTIME, instead of the shell. +Files: src/vimtutor + +Patch 5.6a.016 (extra) +Problem: Mac: Window size is restricted when starting. Cannot drag the + window all over the desktop. +Solution: Get real screen size instead of assuming 640x400. Do not use a + fixed number for the drag limits. (Axel Kielhorn) +Files: src/gui_mac.c + +Patch 5.6a.017 +Problem: The "Paste" entry in popup menu for Visual, Insert and Cmdline + mode is in the wrong position. (Stol) +Solution: Add priority numbers for all Paste menu entries. +Files: runtime/menu.vim + +Patch 5.6a.018 +Problem: GTK GUI: submenu priority doesn't work. + Help dialog could be destroyed too soon. + When closing a dialog window (e.g. the "ATTENTION" one), Vim would + just hang. + When GTK theme is changed, Vim doesn't adjust to the new colors. + Argument for ":promptfind" isn't used. +Solution: Fixed the mentioned problems. + Made the dialogs look&feel nicer. + Moved functions to avoid the need for a forward declaration. + Fixed reentrancy of the file browser dialog. + Added drag&drop support for GNOME. + Init the text for the Find/replace dialog from the last used + search string. Set "match whole word" toggle button correctly. + Made repeat rate for drag outside of window depend on the + distance from the window. (Marcin Dalecki) + Made the drag in Visual mode actually work. + Removed recursiveness protection from gui_mch_get_rgb(), it might + cause more trouble than it solves. +Files: src/ex_docmd.c, src/gui_gtk.c, src/gui_gtk_x11.c, src/ui.c, + src/proto/ui.pro, src/misc2.c + +Patch 5.6a.019 +Problem: When trying to recover through NFS, which uses a large block size, + Vim might think the swap file is empty, because mf_blocknr_max is + zero. (Scott McDermott) +Solution: When computing the number of blocks of the file in mf_open(), + round up instead of down. +Files: src/memfile.c + +Patch 5.6a.020 +Problem: GUI GTK: Could not set display for gvim. +Solution: Add "-display" and "--display" arguments. (Marcin Dalecki) +Files: src/gui_gtk_x11.c + +Patch 5.6a.021 +Problem: Recovering still may not work when the block size of the device + where the swap file is located is larger than 4096. +Solution: Read block 0 with the minimal block size. +Files: src/memline.c, src/memfile.c, src/vim.h + +Patch 5.6a.022 (extra) +Problem: Win32 GUI: When an error in the vimrc causes a dialog to pop up + (e.g., for an existing swap file), Vim crashes. (David Elins) +Solution: Before showing a dialog, open the main window. +Files: src/gui_w32.c + +Patch 5.6a.023 +Problem: Using expand("%:gs??/?") causes a crash. (Ron Aaron) +Solution: Check for running into the end of the string in do_string_sub(). +Files: src/eval.c + +Patch 5.6a.024 +Problem: Using an autocommand to delete a buffer when leaving it can cause + a crash when jumping to a tag. (Franz Gorkotte) +Solution: In do_tag(), store tagstacklen before jumping to another buffer. + Check tagstackidx after jumping to another buffer. + Add extra check in win_split() if tagname isn't NULL. +Files: src/tag.c, src/window.c + +Patch 5.6a.025 (extra) +Problem: Win32 GUI: The tables for toupper() and tolower() are initialized + too late. (Mike Steed) +Solution: Move the initialization to win32_init() and call it from main(). +Files: src/main.c, src/os_w32.c, src/proto/os_w32.pro + +Patch 5.6a.026 +Problem: When the SNiFF connection is open, shell commands hang. (Pruemmer) +Solution: Skip a second wait() call if waitpid() already detected that the + child has exited. +Files: src/os_unix.c + +Patch 5.6a.027 (extra) +Problem: Win32 GUI: The "Edit with Vim" popup menu entry causes problems + for the Office toolbar. +Solution: Use a shell extension dll. (Tianmiao Hu) + Added it to the install and uninstal programs, replaces the old + "Edit with Vim" menu registry entries. +Files: src/dosinst.c, src/uninstal.c, gvimext/*, runtime/doc/gui_w32.txt + +Patch 5.6a.028 (extra) +Problem: Win32 GUI: Dialogs and tear-off menus can't handle multi-byte + characters. +Solution: Adjust nCopyAnsiToWideChar() to handle multi-byte characters + correctly. +Files: src/gui_w32.c + +============================================================================== +VERSION 5.7 *version-5.7* + +Version 5.7 is a bug-fix version of 5.6. + +Changed *changed-5.7* +------- + +Renamed src/INSTALL.mac to INSTALL_mac.txt to avoid it being recognized with a +wrong file type. Also renamed src/INSTALL.amiga to INSTALL_ami.txt. + + +Added *added-5.7* +----- + +New syntax files: +stp Stored Procedures (Jeff Lanzarotta) +snnsnet, snnspat, snnsres SNNS (Davide Alberani) +mel MEL (Robert Minsk) +ruby Ruby (Mirko Nasato) +tli TealInfo (Kurt W. Andrews) +ora Oracle config file (Sandor Kopanyi) +abaqus Abaqus (Carl Osterwisch) +jproperties Java Properties (Simon Baldwin) +apache Apache config (Allan Kelly) +csp CSP (Jan Bredereke) +samba Samba config (Rafael Garcia-Suarez) +kscript KDE script (Thomas Capricelli) +hb Hyper Builder (Alejandro Forero Cuervo) +fortran Fortran (rewritten) (Ajit J. Thakkar) +sml SML (Fabrizio Zeno Cornelli) +cvs CVS commit (Matt Dunford) +aspperl ASP Perl (Aaron Hope) +bc BC calculator (Vladimir Scholtz) +latte Latte (Nick Moffitt) +wml WML (Gerfried Fuchs) + +Included Exuberant ctags 3.5.1. (Darren Hiebert) + +"display" and "fold" arguments for syntax items. For future extension, they +are ignored now. + +strftime() function for the Macintosh. + +macros/explorer.vim: A file browser script (M A Aziz Ahmed) + + +Fixed *fixed-5.7* +----- + +The 16 bit MS-DOS version is now compiled with Bcc 3.1 instead of 4.0. The +executable is smaller. + +When a "make test" failed, the output file was lost. Rename it to +test99.failed to be able to see what went wrong. + +After sourcing bugreport.vim, it's not clear that bugreport.txt has been +written in the current directory. Edit bugreport.txt to avoid that. + +Adding IME support when using Makefile.w32 didn't work. (Taro Muraoka) + +Win32 console: Mouse drags were passed on even when the mouse didn't move. + +Perl interface: In Buffers(), type of argument to SvPV() was int, should be +STRLEN. (Tony Leneis) + +Problem with prototype for index() on AIX 4.3.0. Added check for _AIX43 in +os_unix.h. (Jake Hamby) + +Mappings in mswin.vim could break when some commands are mapped. Add "nore" +to most mappings to avoid re-mapping. + +modify_fname() made a copy of a file name for ":p" when it already was a full +path name, which is a bit slow. + +Win32 with Borland C++ 5.5: Pass the path to the compiler on to xxd and ctags, +to avoid depending on $PATH. Fixed "make clean". + +Many fixes to Macintosh specific parts: (mostly by Dany StAmant) +- Only one Help menu. +- No more crash when removing a menu item. +- Support as External Editor for Codewarrior (still some little glitches). +- Popup menu support. +- Fixed crash when pasting after application switch. +- Color from rgb.txt properly displayed. +- 'isprint' default includes all chars above '~'. (Axel Kielhorn) +- mac_expandpath() was leaking memory. +- Add digraphs table. (Axel Kielhorn) +- Multi-byte support: (Kenichi Asai) + Switch keyscript when going in/out of Insert mode. + Draw multi-byte character correctly. + Don't use mblen() but highest bit of char to detect multi-byte char. + Display value of multi-byte in statusline (also for other systems). +- mouse button was not initialized properly to MOUSE_LEFT when + USE_CTRLCLICKMENU not defined. +- With Japanese SJIS characters: Make "w", "b", and "e" work + properly. (Kenichi Asai) +- Replaced old CodeWarrior file os_mac.CW9.hqx with os_mac.cw5.sit.hqx. + +Fixes for VMS: (Zoltan Arpadffy) (also see patch 5.6.045 below) +- Added Makefile_vms.mms and vimrc.vms to src/testdir to be able to run the + tests. +- Various fixes. +- Set 'undolevels' to 1000 by default. +- Made mch_settitle() equivalent to the one in os_unix.c. + +RiscOS: A few prototypes for os_riscos.c were outdated. Generate prototypes +automatically. + + +Previously released patches: + +Patch 5.6.001 +Problem: When using "set bs=0 si cin", Inserting "#<BS>" or "}<BS>" which + reduces the indent doesn't delete the "#" or "}". (Lorton) +Solution: Adjust ai_col in ins_try_si(). +Files: src/edit.c + +Patch 5.6.002 +Problem: When using the vim.vim syntax file, a comment with all uppercase + characters causes a hang. +Solution: Adjust pattern for vimCommentTitle (Charles Campbell) +Files: runtime/syntax/vim.vim + +Patch 5.6.003 +Problem: GTK GUI: Loading a user defined toolbar bitmap gives a warning + about the colormap. Probably because the window has not been + opened yet. +Solution: Use gdk_pixmap_colormap_create_from_xpm() to convert the xpm file. + (Keith Radebaugh) +Files: src/gui_gtk.c + +Patch 5.6.004 (extra) +Problem: Win32 GUI with IME: When setting 'guifont' to "*", the font + requester appears twice. +Solution: In gui_mch_init_font() don't call get_logfont() but copy + norm_logfont from fh. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + +Patch 5.6.005 +Problem: When 'winminheight' is zero, CTRL-W - with a big number causes a + crash. (David Kotchan) +Solution: Check for negative window height in win_setheight(). +Files: src/window.c + +Patch 5.6.006 +Problem: GTK GUI: Bold font cannot always be used. Memory is freed too + early in gui_mch_init_font(). +Solution: Move call to g_free() to after where sdup is used. (Artem Hodyush) +Files: src/gui_gtk_x11.c + +Patch 5.6.007 (extra) +Problem: Win32 IME: Font is not changed when screen font is changed. And + IME composition window does not trace the cursor. +Solution: Initialize IME font. When cursor is moved, set IME composition + window with ImeSetCompositionWindow(). Add call to + ImmReleaseContext() in several places. (Taro Muraoka) +Files: src/gui.c, src/gui_w32.c, src/proto/gui_w32.pro + +Patch 5.6.008 (extra) +Problem: Win32: When two files exist with the same name but different case + (through NFS or Samba), fixing the file name case could cause the + wrong one to be edited. +Solution: Prefer a perfect match above a match while ignoring case in + fname_case(). (Flemming Madsen) +Files: src/os_win32.c + +Patch 5.6.009 (extra) +Problem: Win32 GUI: Garbage in Windows Explorer help line when selecting + "Edit with Vim" popup menu entry. +Solution: Only return the help line when called with the GCS_HELPTEXT flag. + (Tianmiao Hu) +Files: GvimExt/gvimext.cpp + +Patch 5.6.010 +Problem: A file name which contains a TAB was not read correctly from the + viminfo file and the ":ls" listing was not aligned properly. +Solution: Parse the buffer list lines in the viminfo file from the end + backwards. Count a Tab for two characters to align the ":ls" list. +Files: src/buffer.c + +Patch 5.6.011 +Problem: When 'columns' is huge (using a tiny font) and 'statusline' is + used, Vim can crash. +Solution: Limit maxlen to MAXPATHL in win_redr_custom(). (John Mullin) +Files: src/screen.c + +Patch 5.6.012 +Problem: When using "zsh" for /bin/sh, toolcheck may hang until "exit" is + typed. (Kuratczyk) +Solution: Add "-c exit" when checking for the shell version. +Files: src/toolcheck + +Patch 5.6.013 +Problem: Multibyte char in tooltip is broken. +Solution: Consider multibyte char in replace_termcodes(). (Taro Muraoka) +Files: src/term.c + +Patch 5.6.014 +Problem: When cursor is at the end of line and the character under cursor + is a multibyte character, "yl" doesn't yank 1 multibyte-char. + (Takuhiro Nishioka) +Solution: Recognize a multibyte-char at end-of-line correctly in oneright(). + (Taro Muraoka) + Also: make "+quickfix" in ":version" output appear alphabetically. +Files: src/edit.c + +Patch 5.6.015 +Problem: New xterm delete key sends <Esc>[3~ by default. +Solution: Added <kDel> and <kIns> to make the set of keypad keys complete. +Files: src/edit.c, src/ex_getln.c, src/keymap.h, src/misc1.c, + src/misc2.c, src/normal.c, src/os_unix.c, src/term.c + +Patch 5.6.016 +Problem: When deleting a search string from history from inside a mapping, + another entry is deleted too. (Benji Fisher) +Solution: Reset last_maptick when deleting the last entry of the search + history. Also: Increment maptick when starting a mapping from + typed characters to avoid a just added search string being + overwritten or removed from history. +Files: src/ex_getln.c, src/getchar.c + +Patch 5.6.017 +Problem: ":s/e/\^M/" should replace an "e" with a CTRL-M, not split the + line. (Calder) +Solution: Replace the backslash with a CTRL-V internally. (Stephen P. Wall) +Files: src/ex_cmds.c + +Patch 5.6.018 +Problem: ":help [:digit:]" takes a long time to jump to the wrong place. +Solution: Insert a backslash to avoid the special meaning of '[]'. +Files: src/ex_cmds.c + +Patch 5.6.019 +Problem: "snd.c", "snd.java", etc. were recognized as "mail" filetype. +Solution: Make pattern for mail filetype more strict. +Files: runtime/filetype.vim + +Patch 5.6.020 (extra) +Problem: The DJGPP version eats processor time (Walter Briscoe). +Solution: Call __dpmi_yield() in the busy-wait loop. +Files: src/os_msdos.c + +Patch 5.6.021 +Problem: When 'selection' is "exclusive", a double mouse click in Insert + mode doesn't select last char in line. (Lutz) +Solution: Allow leaving the cursor on the NUL past the line in this case. +Files: src/edit.c + +Patch 5.6.022 +Problem: ":e \~<Tab>" expands to ":e ~\$ceelen", which doesn't work. +Solution: Re-insert the backslash before the '~'. +Files: src/ex_getln.c + +Patch 5.6.023 (extra) +Problem: Various warnings for the Ming compiler. +Solution: Changes to avoid the warnings. (Bill McCarthy) +Files: src/ex_cmds.c, src/gui_w32.c, src/os_w32exe.c, src/os_win32.c, + src/syntax.c, src/vim.rc + +Patch 5.6.024 (extra) +Problem: Win32 console: Entering CTRL-_ requires the shift key. (Kotchan) +Solution: Specifically catch keycode 0xBD, like the GUI. +Files: src/os_win32.c + +Patch 5.6.025 +Problem: GTK GUI: Starting the GUI could be interrupted by a SIGWINCH. + (Nils Lohner) +Solution: Repeat the read() call to get the gui_in_use value when + interrupted by a signal. +Files: src/gui.c + +Patch 5.6.026 (extra) +Problem: Win32 GUI: Toolbar bitmaps are searched for in + $VIMRUNTIME/bitmaps, while GTK looks in $VIM/bitmaps. (Keith + Radebaugh) +Solution: Use $VIM/bitmaps for both, because these are not part of the + distribution but defined by the user. +Files: src/gui_w32.c, runtime/doc/gui.txt + +Patch 5.6.027 +Problem: TCL: Crash when using a Tcl script (reported for Win32). +Solution: Call Tcl_FindExecutable() in main(). (Brent Fulgham) +Files: src/main.c + +Patch 5.6.028 +Problem: Xterm patch level 126 sends codes for mouse scroll wheel. + Fully works with xterm patch level 131. +Solution: Recognize the codes for button 4 (0x60) and button 5 (0x61). +Files: src/term.c + +Patch 5.6.029 +Problem: GTK GUI: Shortcut keys cannot be used for a dialog. (Johannes + Zellner) +Solution: Add support for shortcut keys. (Marcin Dalecki) +Files: src/gui_gtk.c + +Patch 5.6.030 +Problem: When closing a window and 'ea' is set, Vim can crash. (Yasuhiro + Matsumoto) +Solution: Set "curbuf" to a valid value in win_close(). +Files: src/window.c + +Patch 5.6.031 +Problem: Multi-byte: When a double-byte character ends in CSI, Vim waits + for another character to be typed. +Solution: Recognize the CSI as the second byte of a character and don't wait + for another one. (Yasuhiro Matsumoto) +Files: src/getchar.c + +Patch 5.6.032 +Problem: Functions with an argument that is a line number don't all accept + ".", "$", etc. (Ralf Arens) +Solution: Add get_art_lnum() and use it for setline(), line2byte() and + synID(). +Files: src/eval.c + +Patch 5.6.033 +Problem: Multi-byte: "f " sometimes skips to the second space. (Sung-Hyun + Nam) +Solution: Change logic in searchc() to skip trailing byte of a double-byte + character. + Also: Ask for second byte when searching for double-byte + character. (Park Chong-Dae) +Files: src/search.c + +Patch 5.6.034 (extra) +Problem: Compiling with Borland C++ 5.5 fails on tolower() and toupper(). +Solution: Use TO_LOWER() and TO_UPPER() instead. Also adjust the Makefile + to make using bcc 5.5 easier. +Files: src/edit.c, src/ex_docmd.c, src/misc1.c, src/Makefile.bor + +Patch 5.6.035 +Problem: Listing the"+comments" feature in the ":version" output depended + on the wrong ID. (Stephen P. Wall) +Solution: Change "CRYPTV" to "COMMENTS". +Files: src/version.c + +Patch 5.6.036 +Problem: GTK GUI: Copy/paste text doesn't work between gvim and Eterm. +Solution: Support TEXT and COMPOUND_TEXT selection targets. (ChiDeok Hwang) +Files: src/gui_gtk_x11.c + +Patch 5.6.037 +Problem: Multi-byte: Can't use "f" command with multi-byte character in GUI. +Solution: Enable XIM in Normal mode for the GUI. (Sung-Hyun Nam) +Files: src/gui_gtk_x11.c, src/multbyte.c + +Patch 5.6.038 +Problem: Multi-clicks in GUI are interpreted as a mouse wheel click. When + 'ttymouse' is "xterm" a mouse click is interpreted as a mouse + wheel click. +Solution: Don't recognize the mouse wheel in check_termcode() in the GUI. + Use 0x43 for a mouse drag in do_xterm_trace(), not 0x63. +Files: src/term.c, src/os_unix.c + +Patch 5.6.039 +Problem: Motif GUI under KDE: When trying to logout, Vim hangs up the + system. (Hermann Rochholz) +Solution: When handling the WM_SAVE_YOURSELF event, set the WM_COMMAND + property of the window to let the session manager know we finished + saving ourselves. +Files: src/gui_x11.c + +Patch 5.6.040 +Problem: When using ":s" command, matching the regexp is done twice. +Solution: After copying the matched line, adjust the pointers instead of + finding the match again. (Loic Grenie) Added vim_regnewptr(). +Files: src/ex_cmds.c, src/regexp.c, src/proto/regexp.pro + +Patch 5.6.041 +Problem: GUI: Athena, Motif and GTK don't give more than 10 dialog buttons. +Solution: Remove the limit on the number of buttons. + Also support the 'v' flag in 'guioptions'. + For GTK: Center the buttons. +Files: src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c + +Patch 5.6.042 +Problem: When doing "vim -u vimrc" and vimrc contains ":q", the cursor in + the terminal can remain off. +Solution: Call cursor_on() in mch_windexit(). +Files: src/os_unix.c + +Patch 5.6.043 (extra) +Problem: Win32 GUI: When selecting guifont with the dialog, 'guifont' + doesn't include the bold or italic attributes. +Solution: Append ":i" and/or ":b" to 'guifont' in gui_mch_init_font(). +Files: src/gui_w32.c + +Patch 5.6.044 (extra) +Problem: MS-DOS and Windows: The line that dosinst.exe appends to + autoexec.bat to set PATH is wrong when Vim is in a directory with + an embedded space. +Solution: Use double quotes for the value when there is an embedded space. +Files: src/dosinst.c + +Patch 5.6.045 (extra) (fixed version) +Problem: VMS: Various small problems. +Solution: Many small changes. (Zoltan Arpadffy) + File name modifier ":h" keeps the path separator. + File name modifier ":e" also removes version. + Compile with MAX_FEAT by default. + When checking for autocommands ignore version in file name. + Be aware of file names being case insensitive. + Added vt320 builtin termcap. + Be prepared for an empty default_vim_dir. +Files: runtime/gvimrc_example.vim, runtime/vimrc_example.vim, + runtime/doc/os_vms.txt, src/eval.c, src/feature.h, src/fileio.c, + src/gui_motif.c, src/gui_vms_conf.h, src/main.c, src/memline.c, + src/misc1.c, src/option.c, src/os_vms_conf.h, src/os_vms.c, + src/os_vms.h, src/os_vms.mms, src/tag.c, src/term.c, src/version.c + +Patch 5.6.046 +Problem: Systems with backslash in file name: With 'shellslash' set, "vim + */*.c" only uses a slash for the first file name. (Har'El) +Solution: Fix slashes in file name arguments after reading the vimrc file. +Files: src/option.c + +Patch 5.6.047 +Problem: $CPPFLAGS is not passed on to ctags configure. +Solution: Add it. (Walter Briscoe) +Files: src/config.mk.in, src/Makefile + +Patch 5.6.048 +Problem: CTRL-R in Command-line mode is documented to insert text as typed, + but inserts text literally. +Solution: Make CTRL-R insert text as typed, use CTRL-R CTRL-R to insert + literally. This is consistent with Insert mode. But characters + that end Command-line mode are inserted literally. +Files: runtime/doc/index.txt, runtime/doc/cmdline.txt, src/ex_getln.c, + src/ops.c, src/proto/ops.pro + +Patch 5.6.049 +Problem: Documentation for [!] after ":ijump" is wrong way around. (Benji + Fisher) +Solution: Fix the documentation. Also improve the code to check for a match + after a /* */ comment. +Files: runtime/doc/tagsearch.txt, src/search.c + +Patch 5.6.050 +Problem: Replacing is wrong when replacing a single-byte char with + double-byte char or the other way around. +Solution: Shift the text after the character when it is replaced. + (Yasuhiro Matsumoto) +Files: src/normal.c, src/misc1.c + +Patch 5.6.051 +Problem: ":tprev" and ":tnext" don't give an error message when trying to + go before the first or beyond the last tag. (Robert Webb) +Solution: Added error messages. Also: Delay a second when a file-read + message is going to overwrite an error message, otherwise it won't + be seen. +Files: src/fileio.c, src/tag.c + +Patch 5.6.052 +Problem: Multi-byte: When an Ex command has a '|' or '"' as a second byte, + it terminates the command. +Solution: Skip second byte of multi-byte char when checking for '|' and '"'. + (Asai Kenichi) +Files: src/ex_docmd.c + +Patch 5.6.053 +Problem: CTRL-] doesn't work on a tag that contains a '|'. (Cesar Crusius) +Solution: Escape '|', '"' and '\' in tag names when using CTRL-] and also + for command-line completion. +Files: src/ex_getln.c, src/normal.c + +Patch 5.6.054 +Problem: When using ":e" and ":e #" the cursor is put in the first column + when 'startofline' is set. (Cordell) +Solution: Use the last known column when 'startofline' is set. + Also, use ECMD_LAST more often to simplify the code. +Files: src/buffer.c, src/ex_cmds.c, src/ex_docmd.c, src/proto/buffer.pro + +Patch 5.6.055 +Problem: When 'statusline' only contains a text without "%" and doesn't fit + in the window, Vim crashes. (Ron Aaron) +Solution: Don't use the pointer for the first item if there is no item. +Files: src/screen.c + +Patch 5.6.056 (extra) +Problem: MS-DOS: F11 and F12 don't work when 'bioskey' is set. +Solution: Use enhanced keyboard functions. (Vince Negri) + Detect presence of enhanced keyboard and set bioskey_read and + bioskey_ready. +Files: src/os_msdos.c + +Patch 5.6.057 (extra) +Problem: Win32 GUI: Multi-byte characters are wrong in dialogs and tear-off + menus. +Solution: Use system font instead of a fixed font. (Matsumoto, Muraoka) +Files: src/gui_w32.c + +Patch 5.6.058 +Problem: When the 'a' flag is not in 'guioptions', non-Windows systems + copy Visually selected text to the clipboard/selection on a yank + or delete command anyway. On Windows it isn't done even when the + 'a' flag is included. +Solution: Respect the 'a' flag in 'guioptions' on all systems. +Files: src/normal.c + +Patch 5.6.059 (extra) +Problem: When moving the cursor over italic text and the characters spill + over to the cell on the right, that spill-over is deleted. + Noticed in the Win32 GUI, can happen on other systems too. +Solution: Redraw italic text starting from a blank, like this is already + done for bold text. (Vince Negri) +Files: src/gui.c, src/gui.h, src/gui_w32.c + +Patch 5.6.060 +Problem: Some bold characters spill over to the cell on the left, that + spill-over can remain sometimes. +Solution: Redraw a characters when the next character was bold and needs + redrawing. (Robert Webb) +Files: src/screen.c + +Patch 5.6.061 +Problem: When xterm sends 8-bit controls, recognizing the version response + doesn't work. + When using CSI instead of <Esc>[ for the termcap color codes, + using 16 colors doesn't work. (Neil Bird) +Solution: Also accept CSI in place of <Esc>[ for the version string. + Also check for CSI when handling colors 8-15 in term_color(). + Use CSI for builtin xterm termcap entries when 'term' contains + "8bit". +Files: runtime/doc/term.txt, src/ex_cmds.c, src/option.c, src/term.c, + src/os_unix.c, src/proto/option.pro, src/proto/term.pro + +Patch 5.6.062 +Problem: The documentation says that setting 'smartindent' doesn't have an + effect when 'cindent' is set, but it does make a difference for + lines starting with "#". (Neil Bird) +Solution: Really ignore 'smartindent' when 'cindent' is set. +Files: src/misc1.c, src/ops.c + +Patch 5.6.063 +Problem: Using "I" in Visual-block mode doesn't accept a count. (Johannes + Zellner) +Solution: Pass the count on to do_insert() and edit(). (Allan Kelly) +Files: src/normal.c, src/ops.c, src/proto/ops.pro + +Patch 5.6.064 +Problem: MS-DOS and Win32 console: Mouse doesn't work correctly after + including patch 5.6.28. (Vince Negri) +Solution: Don't check for mouse scroll wheel when the mouse code contains + the number of clicks. +Files: src/term.c + +Patch 5.6.065 +Problem: After moving the cursor around in Insert mode, typing a space can + still trigger an abbreviation. (Benji Fisher) +Solution: Don't check for an abbreviation after moving around in Insert mode. +Files: src/edit.c + +Patch 5.6.066 +Problem: Still a few bold character spill-over remains after patch 60. +Solution: Clear character just in front of blanking out rest of the line. + (Robert Webb) +Files: src/screen.c + +Patch 5.6.067 +Problem: When a file name contains a NL, the viminfo file is corrupted. +Solution: Use viminfo_writestring() to convert the NL to CTRL-V n. + Also fix the Buffers menu and listing a menu name with a newline. +Files: runtime/menu.vim, src/buffer.c, src/mark.c, src/menu.c + +Patch 5.6.068 +Problem: Compiling the Perl interface doesn't work with Perl 5.6.0. + (Bernhard Rosenkraenzer) +Solution: Also check xs_apiversion for the version number when prepending + defines for PL_*. +Files: src/Makefile + +Patch 5.6.069 +Problem: "go" doesn't always end up at the right character when + 'fileformat' is "dos". (Bruce DeVisser) +Solution: Correct computations in ml_find_line_or_offset(). +Files: src/memline. + +Patch 5.6.070 (depends on 5.6.068) +Problem: Compiling the Perl interface doesn't work with Perl 5.6.0. + (Bernhard Rosenkraenzer) +Solution: Simpler check instead of the one from patch 68. +Files: src/Makefile + +Patch 5.6.071 +Problem: "A" in Visual block mode on a Tab positions the cursor one char to + the right. (Michael Haumann) +Solution: Correct the column computation in op_insert(). +Files: src/ops.c + +Patch 5.6.072 +Problem: When starting Vim with "vim +startinsert", it enters Insert mode + only after typing the first command. (Andrew Pimlott) +Solution: Insert a dummy command in the stuff buffer. +Files: src/main.c + +Patch 5.6.073 (extra) (depends on 5.6.034) +Problem: Win32 GUI: When compiled with Bcc 5.5 menus don't work. + In dosinst.c toupper() and tolower() give an "internal compiler + error" for Bcc 5.5. +Solution: Define WINVER to 4 to avoid compiling for Windows 2000. (Dan + Sharp) Also cleaned up compilation arguments. + Use our own implementation of toupper() in dosinst.c. Use + mytoupper() instead of tolower(). +Files: src/Makefile.bor, src/dosinst.c + +Patch 5.6.074 (extra) +Problem: Entering CSI directly doesn't always work, because it's recognized + as the start of a special key. Mostly a problem with multi-byte + in the GUI. +Solution: Use K_CSI for a typed CSI character. Use <CSI> for a normal CSI, + <xCSI> for a CSI typed in the GUI. +Files: runtime/doc/intro.txt, src/getchar.c, src/gui_amiga.c, + src/gui_gtk_x11.c, src/gui_mac.c, src/gui_riscos.c, src/gui_w32.c, + src/keymap.h, src/misc2.c + +Patch 5.6.075 +Problem: When using "I" or "A" in Visual block mode while 'sts' is set may + change spaces to a Tab the inserted text is not correct. (Mike + Steed) And some other problems when using "A" to append after the + end of the line. +Solution: Check for change in spaces/tabs after inserting the text. Append + spaces to fill the gap between the end-of-line and the right edge + of the block. +Files: src/ops.c + +Patch 5.6.076 +Problem: GTK GUI: Mapping <M-Space> doesn't work. +Solution: Don't use the "Alt" modifier twice in key_press_event(). +Files: src/gui_gtk_x11.c + +Patch 5.6.077 +Problem: GUI: When interrupting an external program with CTRL-C, gvim might + crash. (Benjamin Korvemaker) +Solution: Avoid using a NULL pointer in ui_inchar_undo(). +Files: src/ui.c + +Patch 5.6.078 +Problem: Locale doesn't always work on FreeBSD. (David O'Brien) +Solution: Link with the "xpg4" library when available. +Files: src/configure.in, src/configure + +Patch 5.6.079 +Problem: Vim could crash when several Tcl interpreters are created and + destroyed. +Solution: handle the "exit" command and nested ":tcl" commands better. (Ingo + Wilken) +Files: runtime/doc/if_tcl.txt, src/if_tcl.c + +Patch 5.6.080 +Problem: When jumping to a tag, generating the tags file and jumping to the + same tag again uses the old search pattern. (Sung-Hyun Nam) +Solution: Flush cached tag matches when executing an external command. +Files: src/misc2.c, src/proto/tag.pro, src/tag.c + +Patch 5.6.081 +Problem: ":syn include" uses a level for the included file, this confuses + contained items included at the same level. +Solution: Use a unique tag for each included file. Changed sp_syn_inc_lvl + to sp_syn_inc_tag. (Scott Bigham) +Files: src/syntax.c, src/structs.h + +Patch 5.6.082 +Problem: When using cscope, Vim can crash. +Solution: Initialize tag_fname in find_tags(). (Anton Blanchard) +Files: src/tag.c + +Patch 5.6.083 (extra) +Problem: Win32: The visual beep can't be seen. (Eric Roesinger) +Solution: Flush the output before waiting with GdiFlush(). (Maurice S. Barnum) + Also: Allow specifying the delay in t_vb for the GUI. +Files: src/gui.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c, + src/gui_riscos.c, src/gui_w32.c, src/gui_x11.c, src/gui_beos.cc, + src/proto/gui_amiga.pro, src/proto/gui_gtk_x11.pro, + src/proto/gui_mac.pro, src/proto/gui_riscos.pro, + src/proto/gui_w32.pro, src/proto/gui_x11.pro, + src/proto/gui_beos.pro + +Patch 5.6.084 (depends on 5.6.074) +Problem: GUI: Entering CSI doesn't always work for Athena and Motif. +Solution: Handle typed CSI as <xCSI> (forgot this bit in 5.6.074). +Files: src/gui_x11.c + +Patch 5.6.085 +Problem: Multi-byte: Using "r" to replace a double-byte char with a + single-byte char moved the cursor one character. (Matsumoto) + Also, using a count when replacing a single-byte char with a + double-byte char didn't work. +Solution: Don't use del_char() to delete the second byte. + Get "ptr" again after calling ins_char(). +Files: src/normal.c + +Patch 5.6.086 (extra) +Problem: Win32: When using libcall() and the returned value is not a valid + pointer, Vim crashes. +Solution: Use IsBadStringPtr() to check if the pointer is valid. +Files: src/os_win32.c + +Patch 5.6.087 +Problem: Multi-byte: Commands and messages with multi-byte characters are + displayed wrong. +Solution: Detect double-byte characters. (Yasuhiro Matsumoto) +Files: src/ex_getln.c, src/message.c, src/misc2.c, src/screen.c + +Patch 5.6.088 +Problem: Multi-byte with Motif or Athena: The message "XIM requires + fontset" is annoying when Vim was compiled with XIM support but it + is not being used. +Solution: Remove that message. +Files: src/multbyte.c + +Patch 5.6.089 +Problem: On non-Unix systems it's possible to overwrite a read-only file + without using "!". +Solution: Check if the file permissions allow overwriting before moving the + file to become the backup file. +Files: src/fileio.c + +Patch 5.6.090 +Problem: When editing a file in "/home/dir/home/dir" this was replaced with + "~~". (Andreas Jellinghaus) +Solution: Replace the home directory only once in home_replace(). +Files: src/misc1.c + +Patch 5.6.091 +Problem: When editing many "no file" files, can't create swap file, because + .sw[a-p] have all been used. (Neil Bird) +Solution: Also use ".sv[a-z]", ".su[a-z]", etc. +Files: src/memline.c + +Patch 5.6.092 +Problem: FreeBSD: When setting $TERM to a non-valid terminal name, Vim + hangs in tputs(). +Solution: After tgetent() returns an error code, call it again with the + terminal name "dumb". This apparently creates an environment in + which tputs() doesn't fail. +Files: src/term.c + +Patch 5.6.093 (extra) +Problem: Win32 GUI: "ls | gvim -" will show a message box about reading + stdin when Vim exits. (Donohue) +Solution: Don't write a message about the file read from stdin until the GUI + has started. +Files: src/fileio.c + +Patch 5.6.094 +Problem: Problem with multi-byte string for ":echo var". +Solution: Check for length in msg_outtrans_len_attr(). (Sung-Hyun Nam) + Also make do_echo() aware of multi-byte characters. +Files: src/eval.c, src/message.c + +Patch 5.6.095 +Problem: With an Emacs TAGS file that include another a relative path + doesn't always work. +Solution: Use expand_tag_fname() on the name of the included file. + (Utz-Uwe Haus) +Files: src/tag.c + +Patch 5.6.096 +Problem: Unix: When editing many files, startup can be slow. (Paul + Ackersviller) +Solution: Halve the number of stat() calls used to add a file to the buffer + list. +Files: src/buffer.c + +Patch 5.7a.001 +Problem: GTK doesn't respond on drag&drop from ROX-Filer. +Solution: Add "text/uri-list" target. (Thomas Leonard) + Also: fix problem with checking for trash arguments. +Files: src/gui_gtk_x11.c + +Patch 5.7a.002 +Problem: Multi-byte: 'showmatch' is performed when second byte of an + inserted double-byte char is a paren or brace. +Solution: Check IsTrailByte() before calling showmatch(). (Taro Muraoka) +Files: src/misc1.c + +Patch 5.7a.003 +Problem: Multi-byte: After using CTRL-O in Insert mode with the cursor at + the end of the line on a multi-byte character the cursor moves to + the left. +Solution: Check for multi-byte character at end-of-line. (Taro Muraoka) + Also: fix cls() to detect a double-byte character. (Chong-Dae Park) +Files: src/edit.c, src/search.c + +Patch 5.7a.004 +Problem: When reporting the search pattern offset, the string could be + unterminated, which may cause a crash. +Solution: Terminate the string for the search offset. (Stephen P. Wall) +Files: src/search.c + +Patch 5.7a.005 +Problem: When ":s//~/" doesn't find a match it reports "[NULL]" for the + pattern. +Solution: Use get_search_pat() to obtain the actually used pattern. +Files: src/ex_cmds.c, src/proto/search.pro, src/search.c + +Patch 5.7a.006 (extra) +Problem: VMS: Various problems, also with the VAXC compiler. +Solution: In many places use the Unix code for VMS too. + Added time, date and compiler version to version message. + (Zoltan Arpadffy) +Files: src/ex_cmds.c, src/ex_docmd.c, src/globals.h, src/gui_vms_conf.h, + src/main.c, src/message.c, src/misc1.c, src/os_vms.c, + src/os_vms.h, src/os_vms.mms, src/os_vms_conf.h, + src/proto/os_vms.pro, src/proto/version.pro, src/term.c, + src/version.c, src/xxd/os_vms.mms, src/xxd/xxd.c + +Patch 5.7a.007 +Problem: Motif and Athena GUI: CTRL-@ is interpreted as CTRL-C. +Solution: Only use "intr_char" when it has been set. +Files: src/gui_x11.c + +Patch 5.7a.008 +Problem: GTK GUI: When using CTRL-L the screen is redrawn twice, causing + trouble for bold characters. Also happens when moving with the + scrollbar. Best seen when 'writedelay' is non-zero. + When starting the GUI with ":gui" the screen is redrawn once with + the wrong colors. +Solution: Only set the geometry hints when the window size really changed. + This avoids setting it each time the scrollbar is forcefully + redrawn. + Don't redraw in expose_event() when gui.starting is still set. +Files: src/gui_gtk_x11.c + + +============================================================================== +VERSION 5.8 *version-5.8* + +Version 5.8 is a bug-fix version of 5.7. + + +Changed *changed-5.8* +------- + +Ctags is no longer included with Vim. It has grown into a project of its own. +You can find it here: http://ctags.sf.net. It is highly recommended as a Vim +companion when you are writing programs. + + +Added *added-5.8* +----- + +New syntax files: +acedb AceDB (Stewart Morris) +aflex Aflex (Mathieu Clabaut) +antlr Antlr (Mathieu Clabaut) +asm68k 68000 Assembly (Steve Wall) +automake Automake (John Williams) +ayacc Ayacc (Mathieu Clabaut) +b B (Mathieu Clabaut) +bindzone BIND zone (glory hump) +blank Blank (Rafal Sulejman) +cfg Configure files (Igor Prischepoff) +changelog ChangeLog (Gediminas Paulauskas) +cl Clever (Phil Uren) +crontab Crontab (John Hoelzel) +csc Essbase script (Raul Segura Acevedo) +cynlib Cynlib(C++) (Phil Derrick) +cynpp Cyn++ (Phil Derrick) +debchangelog Debian Changelog (Wichert Akkerman) +debcontrol Debian Control (Wichert Akkerman) +dns DNS zone file (Jehsom) +dtml Zope's DTML (Jean Jordaan) +dylan Dylan, Dylan-intr and Dylan-lid (Brent Fulgham) +ecd Embedix Component Description (John Beppu) +fgl Informix 4GL (Rafal Sulejman) +foxpro FoxPro (Powing Tse) +gsp GNU Server Pages (Nathaniel Harward) +gtkrc GTK rc (David Necas) +hercules Hercules (Avant! Corporation) (Dana Edwards) +htmlos HTML/OS by Aestiva (Jason Rust) +inittab SysV process control (David Necas) +iss Inno Setup (Dominique Stephan) +jam Jam (Ralf Lemke) +jess Jess (Paul Baleme) +lprolog LambdaProlog (Markus Mottl) +ia64 Intel Itanium (parth malwankar) +kix Kixtart (Nigel Gibbs) +mgp MaGic Point (Gerfried Fuchs) +mason Mason (HTML with Perl) (Andrew Smith) +mma Mathematica (Wolfgang Waltenberger) +nqc Not Quite C (Stefan Scherer) +omnimark Omnimark (Paul Terray) +openroad OpenROAD (Luis Moreno Serrano) +named BIND configuration (glory hump) +papp PApp (Marc Lehmann) +pfmain Postfix main config (Peter Kelemen) +pic PIC assembly (Aleksandar Veselinovic) +ppwiz PPWizard (Stefan Schwarzer) +progress Progress (Phil Uren) +psf Product Specification File (Rex Barzee) +r R (Tom Payne) +registry MS-Windows registry (Dominique Stephan) +robots Robots.txt (Dominique Stephan) +rtf Rich Text Format (Dominique Stephan) +setl SETL (Alex Poylisher) +sgmldecl SGML Declarations (Daniel A. Molina W.) +sinda Sinda input (Adrian Nagle) +sindacmp Sinda compare (Adrian Nagle) +sindaout Sinda output (Adrian Nagle) +smith SMITH (Rafal Sulejman) +snobol4 Snobol 4 (Rafal Sulejman) +strace Strace (David Necas) +tak TAK input (Adrian Nagle) +takcmp TAK compare (Adrian Nagle) +takout TAK output (Adrian Nagle) +tasm Turbo assembly (FooLman) +texmf TeX configuration (David Necas) +trasys Trasys input (Adrian Nagle) +tssgm TSS Geometry (Adrian Nagle) +tssop TSS Optics (Adrian Nagle) +tsscl TSS Command line (Adrian Nagle) +virata Virata Configuration Script (Manuel M.H. Stol) +vsejcl VSE JCL (David Ondrejko) +wdiff Wordwise diff (Gerfried Fuchs) +wsh Windows Scripting Host (Paul Moore) +xkb X Keyboard Extension (David Necas) + +Renamed php3 to php, it now also supports php4 (Lutz Eymers) + +Patch 5.7.015 +Problem: Syntax files for Vim 6.0 can't be used with 5.x. +Solution: Add the "default" argument to the ":highlight" command: Ignore the + command if highlighting was already specified. +Files: src/syntax.c + +Generate the Syntax menu with makemenu.vim, so that it doesn't have to be done +when Vim is starting up. Reduces the startup time of the GUI. + + +Fixed *fixed-5.8* +----- + +Conversion of docs to HTML didn't convert "|tag|s" to a hyperlink. + +Fixed compiling under NeXT. (Jeroen C.M. Goudswaard) + +optwin.vim gave an error when used in Vi compatible mode ('cpo' contains 'C'). + +Tcl interpreter: "buffer" command didn't check for presense of an argument. +(Dave Bodenstab) + +dosinst.c: Added checks for too long file name. + +Amiga: a file name starting with a colon was considered absolute but it isn't. +Amiga: ":pwd" added a slash when in the root of a drive. + +Macintosh: Warnings for unused variables. (Bernhard Pruemmer) + +Unix: When catching a deadly signal, handle it in such a way that it's +unlikely that Vim will hang. Call _exit() instead of exit() in case of a +severe problem. + +Setting the window title from nothing to something didn't work after patch 29. + +Check for ownership of .exrc and .vimrc was done with stat(). Use lstat() as +well for extra security. + +Win32 GUI: Printing a file with 'fileformat' "unix" didn't work. Set +'fileformat' to "dos" before writing the temp file. + +Unix: Could start waiting for a character when checking for a CTRL-C typed +when an X event is received. + +Could not use Perl and Python at the same time on FreeBSD, because Perl used +"-lc" and Python used the threaded C library. + +Win32: The Mingw compiler gave a few warning messages. + +When using "ZZ" and an autocommand for writing uses an abbreviation it didn't +work. Don't stuff the ":x" command but execute it directly. (Mikael Berthe) + +VMS doesn't always have lstat(), added an #ifdef around it. + +Added a few corrections for the Macintosh. (Axel Kielhorn) + +Win32: Gvimext could not edit more than a few files at once, the length of the +argument was fixed. + + +Previously released patches for Vim 5.7: + +Patch 5.7.001 +Problem: When the current buffer is crypted, and another modified buffer + isn't, ":wall" will encrypt the other buffer. +Solution: In buf_write() use "buf" instead of "curbuf" to check for the + crypt key. +Files: src/fileio.c + +Patch 5.7.002 +Problem: When 'showmode' is set, using "CTRL-O :r file" waits three seconds + before displaying the read text. (Wichert Akkerman) +Solution: Set "keep_msg" to the file message so that the screen is redrawn + before the three seconds wait for displaying the mode message. +Files: src/fileio.c + +Patch 5.7.003 +Problem: Searching for "[[:cntrl:]]" doesn't work. +Solution: Exclude NUL from the matching characters, it terminates the list. +Files: src/regexp.c + +Patch 5.7.004 +Problem: GTK: When selecting a new font, Vim can crash. +Solution: In gui_mch_init_font() unreference the old font, not the new one. +Files: src/gui_gtk_x11.c + +Patch 5.7.005 +Problem: Multibyte: Inserting a wrapped line corrupts kterm screen. + Pasting TEXT/COMPOUND_TEXT into Vim does not work. + On Motif no XIM status line is displayed even though it is + available. +Solution: Don't use xterm trick for wrapping lines for multibyte mode. + Correct a missing "break", added TEXT/COMPOUND_TEXT selection + request. + Add XIMStatusArea fallback code. + (Katsuhito Nagano) +Files: src/gui_gtk_x11.c, src/multbyte.c, src/screen.c, src/ui.c + +Patch 5.7.006 +Problem: GUI: redrawing the non-Visual selection is wrong when the window + is unobscured. (Jean-Pierre Etienne) +Solution: Redraw the selection properly and don't clear it. Added "len" + argument to clip_may_redraw_selection(). +Files: src/gui.c, src/ui.c, src/proto/ui.pro + +Patch 5.7.007 +Problem: Python: Crash when using the current buffer twice. +Solution: Increase the reference count for buffer and window objects. + (Johannes Zellner) +Files: src/if_python.c + +Patch 5.7.008 +Problem: In Ex mode, backspacing over the first TAB doesn't work properly. + (Wichert Akkerman) +Solution: Switch the cursor on before printing the newline. +Files: src/ex_getln.c + +Patch 5.7.009 (extra) +Problem: Mac: Crash when using a long file. +Solution: Don't redefine malloc() and free(), because it will break using + realloc(). +Files: src/os_mac.h + +Patch 5.7.010 +Problem: When using CTRL-A on a very long number Vim can crash. (Michael + Naumann) +Solution: Truncate the length of the new number to avoid a buffer overflow. +Files: src/ops.c + +Patch 5.7.011 (extra) +Problem: Win32 GUI on NT 5 and Win98: Displaying Hebrew is reversed. +Solution: Output each character separately, to avoid that Windows reverses + the text for some fonts. (Ron Aaron) +Files: src/gui_w32.c + +Patch 5.7.012 +Problem: When using "-complete=buffer" for ":command" the user command + fails. +Solution: In a user command don't replace the buffer name with a count for + the buffer number. +Files: src/ex_docmd.c + +Patch 5.7.013 +Problem: "gD" didn't always find a match in the first line, depending on + the column the search started at. +Solution: Reset the column to zero before starting to search. +Files: src/normal.c + +Patch 5.7.014 +Problem: Rot13 encoding was done on characters with accents, which is + wrong. (Sven Gottwald) +Solution: Only do rot13 encoding on ASCII characters. +Files: src/ops.c + +Patch 5.7.016 +Problem: When hitting 'n' for a ":s///c" command, the ignore-case flag was + not restored, some matches were skipped. (Daniel Blaustein) +Solution: Restore the reg_ic variable when 'n' was hit. +Files: src/ex_cmds.c + +Patch 5.7.017 +Problem: When using a Vim script for Vim 6.0 with <SID> before a function + name, it produces an error message even when inside an "if version + >= 600". (Charles Campbell) +Solution: Ignore errors in the function name when the function is not going + to be defined. +Files: src/eval.c + +Patch 5.7.018 +Problem: When running "rvim" or "vim -Z" it was still possible to execute a + shell command with system() and backtick-expansion. (Antonios A. + Kavarnos) +Solution: Disallow executing a shell command in get_cmd_output() and + mch_expand_wildcards(). +Files: src/misc1.c, src/os_unix.c + +Patch 5.7.019 +Problem: Multibyte: In a substitute string, a multi-byte character isn't + skipped properly, can be a problem when the second byte is a + backslash. +Solution: Skip an extra byte for a double-byte character. (Muraoka Taro) +Files: src/ex_cmds.c + +Patch 5.7.020 +Problem: Compilation doesn't work on MacOS-X. +Solution: Add a couple of #ifdefs. (Jamie Curmi) +Files: src/regexp.c, src/ctags/general.h + +Patch 5.7.021 +Problem: Vim sometimes produces a beep when started in an xterm. Only + happens when compiled without mouse support. +Solution: Requesting the xterm version results in a K_IGNORE. This wasn't + handled when mouse support is disabled. Accept K_IGNORE always. +Files: src/normal.c + +Patch 5.7.022 +Problem: %v in 'statusline' is not displayed when it's equal to %c. +Solution: Check if %V or %v is used and handle them differently. +Files: src/screen.c + +Patch 5.7.023 +Problem: Crash when a WinLeave autocommand deletes the buffer in the other + window. +Solution: Check that after executing the WinLeave autocommands there still + is a window to be closed. Also update the test that was supposed + to check for this problem. +Files: src/window.c, testdir/test13.in, testdir/test13.ok + +Patch 5.7.024 +Problem: Evaluating an expression for 'statusline' can have side effects. +Solution: Evaluate the expression in a sandbox. +Files: src/edit.c, src/eval.c, src/proto/eval.pro, src/ex_cmds.c, + src/ex_cmds.h, src/ex_docmd.c, src/globals.h, src/option.c, + src/screen.c, src/undo.c + +Patch 5.7.025 (fixed) +Problem: Creating a temp file has a race condition. +Solution: Create a private directory to write the temp files in. +Files: src/fileio.c, src/misc1.c, src/proto/misc1.pro, + src/proto/fileio.pro, src/memline.c, src/os_unix.h + +Patch 5.7.026 (extra) +Problem: Creating a temp file has a race condition. +Solution: Create a private directory to write the temp files in. + This is the extra part of patch 5.7.025. +Files: src/os_msdos.h + +Patch 5.7.027 +Problem: Starting to edit a file can cause a crash. For example when in + Insert mode, using CTRL-O :help abbr<Tab> to scroll the screen and + then <CR>, which edits a help file. (Robert Bogomip) +Solution: Check if keep_msg is NULL before copying it. +Files: src/fileio.c + +Patch 5.7.028 +Problem: Creating a backup or swap file could fail in rare situations. +Solution: Use O_EXCL for open(). +Files: src/fileio.c, src/memfile.c + +Patch 5.7.029 +Problem: Editing a file with an extremely long name crashed Vim. +Solution: Check for length of the name when setting the window title. +Files: src/buffer.c + +Patch 5.7.030 +Problem: A ":make" or ":grep" command with a very long argument could cause + a crash. +Solution: Allocate the buffer for the shell command. +Files: src/ex_docmd.c + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/version6.txt b/Aufgabe5/doc.lang/version6.txt new file mode 100644 index 0000000..9dda577 --- /dev/null +++ b/Aufgabe5/doc.lang/version6.txt @@ -0,0 +1,14530 @@ +*version6.txt* For Vim version 7.0. Last change: 2006 Apr 30 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Welcome to Vim Version 6.0! A large number of features has been added. This +file mentions all the new items that have been added, changes to existing +features and bug fixes compared to Vim 5.x. + +See |vi_diff.txt| for an overview of differences between Vi and Vim 6.0. +See |version4.txt| for differences between Vim 3.0 and Vim 4.0. +See |version5.txt| for differences between Vim 4.0 and Vim 5.0. + +INCOMPATIBLE CHANGES |incompatible-6| + +Cursor position in Visual mode |curpos-visual| +substitute command Vi compatible |substitute-CR| +global option values introduced |new-global-values| +'fileencoding' changed |fileencoding-changed| +Digraphs changed |digraphs-changed| +Filetype detection changed |filetypedetect-changed| +Unlisted buffers introduced |new-unlisted-buffers| +CTRL-U in Command-line mode changed |CTRL-U-changed| +Ctags gone |ctags-gone| +Documentation reorganized |documentation-6| +Modeless selection and clipboard |modeless-and-clipboard| +Small incompatibilities |incomp-small-6| + +NEW FEATURES |new-6| + +Folding |new-folding| +Vertically split windows |new-vertsplit| +Diff mode |new-diff-mode| +Easy Vim: click-and-type |new-evim| +User manual |new-user-manual| +Flexible indenting |new-indent-flex| +Extended search patterns |new-searchpat| +UTF-8 support |new-utf-8| +Multi-language support |new-multi-lang| +Plugin support |new-plugins| +Filetype plugins |new-filetype-plugins| +File browser |new-file-browser| +Editing files over a network |new-network-files| +Window for command-line editing |new-cmdwin| +Debugging mode |new-debug-mode| +Cursor in virtual position |new-virtedit| +Debugger interface |new-debug-itf| +Communication between Vims |new-vim-server| +Buffer type options |new-buftype| +Printing |new-printing| +Ports |ports-6| +Quickfix extended |quickfix-6| +Operator modifiers |new-operator-mod| +Search Path |new-search-path| +Writing files improved |new-file-writing| +Argument list |new-argument-list| +Restore a View |new-View| +Color schemes |new-color-schemes| +Various new items |new-items-6| + +IMPROVEMENTS |improvements-6| + +COMPILE TIME CHANGES |compile-changes-6| + +BUG FIXES |bug-fixes-6| + +VERSION 6.1 |version-6.1| +Changed |changed-6.1| +Added |added-6.1| +Fixed |fixed-6.1| + +VERSION 6.2 |version-6.2| +Changed |changed-6.2| +Added |added-6.2| +Fixed |fixed-6.2| + +VERSION 6.3 |version-6.3| +Changed |changed-6.3| +Added |added-6.3| +Fixed |fixed-6.3| + +VERSION 6.4 |version-6.4| +Changed |changed-6.4| +Added |added-6.4| +Fixed |fixed-6.4| + +============================================================================== +INCOMPATIBLE CHANGES *incompatible-6* + +These changes are incompatible with previous releases. Check this list if you +run into a problem when upgrading from Vim 5.x to 6.0 + + +Cursor position in Visual mode *curpos-visual* +------------------------------ + +When going from one window to another window on the same buffer while in +Visual mode, the cursor position of the other window is adjusted to keep the +same Visual area. This can be used to set the start of the Visual area in one +window and the end in another. In vim 5.x the cursor position of the other +window would be used, which could be anywhere and was not very useful. + + +Substitute command Vi compatible *substitute-CR* +-------------------------------- + +The substitute string (the "to" part of the substitute command) has been made +Vi compatible. Previously a CTRL-V had a special meaning and could be used to +prevent a <CR> to insert a line break. This made it impossible to insert a +CTRL-V before a line break. Now a backslash is used to prevent a <CR> to +cause a line break. Since the number of backslashes is halved, it is still +possible to insert a line break at the end of the line. This now works just +like Vi, but it's not compatible with Vim versions before 6.0. + +When a ":s" command doesn't make any substitutions, it no longer sets the '[ +and '] marks. This is not related to Vi, since it doesn't have these marks. + + +Global option values introduced *new-global-values* +------------------------------- + +There are now global values for options which are local to a buffer or window. +Previously the local options were copied from one buffer to another. When +editing another file this could cause option values from a modeline to be used +for the wrong file. Now the global values are used when entering a buffer +that has not been used before. Also, when editing another buffer in a window, +the local window options are reset to their global values. The ":set" command +sets both the local and global values, this is still compatible. But a +modeline only sets the local value, this is not backwards compatible. + +":let &opt = val" now sets the local and global values, like ":set". New +commands have been added to set the global or local value: + :let &opt = val like ":set" + :let &g:opt = val like ":setglobal" + :let &l:opt = val like ":setlocal" + + +'fileencoding' changed *fileencoding-changed* +---------------------- + +'fileencoding' was used in Vim 5.x to set the encoding used inside all of Vim. +This was a bit strange, because it was local to a buffer and worked for all +buffers. It could never be different between buffers, because it changed the +way text in all buffers was interpreted. +It is now used for the encoding of the file related to the buffer. If you +still set 'fileencoding' it is likely to be overwritten by the detected +encoding from 'fileencodings', thus it is "mostly harmless". +The old FileEncoding autocommand now does the same as the new EncodingChanged +event. + + +Digraphs changed *digraphs-changed* +---------------- + +The default digraphs now correspond to RFC1345. This is very different from +what was used in Vim 5.x. |digraphs| + + +Filetype detection changed *filetypedetect-changed* +-------------------------- + +The filetype detection previously was using the "filetype" autocommand group. +This caused confusion with the FileType event name (case is ignored). The +group is now called "filetypedetect". It still works, but if the "filetype" +group is used the autocommands will not be removed by ":filetype off". + The support for 'runtimepath' has made the "myfiletypefile" and +"mysyntaxfile" mechanism obsolete. They are still used for backwards +compatibility. + +The connection between the FileType event and setting the 'syntax' option was +previously in the "syntax" autocommand group. That caused confusion with the +Syntax event name. The group is now called "syntaxset". + +The distributed syntax files no longer contain "syntax clear". That makes it +possible to include one in the other without tricks. The syntax is now +cleared when the 'syntax' option is set (by an autocommand added from +synload.vim). This makes the syntax cleared when the value of 'syntax' does +not correspond to a syntax file. Previously the existing highlighting was +kept. + + +Unlisted buffers introduced *new-unlisted-buffers* +--------------------------- + +There is now a difference between buffers which don't appear in the buffer +list and buffers which are really not in the buffer list. Commands like +":ls", ":bnext", ":blast" and the Buffers menu will skip buffers not in the +buffer list. |unlisted-buffer| +The 'buflisted' option can be used to make a buffer appear in the buffer list +or not. + +Several commands that previously added a buffer to the buffer list now create +an unlisted buffer. This means that a ":bnext" and ":ball" will not find these +files until they have actually been edited. For example, buffers used for the +alternative file by ":write file" and ":read file". + Other commands previously completely deleted a buffer and now only remove +the buffer from the buffer list. Commands relying on a buffer not to be +present might fail. For example, a ":bdelete" command in an autocommand that +relied on something following to fail (was used in the automatic tests). +|:bwipeout| can be used for the old meaning of ":bdelete". + +The BufDelete autocommand event is now triggered when a buffer is removed from +the buffer list. The BufCreate event is only triggered when a buffer is +created that is added to the buffer list, or when an existing buffer is added +to the buffer list. BufAdd is a new name for BufCreate. +The new BufNew event is for creating any buffer and BufWipeout for really +deleting a buffer. + +When doing Insert mode completion, only buffers in the buffer list are +scanned. Added the 'U' flag to 'complete' to do completion from unlisted +buffers. + +Unlisted buffers are not stored in a viminfo file. + + +CTRL-U in Command-line mode changed *CTRL-U-changed* +----------------------------------- + +Using CTRL-U when editing the command line cleared the whole line. Most +shells only delete the characters before the cursor. Made it work like that. +(Steve Wall) + +You can get the old behavior with CTRL-E CTRL-U: > + :cnoremap <C-U> <C-E><C-U> + + +Ctags gone *ctags-gone* +---------- + +Ctags is no longer part of the Vim distribution. It's now a grown-up program +by itself, it deserves to be distributed separately. +Ctags can be found here: http://ctags.sf.net/. + + +Documentation reorganized *documentation-6* +------------------------- + +The documentation has been reorganized, an item may not be where you found it +in Vim 5.x. +- The user manual was added, some items have been moved to it from the + reference manual. +- The quick reference is now in a separate file (so that it can be printed). + +The examples in the documentation were previously marked with a ">" in the +first column. This made it difficult to copy/paste them. There is now a +single ">" before the example and it ends at a "<" or a non-blank in the first +column. This also looks better without highlighting. + +'helpfile' is no longer used to find the help tags file. This allows a user +to add its own help files (e.g., for plugins). + + +Modeless selection and clipboard *modeless-and-clipboard* +-------------------------------- + +The modeless selection is used to select text when Visual mode can't be used, +for example when editing the command line or at the more prompt. +In Vim 5.x the modeless selection was always used. On MS-Windows this caused +the clipboard to be overwritten, with no way to avoid that. The modeless +selection now obeys the 'a' and 'A' flags in 'guioptions' and "autoselect" and +"autoselectml" in 'clipboard'. By default there is no automatic copy on +MS-Windows. Use the |c_CTRL-Y| command to manually copy the selection. + +To get the old behavior back, do this: > + + :set clipboard^=autoselectml guioptions+=A + + +Small incompatibilities *incomp-small-6* +----------------------- + +'backupdir', 'cdpath', 'directory', 'equalprg', 'errorfile', 'formatprg', +'grepprg', 'helpfile', 'makeef', 'makeprg', 'keywordprg', 'cscopeprg', +'viminfo' and 'runtimepath' can no longer be set from a modeline, for better +security. + +Removed '_' from the 'breakat' default: It's commonly used in keywords. + +The default for 'mousehide' is on, because this works well for most people. + +The Amiga binary is now always compiled with "big" features. The "big" binary +archive no longer exists. + +The items "[RO]", "[+]", "[help]", "[Preview]" and "[filetype]" in +'statusline' no longer have a leading space. + +Non-Unix systems: When expanding wildcards for the Vim arguments, don't use +'suffixes'. It now works as if the shell had expanded the arguments. + +The 'lisp', 'smartindent' and 'cindent' options are not switched off when +'paste' is set. The auto-indenting is disabled when 'paste' is set, but +manual indenting with "=" still works. + +When formatting with "=" uses 'cindent' or 'indentexpr' indenting, and there +is no change in indent, this is not counted as a change ('modified' isn't set +and there is nothing to undo). + +Report 'modified' as changed when 'fileencoding' or 'fileformat' was set. +Thus it reflects the possibility to abandon the buffer without losing changes. + +The "Save As" menu entry now edits the saved file. Most people expect it to +work like this. + +A buffer for a directory is no longer added to the Buffers menu. + +Renamed <Return> to <Enter>, since that's what it's called on most keyboards. +Thus it's now the hit-enter prompt instead of the hit-return prompt. +Can map <Enter> just like <CR> or <Return>. + +The default for the 'viminfo' option is now '20,"50,h when 'compatible' isn't +set. Most people will want to use it, including beginners, but it required +setting the option, which isn't that easy. + +After using ":colder" the newer error lists are overwritten. This makes it +possible to use ":grep" to browse in a tree-like way. Must use ":cnewer 99" +to get the old behavior. + +The patterns in 'errorformat' would sometimes ignore case (MS-Windows) and +sometimes not (Unix). Now case is always ignored. Add "\C" to the pattern to +match case. + +The 16 bit MS-DOS version is now compiled without the +listcmds feature +(buffer list manipulation commands). They are not often needed and this +executable needs to be smaller. + +'sessionoptions' now includes "curdir" by default. This means that restoring +a session will result in the current directory being restored, instead of +going to the directory where the session file is located. + +A session deleted all buffers, deleting all marks. Now keep the buffer list, +it shouldn't hurt for some existing buffers to remain present. +When the argument list is empty ":argdel *" caused an error message. + +No longer put the search pattern from a tag jump in the history. + +Use "SpecialKey" highlighting for unprintable characters instead of "NonText". +The idea is that unprintable text or any text that's displayed differently +from the characters in the file is using "SpecialKey", and "NonText" is used +for text that doesn't really exist in the file. + +Motif now uses the system default colors for the menu and scrollbar. Used to +be grey. It's still possible to set the colors with ":highlight" commands and +resources. + +Formatting text with "gq" breaks a paragraph at a non-empty blank line. +Previously the line would be removed, which wasn't very useful. + +":normal" does no longer hang when the argument ends in half a command. +Previously Vim would wait for more characters to be typed, without updating +the screen. Now it pretends an <Esc> was typed. + +Bitmaps for the toolbar are no longer searched for in "$VIM/bitmaps" but in +the "bitmaps" directories in 'runtimepath'. + +Now use the Cmdline-mode menus for the hit-enter prompt instead of the Normal +mode menus. This generally works better and allows using the "Copy" menu to +produce CTRL-Y to copy the modeless selection. + +Moved the font selection from the Window to the Edit menu, together with the +other settings. + +The default values for 'isfname' include more characters to make "gf" work +better. + +Changed the license for the documentation to the Open Publication License. +This seemed fair, considering the inclusion of parts of the Vim book, which is +also published under the OPL. The downside is that we can't force someone who +would sell copies of the manual to contribute to Uganda. + +After "ayy don't let ""yy or :let @" = val overwrite the "a register. +Use the unnamed register instead. + +MSDOS: A pattern "*.*" previously also matched a file name without a dot. +This was inconsistent with other versions. + +In Insert mode, CTRL-O CTRL-\ CTRL-N {cmd} remains in Normal mode. Previously +it would go back to Insert mode, thus confusing the meaning of CTRL-\ CTRL-N, +which is supposed to take us to Normal mode (especially in ":amenu"). + +Allow using ":" commands after an operator. Could be used to implement a new +movement command. Thus it no longer aborts a pending operator. + +For the Amiga the "-d {device}" argument was possible. When compiled with the +diff feature, this no longer works. Use "-dev {device}" instead. |-dev| + +Made the default mappings for <S-Insert> in Insert mode insert the text +literally, avoids that special characters like BS cause side effects. + +Using ":confirm" applied to the rest of the line. Now it applies only to the +command right after it. Thus ":confirm if x | edit | endif" no longer works, +use ":if x | confirm edit | endif". This was the original intention, that it +worked differently was a bug. + +============================================================================== +NEW FEATURES *new-6* + +Folding *new-folding* +------- + +Vim can now display a buffer with text folded. This allows overviewing the +structure of a file quickly. It is also possible to yank, delete and put +folded text, for example to move a function to another position. + +There is a whole bunch of new commands and options related to folding. +See |folding|. + + +Vertically split windows *new-vertsplit* +------------------------ + +Windows can also be split vertically. This makes it possible to have windows +side by side. One nice use for this is to compare two similar files (see +|new-diff-mode|). The 'scrollbind' option can be used to synchronize +scrolling. + +A vertical split can be created with the commands: + :vsplit or CTRL-W v or CTRL-W CTRL-V |:vsplit| + :vnew |:vnew| + :vertical {cmd} |:vertical| +The last one is a modifier, which has a meaning for any command that splits a +window. For example: > + :vertical stag main +Will vertically split the window and jump to the tag "main" in the new window. + +Moving from window to window horizontally can be done with the |CTRL-W_h| and +|CTRL-W_l| commands. The |CTRL-W_k| and |CTRL-W_j| commands have been changed +to jump to the window above or below the cursor position. + +The vertical and horizontal splits can be mixed as you like. Resizing windows +is easy when using the mouse, just position the pointer on a status line or +vertical separator and drag it. In the GUI a special mouse pointer shape +indicates where you can drag a status or separator line. + +To resize vertically split windows use the |CTRL-W_<| and |CTRL-W_>| commands. +To make a window the maximum width use the CTRL-W | command |CTRL-W_bar|. + +To force a new window to use the full width or height of the Vim window, +these two modifiers are available: + :topleft {cmd} New window appears at the top with full + width or at the left with full height. + :botright {cmd} New window appears at the bottom with full + width or at the right with full height. +This can be combined with ":vertical" to force a vertical split: > + :vert bot dsplit DEBUG +This will open a window at the far right, occupying the full height of the Vim +window, with the cursor on the first definition of "DEBUG". +The help window is opened at the top, like ":topleft" was used, if the current +window is fewer than 80 characters wide. + +A few options can be used to set the preferences for vertically split windows. +They work similar to their existing horizontal equivalents: + horizontal vertical ~ + 'splitbelow' 'splitright' + 'winheight' 'winwidth' + 'winminheight' 'winminwidth' +It's possible to set 'winminwidth' to zero, so that temporarily unused windows +hardly take up space without closing them. + +The new 'eadirection' option tells where 'equalalways' applies: + :set eadirection=both both directions + :set eadirection=ver equalize window heights + :set eadirection=hor equalize windows widths +This can be used to avoid changing window sizes when you want to keep them. + +Since windows can become quite narrow with vertical splits, text lines will +often not fit. The 'sidescrolloff' has been added to keep some context left +and right of the cursor. The 'listchars' option has been extended with the +"precedes" item, to show a "<" for example, when there is text left off the +screen. (Utz-Uwe Haus) + +"-O" command line argument: Like "-o" but split windows vertically. (Scott +Urban) + +Added commands to move the current window to the very top (CTRL-W K), bottom +(CTRL-W J), left (CTRL-W H) and right (CTRL-W L). In the new position the +window uses the full width/height of the screen. + +When there is not enough room in the status line for both the file name and +the ruler, use up to half the width for the ruler. Useful for narrow windows. + + +Diff mode *new-diff-mode* +--------- + +In diff mode Vim shows the differences between two, three or four files. +Folding is used to hide the parts of the file that are equal. +Highlighting is used to show deleted and changed lines. +See |diff-mode|. + +An easy way to start in diff mode is to start Vim as "vimdiff file1 file2". +Added the vimdiff manpage. + +In a running Vim the |:diffsplit| command starts diff mode for the current +file and another file. The |:diffpatch| command starts diff mode using the +current file and a patch file. The |:diffthis| command starts diff mode for +the current window. + +Differences can be removed with the |:diffget| and |:diffput| commands. + +- The 'diff' option switches diff mode on in a window. +- The |:diffupdate| command refreshes the diffs. +- The 'diffopt' option changes how diffs are displayed. +- The 'diffexpr' option can be set how a diff is to be created. +- The 'patchexpr' option can be set how patch is applied to a file. +- Added the "diff" folding method. When opening a window for diff-mode, set + 'foldlevel' to zero and 'foldenable' on, to close the folds. +- Added the DiffAdd, DiffChange, DiffDelete and DiffText highlight groups to + specify the highlighting for differences. The defaults are ugly... +- Unix: make a vimdiff symbolic link for "make install". +- Removed the now obsolete "vimdiff.vim" script from the distribution. +- Added the "[c" and "]c" commands to move to the next/previous change in diff + mode. + + +Easy Vim: click-and-type *new-evim* +------------------------ + +eVim stands for "Easy Vim". This is a separate program, but can also be +started as "vim -y". + +This starts Vim with 'insertmode' set to allow click-and-type editing. The +$VIMRUNTIME/evim.vim script is used to add mappings and set options to be able +to do most things like Notepad. This is only for people who can't stand two +modes. + +eView does the same but in readonly mode. + +In the GUI a CTRL-C now only interrupts when busy with something, not when +waiting for a character. Allows using CTRL-C to copy text to the clipboard. + + +User manual *new-user-manual* +----------- + +The user manual has been added. It is organised around editing tasks. It +reads like a book, from start to end. It should allow beginners to start +learning Vim. It helps everybody to learn using the most useful Vim features. +It is much easier to read than the reference manual, but omits details. See +|user-manual|. + +The user manual includes parts of the Vim book by Steve Oualline |frombook|. +It is published under the OPL |manual-copyright|. + +When syntax highlighting is not enabled, the characters in the help file which +mark examples ('>' and '<') and header lines ('~') are replaced with a space. + +When closing the help window, the window layout is restored from before +opening it, if the window layout didn't change since then. +When opening the help window, put it at the top of the Vim window if the +current window is fewer than 80 characters and not full width. + + +Flexible indenting *new-indent-flex* +------------------ + +Automatic indenting is now possible for any language. It works with a Vim +script, which makes it very flexible to compute the indent. + +The ":filetype indent on" command enables using the provided indent scripts. +This is explained in the user manual: |30.3|. + +The 'indentexpr' option is evaluated to get the indent for a line. The +'indentkeys' option tells when to trigger re-indenting. Normally these +options are set from an indent script. Like Syntax files, indent scripts will +be created and maintained by many people. + + +Extended search patterns *new-searchpat* +------------------------ + +Added the possibility to match more than one line with a pattern. (partly by +Loic Grenie) +New items in a search pattern for multi-line matches: +\n match end-of-line, also in [] +\_[] match characters in range and end-of-line +\_x match character class and end-of-line +\_. match any character or end-of-line +\_^ match start-of-line, can be used anywhere in the regexp +\_$ match end-of-line, can be used anywhere in the regexp + +Various other new items in search patterns: +\c ignore case for the whole pattern +\C match case for the whole pattern +\m magic on for the following +\M magic off for the following +\v make following characters "very magic" +\V make following characters "very nomagic" + +\@! don't match atom before this. + Example: "foo\(bar\)\@!" matches "foo " but not "foobar". +\@= match atom, resulting in zero-width match + Example: "foo\(bar\)\@=" matches "foo" in "foobar". +\@<! don't match preceding atom before the current position +\@<= match preceding atom before the current position +\@> match preceding atom as a subexpression + +\& match only when branch before and after it match + +\%[] optionally match a list of atoms; "end\%[if]" matches "end", + "endi" and "endif" +\%(\) like \(\), but without creating a back-reference; there can be + any number of these, overcomes the limit of nine \( \) pairs +\%^ match start-of-file (Chase Tingley) +\%$ match end-of-file (Chase Tingley) +\%# Match with the cursor position. (Chase Tingley) +\? Just like "\=" but can't be used in a "?" command. + +\%23l match in line 23 +\%<23l match before line 23 +\%>23l match after line 23 +\%23c, \%<23c, \%>23c match in/before/after column 23 +\%23v, \%<23v, \%>23v match in/before/after virtual column 23 + + +For syntax items: +\z(...\) external reference match set (in region start pattern) +\z1 - \z9 external reference match use (in region skip or end pattern) + (Scott Bigham) + +\zs use position as start of match +\ze use position as end of match + +Removed limit of matching only up to 32767 times with *, \+, etc. + +Added support to match multi-byte characters. (partly by Muraoka Taro) +Made "\<" and "\>" work for UTF-8. (Muraoka Taro) + + +UTF-8 support *new-utf-8* +------------- + +Vim can now edit files in UTF-8 encoding. Up to 31 bit characters can be +used, but only 16 bit characters are displayed. Up to two combining +characters are supported, they overprint the preceding character. +Double-wide characters are also supported. See |UTF-8|. + +UCS-2, UCS-4 and UTF-16 encodings are supported too, they are converted to +UTF-8 internally. There is also support for editing Unicode files in a Latin1 +environment. Other encodings are converted with iconv() or an external +converter specified with 'charconvert'. + +Many new items for Multi-byte support: +- Added 'encoding' option: specifies character encoding used inside Vim. It + can be any 8-bit encoding, some double-byte encodings or Unicode. + It is initialized from the environment when a supported value is found. +- Added 'fileencoding' and 'fileencodings': specify character coding in a + file, similar to 'fileformat' and 'fileformats'. + When 'encoding' is "utf-8" and 'fileencodings' is "utf-8,latin1" this will + automatically switch to latin1 if a file does not contain valid UTF-8. +- Added 'bomb' option and detection of a BOM at the start of a file. Can be + used with "ucs-bom" in 'fileencodings' to automatically detect a Unicode + file if it starts with a BOM. Especially useful on MS-Windows (NT and + 2000), which uses ucs-2le files with a BOM (e.g., when exporting the + registry). +- Added the 'termencoding' option: Specifies the encoding used for the + terminal. Useful to put Vim in utf-8 mode while in a non-Unicode locale: > + :let &termencoding = &encoding + :set encoding=utf-8 +- When 'viminfo' contains the 'c' flag, the viminfo file is converted from the + 'encoding' it was written with to the current 'encoding'. +- Added ":scriptencoding" command: convert lines in a sourced script to + 'encoding'. Useful for menu files. +- Added 'guifontwide' to specify a font for double-wide characters. +- Added Korean support for character class detection. Also fix cls() in + search.c. (Chong-Dae Park) +- Win32: Typing multi-byte characters without IME. (Alexander Smishlajev) +- Win32 with Mingw: compile with iconv library. (Ron Aaron) +- Win32 with MSVC: dynamically load iconv.dll library. (Muraoka Taro) +- Make it possible to build a version with multi-byte and iconv support with + Borland 5.5. (Yasuhiro Matsumoto) +- Added 'delcombine' option: Delete combining character separately. (Ron + Aaron) +- The "xfontset" feature isn't required for "xim". These are now two + independent features. +- XIM: enable XIM when typing a language character (Insert mode, Search + pattern, "f" or "r" command). Disable XIM when typing a Normal mode + command. +- When the XIM is active, show "XIM" in the 'showmode' message. (Nam SungHyun) +- Support "CursorIM" for XIM. (Nam SungHyun) +- Added 'm' flag to 'formatoptions': When wrapping words, allow splitting at + each multibyte character, not only at a space. +- Made ":syntax keyword" work with multi-byte characters. +- Added support for Unicode upper/lowercase flipping and comparing. (based on + patch by Raphael Finkel) + Let "~" on multi-byte characters that have a third case ("title case") + switch between the three cases. (Raphael Finkel) + +Allow defining digraphs for multi-byte characters. +Added RFC1345 digraphs for Unicode. +Most Normal mode commands that accept a character argument, like "r", "t" and +"f" now accept a digraph. The 'D' flag in 'cpoptions' disables this to remain +Vi compatible. + +Added Language mapping and 'keymap' to be able to type multi-byte characters: +- Added the ":lmap" command and friends: Define mappings that are used when + typing characters in the language of the text. Also for "r", "t", etc. In + Insert and Command-line mode CTRL-^ switches the use of the mappings on/off. + CTRL-^ also toggles the use of an input method when no language mappings are + present. Allows switching the IM back on halfway typing. +- "<char-123>" argument to ":map", allows to specify the decimal, octal or + hexadecimal value of a character. +- Implemented the 'keymap' option: Load a keymap file. Uses ":lnoremap" to + define mappings for the keymap. The new ":loadkeymap" command is used in + the keymap file. +- Added 'k' flag in 'statusline': Value of "b:keymap_name" or 'keymap' when + it's being used. Uses "<lang>" when no keymap is loaded and ":lmap"s are + active. Show this text in the default statusline too. +- Added the 'iminsert' and 'imsearch' options: Specify use of langmap mappings + and Input Method with an option. (Muraoka Taro) + Added 'imcmdline' option: When set the input method is always enabled when + starting to edit a command line. Useful for a XIM that uses dead keys to + type accented characters. + Added 'imactivatekey' option to better control XIM. (Muraoka Taro) +- When typing a mapping that's not finished yet, display the last character + under the cursor in Insert mode and Command-line mode. Looks good for dead + characters. +- Made the 'langmap' option recognize multi-byte characters. But mapping only + works for 8-bit characters. Helps when using UTF-8. +- Use a different cursor for when ":lmap" mappings are active. Can specify + two highlight groups for an item in 'guicursor'. By default "lCursor" and + "Cursor" are equal, the user must set a color he likes. + Use the cursor color for hangul input as well. (Sung-Hyun Nam) +- Show "(lang)" for 'showmode' when language mapping is enabled. +- UTF-8: Made "r" work with a ":lmap" that includes a composing character. + Also works for "f", which now works to find a character that includes a + composing character. + +Other multi-byte character additions: +- Support double-byte single-width characters for euc-jp: Characters starting + with 0x8E. Added ScreenLines2[] to store the second byte. + + +Multi-language support *new-multi-lang* +---------------------- + +The messages used in Vim can be translated. Several translations are +available. This uses the gettext mechanism. It allows adding a translation +without recompiling Vim. |multi-lang| (partly by Marcin Dalecki) + +The translation files are in the src/po directory. The src/po/README.txt file +explains a few things about doing a translation. + +Menu translations are available as well. This uses the new |:menutranslate| +command. The translations are found in the runtime directory "lang". This +allows a user to add a translation. + +Added |:language| command to set the language (locale) for messages, time and +character type. This allows switching languages in Vim without changing the +locale outside of Vim. + +Made it possible to have vimtutor use different languages. (Eduardo Fernandez) +Spanish (Eduardo Fernandez), Italian (Antonio Colombo), Japanese (Yasuhiro +Matsumoto) and French (Adrien Beau) translations are included. +Added "vimtutor.bat": script to start Vim on a copy of the tutor file for +MS-Windows. (Dan Sharp) + +- Added v:lang variable to be able to get current language setting. + (Marcin Dalecki) Also v:lc_time and v:ctype. +- Make it possible to translate the dialogs used by the menus. Uses global + "menutrans_" variables. ":menutrans clear" deletes them. +- removed "broken locale" (Marcin Dalecki). +- Don't use color names in icons, use RGB values. The names could be + translated. +- Win32: Added global IME support (Muraoka) +- Win32: Added dynamic loading of IME support. +- ":messages" prints a message about who maintains the messages or the + translations. Useful to find out where to make a remark about a wrong + translation. +- --disable-nls argument for configure: Disable use of gettext(). (Sung-Hyun + Nam) +- Added NLS support for Win32 with the MingW compiler. (Eduardo Fernandez) +- When available, call bind_textdomain_codeset() to have gettext() translate + messages to 'encoding'. This requires GNU gettext 0.10.36 or later. +- Added gettext support for Win32. This means messages will be translated + when the locale is set and libintl.dll can be found. (Muraoka Taro) + Also made it work with MingW compiler. (Eduardo Fernandez) + Detect the language and set $LANG to get the appropriate translated messages + (if supported). Also use $LANG to select a language, v:lang is a very + different kind of name. +- Made gvimext.dll use translated messages, if possible. (Yasuhiro Matsumoto) + + +Plugin support *new-plugins* +-------------- + +To make it really easy to load a Vim script when starting Vim, the "plugin" +runtime directory can be used. All "*.vim" files in it will be automatically +loaded. For Unix, the directory "~/.vim/plugin" is used by default. The +'runtimepath' option can be set to look in other directories for plugins. +|load-plugins| |add-plugin| + +The |:runtime| command has been added to load one or more files in +'runtimepath'. + +Standard plugins: +netrw.vim - Edit files over a network |new-network-files| +gzip.vim - Edit compressed files +explorer.vim - Browse directories |new-file-browser| + +Added support for local help files. |add-local-help|. +When searching for help tags, all "doc/tags" files in 'runtimepath' are used. +Added the ":helptags" command: Generate a tags file for a help directory. +The first line of each help file is automagically added to the "LOCAL +ADDITIONS" section in doc/help.txt. + +Added the <unique> argument to ":map": only add a mapping when it wasn't +defined before. + +When displaying an option value with 'verbose' set will give a message about +where the option was last set. Very useful to find out which script did set +the value. + +The new |:scriptnames| command displays a list of all scripts that have been +sourced. + +GUI: For Athena, Motif and GTK look for a toolbar bitmap in the "bitmaps" +directories in 'runtimepath'. Allows adding your own bitmaps. + + +Filetype plugins *new-filetype-plugins* +----------------- + +A new group of files has been added to do settings for specific file types. +These can be options and mappings which are specifically used for one value of +'filetype'. + +The files are located in "$VIMRUNTIME/ftplugin". The 'runtimepath' option +makes it possible to use several sets of plugins: Your own, system-wide, +included in the Vim distribution, etc. + +To be able to make this work, several features were added: +- Added the "s:" variables, local to a script. Avoids name conflicts with + global variables. They can be used in the script and in functions, + autocommands and user commands defined in the script. They are kept between + invocations of the same script. |s:var| +- Added the global value for local options. This value is used when opening + a new buffer or editing another file. The option value specified in a + modeline or filetype setting is not carried over to another buffer. + ":set" sets both the local and the global value. + ":setlocal" sets the local option value only. + ":setglobal" sets or displays the global value for a local option. + ":setlocal name<" sets a local option to its global value. +- Added the buffer-local value for some global options: 'equalprg', 'makeprg', + 'errorformat', 'grepprg', 'path', 'dictionary', 'thesaurus', 'tags', + 'include' and 'define'. This allows setting a local value for these global + options, without making it incompatible. +- Added mappings and abbreviations local to a buffer: ":map <buffer>". +- In a mapping "<Leader>" can be used to get the value of the "mapleader" + variable. This simplifies mappings that use "mapleader". "<Leader>" + defaults to "\". "<LocalLeader>" does the same with "maplocalleader". This + is to be used for mappings local to a buffer. +- Added <SID> Script ID to define functions and mappings local to a script. +- Added <script> argument to ":noremap" and ":noremenu": Only remap + script-local mappings. Avoids that mappings from other scripts get in the + way, but does allow using mappings defined in the script. +- User commands can be local to a buffer: ":command -buffer". + +The new ":setfiletype" command is used in the filetype detection autocommands, +to avoid that 'filetype' is set twice. + + +File browser *new-file-browser* +------------ + +When editing a directory, the explorer plugin will list the files in the +directory. Pressing <Enter> on a file name edits that file. Pressing <Enter> +on a directory moves the browser to that directory. + +There are several other possibilities, such as opening a file in the preview +window, renaming files and deleting files. + + +Editing files over a network *new-network-files* +---------------------------- + +Files starting with scp://, rcp://, ftp:// and http:// are recognized as +remote files. An attempt is made to access these files with the indicated +method. For http:// only reading is possible, for the others writing is also +supported. Uses the netrw.vim script as a standard "plugin". |netrw| + +Made "gf" work on a URL. It no longer assumes the file is local on the +computer (mostly didn't work anyway, because the full path was required). +Adjusted test2 for this. + +Allow using a URL in 'path'. Makes ":find index.html" work. + +GTK: Allow dropping a http:// and ftp:// URL on Vim. The netrw plugin takes +care of downloading the file. (MiKael Berthe) + + +Window for command-line editing *new-cmdwin* +------------------------------- + +The Command-line window can be used to edit a command-line with Normal and +Insert mode commands. When it is opened it contains the history. This allows +copying parts of previous command lines. |cmdwin| + +The command-line window can be opened from the command-line with the key +specified by the 'cedit' option (like Nvi). It can also be opened directly +from Normal mode with "q:", "q/" and "q?". + +The 'cmdwinheight' is used to specify the initial height of the window. + +In Insert mode CTRL-X CTRL-V can be used to complete an Ex command line, like +it's done on the command-line. This is also useful for writing Vim scripts! + +Additionally, there is "improved Ex mode". Entered when Vim is started as +"exim" or "vim -E", and with the "gQ" command. Works like repeated use of +":", with full command-line editing and completion. (Ulf Carlsson) + + +Debugging mode *new-debug-mode* +-------------- + +In debugging mode sourced scripts and user functions can be executed line by +line. There are commands to step over a command or step into it. |debug-mode| + +Breakpoints can be set to run until a certain line in a script or user +function is executed. |:breakadd| + +Debugging can be started with ":debug {cmd}" to debug what happens when a +command executes. The |-D| argument can be used to debug while starting up. + + +Cursor in virtual position *new-virtedit* +-------------------------- + +Added the 'virtualedit' option: Allow positioning the cursor where there is no +actual character in Insert mode, Visual mode or always. (Matthias Kramm) +This is especially useful in Visual-block mode. It allows positioning a +corner of the area where there is no text character. (Many improvements by +Chase Tingley) + + +Debugger interface *new-debug-itf* +------------------ + +This was originally made to work with Sun Visual Workshop. (Gordon Prieur) +See |debugger.txt|, |sign.txt| and |workshop.txt|. + +Added the ":sign" command to define and place signs. They can be displayed +with two ASCII characters or an icon. The line after it can be highlighted. +Useful to display breakpoints and the current PC position. + +Added the |:wsverb| command to execute debugger commands. + +Added balloon stuff: 'balloondelay' and 'ballooneval' options. + +Added "icon=" argument for ":menu". Allows defining a specific icon for a +ToolBar item. + + +Communication between Vims *new-vim-server* +-------------------------- + +Added communication between two Vims. Makes it possible to send commands from +one Vim to another. Works for X-Windows and MS-Windows |clientserver|. + +Use "--remote" to have files be edited in an already running Vim. +Use "--remote-wait" to do the same and wait for the editing to finish. +Use "--remote-send" to send commands from one Vim to another. +Use "--remote-expr" to have an expression evaluated in another Vim. +Use "--serverlist" to list the currently available Vim servers. (X only) +There are also functions to communicate between the server and the client. +|remote_send()| |remote_expr()| + +(X-windows version implemented by Flemming Madsen, MS-Windows version by Paul +Moore) + +Added the command server name to the window title, so you can see which server +name belongs to which Vim. + +Removed the OleVim directory and SendToVim.exe and EditWithVim.exe from the +distribution. Can now use "gvim --remote" and "gvim --remote-send", which is +portable. + +GTK+: Support running Vim inside another window. Uses the --socketid argument +(Neil Bird) + + +Buffer type options *new-buftype* +------------------- + +The 'buftype' and 'bufhidden' options have been added. They can be set to +have different kinds of buffers. For example: +- 'buftype' = "quickfix": buffer with error list +- 'buftype' = "nofile" and 'bufhidden' = "delete": scratch buffer that will be + deleted as soon as there is no window displaying it. + +'bufhidden' can be used to overrule the 'hidden' option for one buffer. + +In combination with 'buflisted' and 'swapfile' this offers the possibility to +use various kinds of special buffers. See |special-buffers|. + + +Printing *new-printing* +-------- + +Included first implementation of the ":hardcopy" command for printing +to paper. For MS-Windows any installed printer can be used. For other +systems a PostScript file is generated, which can be printed with the +'printexpr' option. +(MS-Windows part by Vince Negri, Vipin Aravind, PostScript by Vince Negri and +Mike Williams) + +Made ":hardcopy" work with multi-byte characters. (Muraoka Taro, Yasuhiro +Matsumoto) + +Added options to tune the way printing works: (Vince Negri) +- 'printoptions' defines various things. +- 'printheader' specifies the header format. Added "N" field to 'statusline' + for the page number. +- 'printfont' specifies the font name and attributes. +- 'printdevice' defines the default printer for ":hardcopy!". + + +Ports *ports-6* +----- + +Port to OS/390 Unix (Ralf Schandl) +- A lot of changes to handle EBCDIC encoding. +- Changed Ctrl('x') to Ctrl_x define. + +Included jsbmouse support. (Darren Garth) +Support for dec mouse in Unix. (Steve Wall) + +Port to 16-bit MS Windows (Windows 3.1x) (Vince Negri) + +Port to QNX. Supports the Photon GUI, mouse, etc. (Julian Kinraid) + +Allow cross-compiling the Win32 version with Make_ming.mak. (Ron Aaron) +Added Python support for compiling with Mingw. (Ron Aaron) + +Dos 32 bit: Added support the Windows clipboard. (David Kotchan) + +Win32: Dynamically load Perl and Python. Allows compiling Vim with these +interfaces and will try to find the DLLs at runtime. (Muraoka Taro) + +Compiling the Win32 GUI with Cygwin. Also compile vimrun, dosinst and +uninstall. (Gerfried) + +Mac: Make Vim compile with the free MPW compiler supplied by Apple. And +updates for CodeWarrior. (Axel Kielhorn) + +Added typecasts and ifdefs as a start to make Vim work on Win64 (George +Reilly) + + +Quickfix extended *quickfix-6* +----------------- + +Added the "error window". It contains all the errors of the current error +list. Pressing <Enter> in a line makes Vim jump to that line (in another +window). This makes it easy to navigate through the error list. +|quickfix-window|. + +- |:copen| opens the quickfix window. +- |:cclose| closes the quickfix window. +- |:cwindow| takes care that there is a quickfix window only when there are + recognized errors. (Dan Sharp) + +- Quickfix also knows "info", next to "warning" and "error" types. "%I" can be + used for the start of a multi-line informational message. (Tony Leneis) +- The "%p" argument can be used in 'errorformat' to get the column number from + a line where "^" points to the column. (Stefan Roemer) +- When using "%f" in 'errorformat' on a DOS/Windows system, also include "c:" + in the filename, even when using "%f:". + + +Operator modifiers *new-operator-mod* +------------------ + +Insert "v", "V" or CTRL-V between an operator and a motion command to force +the operator to work characterwise, linewise or blockwise. |o_v| + + +Search Path *new-search-path* +----------- + +Vim can search in a directory tree not only in downwards but also upwards. +Works for the 'path', 'cdpath' and 'tags' options. (Ralf Schandl) + +Also use "**" for 'tags' option. (Ralf Schandl) + +Added 'includeexpr', can be used to modify file name found by 'include' +option. +Also use 'includeexpr' for "gf" and "<cfile>" when the file can't be found +without modification. Useful for doing "gf" on the name after an include or +import statement. + +Added the 'cdpath' option: Locations to find a ":cd" argument. (Raf) + +Added the 'suffixesadd' option: Suffixes to be added to a file name when +searching for a file for the "gf", "[I", etc. commands. + + +Writing files improved *new-file-writing* +---------------------- + +Added the 'backupcopy' option: Select whether a file is to be copied or +renamed to make a backup file. Useful on Unix to speed up writing an ordinary +file. Useful on other systems to preserve file attributes and when editing a +file on a Unix filesystem. + +Added the 'autowriteall' option. Works like 'autowrite' but for more +commands. + +Added the 'backupskip' option: A list of file patterns to skip making a backup +file when it matches. The default for Unix includes "/tmp/*", this makes +"crontab -e" work. + +Added support for Access Control Lists (ACL) for FreeBSD and Win32. The ACL +is copied from the original file to the new file (or the backup if it's +copied). +ACL is also supported for AIX, Solaris and generic POSIX. (Tomas Ogren) +And on SGI. + + +Argument list *new-argument-list* +------------- + +The support for the argument list has been extended. It can now be +manipulated to contain the files you want it to contain. + +The argument list can now be local to a window. It is created with the +|:arglocal| command. The |:argglobal| command can be used to go back to the +global argument list. + +The |:argdo| command executes a command on all files in the argument list. + +File names can be added to the argument list with |:argadd|. File names can +be removed with |:argdelete|. + +"##" can be used like "#", it is replaced by all the names in the argument +list concatenated. Useful for ":grep foo ##". + +The |:argedit| adds a file to the argument list and edits it. Like ":argadd" +and then ":edit". + + +Restore a View *new-View* +-------------- + +The ":mkview" command writes a Vim script with the settings and mappings for +one window. When the created file is sourced, the view of the window is +restored. It's like ":mksession" for one window. +The View also contains the local argument list and manually created, opened +and closed folds. + +Added the ":loadview" command and the 'viewdir' option: Allows for saving and +restoring views of a file with simple commands. ":mkview 1" saves view 1 for +the current file, ":loadview 1" loads it again. Also allows quickly switching +between two views on one file. And saving and restoring manual folds and the +folding state. + +Added 'viewoptions' to specify how ":mkview" works. + +":mksession" now also works fine with vertical splits. It has been further +improved and restores the view of each window. It also works properly with +preview and quickfix windows. + +'sessionoptions' is used for ":mkview" as well. +Added "curdir" and "sesdir" to 'sessionoptions'. Allows selection of what +the current directory will be restored to. + +The session file now also contains the argument list(s). + + +Color schemes *new-color-schemes* +------------- + +Support for loading a color scheme. Added the ":colorscheme" command. +Automatically add menu entries for available schemes. +Should now properly reset the colors when 'background' or 't_Co' is changed. +":highlight clear" sets the default colors again. +":syntax reset" sets the syntax highlight colors back to the defaults. +For ":set bg&" guess the value. This allows a color scheme to switch back to +the default colors. +When syntax highlighting is switched on and a color scheme was defined, reload +the color scheme to define the colors. + + +Various new items *new-items-6* +----------------- + +Normal mode commands: ~ + +"gi" Jump to the ^ mark and start Insert mode. Also works when the + mark is just after the line. |gi| + +"g'm" and "g`m" + Jump to a mark without changing the jumplist. Now you can use + g`" to jump to the last known position in a file without side + effects. Also useful in mappings. + +[', [`, ]' and ]` + move the cursor to the next/previous lowercase mark. + +g_ Go to last non-blank in line. (Steve Wall) + + +Options: ~ + +'autoread' When detected that a file changed outside of Vim, + automatically read a buffer again when it's not changed. + It has a global and a local value. Use ":setlocal autoread<" + to go back to using the global value for 'autoread'. + +'debug' When set to "msg" it will print error messages that would + otherwise be omitted. Useful for debugging 'indentexpr' and + 'foldexpr'. + +'lispwords' List of words used for lisp indenting. It was previously hard + coded. Added a number of Lisp names to the default. + +'fold...' Many new options for folding. + +'modifiable' When off, it is impossible to make changes to a buffer. + The %m and %M items in 'statusline' show a '-'. + +'previewwindow' Set in the preview window. Used in a session file to mark a + window as the preview window. + +'printfont' +'printexpr' +'printheader' +'printdevice' +'printoptions' for ":hardcopy". + +'buflisted' Makes a buffer appear in the buffer list or not. + +Use "vim{version}:" for modelines, only to be executed when the version is +>= {version}. Also "vim>{version}", "vim<{version}" and "vim={version}". + + +Ex commands: ~ + +:sav[eas][!] {file} + Works like ":w file" and ":e #", but without loading the file + again and avoiding other side effects. |:saveas| + +:silent[!] {cmd} + Execute a command silently. Also don't use a delay that would + come after the message. And don't do 'showmatch'. + RISCOS: Removed that "!~cmd" didn't output anything, and + didn't wait for <Enter> afterwards. Can use ":silent !cmd" + now. +:menu <silent> Add a menu that won't echo Ex commands. +:map <silent> Add a mapping that won't echo Ex commands. + +:checktime Check for changed buffers. + +:verbose {cmd} Set 'verbose' for one command. + +:echomsg {expr} +:echoerr {expr} Like ":echo" but store the message in the history. (Mark + Waggoner) + +:grepadd Works just like ":grep" but adds to the current error list + instead of defining a new list. |:grepadd| + +:finish Finish sourcing a file. Can be used to skip the rest of a Vim + script. |:finish| + +:leftabove +:aboveleft Split left/above current window. + +:rightbelow +:belowright Split right/below current window. + +:first, :bfirst, :ptfirst, etc. + Alias for ":rewind". It's more logical compared to ":last". + +:enew Edit a new, unnamed buffer. This is needed, because ":edit" + re-edits the same file. (Wall) + +:quitall Same as ":qall". + +:match Define match highlighting local to a window. Allows + highlighting an item in the current window without interfering + with syntax highlighting. + +:menu enable +:menu disable Commands to enable/disable menu entries without removing them. + (Monish Shah) + +:windo Execute a command in all windows. +:bufdo Execute a command in all buffers. + +:wincmd Window (CTRL-W) command. Useful when a Normal mode command + can't be used (e.g., for a CursorHold autocommand). See + |CursorHold-example| for a nice application with it. + +:lcd and :lchdir + Set local directory for a window. (Benjie Chen) + +:hide {command} + Execute {command} with 'hidden' set. + +:emenu in Visual mode to execute a ":vmenu" entry. + +:popup Pop up a popup menu. + +:redraw Redraw the screen even when busy with a script or function. + +:hardcopy Print to paper. + +:compiler Load a Vim script to do settings for a specific compiler. + +:z# List numbered lines. (Bohdan Vlasyuk) + + +New marks: ~ + +'( and ') Begin or end of current sentence. Useful in Ex commands. +'{ and '} Begin or end of current paragraph. Useful in Ex commands. +'. Position of the last change in the current buffer. +'^ Position where Insert mode was stopped. + +Store the ^ and . marks in the viminfo file. Makes it possible to jump to the +last insert position or changed text. + + +New functions: ~ +argidx() Current index in argument list. +buflisted() Checks if the buffer exists and has 'buflisted' set. +cindent() Get indent according to 'cindent'. +eventhandler() Returns 1 when inside an event handler and interactive + commands can't be used. +executable() Checks if a program or batch script can be executed. +filewritable() Checks if a file can be written. (Ron Aaron) +foldclosed() Find out if there is a closed fold. (Johannes Zellner). +foldcloseend() Find the end of a closed fold. +foldlevel() Find out the foldlevel. (Johannes Zellner) +foreground() Move the GUI window to the foreground. +getchar() Get one character from the user. Can be used to define a + mapping that takes an argument. +getcharmod() Get last used key modifier. +getbufvar() gets the value of an option or local variable in a buffer (Ron + Aaron) +getfsize() Return the size of a file. +getwinvar() gets the value of an option or local variable in a window (Ron + Aaron) +globpath() Find matching files in a list of directories. +hasmapto() Detect if a mapping to a string is already present. +iconv() Convert a string from one encoding to another. +indent() gets the indent of a line (Ron Aaron) +inputdialog() Like input() but use a GUI dialog when possible. Currently + only works for Win32, Motif, Athena and GTK. + Use inputdialog() for the Edit/Settings/Text Width menu. Also + for the Help/Find.. and Toolbar FindHelp items. + (Win32 support by Thore B. Karlsen) + (Win16 support by Vince Negri) +inputsecret() Ask the user to type a string without showing the typed keys. + (Charles Campbell) +libcall() for Unix (Neil Bird, Johannes Zellner, Stephen Wall) +libcallnr() for Win32 and Unix +lispindent() Get indent according to 'lisp'. +mode() Return a string that indicates the current mode. +nextnonblank() Skip blank lines forwards. +prevnonblank() Skip blank lines backwards. Useful to for indent scripts. +resolve() MS-Windows: resolve a shortcut to the file it points to. + Unix: resolve a symbolic link. +search() Search for a pattern. +searchpair() Search for matching pair. Can be used in indent files to find + the "if" matching an endif. +setbufvar() sets an option or variable local to a buffer (Ron Aaron) +setwinvar() sets an option or variable local to a window (Ron Aaron) +stridx() Search for first occurrence of one string in another. +strridx() Search for last occurrence of one string in another. +tolower() Convert string to all-lowercase. +toupper() Convert string to all-uppercase. +type() Check the type of an expression. +wincol() window column of the cursor +winwidth() Width of a window. (Johannes Zellner) +winline() window line of the cursor + + +Added expansion of curly braces in variable and function names. This can be +used for variable names that include the value of an option. Or a primitive +form of arrays. (Vince Negri) + + +New autocommand events: ~ +BufWinEnter Triggered when a buffer is displayed in a window, after using + the modelines. Can be used to load a view. +BufWinLeave Triggered when a buffer is no longer in a window. Also + triggered when exiting Vim. Can be used to save views. +FileChangedRO Triggered before making the first change to a read-only file. + Can be used to check-out the file. (Scott Graham) +TermResponse Triggered when the terminal replies to the version-request. + The v:termresponse internal variable holds the result. Can be + used to react to the version of the terminal. (Ronald Schild) +FileReadCmd Triggered before reading a file. +BufReadCmd Triggered before reading a file into a buffer. +FileWriteCmd Triggered before writing a file. +BufWriteCmd Triggered before writing a buffer into a file. +FileAppendCmd Triggered before appending to a file. +FuncUndefined Triggered when a user function is not defined. (Ron Aaron) + +The autocommands for the *Cmd events read or write the file instead of normal +file read/write. Use this in netrw.vim to be able to edit files on a remote +system. (Charles Campbell) + + +New Syntax files: ~ + +bdf BDF font definition (Nikolai Weibull) +catalog SGML catalog (Johannes Zellner) +debchangelog Debian Changelog (Wichert Akkerman) +debcontrol Debian Control (Wichert Akkerman) +dot dot (Markus Mottl) +dsl DSSSL syntax (Johannes Zellner) +eterm Eterm configuration (Nikolai Weibull) +indent Indent profile (Nikolai Weibull) +lftp LFTP (Nikolai Weibull) +lynx Lynx config (Doug Kearns) +mush mush sourcecode (Bek Oberin) +natural Natural (Marko Leipert) +pilrc Pal resource compiler (Brian Schau) +plm PL/M (Philippe Coulonges) +povini Povray configuration (David Necas) +ratpoison Ratpoison config/command (Doug Kearns) +readline readline config (Nikolai Weibull) +screen Screen RC (Nikolai Weibull) +specman Specman (Or Freund) +sqlforms SQL*Forms (Austin Ziegler) +terminfo terminfo (Nikolai Weibull) +tidy Tidy configuration (Doug Kearns) +wget Wget configuration (Doug Kearns) + + +Updated many syntax files to work both with Vim 5.7 and 6.0. + +Interface to Ruby. (Shugo Maeda) +Support dynamic loading of the Ruby interface on MS-Windows. (Muraoka Taro) +Support this for Mingw too. (Benoit Cerrina) + +Win32: Added possibility to load TCL dynamically. (Muraoka Taro) +Also for Borland 5.5. (Dan Sharp) + +Win32: When editing a file that is a shortcut (*.lnk file), edit the file it +links to. Unless 'binary' is set, then edit the shortcut file itself. +(Yasuhiro Matsumoto) + +The ":command" command now accepts a "-bar" argument. This allows the user +command to be followed by "| command". + +The preview window is now also used by these commands: +- |:pedit| edits the specified file in the preview window +- |:psearch| searches for a word in included files, like |:ijump|, and + displays the found text in the preview window. +Added the CTRL-W P command: go to preview window. + +MS-DOS and MS-Windows also read the system-wide vimrc file $VIM/vimrc. Mostly +for NT systems with multiple users. + +A double-click of the mouse on a character that has a "%" match selects from +that character to the match. Similar to "v%". + +"-S session.vim" argument: Source a script file when starting up. Convenient +way to start Vim with a session file. + +Added "--cmd {command}" Vim argument to execute a command before a vimrc file +is loaded. (Vince Negri) + +Added the "-M" Vim argument: reset 'modifiable' and 'write', thus disallow +making changes and writing files. + +Added runtime/delmenu.vim. Source this to remove all menus and prepare for +loading new menus. Useful when changing 'langmenu'. + +Perl script to filter Perl error messages to quickfix usable format. (Joerg +Ziefle) + +Added runtime/macros/less.vim: Vim script to simulate less, but with syntax +highlighting. + +MS-Windows install program: (Jon Merz) +- The Win32 program can now create shortcuts on the desktop and install Vim in + the Start menu. +- Possibly remove old "Edit with Vim" entries. +- The Vim executable is never moved or $PATH changed. A small batch file is + created in a directory in $PATH. Fewer choices to be made. +- Detect already installed Vim versions and offer to uninstall them first. + +Improved the MS-Windows uninstal program. It now also deletes the entries in +the Start menu, icons from the desktop and the created batch files. (Jon Merz) +Also made it possible to delete only some of these. Also unregister gvim for +OLE. + +Generate a self-installing Vim package for MS-Windows. This uses NSIS. (Jon +Merz et al.) + +Added ":filetype detect". Try detecting the filetype again. Helps when +writing a new shell script, after adding "#!/bin/csh". + +Added ":augroup! name" to delete an autocommand group. Needed for the +client-server "--remote-wait". + +Add the Vim version number to the viminfo file, useful for debugging. + +============================================================================== +IMPROVEMENTS *improvements-6* + +Added the 'n' flag in 'cpoptions': When omitted text of wrapped lines is not +put between line numbers from 'number' option. Makes it a lot easier to read +wrapped lines. + +When there is a format error in a tags file, the byte position is reported so +that the error can be located. + +"gf" works in Visual mode: Use the selected text as the file name. (Chase +Tingley) + +Allow ambiguous mappings. Thus "aa" and "aaa" can both be mapped, the longest +matching one is used. Especially useful for ":lmap" and 'keymap'. + +Encryption: Ask the key to be typed twice when crypting the first time. +Otherwise a typo might cause the text to be lost forever. (Chase Tingley) + +The window title now has "VIM" on the end. The file name comes first, useful +in the taskbar. A "+" is added when the file is modified. "=" is added for +a read-only file. "-" is added for a file with 'modifiable' off. + +In Visual mode, mention the size of the selected area in the 'showcmd' +position. + +Added the "b:changedtick" variable. Incremented at each change, also for +undo. Can be used to take action only if the buffer has been changed. + +In the replacement string of a ":s" command "\=" can be used to replace with +the result of an expression. From this expression the submatch() function can +be used to access submatches. + +When doing ":qall" and there is a change in a buffer that is being edited in +another window, jump to that window, instead of editing that buffer in the +current window. + +Added the "++enc=" and "++ff=" arguments to file read/write commands to force +using the given 'encoding' or 'fileformat'. And added the "v:cmdarg" +variable, to be used for FileReadCmd autocommands that read/write the file +themselves. + +When reading stdin, first read the text in binary mode and then re-read it +with automatic selection of 'fileformat' and 'fileencoding'. This avoids +problems with not being able to rewind the file (e.g., when a line near the +end of the file ends in LF instead of CR-LF). +When reading text from stdin and the buffer is empty, don't mark it changed. +Allows exiting without trouble. + +Added an ID to many error messages. This will make it easier to find help for +a message. + +Insert mode: +- "CTRL-G j" and "CTRL-G k" can be used to insert in another line in the same + column. Useful for editing a table. +- Added Thesaurus completion with CTRL-X CTRL-T. (Vince Negri) +- Added the 'thesaurus' option, to use instead of 'dictionary' for thesaurus + completion. Added the 's' flag in 'complete'. +- Made CTRL-X CTRL-L in Insert mode use the 'complete' option. It now also + scans other loaded buffers for matching lines. +- CTRL-R now also works in Insert mode while doing completion with CTRL-X or + CTRL-N. (Neil Bird) +- When doing Insert mode completion, when completion is finished check for a + match with words from 'cinkeys' or 'indentkeys'. + +Performance: +- Made display updating more efficient. Insert/delete lines may be used for + all changes, also for undo/redo. +- The display is not redrawn when there is typeahead in Insert mode. Speeds + up CTRL-R a lot. +- Improved speed of screen output for 32 bit DOS version. (Vince Negri) +- When dragging with the mouse, there is a lookahead to skip mouse codes when + there is another one next. Makes dragging with the mouse a lot faster. +- Also a memory usage improvement: When calling u_save with a single line, + don't save it if the line was recently saved for the same undo already. +- When using a script that appends one character at a time, the amount of + allocated memory was growing steadily. Also when 'undolevels' is -1. + Caused by the line saved for "U" never to be freed. Now free an undo block + when it becomes empty. +- GUI and Dos32: Use a vertical scroll region, to make scrolling in a + vertically split window faster. No need to redraw the whole window. +- When scrolling isn't possible with terminal codes (e.g., for a vertically + split window) redraw from ScreenLines[]. That should be faster than going + through the lines with win_line(), especially when using syntax + highlighting. +- The Syntax menu is now pre-generated by a separate script. Makes loading + the menu 70% faster. This can halve the startup time of gvim. +- When doing ":help tag", don't open help.txt first, jump directly to the help + tag. It's faster and avoids an extra message. +- Win32: When a file name doesn't end in ".lnk" don't try resolving a + shortcut, it takes quite a bit of time. +- Don't update the mouse pointer shape while there are typeahead characters. +- Change META[] from a string into an array, avoids using strchr() on it. +- Don't clear the command line when adding characters, avoids that screen_fill + is called but doesn't do anything. + +Robustness: +- Unix: Check for running out of stack space when executing a regexp. Avoids + a nasty crash. Only works when the system supports running the signal + function on another stack. +- Disallow ":source <dirname>". On unix it's possible to read a directory, + does not make sense to use it as Vim commands. + +Security: +- When reading from or writing to a temporary file, check that it isn't a + symbolic link. Gives some protection against symlink attacks. +- When creating a backup file copy or a swap file, check for it already + existing to avoid a symlink attack. (Colin Phipps) +- Evaluating options which are an expression is done in a |sandbox|. If the + option was set by a modeline, it cannot cause damage. +- Use a secure way to generate temp file names: Create a private directory for + temp files. Used for Unix, MS-DOS and OS/2. +- 'makeef' can be empty, which means that an internally generated file name is + used. The old default was "/tmp/file", which is a security risk. + Writing 'makeef' in the current directory fails in a read-only directory and + causes trouble when using ":grep" on all files. Made the default empty for + all systems, so that a temp file is used. +- The command from a tags file is executed in the sandbox for better security. +- The Ruby, Tcl and Python interfaces cannot be used from the sandbox. They + might do dangerous things. Perl is still possible, but limited to the Safe + environment. (Donnie Smith) + +Syntax highlighting: +- Optimized the speed by caching the state stack all over the file, not just + the part being displayed. Required for folding. +- Added ":syntax sync fromstart": Always parse from the start of the file. +- Added the "display" argument for syntax items: use the item only when + displaying the result. Can make parsing faster for text that isn't going to + be displayed. +- When using CTRL-L, the cached states are deleted, to force parsing the text + again. +- Use elfhash algorithm for table of keywords. This should give a better + distribution and speedup keyword lookup. (Campbell) +- Also allow the "lc" leading context for skip and end patterns. (Scott + Bigham) +- Syntax items can have the "extend" argument to undo the effect of a + "keepend" argument of an item it is contained in. Makes it possible to have + some contained items extend a region while others don't. +- ":syntax clear" now deletes the b:current_syntax variable. That's logical, + since no syntax is defined after this command. +- Added ":syntax enable": switch on syntax highlighting without changing the + colors. This allows specifying the colors in the .vimrc file without the + need for a mysyntaxfile. +- Added ":syntax reset": reset the colors to their defaults. +- Added the "contains=TOP" and "contains=CONTAINED" arguments. Makes it + possible to define a transparent item that doesn't contain itself. +- Added a "containedin" argument to syntax items. Allows adding a contained + item to an existing item (e.g., to highlight a name in a comment). + +Modeless selection: +- When in the command-line window, use modeless selection in the other + windows. Makes it possible to copy visible text to the command-line window. +- Support modeless selection on the cmdline in a terminal. Previously it was + only possible for the GUI. +- Make double-right-click in modeless selection select a whole word. Single + right click doesn't use the word selection started by a double-left-click. + Makes it work like in Visual mode. +- The modeless selection no longer has an implied automatic copy to the + clipboard. It now obeys the 'a' and 'A' flags in 'guioptions' or + "autoselect" and "autoselectml" in 'clipboard'. +- Added the CTRL-Y command in Cmdline-mode to copy the modeless selection to + the clipboard. Also works at the hit-enter prompt and the more prompt. + Removed the mappings in runtime/mswin.vim for CTRL-Y and CTRL-Z in + cmdline-mode to be able to use CTRL-Y in the new way. + +Reduced the amount of stack space used by regmatch() to allow it to handle +complicated patterns on a longer text. + +'isfname' now includes '%' and '#'. Makes "vim dir\#file" work for MS-DOS. + +Added keypad special keys <kEnter>, <k0> - <k9>. When not mapped they behave +like the ASCII equivalent. (Ivan Wellesz and Vince Negri) +Recognize a few more xterm keys: <C-Right>, <C-Left>, <C-End>, <C-Home> + +Also trigger the BufUnload event when Vim is going to exit. Perhaps a script +needs to do some cleaning up. + +Expand expression in backticks: `={expr}`. Can be used where backtick +expansion is done. (Vince Negri) + +GUI: +- Added 'L' and 'R' flags in 'guioptions': Add a left or right scrollbar only + when there is a vertically split window. +- X11: When a color can't be allocated, use the nearest match from the + colormap. This avoids that black is used for many things. (Monish Shah) + Also do this for the menu and scrollbar, to avoid that they become black. +- Win32 and X11: Added 'mouseshape' option: Adjust the mouse pointer shape to + the current mode. (Vince Negri) +- Added the 'linespace' option: Insert a pixel line between lines. (Nam) +- Allow modeless selection (without moving the cursor) by keeping CTRL and + SHIFT pressed. (Ivan Wellesz) +- Motif: added toolbar. (Gordon Prieur) Also added tooltips. +- Athena: added toolbar and tooltips. (David Harrison -- based on Gordon + Prieur's work) +- Made the 'toolbar' option work for Athena and Motif. Can now switch between + text and icons on the fly. (David Harrison) +- Support menu separator lines for Athena. (David Harrison) +- Athena: Adjust the arrow pixmap used in a pullright menu to the size of the + font. (David Harrison) +- Win32: Added "c" flag to 'guifont' to be able to specify the charset. (Artem + Khodush) +- When no --enable-xim argument is given, automatically enable it when a X GUI + is used. Required for dead key support (and multi-byte input). +- After a file selection dialog, check that the edited files were not changed + or deleted. The Win32 dialog allows deleting and renaming files. +- Motif and Athena: Added support for "editres". (Marcin Dalecki) +- Motif and Athena: Added "menuFont" to be able to specify a font or fontset + for the menus. Can also be set with the "Menu" highlight group. Useful + when the locale is different from 'encoding'. (David Harrison) + When FONTSET_ALWAYS is defined, always use a fontset for the menus. Should + avoid trouble with changing from a font to a fontset. (David Harrison) +- Highlighting and font for the tooltips can be specified with the "Tooltip" + highlight group. (David Harrison) +- The Cmdline-mode menus can be used at the more-prompt. This mostly works + fine, because they start with a CTRL-C. The "Copy" menu works to copy the + modeless selection. Allows copying the output of ":set all" or ":intro" + without auto-selection. +- When starting the GUI when there is no terminal connected to stdout and + stderr, display error messages in a dialog. Previously they wouldn't be + displayed at all. +- Allow setting 'browsedir' to the name of a directory, to be used for the + file dialog. (Dan Sharp) +- b:browsefilter and g:browsefilter can be set to the filters used for the + file dialog. Supported for Win32 and Motif GUI. (Dan Sharp) + +X11: +- Support for the clipboard selection as register "+. When exiting or + suspending copy the selection to cut buffer 0. Should allow copy/paste with + more applications in a X11-standard way. (Neil Bird) +- Use the X clipboard in any terminal, not just in an xterm. + Added "exclude:" in 'clipboard': Specify a pattern to match against terminal + names for which no connection should be made to the X server. The default + currently work for FreeBSD and Linux consoles. +- Added a few messages for when 'verbose' is non-zero to show what happens + when trying to connect to the X server. Should help when trying to find out + why startup is slow. + +GTK GUI: (partly by Marcin Dalecki) +- With some fonts the characters can be taller than ascent + descent. E.g., + "-misc-fixed-*-*-*-*-18-*-*-*-*-*-iso10646-1". Add one to the character + cell height. +- Implement "no" value for 'winaltkeys': don't use Alt-Key as a menu shortcut, + when 'wak' changed after creating the menus. +- Setting 'wak' after the GUI started works. +- recycle text GC's to reduce communication. +- Adjust icon size to window manager. +- Cleanup in font handling. +- Replace XQueryColor with GDK calls. +- Gnome support. Detects Gnome in configure and uses different widgets. + Otherwise it's much like GTK. (Andy Kahn) + It is disabled by default, because it causes a few problems. +- Removed the special code to fork first and then start the GUI. Now use + _exit() instead of exit(), this works fine without special tricks. +- Dialogs sometimes appeared a bit far away. Position the dialogs inside + the gvim window. (Brent Verner) +- When dropping a file on Vim, remove extra slashes from the start of the + path. Also shorten the file name if possible. + +Motif: (Marcin Dalecki) +- Made the dialog layout better. +- Added find and find/replace dialogs. +- For the menus, change "iso-8859" to "iso_8859", Linux appears to need this. +- Added icon to dialogs, like for GTK. +- Use XPM bitmaps for the icon when possible. Use the Solaris XpmP.h include + file when it's available. +- Change the shadow of the toolbar items to get a visual feedback of it being + pressed on non-LessTif. +- Use gadgets instead of windows for some items for speed. + +Command line completion: +- Complete environment variable names. (Mike Steed) +- For ":command", added a few completion methods: "mapping", "function", + "expression" and "environment". +- When a function doesn't take arguments, let completion add () instead of (. + +For MS-DOS, MS-Windows and OS/2: Expand %VAR% environment variables like $VAR. +(Walter Briscoe) + +Redirect messages to the clipboard ":redir @*" and to the unnamed register +":redir @"". (Wall) + +":let @/ = ''" clears the search pattern, instead of setting it to an empty +string. + +Expression evaluation: +- "? :" can be used like in C. +- col("$") returns the length of the cursor line plus one. (Stephen P. Wall) +- Optional extra argument for match(), matchend() and matchstr(): Offset to + start looking for a match. +- Made third argument to strpart() optional. (Paul Moore, Zdenek Sekera) +- exists() can also be used to check for Ex commands and defined autocommands. +- Added extra argument to input(): Default text. +- Also set "v:errmsg" when using ":silent! cmd". +- Added the v:prevcount variable: v:count for the previous command. +- Added "v:progname", name with which Vim was started. (Vince Negri) +- In the verbose message about returning from a function, also show the return + value. + +Cscope: +- Added the cscope_connection() function. (Andy Kahn) +- ":cscope kill -1" kills all cscope connections. (Andy Kahn) +- Added the 'cscopepathcomp' option. (Scott Hauck) +- Added ":scscope" command, split window and execute Cscope command. (Jason + Duell) + +VMS: +- Command line arguments are always uppercase. Interpret a "-X" argument as + "-x" and "-/X" as "-X". +- Set 'makeprg' and 'grepprg' to meaningful defaults. (Zoltan Arpadffy) +- Use the X-clipboard feature and the X command server. (Zoltan Arpadffy) + +Macintosh: (Dany St-Amant) +- Allow a tags file to have CR, CR-LF or LF line separator. (Axel Kielhorn) +- Carbonized (while keeping non Carbon code) + (Some work "stolen" from Ammon Skidmore) +- Improved the menu item index handling (should be faster) +- Runtime commands now handle / in file name (MacOS 9 version) +- Added ":winpos" support. +- Support using "~" in file names for home directory. + +Options: +- When using set += or ^= , check for items used twice. Duplicates are + removed. (Vince Negri) +- When setting an option that is a list of flags, remove duplicate flags. +- If possible, use getrlimit() to set 'maxmemtot' and 'maxmem'. (Pina) +- Added "alpha" to 'nrformats': increment or decrement an alphabetic character + with CTRL-A and CTRL-X. +- ":set opt&vi" sets an option to its Vi default, ":set opt&vim" to its Vim + default. Useful to set 'cpo' to its Vim default without knowing what flags + that includes. +- 'scrolloff' now also applies to a long, wrapped line that doesn't fit in the + window. +- Added more option settings to the default menus. +- Updated the option window with new options. Made it a bit easier to read. + +Internal changes: +- Split line pointers in text part and attributes part. Allows for future + change to make attribute more than one byte. +- Provide a qsort() function for systems that don't have it. +- Changed the big switch for Normal mode commands into a table. This cleans + up the code considerably and avoids trouble for some optimizing compilers. +- Assigned a negative value to special keys, to avoid them being mixed up with + Unicode characters. +- Global variables expand_context and expand_pattern were not supposed to be + global. Pass them to ExpandOne() and all functions called by it. +- No longer use the global reg_ic flag. It caused trouble and in a few places + it was not set. +- Removed the use of the stuff buffer for "*", "K", CTRL-], etc. Avoids + problem with autocommands. +- Moved some code from ex_docmd.c to ex_cmds2.c. The file was getting too + big. Also moved some code from screen.c to move.c. +- Don't include the CRC table for encryption, generate it. Saves quite a bit + of space in the source code. (Matthias Kramm) +- Renamed multibyte.c to mbyte.c to avoid a problem with 8.3 filesystems. +- Removed the GTK implementation of ":findhelp", it now uses the + ToolBar.FindHelp menu entry. +- Renamed mch_windexit() to mch_exit(), mch_init() to mch_early_init() and + mch_shellinit() to mch_init(). + +Highlighting: +- In a ":highlight" listing, show "xxx" with the highlight color. +- Added support for xterm with 88 or 256 colors. The right color numbers will + be used for the name used in a ":highlight" command. (Steve Wall) +- Added "default" argument for ":highlight". When included, the command is + ignored if highlighting for the group was already defined. + All syntax files now use ":hi default ..." to allow the user to specify + colors in his vimrc file. Also, the "if did_xxx_syntax_inits" is not needed + anymore. This greatly simplifies using non-default colors for a specific + language. +- Adjusted colortest.vim: Included colors on normal background and reduced the + size by using a while loop. (Rafael Garcia-Suarez) +- Added the "DarkYellow" color name. Just to make the list of standard colors + consistent, it's not really a nice color to use. + +When an xterm is in 8-bit mode this is detected by the code returned for +|t_RV|. All key codes are automatically converted to their 8-bit versions. + +The OPT_TCAP_QUERY in xterm patch level 141 and later is used to obtain the +actual key codes used and the number of colors for t_Co. Only when |t_RV| is +also used. + +":browse set" now also works in the console mode. ":browse edit" will give an +error message. + +":bdelete" and ":bunload" only report the number of deleted/unloaded buffers +when more than 'report'. The message was annoying when deleting a buffer in a +script. + +Jump list: +- The number of marks kept in the jumplist has been increased from 50 to 100. +- The jumplist is now stored in the viminfo file. CTRL-O can be used to jump + to positions from a previous edit session. +- When doing ":split" copy the jumplist to the new window. + +Also set the '[ and '] marks for the "~" and "r" commands. These marks are +now always set when making a change with a Normal mode command. + +Python interface: Allow setting the width of a vertically split window. (John +Cook) + +Added "=word" and "=~word" to 'cinkeys' (also used in 'indentkeys'). + +Added "j1" argument in 'cinoptions': indent {} inside () for Java. (Johannes +Zellner) +Added the "l" flag in 'cinoptions'. (Anduin Withers) +Added 'C', 'U', 'w' and 'm' flags to 'cinoptions'. (Servatius Brandt) + +When doing ":wall" or ":wqall" and a modified buffer doesn't have a name, +mention its buffer number in the error message. + +":function Name" lists the function with line numbers. Makes it easier to +find out where an error happened. + +In non-blockwise Visual mode, "r" replaces all selected characters with the +typed one, like in blockwise Visual mode. + +When editing the last file in the argument list in any way, allow exiting. +Previously this was only possible when getting to that file with ":next" or +":last". + +Added the '1' flag to 'formatoptions'. (Vit Stradal) +Added 'n' flag in 'formatoptions': format a numbered list. + +Swap file: +- When a swap file already exists, and the user selects "Delete" at the + ATTENTION prompt, use the same ".swp" swapfile, to avoid creating a ".swo" + file which won't always be found. +- When giving the ATTENTION message and the date of the file is newer than the + date of swap file, give a warning about this. +- Made the info for an existing swap file a bit shorter, so that it still fits + on a 24 line screen. +- It was possible to make a symlink with the name of a swap file, linking to a + file that doesn't exist. Vim would then silently use another file (if open + with O_EXCL refuses a symlink). Now check for a symlink to exist. Also do + another check for an existing swap file just before creating it to catch a + symlink attack. + +The g CTRL-G command also works in Visual mode and counts the number of words. +(Chase Tingley) + +Give an error message when using 'shell' and it's empty. + +Added the possibility to include "%s" in 'shellpipe'. + +Added "uhex" value for 'display': show non-printable characters as <xx>. +Show unprintable characters with NonText highlighting, also in the command +line. + +When asked to display the value of a hidden option, tell it's not supported. + +Win32: +- When dropping a shortcut on gvim (.lnk file) edit the target, not the + shortcut itself. (Yasuhiro Matsumoto) +- Added C versions of the OpenWithVim and SendToVim programs. (Walter Briscoe) +- When 'shell' is "cmd" or "cmd.exe", set 'shellredir' to redirect stderr too. + Also check for the Unix shell names. +- When $HOMEDRIVE and $HOMEPATH are defined, use them to define $HOME. (Craig + Barkhouse) + +Win32 console version: +- Includes the user and system name in the ":version" message, when available. + It generates a pathdef.c file for this. (Jon Miner) +- Set the window icon to Vim's icon (only for Windows 2000). While executing + a shell command, modify the window title to show this. When exiting, + restore the cursor position too. (Craig Barkhouse) +- The Win32 console version can be compiled with OLE support. It can only + function as a client, not as an OLE server. + +Errorformat: +- Let "%p" in 'errorformat' (column of error indicated by a row of characters) + also accept a line of dots. +- Added "%v" item in 'errorformat': Virtual column number. (Dan Sharp) +- Added a default 'errorformat' value for VMS. (Jim Bush) + +The "p" command can now be used in Visual mode. It overwrites the selected +text with the contents of a register. + +Highlight the <> items in the intro message to make clear they are special. + +When using the "c" flag for ":substitute", allow typing "l" for replacing this +item and then stop: "last". + +When printing a verbose message about sourcing another file, print the line +number. + +When resizing the Vim window, don't use 'equalalways'. Avoids that making the +Vim window smaller makes split windows bigger. And it's what the docs say. + +When typing CTRL-D in Insert mode, just after an autoindent, then hitting CR +kept the remaining white space. Now made it work like BS: delete the +autoindent to avoid a blank non-empty line results. + +Added a GetHwnd() call to the OLE interface. (Vince Negri) + +Made ":normal" work in an event handler. Useful when dropping a file on Vim +and for CursorHold autocommands. + +For the MS-Windows version, don't change to the directory of the file when a +slash is used instead of a backslash. Explorer should always use a backslash, +the user can use a slash when typing the command. + +Timestamps: +- When a buffer was changed outside of Vim and regaining focus, give a dialog + to allow the user to reload the file. Now also for other GUIs than + MS-Windows. And also used in the console, when compiled with dialog + support. +- Inspect the file contents to find out if it really changed, ignore + situations where only the time stamp changed (e.g., checking the file out + from CVS). +- When checking the timestamp, first check if the file size changed, to avoid + a file compare then. Makes it quicker for large (log) files that are + appended to. +- Don't give a warning for a changed or deleted file when 'buftype' is set. +- No longer warn for a changed directory. This avoids that the file explorer + produces warnings. +- Checking timestamps is only done for buffers that are not hidden. These + will be checked when they become unhidden. +- When checking for a file being changed outside of Vim, also check if the + file permissions changed. When the file contents didn't change but the + permissions did, give a warning. +- Avoid checking too often, otherwise the dialog keeps popping up for a log + file that steadily grows. + +Mapping <M-A> when 'encoding' is "latin1" and then setting 'encoding' to +"utf-8" causes the first byte of a multi-byte to be mapped. Can cause very +hard to find problems. Disallow mapping part of a multi-byte character. + +For ":python" and ":tcl" accept an in-line script. (Johannes Zellner) +Also for ":ruby" and ":perl". (Benoit Cerrina) + +Made ":syn include" use 'runtimepath' when the file name is not a full path. + +When 'switchbuf' contains "split" and the current window is empty, don't split +the window. + +Unix: Catch SIGPWR to preserve files when the power is about to go down. + +Sniff interface: (Anton Leherbauer) +- fixed windows code, esp. the event handling stuff +- adaptations for sniff 4.x ($SNIFF_DIR4) +- support for adding sniff requests at runtime + +Support the notation <A-x> as an alias for <M-x>. This logical, since the Alt +key is used. + +":find" accepts a count, which means that the count'th match in 'path' is +used. + +":ls" and ":buffers" output shows modified/readonly/modifiable flag. When a +buffer is active show "a" instead of nothing. When a buffer isn't loaded +show nothing instead of "-". + +Unix install: +- When installing the tools, set absolute paths in tools scripts efm_perl.pl + and mve.awk. Avoids that the user has to edit these files. +- Install Icons for KDE when the directories exist and the icons do not exist + yet. + +Added has("win95"), to be able to distinguish between MS-Windows 95/98/ME and +NT/2000/XP in a Vim script. + +When a ":cd" command was typed, echo the new current directory. (Dan Sharp) + +When using ":winpos" before the GUI window has been opened, remember the +values until it is opened. + +In the ":version" output, add "/dyn" for features that are dynamically loaded. +This indicates the feature may not always work. + +On Windows NT it is possible that a directory is read-only, but a file can be +deleted. When making a backup by renaming the file and 'backupdir' doesn't +use the current directory, this causes the original file to be deleted, +without the possibility to create a new file. Give an extra error message +then to warn to user about this. + +Made CTRL-R CTRL-O at the command line work like CTRL-R CTRL-R, so that it's +consistent with Insert mode. + +============================================================================== +COMPILE TIME CHANGES *compile-changes-6* + +All generated files have been moved out of the "src" directory. This makes it +easy to see which files are not edited by hand. The files generated by +configure are now in the "src/auto" directory. For Unix, compiled object +files go in the objects directory. + +The source archive was over the 1.4M floppy limit. The archives are now split +up into two runtime and two source archives. Also provide a bzip2 compressed +archive that contains all the sources and runtime files. + +Added "reconfig" as a target for make. Useful when changing some of the +arguments that require flushing the cache, such as switching from GTK to +Motif. Adjusted the meaning of GUI_INC_LOC and GUI_LIB_LOC to be consistent +over different GUIs. + +Added src/README.txt to give an overview of the main parts of the source code. + +The Unix Makefile now fully supports using $(DESTDIR) to install to a specific +location. Replaces the manual setting of *ENDLOC variables. + +Added the possibility for a maintainer of a binary version to include his +e-mail address with the --with-compiledby configure argument. + +Included features are now grouped in "tiny", "small", "normal", "big" and +"huge". This replaces "min-features" and "max-features". Using "tiny" +disables multiple windows for a really small Vim. + +For the tiny version or when FEAT_WINDOWS is not defined: Firstwin and lastwin +are equal to curwin and don't use w_next and w_prev. + +Added the +listcmds feature. Can be used to compile without the Vim commands +that manipulate the buffer list and argument list (the buffer list itself is +still there, can't do without it). + +Added the +vreplace feature. It is disabled in the "small" version to avoid +that the 16 bit DOS version runs out of memory. + +Removed GTK+ support for versions older than 1.1.16. + +The configure checks for using PTYs have been improved. Code taken from a +recent version of screen. + +Added configure options to install Vim, Ex and View under another name (e.g., +vim6, ex6 and view6). + +Added "--with-global-runtime" configure argument. Allows specifying the +global directory used in the 'runtimepath' default. + +Made enabling the SNiFF+ interface possible with a configure argument. + +Configure now always checks /usr/local/lib for libraries and +/usr/local/include for include files. Helps finding the stuff for iconv() and +gettext(). + +Moved the command line history stuff into the +cmdline_hist feature, to +exclude the command line history from the tiny version. + +MS-Windows: Moved common functions from Win16 and Win32 to os_mswin.c. Avoids +having to change two files for one problem. (Vince Negri) + +Moved common code from gui_w16.c and gui_w32.c to gui_w48.c (Vince Negri) + +The jumplist is now a separate feature. It is disabled for the "small" +version (16 bit MS-DOS). + +Renamed all types ending in _t to end in _T. Avoids potential problems with +system types. + +Added a configure check for X11 header files that implicitly define the return +type to int. (Steve Wall) + +"make doslang" in the top directory makes an archive with the menu and .mo +files for Windows. This uses the files generated on Unix, these should work +on MS-Windows as well. + +Merged a large part of os_vms.c with os_unix.c. The code was duplicated in +the past which made maintenance more work. (Zoltan Arpadffy) + +Updated the Borland C version 5 Makefile: (Dan Sharp) +- Fixed the Perl build +- Added python and tcl builds +- Added dynamic perl and dynamic python builds +- Added uninstal.exe build +- Use "yes" and "no" for the options, like in Make_mvc.mak. + +Win32: Merged Make_gvc.mak and Make_ovc.mak into one file: Make_ivc.mak. It's +much smaller, many unnecessary text has been removed. (Walter Briscoe) +Added Make_dvc.mak to be able to debug exe generated with Make_mvc.mak in +MS-Devstudio. (Walter Briscoe) + +MS-Windows: The big gvim.exe, which includes OLE, now also includes +dynamically loaded Tcl, Perl and Python. This uses ActivePerl 5.6.1, +ActivePython 2.1.1 and ActiveTCL 8.3.3 + +Added AC_EXEEXT to configure.in, to check if the executable needs ".exe" for +Cygwin or MingW. Renamed SUFFIX to EXEEXT in Makefile. + +Win32: Load comdlg32.dll delayed for faster startup. Only when using VC 6. +(Vipin Aravind) + +Win32: When compiling with Borland, allow using IME. (Yasuhiro Matsumoto) + +Win32: Added Makefile for Borland 5 to compile gvimext.dll. (Yasuhiro +Matsumoto) + +============================================================================== +BUG FIXES *bug-fixes-6* + +When checking the command name for "gvim", "ex", etc. ignore case. Required +for systems where case is ignored in command names. + +Search pattern "[a-c-e]" also matched a 'd' and didn't match a '-'. + +When double-clicking in another window, wasn't recognized as double click, +because topline is different. Added set_mouse_topline(). + +The BROKEN_LOCALE check was broken. (Marcin Dalecki) + +When "t_Co" is set, the default colors remain the same, thus wrong. Reset the +colors after changing "t_Co". (Steve Wall) + +When exiting with ":wqall" the messages about writing files could overwrite +each other and be lost forever. + +When starting Vim with an extremely long file name (around 1024 characters) it +would crash. Added a few checks to avoid buffer overflows. + +CTRL-E could get stuck in a file with very long lines. + +":au syntax<Tab>" expanded event names while it should expand groups starting +with "syntax". + +When expanding a file name caused an error (e.g., for <amatch>) it was +produced even when inside an "if 0". + +'cindent' formatted C comments differently from what the 'comments' option +specified. (Steve Wall) + +Default for 'grepprg' didn't include the file name when only grepping in one +file. Now /dev/null has been added for Unix. + +Opening the option window twice caused trouble. Now the cursor goes to the +existing option window. + +":sview" and ":view" didn't set 'readonly' for an existing buffer. Now do set +'readonly', unless the buffer is also edited in another window. + +GTK GUI: When 'guioptions' excluded 'g', the more prompt caused the toolbar +and menubar to disappear and resize the window (which clears the text). +Now always grey-out the toplevel menus to avoid that the menubar changes size +or disappears. + +When re-using the current buffer for a new buffer, buffer-local variables were +not deleted. + +GUI: when 'scrolloff' is 0 dragging the mouse above the window didn't cause a +down scroll. Now pass on a mouse event with mouse_row set to -1. + +Win32: Console version didn't work on telnet, because of switching between two +console screens. Now use one console screen and save/restore the contents +when needed. (Craig Barkhouse) + +When reading a file the magic number for encryption was included in the file +length. (Antonio Colombo) + +The quickfix window contained leading whitespace and NULs for multi-line +messages. (David Harrison) + +When using cscope, redundant tags were removed. This caused a numbering +problem, because they were all listed. Don't remove redundant cscope tags. +(David Bustos). + +Cscope: Test for which matches are in the current buffer sometimes failed, +causing a jump to another match than selected. (David Bustos) + +Win32: Buffer overflow when adding a charset name in a font. + +'titlestring' and 'iconstring' were evaluating an expression in the current +context, which could be a user function, which is a problem for local +variables vs global variables. + +Win32 GUI: Mapping <M-F> didn't work. Now handle SHIFT and CTRL in +_OnSysChar(). + +Win32 GUI: (on no file), :vs<CR>:q<CR> left a trail of pixels down the middle. +Could also happen for the ruler. screen_puts() didn't clear the right char in +ScreenLines[] for the bold trick. + +Win32: ":%!sort|uniq" didn't work, because the input file name touches the +"|". Insert a space before the "|". + +OS/2: Expanding wildcards included non-existing files. Caused ":runtime" to +fail, which caused syntax highlighting to fail. + +Pasting a register containing CTRL-R on the command line could cause an +endless loop that can't be interrupted. Now it can be stopped with CTRL-C. + +When 'verbose' is set, a message for file read/write could overwrite the +previous message. +When 'verbose' is set, the header from ":select" was put after the last +message. Now start a new line. + +The hit-enter prompt reacted to the response of the t_RV string, causing +messages at startup to disappear. + +When t_Co was set to 1, colors were still used. Now only use color when t_Co +> 1. + +Listing functions with ":function" didn't quit when 'q' or ':' was typed at +the more prompt. + +Use mkstemp() instead of mktemp() when it's available, avoids a warning for +linking on FreeBSD. + +When doing Insert mode completion it's possible that b_sfname is NULL. Don't +give it to printf() for the "Scanning" message. + +":set runtimepath-=$VIMRUNTIME" didn't work, because expansion of wildcards +was done after trying to remove the string. Now for ":set opt+=val" and ":set +opt-=val" the expansion of wildcards is done before adding or removing "val". + +Using CTRL-V with the "r" command with a blockwise Visual selection inserted a +CTRL-V instead of getting a special character. + +Unix: Changed the order of libraries: Put -lXdmcp after -lX11 and -lSM -lICE +after -lXdmcp. Should fix link problem on HP-UX 10.20. + +Don't remove the last "-lm" from the link line. Vim may link but fail later +when the GUI starts. + +When the shell returns with an error when trying to expand wildcards, do +include the pattern when the "EW_NOTFOUND" flag was set. +When expanding wildcards with the shell fails, give a clear error message +instead of just "1 returned". + +Selecting a Visual block, with the start partly on a Tab, deleting it leaves +the cursor too far to the left. Causes "s" to work in the wrong position. + +Pound sign in normal.c caused trouble on some compilers. Use 0xA3 instead. + +Warning for changing a read-only file wasn't given when 'insertmode' was set. + +Win32: When 'shellxquote' is set to a double quote (e.g., using csh), ":!start +notepad file" doesn't work. Remove the double quotes added by 'shellxquote' +when using ":!start". (Pavol Juhas) + +The "<f-args>" argument of ":command" didn't accept Tabs for white space. +Also, don't add an empty argument when there are trailing blanks. + +":e test\\je" edited "test\je", but ":next test\\je" edited "testje". +Backslashes were removed one time too many for ":next". + +VMS: "gf" didn't work properly. Use vms_fixfilename() to translate the file +name. (Zoltan Arpadffy) + +After ":hi Normal ctermbg=black ctermfg=white" and suspending Vim not all +characters are redrawn with the right background. + +When doing "make test" without +eval or +windows feature, many tests failed. +Now have test1 generate a script to copy the correct output, so that a test +that doesn't work is skipped. + +On FreeBSD the Perl interface added "-lc" to the link command and Python added +"-pthread". These two don't work together, because the libc_r library should +be used. Removed "-lc" from Perl, it should not be needed. +Also: Add "-pthread" to $LIBS, so that the checks for functions is done with +libc_r. Sigaltstack() appears to be missing from libc_r. + +The Syntax sub-menus were getting too long, reorganized them and added another +level for some languages. + +Visual block "r"eplace didn't work well when a Tab is partly included. +(Matthias Kramm) + +When yanking a Visual block, where some lines end halfway the block, putting +the text somewhere else doesn't insert a block. Padd with spaces for missing +characters. Added "y_width" to struct yankreg. (Matthias Kramm) + +If a substitute string has a multibyte character after a backslash only the +first byte of it was skipped. (Muraoka Taro) + +Win32: Numeric keypad keys were missing from the builtin termcap entry. + +When a file was read-only ":wa!" didn't force it to be written. (Vince Negri) + +Amiga: A file name starting with a colon was considered absolute but it isn't. +Amiga: ":pwd" added a slash when in the root of a drive. + +Don't let 'ttymouse' default to "dec" when compiled with dec mouse support. +It breaks the gpm mouse (Linux console). + +The prototypes for the Perl interface didn't work for threaded Perl. Added a +sed command to remove the prototypes from proto/if_perl.pro and added them +manually to if_perl.xs. + +When ":w!" resets the 'readonly' option the title and status lines were not +updated. + +":args" showed the current file when the argument list was empty. Made this +work like Vi: display nothing. + +"99:<C-U>echo v:count" echoed "99" in Normal mode, but 0 in Visual mode. +Don't set v:count when executing a stuffed command. + +Amiga: Got a requester for "home:" because it's in the default runtime path. +Don't bring up a requester when searching for a file in 'path', sourcing the +.vimrc file or using ":runtime". + +Win16 and Win32: Considered a file "\path\file" absolute. Can cause the same +file to appear as two different buffers. + +Win32: Renaming a file to an empty string crashed Vim. Happened when using +explorer.vim and hitting ESC at the rename prompt. + +Win32: strftime() crashed when called with a "-1" value for the time. + +Win32 with Borland compiler: mch_FullName() didn't work, caused tag file not +to be found. + +Cscope sometimes jumped to the wrong tag. (David Bustos) + +OS/2: Could not find the tags file. mch_expand_wildcards() added another +slash to a directory name. + +When using ">>" the `] mark was not in the last column. + +When Vim was compiled without menu support, filetype.vim was still trying to +source the menu.vim script. (Rafael Garcia-Suarez) + +":ptag" added an item to the tag stack. + +Win32 IME: "gr" didn't use IME mode. + +In the "vim --help" message the term "options" was used for arguments. That's +confusing, call them "arguments". + +When there are two windows, and a BufUnload autocommand for closing window #1 +closed window #2, Vim would crash. + +When there is a preview window and only one other window, ":q" wouldn't exit. + +In Insert mode, when cancelling a digraph with ESC, the '?' wasn't removed. + +On Unix glob(".*") returned "." and "..", on Windows it didn't. On Windows +glob("*") also returned files starting with a dot. Made this work like Unix +on all systems. + +Win32: Removed old code to open a console. Vimrun is now used and works fine. + +Compute the room needed by the intro message accurately, so that it also fits +on a 25 line console. (Craig Barkhouse) + +":ptnext" was broken. Now remember the last tag used in the preview window +separately from the tagstack. + +Didn't check for "-display" being the last argument. (Wichert Akkerman) + +GTK GUI: When starting "gvim" under some conditions there would be an X error. +Don't replace the error handler when creating the xterm clipboard. (Wichert +Akkerman) + +Adding a space after a help tag caused the tag not to be found. E.g., ":he +autoindent ". + +Was trying to expand a URL into a full path name. On Windows this resulted in +the current directory to be prepended to the URL. Added vim_isAbsName() and +vim_FullName() to avoid that various machine specific functions do it +differently. + +":n *.c" ":cd .." ":n" didn't use the original directory of the file. Vi only +does it for the current file (looks like a bug). Now remember the buffer used +for the entry in the argument list and use it's name (adjusted when doing +":cd"), unless it's deleted. + +When inserting a special key as its name ("<F8>" as four characters) after +moving around in Insert mode, undo didn't work properly. + +Motif GUI: When using the right mouse button, for some people gvim froze for +a couple of seconds (Motif 1.2?). This doesn't happen when there is no Popup +menu. Solved by only creating a popup menu when 'mousemodel' is "popup" or +"popup_setpos". (David Harrison) + +Motif: When adding many menu items, the "Help" menu disappeared but the +menubar didn't wrap. Now manually set the menubar height. + +When using <BS> in Insert mode to remove a line break, or using "J" to join +lines, the cursor could end up halfway a multi-byte character. (Muraoka Taro) + +Removed defining SVR4 in configure. It causes problems for some X header +files and doesn't appear to be used anywhere. + +When 'wildignore' is used, 'ignorecase' for a tag match was not working. + +When 'wildignore' contains "*~" it was impossible to edit a file ending in a +"~". Now don't recognize a file ending in "~" as containing wildcards. + +Disabled the mouse code for OS/2. It was not really used. + +":mksession" always used the full path name for a buffer, also when the short +name could be used. +":mkvimrc" and ":mksession" didn't save 'wildchar' and 'pastetoggle' in such a +way that they would be restored. Now use the key name if possible, this is +portable. + +After recovering a file and abandoning it, an ":edit" command didn't give the +ATTENTION prompt again. Would be useful to be able to delete the file in an +easy way. Reset the BF_RECOVERED flag when unloading the buffer. + +histdel() could match or ignore case, depending on what happened before it. +Now always match case. + +When a window size was specified when splitting a window, it would still get +the size from 'winheight' or 'winwidth' if it's larger. + +When using "append" or "insert" inside a function definition, a line starting +with "function" or "endfunction" caused confusion. Now recognize the commands +and skip lines until a ".". + +At the end of any function or sourced file need_wait_return could be reset, +causing messages to disappear when redrawing. + +When in a while loop the line number for error messages stayed fixed. Now the +line number is remembered in the while loop. + +"cd c:/" didn't work on MS-DOS. mch_isdir() removed a trailing slash. + +MS-Windows: getftime() didn't work when a directory had a trailing slash or +backslash. Didn't show the time in the explorer because of this. + +When doing wildcard completion, a directory "a/" sorted after "a-b". Now +recognize path separators when sorting files. + +Non-Unix systems: When editing "c:/dir/../file" and "c:/file" they were +created as different buffers, although it's the same file. Expand to a full +file name also when an absolute name contains "..". + +"g&" didn't repeat the last substitute properly. + +When 'clipboard' was set to "unnamed", a "Y" command would not write to "0. +Now make a copy of register 0 to the clipboard register. + +When the search pattern matches in many ways, it could not always be +interrupted with a CTRL-C. And CTRL-C would have to be hit once for every +line when 'hlsearch' is on. +When 'incsearch' is on and interrupting the search for a match, don't abandon +the command line. + +When turning a directory name into a full path, e.g., with fnamemodify(), +sometimes a slash was added. Make this consistent: Don't add a slash. + +When a file name contains a "!", using it in a shell command will cause +trouble: ":!cat %". Escape the "!" to avoid that. Escape it another time +when 'shell' contains "sh". + +Completing a file name that has a tail that starts with a "~" didn't work: +":e view/~<Tab>". + +Using a ":command" argument that contains < and > but not for a special +argument was not skipped properly. + +The DOS install program: On Win2000 the check for a vim.exe or gvim.exe in +$PATH didn't work, it always found it in the current directory. +Rename the vim.exe in the current dir to avoid this. (Walter Briscoe) + +In the MS-DOS/Windows install program, use %VIM% instead of an absolute path, +so that moving Vim requires only one change in the batch file. + +Mac: mch_FullName() changed the "fname" argument and didn't always initialize +the buffer. + +MS-DOS: mch_FullName() didn't fix forward/backward slashes in an absolute file +name. + +"echo expand("%:p:h")" with an empty file name removed one directory name on +MS-DOS. For Unix, when the file name is a directory, the directory name was +removed. Now make it consistent: "%:p" adds a path separator for all systems, +but no path separator is added in other situations. + +Unix: When checking for a CTRL-C (could happen any time) and there is an X +event (e.g., clipboard updated) and there is typeahead, Vim would hang until a +character was typed. + +MS-DOS, MS-Windows and Amiga: expanding "$ENV/foo" when $ENV ends in a colon, +had the slash removed. + +":he \^=" gave an error for using \_. ":he ^=" didn't find tag :set^=. Even +"he :set^=" didn't find it. + +A tags file name "D:/tags" was used as file "tags" in "D:". That doesn't work +when the current path for D: isn't the root of the drive. + +Removed calls to XtInitializeWidgetClass(), they shouldn't be necessary. + +When using a dtterm or various other color terminals, and the Normal group has +been set to use a different background color, the background wouldn't always +be displayed with that color. Added check for "ut" termcap entry: If it's +missing, clearing the screen won't give us the current background color. Need +to draw each character instead. Vim now also works when the "cl" (clear +screen) termcap entry is missing. + +When repeating a "/" search command with a line offset, the "n" did use the +offset but didn't make the motion linewise. Made "d/pat/+2" and "dn" do the +same. + +Win32: Trying to use ":tearoff" for a menu that doesn't exist caused a crash. + +OpenPTY() didn't work on Sequent. Add a configure check for getpseudotty(). + +C-indenting: Indented a line starting with ")" with the matching "(", but not +a line starting with "x)" looks strange. Also compute the indent for aligning +with items inside the () and use the lowest indent. + +MS-DOS and Windows: ":n *.vim" also matched files ending in "~". +Moved mch_expandpath() from os_win16.c and os_msdos.c to misc1.c, they are +equal. + +Macintosh: (Dany St-Amant) +- In Vi-compatible mode didn't read files with CR line separators. +- Fixed a bug in the handling of Activate/Deactivate Event +- Fixed a bug in gui_mch_dialog (using wrong pointer) + +Multibyte GDK XIM: While composing a multibyte-word, if user presses a +mouse button, then the word is removed. It should remain and composing end. +(Sung-Hyun Nam) + +MS-DOS, MS-Windows and OS/2: When reading from stdin, automatic CR-LF +conversion by the C library got in the way of detecting a "dos" 'fileformat'. + +When 'smartcase' is set, patterns with "\S" would also make 'ignorecase' +reset. + +When clicking the mouse in a column larger than 222, it moved to the first +column. Can't encode a larger number in a character. Now limit the number to +222, don't jump back to the first column. + +GUI: In some versions CSI would cause trouble, either when typed directly or +when part of a multi-byte sequence. + +When using multibyte characters in a ":normal" command, a trailing byte that +is CSI or K_SPECIAL caused problems. + +Wildmenu didn't handle multi-byte characters. + +":sleep 10" could not be interrupted on Windows, while "gs" could. Made them +both work the same. + +Unix: When waiting for a character is interrupted by an X-windows event (e.g., +to obtain the contents of the selection), the wait time would not be honored. +A message could be overwritten quickly. Now compute the remaining waiting +time. + +Windows: Completing "\\share\c$\S" inserted a backslash before the $ and then +the name is invalid. Don't insert the backslash. + +When doing an auto-write before ":make", IObuff was overwritten and the wrong +text displayed later. + +On the Mac the directories "c:/tmp" and "c:/temp" were used in the defaults +for 'backupdir' and 'directory', they don't exist. + +The check for a new file not to be on an MS-DOS filesystem created the file +temporarily, which can be slow. Don't do this if there is another check for +the swap file being on an MS-DOS filesystem. + +Don't give the "Changing a readonly file" warning when reading from stdin. + +When using the "Save As" menu entry and not entering a file name, would get an +error message for the trailing ":edit #". Now only do that when the +alternate file name was changed. + +When Vim owns the X11 selection and is being suspended, an application that +tries to use the selection hangs. When Vim continues it could no longer +obtain the selection. Now give up the selection when suspending. + +option.h and globals.h were included in some files, while they were already +included in vim.h. Moved the definition of EXTERN to vim.h to avoid doing it +twice. + +When repeating an operator that used a search pattern and the search pattern +contained characters that have a special meaning on the cmdline (e.g., CTRL-U) +it didn't work. + +Fixed various problems with using K_SPECIAL (0x80) and CSI (0x9b) as a byte in +a (multibyte) character. For example, the "r" command could not be repeated. + +The DOS/Windows install program didn't always work from a directory with a +long filename, because $VIM and the executable name would not have the same +path. + +Multi-byte: +- Using an any-but character range [^x] in a regexp didn't work for UTF-8. + (Muraoka Taro) +- When backspacing over inserted characters in Replace mode multi-byte + characters were not handled correctly. (Muraoka Taro) +- Search commands "#" and "*" didn't work with multibyte characters. (Muraoka + Taro) +- Word completion in Insert mode didn't work with multibyte characters. + (Muraoka Taro) +- Athena/Motif GUI: when 'linespace' is non-zero the cursor would be drawn too + wide (number of bytes instead of cell width). +- When changing 'encoding' to "euc-jp" and inserting a character Vim would + crash. +- For euc-jp characters positioning the cursor would sometimes be wrong. + Also, with two characters with 0x8e leading byte only the first one would be + displayed. +- When using DYNAMIC_ICONV on Win32 conversion might fail because of using the + wrong error number. (Muraoka Taro) +- Using Alt-x in the GUI while 'encoding' was set to "utf-8" didn't produce + the right character. +- When using Visual block selection and only the left halve of a double-wide + character is selected, the highlighting continued to the end of the line. +- Visual-block delete didn't work properly when deleting the right halve of a + double-wide character. +- Overstrike mode for the cmdline replaced only the first byte of a multibyte + character. +- The cursor in Replace mode (also in the cmdline) was to small on a + double-wide character. +- When a multibyte character contained a 0x80 byte, it didn't work (was using + a CSI byte instead). (Muraoka Taro) +- Wordwise selection with the mouse didn't work. +- Yanking a modeless selection of multi-byte characters didn't work. +- When 'selection' is "exclusive", selecting a word that ends in a multi-byte + character used wrong highlighting for the following character. + +Win32 with Make_mvc.mak: Didn't compile for debugging. (Craig Barkhouse) + +Win32 GUI: When "vimrun.exe" is used to execute an external command, don't +give a message box with the return value, it was already printed by vimrun. +Also avoid printing the return value of the shell when ":silent!" is used. + +Win32: selecting a lot of text and using the "find/replace" dialog caused a +crash. + +X11 GUI: When typing a character with the 8th bit set and the Meta/Alt +modifier, the modifier was removed without changing the character. + +Truncating a message to make it fit on the command line, using "..." for the +middle, didn't always compute the space correctly. + +Could not imap <C-@>. Now it works like <Nul>. + +VMS: +- Fixed a few things for VAXC. os_vms_fix.com had some strange CTRL-M + characters. (Zoltan Arpadffy and John W. Hamill) +- Added VMS-specific defaults for the 'isfname' and 'isprint' options. + (Zoltan Arpadffy) +- Removed os_vms_osdef.h, it's no longer used. + +The gzip plugin used a ":normal" command, this doesn't work when dropping a +compressed file on Vim. + +In very rare situations a binary search for a tag would fail, because an +uninitialized value happens to be half the size of the tag file. (Narendran) + +When using BufEnter and BufLeave autocommands to enable/disable a menu, it +wasn't updated right away. + +When doing a replace with the "c"onfirm flag, the cursor was positioned after +the ruler, instead of after the question. With a long replacement string the +screen could scroll up and cause a "more" prompt. Now the message is +truncated to make it fit. + +Motif: The autoconf check for the Xp library didn't work. + +When 'verbose' is set to list lines of a sourced file, defining a function +would reset the counter used for the "more" prompt. + +In the Win32 find/replace dialog, a '/' character caused problems. Escape it +with a backslash. + +Starting a shell with ":sh" was different from starting a shell for CTRL-Z +when suspending doesn't work. They now work the same way. + +Jumping to a file mark while in a changed buffer gave a "mark not set" error. + +":execute histget("cmd")" causes an endless loop and crashed Vim. Now catch +all commands that cause too much recursiveness. + +Removed "Failed to open input method" error message, too many people got this +when they didn't want to use a XIM. + +GUI: When compiled without the +windows feature, the scrollbar would start +below line one. + +Removed the trick with redefining character class functions from regexp.c. + +Win32 GUI: Find dialog gives focus back to main window, when typing a +character mouse pointer is blanked, it didn't reappear when moving it in the +dialog window. (Vince Negri) + +When recording and typing a CTRL-C, no character was recorded. When in Insert +mode or cancelling half a command, playing back the recorded sequence wouldn't +work. Now record the CTRL-C. + +When the GUI was started, mouse codes for DEC and netterm were still checked +for. + +GUI: When scrolling and 'writedelay' is non-zero, the character under the +cursor was displayed in the wrong position (one line above/below with +CTRL-E/CTRL-Y). + +A ":normal" command would reset the 'scrollbind' info. Causes problems when +using a ":normal" command in an autocommand for opening a file. + +Windows GUI: a point size with a dot, like "7.5", wasn't recognized. (Muraoka +Taro) + +When 'scrollbind' wasn't set would still remember the current position, +wasting time. + +GTK: Crash when 'shell' doesn't exist and doing":!ls". Use _exit() instead of +exit() when the child couldn't execute the shell. + +Multi-byte: +- GUI with double-byte encoding: a mouse click in left halve of double-wide + character put the cursor in previous char. +- Using double-byte encoding and 'selection' is "exclusive": "vey" and "^Vey" + included the character after the word. +- When using a double-byte encoding and there is a lead byte at the end of the + line, the preceding line would be displayed. "ga" also showed wrong info. +- "gf" didn't include multi-byte characters before the cursor properly. + (Muraoka Taro) + +GUI: The cursor was sometimes not removed when scrolling. Changed the policy +from redrawing the cursor after each call to gui_write() to only update it at +the end of update_screen() or when setting the cursor position. Also only +update the scrollbars at the end of update_screen(), that's the only place +where the window text may have been scrolled. + +Formatting "/*<Tab>long text", produced "* <Tab>" in the next line. Now +remove the space before the Tab. +Formatting "/*<Tab> long text", produced "* <Tab> long text" in the next +line. Now keep the space after the Tab. + +In some places non-ASCII alphabetical characters were accepted, which could +cause problems. For example, ":X" (X being such a character). + +When a pattern matches the end of the line, the last character in the line was +highlighted for 'hlsearch'. That looks wrong for "/\%3c". Now highlight the +character just after the line. + +Motif: If a dialog was closed by clicking on the "X" of the window frame Vim +would no longer respond. + +When using CTRL-X or CTRL-A on a number with many leading zeros, Vim would +crash. (Matsumoto) + +When 'insertmode' is set, the mapping in mswin.vim for CTRL-V didn't work in +Select mode. Insert mode wasn't restarted after overwriting the text. +Now allow nesting Insert mode with insert and change commands. CTRL-O +cwfoo<Esc> now also works. + +Clicking with the right mouse button in another window started Visual mode, +but used the start position of the current window. Caused ml_get errors when +the line number was invalid. Now stay in the same window. + +When 'selection' is "exclusive", "gv" sometimes selected one character fewer. + +When 'comments' contains more than one start/middle/end triplet, the optional +flags could be mixed up. Also didn't align the end with the middle part. + +Double-right-click in Visual mode didn't update the shown mode. + +When the Normal group has a font name, it was never used when starting up. +Now use it when 'guifont' and 'guifontset' are empty. +Setting a font name to a highlight group before the GUI was started didn't +work. + +"make test" didn't use the name of the generated Vim executable. + +'cindent' problems: +- Aligned with an "else" inside a do-while loop for a line below that loop. + (Meikel Brandmeyer) +- A line before a function would be indented even when terminated with a + semicolon. (Meikel Brandmeyer) +- 'cindent' gave too much indent to a line after a "};" that ends an array + init. +- Support declaration lines ending in "," and "\". (Meikel Brandmeyer) +- A case statement inside a do-while loop was used for indenting a line after + the do-while loop. (Meikel Brandmeyer) +- When skipping a string in a line with one double quote it could continue in + the previous line. (Meikel Brandmeyer) + +When 'list' is set, 'hlsearch' didn't highlight a match at the end of the +line. Now highlight the '$'. + +The Paste menu item in the menu bar, the popup menu and the toolbar were all +different. Now made them all equal to how it was done in mswin.vim. + +st_dev can be smaller than "unsigned". The compiler may give an overflow +warning. Added a configure check for dev_t. + +Athena: closing a confirm() dialog killed Vim. + +Various typos in the documentation. (Matt Dunford) + +Python interface: The definition of _DEBUG could cause trouble, undefine it. +The error message for not being able to load the shared library wasn't +translated. (Muraoka Taro) + +Mac: (Dany St-Amant and Axel Kielhorn) +- Several fixes. +- Vim was eating 80% of the CPU time. +- The project os_mac.pbxproj didn't work, Moved it to a subdirectory. +- Made the menu priority work for the menubar. +- Fixed a problem with dragging the scrollbar. +- Cleaned up the various #ifdefs. + +Unix: When catching a deadly signal and we keep getting one use _exit() to +exit in a quick and dirty way. + +Athena menu ordering didn't work correctly. (David Harrison) + +A ":make" or ":grep" command with a long argument could cause a crash. + +Doing ":new file" and using "Quit" for the ATTENTION dialog still opened a new +window. + +GTK: When starting the GUI and there is an error in the .vimrc file, don't +present the wait-return prompt, since the message was given in the terminal. + +When there was an error in a .vimrc file the terminal where gvim was started +could be cleared. Set msg_row in main.c before writing any messages. + +GTK and X11 GUI: When trying to read characters from the user (e.g. with +input()) before the Vim window was opened caused Vim to hang when it was +started from the desktop. + +OS/390 uses 31 bit pointers. That broke some computations with MAX_COL. +Reduce MAX_COL by one bit for OS/390. (Ralf Schandl) + +When defining a function and it already exists, Vim didn't say it existed +until after typing it. Now do this right away when typing it. + +The message remembered for displaying later (keep_msg) was sometimes pointing +into a generic buffer, which might be changed by the time the message is +displayed. Now make a copy of the message. + +When using multi-byte characters in a menu and a trailing byte is a backslash, +the menu would not be created correctly. (Muraoka Taro) +Using a multibyte character in the substitute string where a trail byte is a +backslash didn't work. (Muraoka Taro) + +When setting "t_Co" in a vimrc file, then setting it automatically from an +xterm termresponse and then setting it again manually caused a crash. + +When getting the value of a string option that is not supported, the number +zero was returned. This breaks a check like "&enc == "asdf". Now an empty +string is returned for string options. + +Crashed when starting the GTK GUI while using 'notitle' in the vimrc, setting +'title' in the gvimrc and starting the GUI with ":gui". Closed the connection +to the X server accidentally. + +Had to hit return after selecting an entry for ":ts". + +The message from ":cn" message was sometimes cleared. Now display it after +redrawing if it doesn't cause a scroll (truncated when necessary). + +hangulin.c didn't compile when the GUI was disabled. Disable it when it won't +work. + +When setting a termcap option like "t_CO", the value could be displayed as +being for a normal key with a modifier, like "<M-=>". + +When expanding the argument list, entries which are a directory name did not +get included. This stopped "vim c:/" from opening the file explorer. + +":syn match sd "^" nextgroup=asdf" skipped the first column and matched the +nextgroup in the second column. + +GUI: When 'lazyredraw' is set, 'showmatch' didn't work. Required flushing +the output. + +Don't define the <NetMouse> termcode in an xterm, reduces the problem when +someone types <Esc> } in Insert mode. + +Made slash_adjust() work correctly for multi-byte characters. (Yasuhiro +Matsumoto) +Using a filename in Big5 encoding for autocommands didn't work (backslash in +trailbyte). (Yasuhiro Matsumoto) + +DOS and Windows: Expanding *.vim also matched file.vimfoo. Expand path like +Unix to avoid problems with Windows dir functions. Merged the DOS and Win32 +functions. + +Win32: Gvimext could not edit more than a few files at once, the length of the +argument was fixed. + +"ls -1 * | xargs vim" worked, but the input was in cooked mode. Now switch to +raw mode when needed. Use dup() to copy the stderr file descriptor to stdin +to make shell commands work. No longer requires an external program to do +this. + +When using ":filetype off", ftplugin and indent usage would be switched off at +the same time. Don't do this, setting 'filetype' manually can still use them. + +GUI: When writing a double-byte character, it could be split up in two calls +to gui_write(), which doesn't work. Now flush before the output buffer +becomes full. + +When 'laststatus' is set and 'cmdheight' is two or bigger, the intro message +would be written over the status line. +The ":intro" command didn't work when there wasn't enough room. + +Configuring for Ruby failed with a recent version of Ruby. (Akinori Musha) + +Athena: When deleting the directory in which Vim was started, using the file +browser made Vim exit. Removed the use of XtAppError(). + +When using autoconf 2.50, UNIX was not defined. Moved the comment for "#undef +UNIX" to a separate line. + +Win32: Disabled _OnWindowPosChanging() to make maximize work better. + +Win32: Compiling with VC 4.0 didn't work. (Walter Briscoe) + +Athena: +- Finally fixed the problems with deleting a menu. (David Harrison) +- Athena: When closing the confirm() dialog, worked like OK was pressed, + instead of Cancel. + +The file explorer didn't work in compatible mode, because of line +continuation. + +Didn't give an error message for ":digraph a". + +When using Ex mode in the GUI and typing a special key, <BS> didn't delete it +correctly. Now display '?' for a special key. + +When an operator is pending, clicking in another window made it apply to that +window, even though the line numbers could be beyond the end of the buffer. + +When a function call doesn't have a terminating ")" Vim could crash. + +Perl interface: could crash on exit with perl 5.6.1. (Anduin Withers) + +Using %P in 'errorformat' wasn't handled correctly. (Tomas Zellerin) + +Using a syntax cluster that includes itself made Vim crash. + +GUI: With 'ls' set to 2, dragging the status line all the way up, then making +the Vim window smaller: Could not the drag status line anymore. + +"vim -c startinsert! file" placed cursor on last char of a line, instead of +after it. A ":set" command in the buffer menu set w_set_curswant. Now don't +do this when w_curswant is MAXCOL. + +Win32: When the gvim window was maximized and selecting another font, the +window would no longer fill the screen. + +The line with 'pastetoggle' in ":options" didn't show the right value when it +is a special key. Hitting <CR> didn't work either. + +Formatting text, resulting in a % landing in the first line, repeated the % in +the following lines, like it's the start of a comment. + +GTK: When adding a toolbar item while gvim is already running, it wasn't +possible to use the tooltip. Now it works by adding the tooltip first. + +The output of "g CTRL-G" mentioned "Char" but it's actually bytes. + +Searching for the end of a oneline region didn't work correctly when there is +an offset for the highlighting. + +Syntax highlighting: When synchronizing on C-comments, //*/ was seen as the +start of a comment. + +Win32: Without scrollbars present, the MS mouse scroll wheel didn't work. +Also handle the scrollbars when they are not visible. + +Motif: When there is no right scrollbar, the bottom scrollbar would still +leave room for it. (Marcin Dalecki) + +When changing 'guicursor' and the value is invalid, some of the effects would +still take place. Now first check for errors and only make the new value +effective when it's OK. + +Using "A" In Visual block mode, appending to lines that don't extend into the +block, padding was wrong. + +When pasting a block of text, a character that occupies more than one screen +column could be deleted and spaces inserted instead. Now only do that with a +tab. + +Fixed conversion of documentation to HTML using Perl. (Dan Sharp) + +Give an error message when a menu name starts with a dot. + +Avoid a hang when executing a shell from the GUI on HP-UX by pushing "ptem" +even when sys/ptem.h isn't present. + +When creating the temp directory, make sure umask is 077, otherwise the +directory is not accessible when it was set to 0177. + +Unix: When resizing the window and a redraw is a bit slow, could get a window +resize event while redrawing, resulting in a messed up window. Any input +(e.g., a mouse click) would redraw. + +The "%B" item in the status line became zero in Insert mode (that's normal) +for another than the current window. + +The menu entries to convert to xxd and back didn't work in Insert mode. + +When ":vglobal" didn't find a line where the pattern doesn't match, the error +message would be the wrong way around. + +When ignoring a multi-line error message with "%-A", the continuation lines +would be used anyway. (Servatius Brandt) + +"grx" on a double-wide character inserted "x", instead of replacing the +character with "x ". "gR" on <xx> ('display' set the "uhex") didn't replace +at all. When doing "gRxx" on a control character the first "x" would be +inserted, breaking the alignment. + +Added "0)" to 'cinkeys', so that when typing a ) it is put in the same place +as where "==" would put it. + +Win32: When maximized, adding/removing toolbar didn't resize the text area. + +When using <C-RightMouse> a count was discarded. + +When typing CTRL-V and <RightMouse> in the command line, would insert +<LeftMouse>. + +Using "vis" or "vas" when 'selection' is exclusive didn't include the last +character. + +When adding to an option like 'grepprg', leading space would be lost. Don't +expand environment variables when there is no comma separating the items. + +GUI: When using a bold-italic font, would still use the bold trick and +underlining. + +Motif: The default button didn't work in dialogs, the first one was always +used. Had to give input focus to the default button. + +When using CTRL-T to jump within the same file, the '' mark wasn't set. + +Undo wasn't Vi compatible when using the 'c' flag for ":s". Now it undoes the +whole ":s" command instead of each confirmed replacement. + +The Buffers menu, when torn-off, disappeared when being refreshed. Add a +dummy item to avoid this. + +Removed calling msg_start() in main(), it should not be needed. + +vim_strpbrk() did not support multibyte characters. (Muraoka Taro) + +The Amiga version didn't compile, the code was too big for relative jumps. +Moved a few files from ex_docmd.c to ex_cmds2.c + +When evaluating the "= register resulted in the "= register being changed, Vim +would crash. + +When doing ":view file" and it fails, the current buffer was made read-only. + +Motif: For some people the separators in the toolbar disappeared when resizing +the Vim window. (Marcin Dalecki) + +Win32 GUI: when setting 'lines' to a huge number, would not compute the +available space correctly. Was counting the menu height twice. + +Conversion of the docs to HTML didn't handle the line with the +quickfix tag +correctly. (Antonio Colombo) + +Win32: fname_case() didn't handle multi-byte characters correctly. (Yasuhiro +Matsumoto) + +The Cygwin version had trouble with fchdir(). Don't use that function for +Cygwin. + +The generic check in scripts.vim for "conf" syntax was done before some checks +in filetype.vim, resulting in "conf" syntax too often. + +Dos32: Typing lagged behind. Would wait for one biostick when checking if a +character is available. + +GTK: When setting 'columns' while starting up "gvim", would set the width of +the terminal it was started in. + +When using ESC in Insert mode, an autoindent that wraps to the next line +caused the cursor to move to the end of the line temporarily. When the +character before the cursor was a double-wide multi-byte character the cursor +would be on the right halve, which causes problems with some terminals. + +Didn't handle multi-byte characters correctly when expanding a file name. +(Yasuhiro Matsumoto) + +Win32 GUI: Errors generated before the GUI is decided to start were not +reported. + +globpath() didn't reserve enough room for concatenated results. (Anduin +Withers) + +When expanding an option that is very long already, don't do the expansion, it +would be truncated to MAXPATHL. (Anduin Withers) + +When 'selection' is "exclusive", using "Fx" in Visual mode only moved until +just after the character. + +When using IME on the console to enter a file name, the screen may scroll up. +Redraw the screen then. (Yasuhiro Matsumoto) + +Motif: In the find/replace dialog the "Replace" button didn't work first time, +second time it replaced all matches. Removed the use of ":s///c". +GTK: Similar problems with the find/replace dialog, moved the code to a common +function. + +X11: Use shared GC's for text. (Marcin Dalecki) + +"]i" found the match under the cursor, instead of the first one below it. +Same for "]I", "] CTRL-I", "]d", "]D" and "] CTRL-D". + +Win16: When maximized and the font is changed, don't change the window size. +(Vince Negri) + +When 'lbr' is set, deleting a block of text could leave the cursor in the +wrong position. + +Win32: When opening a file with the "Edit with Vim" popup menu entry, +wildcards would cause trouble. Added the "--literal" argument to avoid +expanding file names. + +When using "gv", it didn't restore that "$" was used in Visual block mode. + +Win32 GUI: While waiting for a shell command to finish, the window wasn't +redrawn at all. (Yasuhiro Matsumoto) + +Syntax highlighting: A match that continues on a next line because of a +contained region didn't end when that region ended. + +The ":s" command didn't allow flags like 'e' and 'i' right after it. + +When using ":s" to split a line, marks were moved to the next line. Vi keeps +them in the first line. + +When using ":n" ":rew", the previous context mark was at the top of the file, +while Vi puts it in the same place as the cursor. Made it Vi compatible. + +Fixed Vi incompatibility: Text was not put in register 1 when using "c" and +"d" with a motion character, when deleting within one line with one of the +commands: % ( ) `<character> / ? N n { } + +Win32 GUI: The tooltip for tear-off items remained when the tear-off item was +no longer selected. + +GUI: When typing ":" at the more prompt, would return to Normal mode and not +redraw the screen. + +When starting Vim with an argument "-c g/at/p" the printed lines would +overwrite each other. + +BeOS: Didn't compile. Configure didn't add the os_beos files, the QNX check +removed them. Various changes to os_beos.cc. (Joshua Haberman) +Removed the check for the hardware platform, the BeBox has not been produced +for a long time now. + +Win32 GUI: don't use a message box when the shell returns an error code, +display the message in the Vim window. + +Make_mvc.mak always included "/debug" for linking. "GUI=no" argument didn't +work. Use "DEBUG=yes" instead of "DEBUG=1" to make it consistent. (Dan Sharp) + +When a line in the tags file ended in ;" (no TAB following) the command would +not be recognized as a search command. + +X11: The inputMethod resource never worked. Don't use the "none" input method +for SGI, it apparently makes the first character in Input method dropped. + +Fixed incorrect tests in os_mac.h. (Axel Kielhorn) + +Win32 console: When the console where Vim runs in is closed, Vim could hang in +trying to restore the window icon. (Yasuhiro Matsumoto) + +When using ":3call func()" or ":3,3call func() the line number was ignored. + +When 'showbreak' and 'linebreak' were both set, Visual highlighting sometimes +continued until the end of the line. + +GTK GUI: Tearoff items were added even when 'guioptions' didn't contain 't' +when starting up. + +MS-Windows: When the current directory includes a "~", searching files with +"gf" or ":find" didn't work. A "$" in the directory had the same problem. +Added mch_has_exp_wildcard() functions. + +When reducing the Vim window height while starting up, would get an +out-of-memory error message. + +When editing a very long search pattern, 'incsearch' caused the redraw of the +command line to fail. + +Motif GUI: On some systems the "Help" menu would not be on the far right, as +it should be. On some other systems (esp. IRIX) the command line would not +completely show. Solution is to only resize the menubar for Lesstif. + +Using "%" in a line that contains "\\" twice didn't take care of the quotes +properly. Now make a difference between \" and \\". + +For non-Unix systems a dummy file is created when finding a swap name to +detect a 8.3 filesystem. When there is an existing swap file, would get a +warning for the file being created outside of Vim. Also, when closing the Vim +window the file would remain. + +Motif: The menu height was always computed, using a "-menuheight" argument +was setting the room for the command line. Now make clear the argument is not +supported. + +For some (EBCDIC) systems, POUND was equal to '#'. Added an #if for that to +avoid a duplicate case in a switch. + +The GUI may have problems when forking. Always call _exit() instead of exit() +in the parent, the child will call exit(). + +Win32 GUI: Accented characters were often wrong in dialogs and tearoff menus. +Now use CP_ACP instead of CP_OEMCP. (Vince Negri) + +When displaying text with syntax highlighting causes an error (e.g., running +out of stack) the syntax highlighting is disabled to avoid further messages. + +When a command in a .vimrc or .gvimrc causes an ATTENTION prompt, and Vim was +started from the desktop (no place to display messages) it would hang. Now +open the GUI window early to be able to display the messages and pop up the +dialog. + +"r<CR>" on a multi-byte character deleted only the first byte of the +character. "3r<CR>" deleted three bytes instead of three characters. + +When interrupting reading a file, Vi considers the buffer modified. Added the +'i' flag in 'cpoptions' flag for this (we don't want it modified to be able to +do ":q"). + +When using an item in 'guicursor' that starts with a colon, Vim would get +stuck or crash. + +When putting a file mark in a help file and later jumping back to it, the +options would not be set. Extended the modeline in all help files to make +this work better. + +When a modeline contained "::" the local option values would be printed. Now +ignore it. + +Some help files did not use a 8.3 names, which causes problems when using +MS-DOS unzip. Renamed "multibyte.txt" to "mbyte.txt", "rightleft.txt" to +"rileft.txt", "tagsearch.txt" to "tagsrch.txt", "os_riscos.txt" to +"os_risc.txt". + +When Visual mode is blockwise, using "iw" or "aw" made it characterwise. That +doesn't seem right, only do this when in linewise mode. But then do it +always, not only when start and end of Visual mode are equal. + +When using "viw" on a single-letter word and 'selection' is exclusive, would +not include the word. + +When formatting text from Insert mode, using CTRL-O, could mess up undo +information. + +While writing a file (also for the backup file) there was no check for an +interrupt (hitting CTRL-C). Vim could hang when writing a large file over a +slow network, and moving the mouse didn't make it appear (when 'mousehide' is +set) and the screen wasn't updated in the GUI. Also allow interrupting when +syncing the swap file, it can take a long time. + +When using ":mksession" while there is help window, it would later be restored +to the right file but not marked as a help buffer. ":help" would then open +another window. Now use the value "help" for 'buftype' to mark a help buffer. + +The session file contained absolute path names in option values, that doesn't +work when the home directory depends on the situation. Replace the home +directory with ~/ when possible. + +When using 'showbreak' a TAB just after the shown break would not be counted +correctly, the cursor would be positioned wrong. + +With 'showbreak' set to "--->" or "------->" and 'sts' set to 4, inserting +tabs did not work right. Could cause a crash. Backspacing was also wrong, +could get stuck at a line break. + +Win32: crashed when tearing off a menu with over 300 items. + +GUI: A menu or toolbar item would appear when only a tooltip was defined for +it. + +When 'scrolloff' is non-zero and "$" is in 'cpoptions', using "s" while the +last line of the file is the first line on screen, the text wasn't displayed. + +When running "autoconf", delete the configure cache to force starting cleanly +when configure is run again. + +When changing the Normal colors for cterm, the value of 'background' was +changed even when the GUI was used. + +The warning for a missing vimrun.exe was always given on startup, but some +people just editing a file don't need to be bothered by it. Only show it when +vimrun would be used. + +When using "%" in a multibyte text it could get confused by trailbytes that +match. (Muraoka Taro) + +Termcap entry for RiscOS was wrong, using 7 and 8 in octal codes. + +Athena: The title of a dialog window and the file selector window were not +set. (David Harrison) + +The "htmlLink" highlight group specified colors, which gives problems when +using a color scheme. Added the "Underlined" highlight group for this. + +After using ":insert" or ":change" the '[ mark would be one line too low. + +When looking for the file name after a match with 'include' one character was +skipped. Same for 'define'. + +Win32 and DJGPP: When editing a file with a short name in a directory, and +editing the same file but using the long name, would end up with two buffers +on the same file. + +"gf" on a filename that starts with "../" only worked when the file being +edited is in the current directory. An include file search didn't work +properly for files starting with "../" or ".". Now search both relative to +the file and to the current directory. + +When 'printheader', 'titlestring', 'iconstring', 'rulerformat' or 'statusline' +contained "%{" but no following "}" memory was corrupted and a crash could +happen. + +":0append" and then inserting two lines did not redraw the blank lines that +were scrolled back down. + +When using insert mode completion in a narrow window, the message caused a +scroll up. Now shorten the message if it doesn't fit and avoid writing the +ruler over the message. + +XIM still didn't work correctly on some systems, especially SGI/IRIX. Added +the 'imdisable' option, which is set by default for that system. + +Patch 6.0aw.008 +Problem: When the first character of a file name is over 127, the Buffers + menu entry would get a negative priority and cause problems. +Solution: Reduce the multiplier for the first character when computing + the hash value for a Buffers menu entry. +Files: runtime/menu.vim + +Patch 6.0aw.010 +Problem: Win32: ":browse edit dir/dir" didn't work. (Vikas) +Solution: Change slashes to backslashes in the directory passed to the file + browser. +Files: src/gui_w48.c + +Athena file browser: On some systems wcstombs() can't be used to get the +length of a multi-byte string. Use the maximum length then. (Yasuhiro +Matsumoto) + +Patch 6.0ax.001 +Problem: When 'patchmode' is set, appending to a file gives an empty + original file. (Ed Ralston) +Solution: Also make a backup copy when appending and 'patchmode' is set. +Files: src/fileio.c + +Patch 6.0ax.002 +Problem: When 'patchmode' is set, appending to a compressed file gives an + uncompressed original file. (Ed Ralston) +Solution: Create the original file before decompressing. +Files: runtime/plugin/gzip.vim + +Patch 6.0ax.005 +Problem: Athena file selector keeps the title of the first invocation. +Solution: Set the title each time the file selector is opened. (David + Harrison) +Files: src/gui_at_fs.c + +Patch 6.0ax.007 +Problem: When using GPM (mouse driver in a Linux console) a double click is + interpreted as a scroll wheel click. +Solution: Check if GPM is being used when deciding if a mouse event is for + the scroll wheel. +Files: src/term.c + +Patch 6.0ax.010 +Problem: The Edit.Save menu and the Save toolbar button didn't work when + the buffer has no file name. +Solution: Use a file browser to ask for a file name. Also fix the toolbar + Find item in Visual mode. +Files: runtime/menu.vim + +Patch 6.0ax.012 +Problem: When 'cpoptions' contains "$", breaking a line for 'textwidth' + doesn't redraw properly. (Stefan Schulze) +Solution: Remove the dollar before breaking the line. +Files: src/edit.c + +Patch 6.0ax.014 +Problem: Win32: On Windows 98 ":make -f file" doesn't work when 'shell' is + "command.com" and 'makeprg' is "nmake". The environment isn't + passed on to "nmake". +Solution: Also use vimrun.exe when redirecting the output of a command. +Files: src/os_win32.c + +Patch 6.0ax.016 +Problem: The version number was reported wrong in the intro screen. +Solution: Check for a version number with two additional letters. +Files: src/version.c + +Patch 6.0ax.019 +Problem: When scrolling a window with folds upwards, switching to another + vertically split window and back may not update the scrollbar. +Solution: Limit w_botline to the number of lines in the buffer plus one. +Files: src/move.c + + +============================================================================== +VERSION 6.1 *version-6.1* + +This section is about improvements made between version 6.0 and 6.1. + +This is a bug-fix release, there are not really any new features. + + +Changed *changed-6.1* +------- + +'iminsert' and 'imsearch' are no longer set as a side effect of defining a +language-mapping using ":lmap". + + +Added *added-6.1* +----- + +Syntax files: +ampl AMPL (David Krief) +ant Ant (Johannes Zellner) +baan Baan (Her van de Vliert) +cs C# (Johannes Zellner) +lifelines Lifelines (Patrick Texier) +lscript LotusScript (Taryn East) +moo MOO (Timo Frenay) +nsis NSIS (Alex Jakushev) +ppd Postscript Printer Description (Bjoern Jacke) +rpl RPL/2 (Joel Bertrand) +scilab Scilab (Benoit Hamelin) +splint Splint (Ralf Wildenhues) +sqlj SQLJ (Andreas Fischbach) +wvdial WvDial (Prahlad Vaidyanathan) +xf86conf XFree86 config (Nikolai Weibull) +xmodmap Xmodmap (Nikolai Weibull) +xslt Xslt (Johannes Zellner) +monk Monk (Mike Litherland) +xsd Xsd (Johannes Zellner) +cdl CDL (Raul Segura Acevedo) +sendpr Send-pr (Hendrik Scholz) + +Added indent file for Scheme. (Dorai Sitaram) +Added indent file for Prolog. (Kontra Gergely) +Added indent file for Povray (David Necas) +Added indent file for IDL (Aleksandar Jelenak) +Added C# indent and ftplugin scripts. + +Added Ukrainian menu translations. (Bohdan Vlasyuk) +Added ASCII version of the Czech menus. (Jiri Brezina) + +Added Simplified Chinese translation of the tutor. (Mendel L Chan) + +Added Russian keymap for yawerty keyboard. + +Added an explanation of using the vimrc file in the tutor. +Changed tutor.vim to get the right encoding for the Taiwainese tutor. + +Added Russian tutor. (Andrey Kiselev) +Added Polish tutor. (Mikolaj Machowski) + +Added darkblue color scheme. (Bohdan Vlasyuk) + +When packing the dos language archive automatically generate the .mo files +that are required. + +Improved NSIS script to support NSIS 180. Added icons for the +enabled/disabled status. (Mirek Pruchnik) + +cp1250 version of the Slovak message translations. + +Compiler plugins for IRIX compilers. (David Harrison) + + +Fixed *fixed-6.1* +----- + +The license text was updated to make the meaning clearer and make it +compatible with the GNU GPL. Otherwise distributors have a problem when +linking Vim with a GPL'ed library. + +When installing the "less.sh" script it was not made executable. (Chuck Berg) + +Win32: The "9" key on the numpad wasn't working. (Julian Kinraid) + +The NSIS install script didn't work with NSIS 1.80 or later. Also add +Vim-specific icons. (Pruchnik) + +The script for conversion to HTML contained an "if" in the wrong place. +(Michael Geddes) + +Allow using ":ascii" in the sandbox, it's harmless. + +Removed creat() from osdef2.h.in, it wasn't used and may cause a problem when +it's redefined to creat64(). + +The text files in the VisVim directory were in "dos" format. This caused +problems when applying a patch. Now keep them in "unix" format and convert +them to "dos" format only for the PC archives. + +Add ruby files to the dos source archive, they can be used by Make_mvc.mak. +(Mirek Pruchnik) + +"cp -f" doesn't work on all systems. Change "cp -f" in the Makefile to "rm +-f" and "cp". + +Didn't compile on a Compaq Tandem Himalaya OSS. (Michael A. Benzinger) + +The GTK file selection dialog didn't include the "Create Dir", "Delete File" +and "Rename File" buttons. + +When doing ":browse source" the dialog has the title "Run Macro". Better +would be "Source Vim script". (Yegappan Lakshmanan) + +Win32: Don't use the printer font as default for the font dialog. + +"make doslang" didn't work when configure didn't run (yet). Set $MAKEMO to +"yes". (Mirek Pruchnik) + +The ToolBar TagJump item used "g]", which prompts for a selection even when +there is only one matching tag. Use "g<C-]>" instead. + +The ming makefile for message translations didn't have the right list of +files. + +The MS-Windows 3.1 version complains about LIBINTL.DLL not found. Compile +this version without message translations. + +The Borland 5 makefile contained a check for Ruby which is no longer needed. +The URLs for the TCL library was outdated. (Dan Sharp) + +The eviso.ps file was missing from the DOS runtime archive, it's needed for +printing PostScript in the 32bit DOS version. + +In menu files ":scriptencoding" was used in a wrong way after patch 6.1a.032 +Now use ":scriptencoding" in the file where the translations are given. Do +the same for all menus in latin1 encoding. + +Included a lot of fixes for the Macintosh, mostly to make it work with Carbon. +(Dany StAmant, Axel Kielhorn, Benji Fisher) + +Improved the vimtutor shell script to use $TMPDIR when it exists, and delete +the copied file when exiting in an abnormal way. (Max Ischenko) + +When "iconv.dll" can't be found, try using "libiconv.dll". + +When encryption is used, filtering with a shell command wasn't possible. + +DJGPP: ":cd c:" always failed, can't get permissions for "c:". +Win32: ":cd c:/" failed if the previous current directory on c: had become +invalid. + +DJGPP: Shift-Del and Del both produce \316\123. Default mapping for Del is +wrong. Disabled it. + +Dependencies on header files in MingW makefile was wrong. + +Win32: Don't use ACL stuff for MSVC 4.2, it's not supported. (Walter Briscoe) + +Win32 with Borland: bcc.cfg was caching the value for $(BOR), but providing a +different argument to make didn't regenerate it. + +Win32 with MSVC: Make_ivc.mak generates a new if_ole.h in a different +directory, the if_ole.h in the src directory may be used instead. Delete the +distributed file. + +When a window is vertically split and then ":ball" is used, the window layout +is messed up, can cause a crash. (Muraoka Taro) + +When 'insertmode' is set, using File/New menu and then double clicking, "i" is +soon inserted. (Merlin Hansen) + +When Select mode is active and using the Buffers menu to switch to another +buffer, an old selection comes back. Reset VIsual_reselect for a ":buffer" +command. + +When Select mode is active and 'insertmode' is set, using the Buffers menu to +switch to another buffer, did not return to Insert mode. Make sure +"restart_edit" is set. + +When double clicking on the first character of a word while 'selection' is +"exclusive" didn't select that word. + + +Patch 6.0.001 +Problem: Loading the sh.vim syntax file causes error messages . (Corinna + Vinschen) +Solution: Add an "if". (Charles Campbell) +Files: runtime/syntax/sh.vim + +Patch 6.0.002 +Problem: Using a '@' item in 'viminfo' doesn't work. (Marko Leipert) +Solution: Add '@' to the list of accepted items. +Files: src/option.c + +Patch 6.0.003 +Problem: The configure check for ACLs on AIX doesn't work. +Solution: Fix the test program so that it compiles. (Tomas Ogren) +Files: src/configure.in, src/auto/configure + +Patch 6.0.004 +Problem: The find/replace dialog doesn't reuse a previous argument + properly. +Solution: After removing a "\V" terminate the string. (Zwane Mwaikambo) +Files: src/gui.c + +Patch 6.0.005 +Problem: In Insert mode, "CTRL-O :ls" has a delay before redrawing. +Solution: Don't delay just after wait_return() was called. Added the + did_wait_return flag. +Files: src/globals.h, src/message.c, src/normal.c, src/screen.c + +Patch 6.0.006 +Problem: With a vertical split, 'number' set and 'scrolloff' non-zero, + making the window width very small causes a crash. (Niklas + Lindstrom) +Solution: Check for a zero width. +Files: src/move.c + +Patch 6.0.007 +Problem: When setting 'filetype' while there is no FileType autocommand, a + following ":setfiletype" would set 'filetype' again. (Kobus + Retief) +Solution: Set did_filetype always when 'filetype' has been set. +Files: src/option.c + +Patch 6.0.008 +Problem: 'imdisable' is missing from the options window. (Michael Naumann) +Solution: Add an entry for it. +Files: runtime/optwin.vim + +Patch 6.0.009 +Problem: Nextstep doesn't have S_ISBLK. (John Beppu) +Solution: Define S_ISBLK using S_IFBLK. +Files: src/os_unix.h + +Patch 6.0.010 +Problem: Using "gf" on a file name starting with "./" or "../" in a buffer + without a name causes a crash. (Roy Lewis) +Solution: Check for a NULL file name. +Files: src/misc2.c + +Patch 6.0.011 +Problem: Python: After replacing or deleting lines get an ml_get error. + (Leo Lipelis) +Solution: Adjust the cursor position for deleted or added lines. +Files: src/if_python.c + +Patch 6.0.012 +Problem: Polish translations contain printf format errors, this can result + in a crash when using one of them. +Solution: Fix for translated messages. (Michal Politowski) +Files: src/po/pl.po + +Patch 6.0.013 +Problem: Using ":silent! cmd" still gives some error messages, like for an + invalid range. (Salman Halim) +Solution: Reset emsg_silent after calling emsg() in do_one_cmd(). +Files: src/ex_docmd.c + +Patch 6.0.014 +Problem: When 'modifiable' is off and 'virtualedit' is "all", "rx" on a TAB + still changes the buffer. (Muraoka Taro) +Solution: Check if saving the line for undo fails. +Files: src/normal.c + +Patch 6.0.015 +Problem: When 'cpoptions' includes "S" and "filetype plugin on" has been + used, can get an error for deleting the b:did_ftplugin variable. + (Ralph Henderson) +Solution: Only delete the variable when it exists. +Files: runtime/ftplugin.vim + +Patch 6.0.016 +Problem: bufnr(), bufname() and bufwinnr() don't find unlisted buffers when + the argument is a string. (Hari Krishna Dara) + Also for setbufvar() and getbufvar(). +Solution: Also find unlisted buffers. +Files: src/eval.c + +Patch 6.0.017 +Problem: When 'ttybuiltin' is set and a builtin termcap entry defines t_Co + and the external one doesn't, it gets reset to empty. (David + Harrison) +Solution: Only set t_Co when it wasn't set yet. +Files: src/term.c + +Patch 6.0.018 +Problem: Initializing 'encoding' may cause a crash when setlocale() is not + used. (Dany St-Amant) +Solution: Check for a NULL pointer. +Files: src/mbyte.c + +Patch 6.0.019 +Problem: Converting a string with multi-byte characters to a printable + string, e.g., with strtrans(), may cause a crash. (Tomas Zellerin) +Solution: Correctly compute the length of the result in transstr(). +Files: src/charset.c + +Patch 6.0.020 +Problem: When obtaining the value of a global variable internally, could + get the function-local value instead. Applies to using <Leader> + and <LocalLeader> and resetting highlighting in a function. +Solution: Prepend "g:" to the variable name. (Aric Blumer) +Files: src/syntax.c, src/term.c + +Patch 6.0.021 +Problem: The 'cscopepathcomp' option didn't work. +Solution: Change USE_CSCOPE to FEAT_CSCOPE. (Mark Feng) +Files: src/option.c + +Patch 6.0.022 +Problem: When using the 'langmap' option, the second character of a command + starting with "g" isn't adjusted. +Solution: Apply 'langmap' to the second character. (Alex Kapranoff) +Files: src/normal.c + +Patch 6.0.023 +Problem: Loading the lhaskell syntax doesn't work. (Thore B. Karlsen) +Solution: Use ":runtime" instead of "source" to load haskell.vim. +Files: runtime/syntax/lhaskell.vim + +Patch 6.0.024 +Problem: Using "CTRL-V u 9900" in Insert mode may cause a crash. (Noah + Levitt) +Solution: Don't insert a NUL byte in the text, use a newline. +Files: src/misc1.c + +Patch 6.0.025 +Problem: The pattern "\vx(.|$)" doesn't match "x" at the end of a line. + (Preben Peppe Guldberg) +Solution: Always see a "$" as end-of-line after "\v". Do the same for "^". +Files: src/regexp.c + +Patch 6.0.026 +Problem: GTK: When using arrow keys to navigate through the menus, the + separators are selected. +Solution: Set the separators "insensitive". (Pavel Kankovsky) +Files: src/gui_gtk.c, src/gui_gtk_x11.c + +Patch 6.0.027 +Problem: VMS: Printing doesn't work, the file is deleted too quickly. + No longer need the VMS specific printing menu. + gethostname() is not available with VAXC. + The makefile was lacking selection of the tiny-huge feature set. +Solution: Adjust the 'printexpr' option default. Fix the other problems and + update the documentation. (Zoltan Arpadffy) +Files: runtime/doc/os_vms.txt, runtime/menu.vim, src/INSTALLvms.txt, + src/Make_vms.mms, src/option.c, src/os_unix.c, src/os_vms_conf.h + +Patch 6.0.028 +Problem: Can't compile without +virtualedit and with +visualextra. (Geza + Lakner) +Solution: Add an #ifdef for +virtualedit. +Files: src/ops.c + +Patch 6.0.029 +Problem: When making a change in line 1, then in line 2 and then deleting + line 1, undo info could be wrong. Only when the changes are undone + at once. (Gerhard Hochholzer) +Solution: When not saving a line for undo because it was already done + before, remember for which entry the last line must be computed. + Added ue_getbot_entry pointer for this. When the number of lines + changes, adjust the position of newer undo entries. +Files: src/structs.h, src/undo.c + +Patch 6.0.030 +Problem: Using ":source! file" doesn't work inside a loop or after + ":argdo". (Pavol Juhas) +Solution: Execute the commands in the file right away, do not let the main + loop do it. +Files: src/ex_cmds2.c, src/ex_docmd.c, src/getchar.c, src/globals.h, + src/proto/ex_docmd.pro, src/proto/getchar.pro + +Patch 6.0.031 +Problem: Nextstep doesn't have setenv() or putenv(). (John Beppu) +Solution: Move putenv() from pty.c to misc2.c +Files: src/misc2.c, src/pty.c + +Patch 6.0.032 +Problem: When changing a setting that affects all folds, they are not + displayed immediately. +Solution: Set the redraw flag in foldUpdateAll(). +Files: src/fold.c + +Patch 6.0.033 +Problem: Using 'wildmenu' on MS-Windows, file names that include a space + are only displayed starting with that space. (Xie Yuheng) +Solution: Don't recognize a backslash before a space as a path separator. +Files: src/screen.c + +Patch 6.0.034 +Problem: Calling searchpair() with three arguments could result in a crash + or strange error message. (Kalle Bjorklid) +Solution: Don't use the fifth argument when there is no fourth argument. +Files: src/eval.c + +Patch 6.0.035 +Problem: The menu item Edit/Global_Settings/Toggle_Toolbar doesn't work + when 'ignorecase' is set. (Allen Castaban) +Solution: Always match case when checking if a flag is already present in + 'guioptions'. +Files: runtime/menu.vim + +Patch 6.0.036 +Problem: OS/2, MS-DOS and MS-Windows: Using a path that starts with a + slash in 'tags' doesn't work as expected. (Mathias Koehrer) +Solution: Only use the drive, not the whole path to the current directory. + Also make it work for "c:dir/file". +Files: src/misc2.c + +Patch 6.0.037 +Problem: When the user has set "did_install_syntax_menu" to avoid the + default Syntax menu it still appears. (Virgilio) +Solution: Don't add the three default items when "did_install_syntax_menu" + is set. +Files: runtime/menu.vim + +Patch 6.0.038 +Problem: When 'selection' is "exclusive", deleting a block of text at the + end of a line can leave the cursor beyond the end of the line. +Solution: Correct the cursor position. +Files: src/ops.c + +Patch 6.0.039 +Problem: "gP" leaves the cursor in the wrong position when 'virtualedit' is + used. Using "c" in blockwise Visual mode leaves the cursor in a + strange position. +Solution: For "gP" reset the "coladd" field for the '] mark. For "c" leave + the cursor on the last inserted character. +Files: src/ops.c + +Patch 6.0.040 +Problem: When 'fileencoding' is invalid and writing fails because of + this, the original file is gone. (Eric Carlier) +Solution: Restore the original file from the backup. +Files: src/fileio.c + +Patch 6.0.041 +Problem: Using ":language messages en" when LC_MESSAGES is undefined + results in setting LC_CTYPE. (Eric Carlier) +Solution: Set $LC_MESSAGES instead. +Files: src/ex_cmds2.c + +Patch 6.0.042 +Problem: ":mksession" can't handle file names with a space. +Solution: Escape special characters in file names with a backslash. +Files: src/ex_docmd.c + +Patch 6.0.043 +Problem: Patch 6.0.041 was wrong. +Solution: Use mch_getenv() instead of vim_getenv(). +Files: src/ex_cmds2.c + +Patch 6.0.044 +Problem: Using a "containedin" list for a syntax item doesn't work for an + item that doesn't have a "contains" argument. Also, "containedin" + doesn't ignore a transparent item. (Timo Frenay) +Solution: When there is a "containedin" argument somewhere, always check for + contained items. Don't check for the transparent item but the + item it's contained in. +Files: src/structs.h, src/syntax.c + +Patch 6.0.045 +Problem: After creating a fold with a Visual selection, another window + with the same buffer still has inverted text. (Sami Salonen) +Solution: Redraw the inverted text. +Files: src/normal.c + +Patch 6.0.046 +Problem: When getrlimit() returns an 8 byte number the check for running + out of stack may fail. (Anthony Meijer) +Solution: Skip the stack check if the limit doesn't fit in a long. +Files: src/auto/configure, src/config.h.in, src/configure.in, + src/os_unix.c + +Patch 6.0.047 +Problem: Using a regexp with "\(\)" inside a "\%[]" item causes a crash. + (Samuel Lacas) +Solution: Don't allow nested atoms inside "\%[]". +Files: src/regexp.c + +Patch 6.0.048 +Problem: Win32: In the console the mouse doesn't always work correctly. + Sometimes after getting focus a mouse movement is interpreted like + a button click. +Solution: Use a different function to obtain the number of mouse buttons. + Avoid recognizing a button press from undefined bits. (Vince Negri) +Files: src/os_win32.c + +Patch 6.0.049 +Problem: When using evim the intro screen is misleading. (Adrian Nagle) +Solution: Mention whether 'insertmode' is set and the menus to be used. +Files: runtime/menu.vim, src/version.c + +Patch 6.0.050 +Problem: UTF-8: "viw" doesn't include non-ASCII characters before the + cursor. (Bertilo Wennergren) +Solution: Use dec_cursor() instead of decrementing the column number. +Files: src/search.c + +Patch 6.0.051 +Problem: UTF-8: Using CTRL-R on the command line doesn't insert composing + characters. (Ron Aaron) +Solution: Also include the composing characters and fix redrawing them. +Files: src/ex_getln.c, src/ops.c + +Patch 6.0.052 +Problem: The check for rlim_t in patch 6.0.046 does not work on some + systems. (Zdenek Sekera) +Solution: Also look in sys/resource.h for rlim_t. +Files: src/auto/configure, src/configure.in + +Patch 6.0.053 (extra) +Problem: Various problems with QNX. +Solution: Minor fix for configure. Switch on terminal clipboard support in + main.c. Fix "pterm" mouse support. os_qnx.c didn't build without + photon. (Julian Kinraid) +Files: src/auto/configure, src/configure.in, src/gui_photon.c, + src/main.c, src/misc2.c, src/option.h, src/os_qnx.c, src/os_qnx.h, + src/syntax.c + +Patch 6.0.054 +Problem: When using mswin.vim, CTRL-V pastes a block of text like it is + normal text. Using CTRL-V in blockwise Visual mode leaves "x" + characters behind. +Solution: Make CTRL-V work as it should. Do the same for the Paste menu + entries. +Files: runtime/menu.vim, runtime/mswin.vim + +Patch 6.0.055 +Problem: GTK: The selection isn't copied the first time. +Solution: Own the selection at the right moment. +Files: src/gui_gtk_x11.c + +Patch 6.0.056 +Problem: Using "CTRL-O cw" in Insert mode results in a nested Insert mode. + <Esc> doesn't leave Insert mode then. +Solution: Only use nested Insert mode when 'insertmode' is set or when a + mapping is used. +Files: src/normal.c + +Patch 6.0.057 +Problem: Using ":wincmd g}" in a function doesn't work. (Gary Holloway) +Solution: Execute the command directly, instead of putting it in the + typeahead buffer. +Files: src/normal.c, src/proto/normal.pro, src/window.c + +Patch 6.0.058 +Problem: When a Cursorhold autocommand moved the cursor, the ruler wasn't + updated. (Bohdan Vlasyuk) +Solution: Update the ruler after executing the autocommands. +Files: src/gui.c + +Patch 6.0.059 +Problem: Highlighting for 'hlsearch' isn't visible in lines that are + highlighted for diff highlighting. (Gary Holloway) +Solution: Let 'hlsearch' highlighting overrule diff highlighting. +Files: src/screen.c + +Patch 6.0.060 +Problem: Motif: When the tooltip is to be popped up, Vim crashes. + (Gary Holloway) +Solution: Check for a NULL return value from gui_motif_fontset2fontlist(). +Files: src/gui_beval.c + +Patch 6.0.061 +Problem: The toolbar buttons to load and save a session do not correctly + use v:this_session. +Solution: Check for v:this_session to be empty instead of existing. +Files: runtime/menu.vim + +Patch 6.0.062 +Problem: Crash when 'verbose' is > 3 and using ":shell". (Yegappan + Lakshmanan) +Solution: Avoid giving a NULL pointer to printf(). Also output a newline + and switch the cursor on. +Files: src/misc2.c + +Patch 6.0.063 +Problem: When 'cpoptions' includes "$", using "cw" to type a ')' on top of + the "$" doesn't update syntax highlighting after it. +Solution: Stop displaying the "$" when typing a ')' in its position. +Files: src/search.c + +Patch 6.0.064 (extra) +Problem: The NSIS install script doesn't work with newer versions of NSIS. + The diff feature doesn't work when there isn't a good diff.exe on + the system. +Solution: Replace the GetParentDir instruction by a user function. + Fix a few cosmetic problems. Use defined constants for the + version number, so that it's defined in one place only. + Only accept the install directory when it ends in "vim". + (Eduardo Fernandez) + Add a diff.exe and use it from the default _vimrc. +Files: nsis/gvim.nsi, nsis/README.txt, src/dosinst.c + +Patch 6.0.065 +Problem: When using ":normal" in 'indentexpr' it may use redo characters + before its argument. (Neil Bird) +Solution: Save and restore the stuff buffer in ex_normal(). +Files: src/ex_docmd.c, src/getchar.c, src/globals.h, src/structs.h + +Patch 6.0.066 +Problem: Sometimes undo for one command is split into two undo actions. + (Halim Salman) +Solution: Don't set the undo-synced flag when reusing a line that was + already saved for undo. +Files: src/undo.c + +Patch 6.0.067 +Problem: if_xcmdsrv.c doesn't compile on systems where fd_set isn't defined + in the usual header file (e.g., AIX). (Mark Waggoner) +Solution: Include sys/select.h in if_xcmdsrv.c for systems that have it. +Files: src/if_xcmdsrv.c + +Patch 6.0.068 +Problem: When formatting a Visually selected area with "gq" and the number + of lines increases the last line may not be redrawn correctly. + (Yegappan Lakshmanan) +Solution: Correct the area to be redrawn for inserted/deleted lines. +Files: src/ops.c + +Patch 6.0.069 +Problem: Using "K" on a word that includes a "!" causes a "No previous + command" error, because the "!" is expanded. (Craig Jeffries) +Solution: Put a backslash before the "!". +Files: src/normal.c + +Patch 6.0.070 +Problem: Win32: The error message for a failed dynamic linking of a Perl, + Ruby, Tcl and Python library is unclear about what went wrong. +Solution: Give the name of the library or function that could not be loaded. + Also for the iconv and gettext libraries when 'verbose' is set. +Files: src/eval.c, src/if_perl.xs, src/if_python.c, src/if_ruby.c, + src/if_tcl.c, src/mbyte.c, src/os_win32.c, src/proto/if_perl.pro, + src/proto/if_python.pro, src/proto/if_ruby.pro, + src/proto/if_tcl.pro, src/proto/mbyte.pro + +Patch 6.0.071 +Problem: The "iris-ansi" builtin termcap isn't very good. +Solution: Fix the wrong entries. (David Harrison) +Files: src/term.c + +Patch 6.0.072 +Problem: When 'lazyredraw' is set, a mapping that stops Visual mode, moves + the cursor and starts Visual mode again causes a redraw problem. + (Brian Silverman) +Solution: Redraw both the old and the new Visual area when necessary. +Files: src/normal.c, src/screen.c + +Patch 6.0.073 (extra) +Problem: DJGPP: When using CTRL-Z to start a shell, the prompt is halfway + the text. (Volker Kiefel) +Solution: Position the system cursor before starting the shell. +Files: src/os_msdos.c + +Patch 6.0.074 +Problem: When using "&" in a substitute string a multi-byte character with + a trailbyte 0x5c is not handled correctly. +Solution: Recognize multi-byte characters inside the "&" part. (Muraoka Taro) +Files: src/regexp.c + +Patch 6.0.075 +Problem: When closing a horizontally split window while 'eadirection' is + "hor" another horizontally split window is still resized. (Aron + Griffis) +Solution: Only resize windows in the same top frame as the window that is + split or closed. +Files: src/main.c, src/proto/window.pro, src/window.c + +Patch 6.0.076 +Problem: Warning for wrong pointer type when compiling. +Solution: Use char instead of char_u pointer. +Files: src/version.c + +Patch 6.0.077 +Problem: Patch 6.0.075 was incomplete. +Solution: Fix another call to win_equal(). +Files: src/option.c + +Patch 6.0.078 +Problem: Using "daw" at the end of a line on a single-character word didn't + include the white space before it. At the end of the file it + didn't work at all. (Gavin Sinclair) +Solution: Include the white space before the word. +Files: src/search.c + +Patch 6.0.079 +Problem: When "W" is in 'cpoptions' and 'backupcopy' is "no" or "auto", can + still overwrite a read-only file, because it's renamed. (Gary + Holloway) +Solution: Add a check for a read-only file before renaming the file to + become the backup. +Files: src/fileio.c + +Patch 6.0.080 +Problem: When using a session file that has the same file in two windows, + the fileinfo() call in do_ecmd() causes a scroll and a hit-enter + prompt. (Robert Webb) +Solution: Don't scroll this message when 'shortmess' contains 'O'. +Files: src/ex_cmds.c + +Patch 6.0.081 +Problem: After using ":saveas" the new buffer name is added to the Buffers + menu with a wrong number. (Chauk-Mean Proum) +Solution: Trigger BufFilePre and BufFilePost events for the renamed buffer + and BufAdd for the old name (which is with a new buffer). +Files: src/ex_cmds.c + +Patch 6.0.082 +Problem: When swapping screens in an xterm and there is an (error) message + from the vimrc script, the shell prompt is after the message. +Solution: Output a newline when there was output on the alternate screen. + Also when starting the GUI. +Files: src/main.c + +Patch 6.0.083 +Problem: GTK: When compiled without menu support the buttons in a dialog + don't have any text. (Erik Edelmann) +Solution: Add the text also when GTK_USE_ACCEL isn't defined. And define + GTK_USE_ACCEL also when not using menus. +Files: src/gui_gtk.c + +Patch 6.0.084 +Problem: UTF-8: a "r" command with an argument that is a keymap for a + character with a composing character can't be repeated with ".". + (Raphael Finkel) +Solution: Add the composing characters to the redo buffer. +Files: src/normal.c + +Patch 6.0.085 +Problem: When 'mousefocus' is set, using "s" to go to Insert mode and then + moving the mouse pointer to another window stops Insert mode, + while this doesn't happen with "a" or "i". (Robert Webb) +Solution: Reset finish_op before calling edit(). +Files: src/normal.c + +Patch 6.0.086 +Problem: When using "gu" the message says "~ed". +Solution: Make the message say "changed". +Files: src/ops.c + +Patch 6.0.087 (lang) +Problem: Message translations are incorrect, which may cause a crash. + (Peter Figura) + The Turkish translations needed more work and the maintainer + didn't have time. +Solution: Fix order of printf arguments. Remove %2$d constructs. + Add "-v" to msgfmt to get a warning for wrong translations. + Don't install the Turkish translations for now. + Update a few more translations. +Files: src/po/Makefile, src/po/af.po, src/po/cs.po, src/po/cs.cp1250.po, + src/po/de.po, src/po/es.po, src/po/fr.po, src/po/it.po, + src/po/ja.po, src/po/ja.sjis.po, src/po/ko.po, src/po/pl.po, + src/po/sk.po, src/po/uk.po, src/po/zh_CN.UTF-8.po, + src/po/zh_CN.cp936.po, src/po/zh_CN.po, src/po/zh_TW.po + +Patch 6.0.088 +Problem: "." doesn't work after using "rx" in Visual mode. (Charles + Campbell) +Solution: Also store the replacement character in the redo buffer. +Files: src/normal.c + +Patch 6.0.089 +Problem: In a C file, using "==" to align a line starting with "* " after + a line with "* -" indents one space too few. (Piet Delport) +Solution: Align with the previous line if the comment-start-string matches + there. +Files: src/misc1.c + +Patch 6.0.090 +Problem: When a wrapping line does not fit in a window and 'scrolloff' is + bigger than half the window height, moving the cursor left or + right causes the screen to flash badly. (Lubomir Host) +Solution: When there is not enough room to show 'scrolloff' screen lines and + near the end of the line, show the end of the line. +Files: src/move.c + +Patch 6.0.091 +Problem: Using CTRL-O in Insert mode, while 'virtualedit' is "all" and the + cursor is after the end-of-line, moves the cursor left. (Yegappan + Lakshmanan) +Solution: Keep the cursor in the same position. +Files: src/edit.c + +Patch 6.0.092 +Problem: The explorer plugin doesn't ignore case of 'suffixes' on + MS-Windows. (Mike Williams) +Solution: Match or ignore case as appropriate for the OS. +Files: runtime/plugin/explorer.vim + +Patch 6.0.093 +Problem: When the Tcl library couldn't be loaded dynamically, get an error + message when closing a buffer or window. (Muraoka Taro) +Solution: Only free structures if already using the Tcl interpreter. +Files: src/if_tcl.c + +Patch 6.0.094 +Problem: Athena: When clicking in the horizontal scrollbar Vim crashes. + (Paul Ackersviller) +Solution: Use the thumb size instead of the window pointer of the scrollbar + (which is NULL). (David Harrison) + Also avoid that scrolling goes the wrong way in a narrow window. +Files: src/gui_athena.c + +Patch 6.0.095 +Problem: Perl: Deleting lines may leave the cursor beyond the end of the + file. +Solution: Check the cursor position after deleting a line. (Serguei) +Files: src/if_perl.xs + +Patch 6.0.096 +Problem: When ":saveas fname" fails because the file already exists, the + file name is changed anyway and a following ":w" will overwrite + the file. (Eric Carlier) +Solution: Don't change the file name if the file already exists. +Files: src/ex_cmds.c + +Patch 6.0.097 +Problem: Re-indenting in Insert mode with CTRL-F may cause a crash with a + multi-byte encoding. +Solution: Avoid using a character before the start of a line. (Sergey + Vlasov) +Files: src/edit.c + +Patch 6.0.098 +Problem: GTK: When using Gnome the "Search" and "Search and Replace" dialog + boxes are not translated. +Solution: Define ENABLE_NLS before including gnome.h. (Eduardo Fernandez) +Files: src/gui_gtk.c, src/gui_gtk_x11.c + +Patch 6.0.099 +Problem: Cygwin: When running Vi compatible MS-DOS line endings cause + trouble. +Solution: Make the default for 'fileformats' "unix,dos" in Vi compatible + mode. (Michael Schaap) +Files: src/option.h + +Patch 6.0.100 +Problem: ":badd +0 test%file" causes a crash. +Solution: Take into account that the "+0" is NUL terminated when allocating + room for replacing the "%". +Files: src/ex_docmd.c + +Patch 6.0.101 +Problem: ":mksession" doesn't restore editing a file that has a '#' or '%' + in its name. (Wolfgang Blankenburg) +Solution: Put a backslash before the '#' and '%'. +Files: src/ex_docmd.c + +Patch 6.0.102 +Problem: When changing folds the cursor may appear halfway a closed fold. + (Nam SungHyun) +Solution: Set w_cline_folded correctly. (Yasuhiro Matsumoto) +Files: src/move.c + +Patch 6.0.103 +Problem: When using 'scrollbind' a large value of 'scrolloff' will make the + scroll binding stop near the end of the file. (Coen Engelbarts) +Solution: Don't use 'scrolloff' when limiting the topline for scroll + binding. (Dany StAmant) +Files: src/normal.c + +Patch 6.0.104 +Problem: Multi-byte: When '$' is in 'cpoptions', typing a double-wide + character that overwrites the left halve of an old double-wide + character causes a redraw problem and the cursor stops blinking. +Solution: Clear the right half of the old character. (Yasuhiro Matsumoto) +Files: src/edit.c, src/screen.c + +Patch 6.0.105 +Problem: Multi-byte: In a window of one column wide, with syntax + highlighting enabled a crash might happen. +Solution: Skip getting the syntax attribute when the character doesn't fit + anyway. (Yasuhiro Matsumoto) +Files: src/screen.c + +Patch 6.0.106 (extra) +Problem: Win32: When the printer font is wrong, there is no error message. +Solution: Give an appropriate error message. (Yasuhiro Matsumoto) +Files: src/os_mswin.c + +Patch 6.0.107 (extra) +Problem: VisVim: When editing another file, a modified file may be written + unexpectedly and without warning. +Solution: Split the window if a file was modified. +Files: VisVim/Commands.cpp + +Patch 6.0.108 +Problem: When using folding could try displaying line zero, resulting in an + error for a NULL pointer. +Solution: Stop decrementing w_topline when the first line of a window is in + a closed fold. +Files: src/window.c + +Patch 6.0.109 +Problem: XIM: When the input method is enabled, repeating an insertion with + "." disables it. (Marcel Svitalsky) +Solution: Don't store the input method status when a command comes from the + stuff buffer. +Files: src/ui.c + +Patch 6.0.110 +Problem: Using undo after executing "OxjAxkdd" from a register in + an empty buffer gives an error message. (Gerhard Hochholzer) +Solution: Don't adjust the bottom line number of an undo block when it's + zero. Add a test for this problem. +Files: src/undo.c, src/testdir/test20.in, src/testdir/test20.ok + +Patch 6.0.111 +Problem: The virtcol() function doesn't take care of 'virtualedit'. +Solution: Add the column offset when needed. (Yegappan Lakshmanan) +Files: src/eval.c + +Patch 6.0.112 +Problem: The explorer plugin doesn't sort directories with a space or + special character after a directory with a shorter name. +Solution: Ignore the trailing slash when comparing directory names. (Mike + Williams) +Files: runtime/plugin/explorer.vim + +Patch 6.0.113 +Problem: ":edit ~/fname" doesn't work if $HOME includes a space. Also, + expanding wildcards with the shell may fail. (John Daniel) +Solution: Escape spaces with a backslash when needed. +Files: src/ex_docmd.c, src/misc1.c, src/proto/misc1.pro, src/os_unix.c + +Patch 6.0.114 +Problem: Using ":p" with fnamemodify() didn't expand "~/" or "~user/" to a + full path. For Win32 the current directory was prepended. + (Michael Geddes) +Solution: Expand the home directory. +Files: src/eval.c + +Patch 6.0.115 (extra) +Problem: Win32: When using a dialog with a textfield it cannot scroll the + text. +Solution: Add ES_AUTOHSCROLL to the textfield style. (Pedro Gomes) +Files: src/gui_w32.c + +Patch 6.0.116 (extra) +Problem: MS-Windows NT/2000/XP: filewritable() doesn't work correctly for + filesystems that use ACLs. +Solution: Use ACL functions to check if a file is writable. (Mike Williams) +Files: src/eval.c, src/macros.h, src/os_win32.c, src/proto/os_win32.pro + +Patch 6.0.117 (extra) +Problem: Win32: when disabling the menu, "set lines=999" doesn't use all + the available screen space. +Solution: Don't subtract the fixed caption height but the real menu height + from the available screen space. Also: Avoid recursion in + gui_mswin_get_menu_height(). +Files: src/gui_w32.c, src/gui_w48.c + +Patch 6.0.118 +Problem: When $TMPDIR is a relative path, the temp directory is missing a + trailing slash and isn't deleted when Vim exits. (Peter Holm) +Solution: Add the slash after expanding the directory to an absolute path. +Files: src/fileio.c + +Patch 6.0.119 (depends on patch 6.0.116) +Problem: VMS: filewritable() doesn't work properly. +Solution: Use the same method as for Unix. (Zoltan Arpadffy) +Files: src/eval.c + +Patch 6.0.120 +Problem: The conversion to html isn't compatible with XHTML. +Solution: Quote the values. (Jess Thrysoee) +Files: runtime/syntax/2html.vim + +Patch 6.0.121 (extra) (depends on patch 6.0.116) +Problem: Win32: After patch 6.0.116 Vim doesn't compile with mingw32. +Solution: Add an #ifdef HAVE_ACL. +Files: src/os_win32.c + +Patch 6.0.122 (extra) +Problem: Win16: Same resize problems as patch 6.0.117 fixed for Win32. And + dialog textfield problem from patch 6.0.115. +Solution: Set old_menu_height only when used. Add ES_AUTOHSCROLL flag. + (Vince Negri) +Files: src/gui_w16.c + +Patch 6.0.123 (depends on patch 6.0.119) +Problem: Win16: Compilation problems. +Solution: Move "&&" to other lines. (Vince Negri) +Files: src/eval.c + +Patch 6.0.124 +Problem: When using a ":substitute" command that starts with "\=" + (evaluated as an expression), "~" was still replaced with the + previous substitute string. +Solution: Skip the replacement when the substitute string starts with "\=". + Also adjust the documentation about doubling backslashes. +Files: src/ex_cmds.c, runtime/doc/change.txt + +Patch 6.0.125 (extra) +Problem: Win32: When using the multi_byte_ime feature pressing the shift + key would be handled as if a character was entered, thus mappings + with a shifted key didn't work. (Charles Campbell) +Solution: Ignore pressing the shift, control and alt keys. +Files: src/os_win32.c + +Patch 6.0.126 +Problem: The python library was always statically linked. +Solution: Link the python library dynamically. (Matthias Klose) +Files: src/auto/configure, src/configure.in + +Patch 6.0.127 +Problem: When using a terminal that swaps screens and the Normal background + color has a different background, using an external command may + cause the color of the wrong screen to be changed. (Mark Waggoner) +Solution: Don't call screen_stop_highlight() in stoptermcap(). +Files: src/term.c + +Patch 6.0.128 +Problem: When moving a vertically split window to the far left or right, + the scrollbars are not adjusted. (Scott E Lee) When 'mousefocus' + is set the mouse pointer wasn't adjusted. +Solution: Adjust the scrollbars and the mouse pointer. +Files: src/window.c + +Patch 6.0.129 +Problem: When using a very long file name, ":ls" (repeated a few times) + causes a crash. Test with "vim `perl -e 'print "A"x1000'`". + (Tejeda) +Solution: Terminate a string before getting its length in buflist_list(). +Files: src/buffer.c + +Patch 6.0.130 +Problem: When using ":cprev" while the error window is open, and the new + line at the top wraps, the window isn't correctly drawn. + (Yegappan Lakshmanan) +Solution: When redrawing the topline don't scroll twice. +Files: src/screen.c + +Patch 6.0.131 +Problem: When using bufname() and there are two matches for listed buffers + and one match for an unlisted buffer, the unlisted buffer is used. + (Aric Blumer) +Solution: When there is a match with a listed buffer, don't check for + unlisted buffers. +Files: src/buffer.c + +Patch 6.0.132 +Problem: When setting 'iminsert' in the vimrc and using an xterm with two + screens the ruler is drawn in the wrong screen. (Igor Goldenberg) +Solution: Only draw the ruler when using the right screen. +Files: src/option.c + +Patch 6.0.133 +Problem: When opening another buffer while 'keymap' is set and 'iminsert' + is zero, 'iminsert' is set to one unexpectedly. (Igor Goldenberg) +Solution: Don't set 'iminsert' as a side effect of defining a ":lmap" + mapping. Only do that when 'keymap' is set. +Files: src/getchar.c, src/option.c + +Patch 6.0.134 +Problem: When completing ":set tags=" a path with an embedded space causes + the completion to stop. (Sektor van Skijlen) +Solution: Escape spaces with backslashes, like for ":set path=". Also take + backslashes into account when searching for the start of the path + to complete (e.g., for 'backupdir' and 'cscopeprg'). +Files: src/ex_docmd.c, src/ex_getln.c, src/option.c, src/structs.h + +Patch 6.0.135 +Problem: Menus that are not supposed to do anything used "<Nul>", which + still produced an error beep. + When CTRL-O is mapped for Insert mode, ":amenu" commands didn't + work in Insert mode. + Menu language falls back to English when $LANG ends in "@euro". +Solution: Use "<Nop>" for a menu item that doesn't do anything, just like + mappings. + Use ":anoremenu" instead of ":amenu". + Ignore "@euro" in the locale name. +Files: runtime/makemenu.vim, runtime/menu.vim, src/menu.c + +Patch 6.0.136 +Problem: When completing in Insert mode, a mapping could be unexpectedly + applied. +Solution: Don't use mappings when checking for a typed character. +Files: src/edit.c + +Patch 6.0.137 +Problem: GUI: When using the find or find/replace dialog from Insert mode, + the input mode is stopped. +Solution: Don't use the input method status when the main window doesn't + have focus. +Files: src/ui.c + +Patch 6.0.138 +Problem: GUI: When using the find or find/replace dialog from Insert mode, + the text is inserted when CTRL-O is mapped. (Andre Pang) + When opening the dialog again, a whole word search isn't + recognized. + When doing "replace all" a whole word search was never done. +Solution: Don't put a search or replace command in the input buffer, + execute it directly. + Recognize "\<" and "\>" after removing "\V". + Add "\<" and "\>" also for "replace all". +Files: src/gui.c + +Patch 6.0.139 +Problem: When stopping 'wildmenu' completion, the statusline of the + bottom-left vertically split window isn't redrawn. (Yegappan + Lakshmanan) +Solution: Redraw all the bottom statuslines. +Files: src/ex_getln.c, src/proto/screen.pro, src/screen.c + +Patch 6.0.140 +Problem: Memory allocated for local mappings and abbreviations is leaked + when the buffer is wiped out. +Solution: Clear the local mappings when deleting a buffer. +Files: src/buffer.c, src/getchar.c, src/proto/getchar.pro, src/vim.h + +Patch 6.0.141 +Problem: When using ":enew" in an empty buffer, some buffer-local things + are not cleared. b:keymap_name is not set. +Solution: Clear user commands and mappings local to the buffer when re-using + the current buffer. Reload the keymap. +Files: src/buffer.c + +Patch 6.0.142 +Problem: When Python is linked statically, loading dynamic extensions might + fail. +Solution: Add an extra linking flag when needed. (Andrew Rodionoff) +Files: src/configure.in, src/auto/configure + +Patch 6.0.143 +Problem: When a syntax item includes a line break in a pattern, the syntax + may not be updated properly when making a change. +Solution: Add the "linebreaks" argument to ":syn sync". +Files: runtime/doc/syntax.txt, src/screen.c, src/structs.h, src/syntax.c + +Patch 6.0.144 +Problem: After patch 6.0.088 redoing "veU" doesn't work. +Solution: Don't add the "U" to the redo buffer, it will be used as an undo + command. +Files: src/normal.c + +Patch 6.0.145 +Problem: When Vim can't read any input it might get stuck. When + redirecting stdin and stderr Vim would not read commands from a + file. (Servatius Brandt) +Solution: When repeatedly trying to read a character when it's not possible, + exit Vim. When stdin and stderr are not a tty, still try reading + from them, but don't do a blocking wait. +Files: src/ui.c + +Patch 6.0.146 +Problem: When 'statusline' contains "%{'-'}" this results in a zero. + (Milan Vancura) +Solution: Don't handle numbers with a minus as a number, they were not + displayed anyway. +Files: src/buffer.c + +Patch 6.0.147 +Problem: It's not easy to mark a Vim version as being modified. The new + license requires this. +Solution: Add the --modified-by argument to configure and the MODIFIED_BY + define. I's used in the intro screen and the ":version" output. +Files: src/auto/configure, src/configure.in, src/config.h.in, + src/feature.h, src/version.c + +Patch 6.0.148 +Problem: After "p" in an empty line, `[ goes to the second character. + (Kontra Gergely) +Solution: Don't increment the column number in an empty line. +Files: src/ops.c + +Patch 6.0.149 +Problem: The pattern "\(.\{-}\)*" causes a hang. When using a search + pattern that causes a stack overflow to be detected Vim could + still hang. +Solution: Correctly report "operand could be empty" when using "\{-}". + Check for "out_of_stack" inside loops to avoid a hang. +Files: src/regexp.c + +Patch 6.0.150 +Problem: When using a multi-byte encoding, patch 6.0.148 causes "p" to work + like "P". (Sung-Hyun Nam) +Solution: Compute the byte length of a multi-byte character. +Files: src/ops.c + +Patch 6.0.151 +Problem: Redrawing the status line and ruler can be wrong when it contains + multi-byte characters. +Solution: Use character width and byte length correctly. (Yasuhiro Matsumoto) +Files: src/screen.c + +Patch 6.0.152 +Problem: strtrans() could hang on an illegal UTF-8 byte sequence. +Solution: Skip over illegal bytes. (Yasuhiro Matsumoto) +Files: src/charset.c + +Patch 6.0.153 +Problem: When using (illegal) double-byte characters and Vim syntax + highlighting Vim can crash. (Yasuhiro Matsumoto) +Solution: Increase a pointer over a character instead of a byte. +Files: src/regexp.c + +Patch 6.0.154 +Problem: MS-DOS and MS-Windows: The menu entries for xxd don't work when + there is no xxd in the path. + When converting back from Hex the filetype may remain "xxd" if it + is not detected. +Solution: When xxd is not in the path use the one in the runtime directory, + where the install program has put it. + Clear the 'filetype' option before detecting the new value. +Files: runtime/menu.vim + +Patch 6.0.155 +Problem: Mac: compilation problems in ui.c after patch 6.0.145. (Axel + Kielhorn) +Solution: Don't call mch_inchar() when NO_CONSOLE is defined. +Files: src/ui.c + +Patch 6.0.156 +Problem: Starting Vim with the -b argument and two files, ":next" doesn't + set 'binary' in the second file, like Vim 5.7. (Norman Diamond) +Solution: Set the global value for 'binary'. +Files: src/option.c + +Patch 6.0.157 +Problem: When defining a user command with "-complete=dir" files will also + be expanded. Also, "-complete=mapping" doesn't appear to work. + (Michael Naumann) +Solution: Use the expansion flags defined with the user command. + Handle expanding mappings specifically. +Files: src/ex_docmd.c + +Patch 6.0.158 +Problem: When getting the warning for a file being changed outside of Vim + and reloading the file, the 'readonly' option is reset, even when + the permissions didn't change. (Marcel Svitalsky) +Solution: Keep 'readonly' set when reloading a file and the permissions + didn't change. +Files: src/fileio.c + +Patch 6.0.159 +Problem: Wildcard expansion for ":emenu" also shows separators. +Solution: Skip menu separators for ":emenu", ":popup" and ":tearoff". + Also, don't handle ":tmenu" as if it was ":tearoff". And leave + out the alternatives with "&" included. +Files: src/menu.c + +Patch 6.0.160 +Problem: When compiling with GCC 3.0.2 and using the "-O2" argument, the + optimizer causes a problem that makes Vim crash. +Solution: Add a configure check to avoid "-O2" for this version of gcc. +Files: src/configure.in, src/auto/configure + +Patch 6.0.161 (extra) +Problem: Win32: Bitmaps don't work with signs. +Solution: Make it possible to use bitmaps with signs. (Muraoka Taro) +Files: src/ex_cmds.c, src/feature.h, src/gui_w32.c, src/gui_x11.c, + src/proto/gui_w32.pro, src/proto/gui_x11.pro + +Patch 6.0.162 +Problem: Client-server: An error message for a wrong expression appears in + the server instead of the client. +Solution: Pass the error message from the server to the client. Also + adjust the example code. (Flemming Madsen) +Files: src/globals.h, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c, + src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro, + runtime/doc/eval.txt, runtime/tools/xcmdsrv_client.c + +Patch 6.0.163 +Problem: When using a GUI dialog, a file name is sometimes used like it was + a directory. +Solution: Separate path and file name properly. + For GTK, Motif and Athena concatenate directory and file name for + the default selection. +Files: src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, + src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c, src/message.c + +Patch 6.0.164 +Problem: After patch 6.0.135 the menu entries for pasting don't work in + Insert and Visual mode. (Muraoka Taro) +Solution: Add <script> to allow script-local mappings. +Files: runtime/menu.vim + +Patch 6.0.165 +Problem: Using --remote and executing locally gives unavoidable error + messages. +Solution: Add --remote-silent and --remote-wait-silent to silently execute + locally. + For Win32 there was no error message when a server didn't exist. +Files: src/eval.c, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c, + src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro + +Patch 6.0.166 +Problem: GUI: There is no way to avoid dialogs to pop up. +Solution: Add the 'c' flag to 'guioptions': Use console dialogs. (Yegappan + Lakshmanan) +Files: runtime/doc/options.txt, src/option.h, src/message.c + +Patch 6.0.167 +Problem: When 'fileencodings' is "latin2" some characters in the help files + are displayed wrong. +Solution: Force the 'fileencoding' for the help files to be "latin1". +Files: src/fileio.c + +Patch 6.0.168 +Problem: ":%s/\n/#/" doesn't replace at an empty line. (Bruce DeVisser) +Solution: Don't skip matches after joining two lines. +Files: src/ex_cmds.c + +Patch 6.0.169 +Problem: When run as evim and the GUI can't be started we get stuck in a + terminal without menus in Insert mode. +Solution: Exit when using "evim" and "gvim -y" when the GUI can't be + started. +Files: src/main.c + +Patch 6.0.170 +Problem: When printing double-width characters the size of tabs after them + is wrong. (Muraoka Taro) +Solution: Correctly compute the column after a double-width character. +Files: src/ex_cmds2.c + +Patch 6.0.171 +Problem: With 'keymodel' including "startsel", in Insert mode after the end + of a line, shift-Left does not move the cursor. (Steve Hall) +Solution: CTRL-O doesn't move the cursor left, need to do that explicitly. +Files: src/edit.c + +Patch 6.0.172 +Problem: CTRL-Q doesn't replace CTRL-V after CTRL-X in Insert mode while it + does in most other situations. +Solution: Make CTRL-X CTRL-Q work like CTRL-X CTRL-V in Insert mode. +Files: src/edit.c + +Patch 6.0.173 +Problem: When using "P" to insert a line break the cursor remains past the + end of the line. +Solution: Check for the cursor being beyond the end of the line. +Files: src/ops.c + +Patch 6.0.174 +Problem: After using "gd" or "gD" the search direction for "n" may still be + backwards. (Servatius Brandt) +Solution: Reset the search direction to forward. +Files: src/normal.c, src/search.c, src/proto/search.pro + +Patch 6.0.175 +Problem: ":help /\z(\)" doesn't work. (Thomas Koehler) +Solution: Double the backslashes. +Files: src/ex_cmds.c + +Patch 6.0.176 +Problem: When killed by a signal autocommands are still triggered as if + nothing happened. +Solution: Add the v:dying variable to allow autocommands to work differently + when a deadly signal has been trapped. +Files: src/eval.c, src/os_unix.c, src/vim.h + +Patch 6.0.177 +Problem: When 'commentstring' is empty and 'foldmethod' is "marker", "zf" + doesn't work. (Thomas S. Urban) +Solution: Add the marker even when 'commentstring' is empty. +Files: src/fold.c, src/normal.c + +Patch 6.0.178 +Problem: Uninitialized memory read from xp_backslash field. +Solution: Initialize xp_backslash field properly. +Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/misc1.c, src/tag.c + +Patch 6.0.179 +Problem: Win32: When displaying UTF-8 characters may read uninitialized + memory. +Solution: Add utfc_ptr2len_check_len() to avoid reading past the end of a + string. +Files: src/mbyte.c, src/proto/mbyte.pro, src/gui_w32.c + +Patch 6.0.180 +Problem: Expanding environment variables in a string that ends in a + backslash could go past the end of the string. +Solution: Detect the trailing backslash. +Files: src/misc1.c + +Patch 6.0.181 +Problem: When using ":cd dir" memory was leaked. +Solution: Free the allocated memory. Also avoid an uninitialized memory + read. +Files: src/misc2.c + +Patch 6.0.182 +Problem: When using a regexp on multi-byte characters, could try to read a + character before the start of the line. +Solution: Don't decrement a pointer to before the start of the line. +Files: src/regexp.c + +Patch 6.0.183 +Problem: Leaking memory when ":func!" redefines a function. +Solution: Free the function name when it's not used. +Files: src/eval.c + +Patch 6.0.184 +Problem: Leaking memory when expanding option values. +Solution: Don't always copy the expanded option into allocated memory. +Files: src/option.c + +Patch 6.0.185 +Problem: Crash in Vim when pasting a selection in another application, on a + 64 bit machine. +Solution: Fix the format for an Atom to 32 bits. (Peter Derr) +Files: src/ui.c + +Patch 6.0.186 +Problem: X11: Three warnings when compiling the client-server code. +Solution: Add a typecast to unsigned char. +Files: src/if_xcmdsrv.c + +Patch 6.0.187 +Problem: "I" in Visual mode and then "u" reports too many changes. (Andrew + Stryker) + "I" in Visual linewise mode adjusts the indent for no apparent + reason. +Solution: Only save those lines for undo that are changed. + Don't change the indent after inserting in Visual linewise mode. +Files: src/ops.c + +Patch 6.0.188 +Problem: Win32: After patch 6.0.161 signs defined in the vimrc file don't + work. +Solution: Initialize the sign icons after initializing the GUI. (Vince + Negri) +Files: src/gui.c, src/gui_x11.c + +Patch 6.0.189 +Problem: The size of the Visual area isn't always displayed when scrolling + ('ruler' off, 'showcmd' on). Also not when using a search + command. (Sylvain Hitier) +Solution: Redisplay the size of the selection after showing the mode. +Files: src/screen.c + +Patch 6.0.190 +Problem: GUI: when 'mouse' is empty a click with the middle button still + moves the cursor. +Solution: Paste at the cursor position instead of the mouse position. +Files: src/normal.c + +Patch 6.0.191 +Problem: When no servers are available serverlist() gives an error instead + of returning an empty string. (Hari Krishna) +Solution: Don't give an error message. +Files: src/eval.c + +Patch 6.0.192 +Problem: When 'virtualedit' is set, "ylj" goes to the wrong column. (Andrew + Nikitin) +Solution: Reset the flag that w_virtcol is valid when moving the cursor back + to the start of the operated area. +Files: src/normal.c + +Patch 6.0.193 +Problem: When 'virtualedit' is set, col(".") after the end of the line + should return one extra. +Solution: Add one to the column. +Files: src/eval.c + +Patch 6.0.194 +Problem: "--remote-silent" tries to send a reply to the client, like it was + "--remote-wait". +Solution: Properly check for the argument. +Files: src/main.c + +Patch 6.0.195 +Problem: When 'virtualedit' is set and a search starts in virtual space + ":call search('x')" goes to the wrong position. (Eric Long) +Solution: Reset coladd when finding a match. +Files: src/search.c + +Patch 6.0.196 +Problem: When 'virtualedit' is set, 'selection' is "exclusive" and visually + selecting part of a tab at the start of a line, "x" joins it with + the previous line. Also, when the selection spans more than one + line the whole tab is deleted. +Solution: Take coladd into account when adjusting for 'selection' being + "exclusive". Also expand a tab into spaces when deleting more + than one line. +Files: src/normal.c, src/ops.c + +Patch 6.0.197 +Problem: When 'virtualedit' is set and 'selection' is "exclusive", "v$x" + doesn't delete the last character in the line. (Eric Long) +Solution: Don't reset the inclusive flag. (Helmut Stiegler) +Files: src/normal.c + +Patch 6.0.198 +Problem: When 'virtualedit' is set and 'showbreak' is not empty, moving the + cursor over the line break doesn't work properly. (Eric Long) +Solution: Make getviscol() and getviscol2() use getvvcol() to obtain the + virtual cursor position. Adjust coladvance() and oneleft() to + skip over the 'showbreak' characters. +Files: src/edit.c, src/misc2.c + +Patch 6.0.199 +Problem: Multi-byte: could use iconv() after calling iconv_end(). + (Yasuhiro Matsumoto) +Solution: Stop converting input and output stream after calling iconv_end(). +Files: src/mbyte.c + +Patch 6.0.200 +Problem: A script that starts with "#!perl" isn't recognized as a Perl + filetype. +Solution: Ignore a missing path in a script header. Also, speed up + recognizing scripts by simplifying the patterns used. +Files: runtime/scripts.vim + +Patch 6.0.201 +Problem: When scrollbinding and doing a long jump, switching windows jumps + to another position in the file. Scrolling a few lines at a time + is OK. (Johannes Zellner) +Solution: When setting w_topline reset the flag that indicates w_botline is + valid. +Files: src/diff.c + +Patch 6.0.202 +Problem: The "icon=" argument for the menu command to define a toolbar icon + with a file didn't work for GTK. (Christian J. Robinson) + For Motif and Athena a full path was required. +Solution: Search the icon file using the specified path. Expand environment + variables in the file name. +Files: src/gui_gtk.c, src/gui_x11.c + +Patch 6.0.203 +Problem: Can change 'fileformat' even though 'modifiable' is off. + (Servatius Brandt) +Solution: Correct check for kind of set command. +Files: src/option.c + +Patch 6.0.204 +Problem: ":unlet" doesn't work for variables with curly braces. (Thomas + Scott Urban) +Solution: Handle variable names with curly braces properly. (Vince Negri) +Files: src/eval.c + +Patch 6.0.205 (extra) +Problem: "gvim -f" still forks when using the batch script to start Vim. +Solution: Add an argument to "start" to use a foreground session (Michael + Geddes) +Files: src/dosinst.c + +Patch 6.0.206 +Problem: Unix: if expanding a wildcard in a file name results in a + wildcard character and there are more parts in the path with a + wildcard, it is expanded again. + Windows: ":edit \[abc]" could never edit the file "[abc]". +Solution: Don't expand wildcards in already expanded parts. + Don't remove backslashes used to escape the special meaning of a + wildcard; can edit "[abc]" if '[' is removed from 'isfname'. +Files: src/misc1.c, src/os_unix.c + +Patch 6.0.207 (extra) +Problem: Win32: The shortcuts and start menu entries let Vim startup in the + desktop directory, which is not very useful. +Solution: Let shortcuts start Vim in $HOME or $HOMEDIR$HOMEPATH. +Files: src/dosinst.c + +Patch 6.0.208 +Problem: GUI: When using a keymap and the cursor is not blinking, CTRL-^ in + Insert mode doesn't directly change the cursor color. (Alex + Solow) +Solution: Force a redraw of the cursor after CTRL-^. +Files: src/edit.c + +Patch 6.0.209 +Problem: GUI GTK: After selecting a 'guifont' with the font dialog there + are redraw problems for multi-byte characters. +Solution: Separate the font dialog from setting the new font name to avoid + that "*" is used to find wide and bold fonts. + When redrawing extra characters for the bold trick, take care of + UTF-8 characters. +Files: src/gui.c, src/gui_gtk_x11.c, src/option.c, src/proto/gui.pro, + src/proto/gui_gtk_x11.pro + +Patch 6.0.210 +Problem: After patch 6.0.167 it's no longer possible to edit a help file in + another encoding than latin1. +Solution: Let the "++enc=" argument overrule the encoding. +Files: src/fileio.c + +Patch 6.0.211 +Problem: When reading a file fails, the buffer is empty, but it might still + be possible to write it with ":w" later. The original file is + lost then. (Steve Amerige) +Solution: Set the 'readonly' option for the buffer. +Files: src/fileio.c + +Patch 6.0.212 +Problem: GUI GTK: confirm("foo", "") causes a crash. +Solution: Don't make a non-existing button the default. Add a default "OK" + button if none is specified. +Files: src/eval.c, src/gui_gtk.c + +Patch 6.0.213 +Problem: When a file name contains unprintable characters, CTRL-G and other + commands don't work well. +Solution: Turn unprintable into printable characters. (Yasuhiro Matsumoto) +Files: src/buffer.c, src/charset.c + +Patch 6.0.214 +Problem: When there is a buffer without a name, empty entries appear in the + jumplist saved in the viminfo file. +Solution: Don't write jumplist entries without a file name. +Files: src/mark.c + +Patch 6.0.215 +Problem: After using "/" from Visual mode the Paste menu and Toolbar + entries don't work. Pasting with the middle mouse doesn't work + and modeless selection doesn't work. +Solution: Use the command line mode menus and use the mouse like in the + command line. +Files: src/gui.c, src/menu.c, src/ui.c + +Patch 6.0.216 +Problem: After reloading a file, displayed in another window than the + current one, which was changed outside of Vim the part of the file + around the cursor set by autocommands may be displayed, but + jumping back to the original cursor position when entering the + window again. +Solution: Restore the topline of the window. +Files: src/fileio.c + +Patch 6.0.217 +Problem: When getting help from a help file that was used before, an empty + unlisted buffer remains in the buffer list. (Eric Long) +Solution: Wipe out the buffer used to do the tag jump from. +Files: src/buffer.c, src/ex_cmds.c, src/proto/buffer.pro + +Patch 6.0.218 +Problem: With explorer plugin: "vim -o filename dirname" doesn't load the + explorer window until entering the window. +Solution: Call s:EditDir() for each window after starting up. +Files: runtime/plugin/explorer.vim + +Patch 6.0.219 +Problem: ":setlocal" and ":setglobal", without arguments, display terminal + options. (Zdenek Sekera) +Solution: Skip terminal options for these two commands. +Files: src/option.c + +Patch 6.0.220 +Problem: After patch 6.0.218 get a beep on startup. (Muraoka Taro) +Solution: Don't try going to another window when there isn't one. +Files: runtime/plugin/explorer.vim + +Patch 6.0.221 +Problem: When using ":bdel" and all other buffers are unloaded the lowest + numbered buffer is jumped to instead of the most recent one. (Dave + Cecil) +Solution: Prefer an unloaded buffer from the jumplist. +Files: src/buffer.c + +Patch 6.0.222 +Problem: When 'virtualedit' is set and using autoindent, pressing Esc after + starting a new line leaves behind part of the autoindent. (Helmut + Stiegler) +Solution: After deleting the last char in the line adjust the cursor + position in del_bytes(). +Files: src/misc1.c, src/ops.c + +Patch 6.0.223 +Problem: When splitting a window that contains the explorer, hitting CR on + a file name gives error messages. +Solution: Set the window variables after splitting the window. +Files: runtime/plugin/explorer.vim + +Patch 6.0.224 +Problem: When 'sidescroll' and 'sidescrolloff' are set in a narrow window + the text may jump left-right and the cursor is displayed in the + wrong position. (Aric Blumer) +Solution: When there is not enough room, compute the left column for the + window to put the cursor in the middle. +Files: src/move.c + +Patch 6.0.225 +Problem: In Visual mode "gk" gets stuck in a closed fold. (Srinath + Avadhanula) +Solution: Behave differently in a closed fold. +Files: src/normal.c + +Patch 6.0.226 +Problem: When doing ":recover file" get the ATTENTION prompt. + After recovering the same file five times get a read error or a + crash. (Alex Davis) +Solution: Set the recoverymode flag before setting the file name. + Correct the amount of used memory for the size of block zero. +Files: src/ex_docmd.c + +Patch 6.0.227 (extra) +Problem: The RISC OS port has several problems. +Solution: Update the makefile and fix some of the problems. (Andy Wingate) +Files: src/Make_ro.mak, src/os_riscos.c, src/os_riscos.h, + src/proto/os_riscos.pro, src/search.c + +Patch 6.0.228 +Problem: After putting text in Visual mode the '] mark is not at the end of + the put text. + Undo doesn't work properly when putting a word into a Visual + selection that spans more than one line. +Solution: Correct the '] mark for the deleting the Visually selected text. + #ifdef code that depends on FEAT_VISUAL properly. + Also fix that "d" crossing line boundary puts '[ just before + deleted text. + Fix undo by saving all deleted lines at once. +Files: src/ex_docmd.c, src/globals.h, src/normal.c, src/ops.c, + src/structs.h, src/vim.h + +Patch 6.0.229 +Problem: Multi-byte: With 'm' in 'formatoptions', formatting doesn't break + at a multi-byte char followed by an ASCII char, and the other way + around. (Muraoka Taro) + When joining lines a space is inserted between multi-byte + characters, which is not always wanted. +Solution: Check for multi-byte character before and after the breakpoint. + Don't insert a space before or after a multi-byte character when + joining lines and the 'M' flag is in 'formatoptions'. Don't + insert a space between multi-byte characters when the 'B' flag is + in 'formatoptions'. +Files: src/edit.c, src/ops.c, src/option.h + +Patch 6.0.230 +Problem: The ":" used as a motion after an operator is exclusive, but + sometimes it should be inclusive. +Solution: Make the "v" in between an operator and motion toggle + inclusive/exclusive. (Servatius Brandt) +Files: runtime/doc/motion.txt, src/normal.c + +Patch 6.0.231 +Problem: "gd" and "gD" don't work when the variable matches in a comment + just above the match to be found. (Servatius Brandt) +Solution: Continue searching in the first column below the comment. +Files: src/normal.c + +Patch 6.0.232 +Problem: "vim --version" prints on stderr while "vim --help" prints on + stdout. +Solution: Make "vim --version" use stdout. +Files: runtime/doc/starting.txt, src/globals.h, src/main.c, src/message.c + +Patch 6.0.233 +Problem: "\1\{,8}" in a regexp is not allowed, but it should work, because + there is an upper limit. (Jim Battle) +Solution: Allow using "\{min,max}" after an atom that can be empty if there + is an upper limit. +Files: src/regexp.c + +Patch 6.0.234 +Problem: It's not easy to set the cursor position without modifying marks. +Solution: Add the cursor() function. (Yegappan Lakshmanan) +Files: runtime/doc/eval.txt, src/eval.c + +Patch 6.0.235 +Problem: When writing a file and renaming the original file to make the + backup, permissions could change when setting the owner. +Solution: Only set the owner when it's needed and set the permissions again + afterwards. + When 'backupcopy' is "auto" check that the owner and permissions + of a newly created file can be set properly. +Files: src/fileio.c + +Patch 6.0.236 +Problem: ":edit" without argument should move cursor to line 1 in Vi + compatible mode. +Solution: Add 'g' flag to 'cpoptions'. +Files: runtime/doc/options.txt, src/ex_docmd.c, src/option.h + +Patch 6.0.237 +Problem: In a C file, using the filetype plugin, re-indenting a comment + with two spaces after the middle "*" doesn't align properly. +Solution: Don't use a middle entry from a start/middle/end to line up with + the start of the comment when the start part doesn't match with + the actual comment start. +Files: src/misc1.c + +Patch 6.0.238 +Problem: Using a ":substitute" command with a substitute() call in the + substitution expression causes errors. (Srinath Avadhanula) +Solution: Save and restore pointers when doing substitution recursively. +Files: src/regexp.c + +Patch 6.0.239 +Problem: Using "A" to append after a Visually selected block which is after + the end of the line, spaces are inserted in the wrong line and + other unexpected effects. (Michael Naumann) +Solution: Don't advance the cursor to the next line. +Files: src/ops.c + +Patch 6.0.240 +Problem: Win32: building with Python 2.2 doesn't work. +Solution: Add support for Python 2.2 with dynamic linking. (Paul Moore) +Files: src/if_python.c + +Patch 6.0.241 +Problem: Win32: Expanding the old value of an option that is a path that + starts with a backslash, an extra backslash is inserted. +Solution: Only insert backslashes where needed. + Also handle multi-byte characters properly when removing + backslashes. +Files: src/option.c + +Patch 6.0.242 +Problem: GUI: On a system with an Exceed X server sometimes get a "Bad + Window" error. (Tommi Maekitalo) +Solution: When forking, use a pipe to wait in the parent for the child to + have done the setsid() call. +Files: src/gui.c + +Patch 6.0.243 +Problem: Unix: "vim --version" outputs a NL before the last line instead of + after it. (Charles Campbell) +Solution: Send the NL to the same output stream as the text. +Files: src/message.c, src/os_unix.c, src/proto/message.pro + +Patch 6.0.244 +Problem: Multi-byte: Problems with (illegal) UTF-8 characters in menu and + file name (e.g., icon text, status line). +Solution: Correctly handle unprintable characters. Catch illegal UTF-8 + characters and replace them with <xx>. Truncating the status line + wasn't done correctly at a multi-byte character. (Yasuhiro + Matsumoto) + Added correct_cmdspos() and transchar_byte(). +Files: src/buffer.c, src/charset.c, src/ex_getln.c, src/gui.c, + src/message.c, src/screen.c, src/vim.h + +Patch 6.0.245 +Problem: After using a color scheme, setting the 'background' option might + not work. (Peter Horst) +Solution: Disable the color scheme if it switches 'background' back to the + wrong value. +Files: src/option.c + +Patch 6.0.246 +Problem: ":echomsg" didn't use the highlighting set by ":echohl". (Gary + Holloway) +Solution: Use the specified attributes for the message. (Yegappan + Lakshmanan) +Files: src/eval.c + +Patch 6.0.247 +Problem: GTK GUI: Can't use gvim in a kpart widget. +Solution: Add the "--echo-wid" argument to let Vim echo the window ID on + stdout. (Philippe Fremy) +Files: runtime/doc/starting.txt, src/globals.h, src/gui_gtk_x11.c, + src/main.c + +Patch 6.0.248 +Problem: When using compressed help files and 'encoding' isn't "latin1", + Vim converts the help file before decompressing. (David Reviejo) +Solution: Don't convert a help file when 'binary' is set. +Files: src/fileio.c + +Patch 6.0.249 +Problem: "vim -t edit -c 'sta ex_help'" doesn't move cursor to edit(). +Solution: Don't set the cursor on the first line for "-c" arguments when + there also is a "-t" argument. +Files: src/main.c + +Patch 6.0.250 (extra) +Problem: Macintosh: Various problems when compiling. +Solution: Various fixes, mostly #ifdefs. (Dany St. Amant) +Files: src/gui_mac.c, src/main.c, src/misc2.c, src/os_mac.h, + src/os_mac.pbproj/project.pbxproj, src/os_unix.c + +Patch 6.0.251 (extra) +Problem: Macintosh: menu shortcuts are not very clear. +Solution: Show the shortcut with the Mac clover symbol. (raindog) +Files: src/gui_mac.c + +Patch 6.0.252 +Problem: When a user function was defined with "abort", an error that is + not inside if/endif or while/endwhile doesn't abort the function. + (Servatius Brandt) +Solution: Don't reset did_emsg when the function is to be aborted. +Files: src/ex_docmd.c + +Patch 6.0.253 +Problem: When 'insertmode' is set, after "<C-O>:edit file" the next <C-O> + doesn't work. (Benji Fisher) <C-L> has the same problem. +Solution: Reset need_start_insertmode once in edit(). +Files: src/edit.c + +Patch 6.0.254 (extra) +Problem: Borland C++ 5.5: Checking for stack overflow doesn't work + correctly. Matters when using a complicated regexp. +Solution: Remove -N- from Make_bc5.mak. (Yasuhiro Matsumoto) +Files: src/Make_bc5.mak + +Patch 6.0.255 (extra) (depends on patch 6.0.116 and 6.0.121) +Problem: Win32: ACL support doesn't work well on Samba drives. +Solution: Add a check for working ACL support. (Mike Williams) +Files: src/os_win32.c + +Patch 6.0.256 (extra) +Problem: Win32: ":highlight Comment guifg=asdf" does not give an error + message. (Randall W. Morris) Also for other systems. +Solution: Add gui_get_color() to give one error message for all systems. +Files: src/gui.c, src/gui_amiga.c, src/gui_athena.c, src/gui_motif.c, + src/gui_riscos.c, src/gui_x11.c, src/gui_gtk_x11.c, + src/proto/gui.pro, src/syntax.c + +Patch 6.0.257 +Problem: Win32: When 'mousefocus' is set and there is a BufRead + autocommand, after the dialog for permissions changed outside of + Vim: 'mousefocus' stops working. (Robert Webb) +Solution: Reset need_mouse_correct after checking timestamps. +Files: src/fileio.c + +Patch 6.0.258 +Problem: When 'scrolloff' is 999 and there are folds, the text can jump up + and down when moving the cursor down near the end of the file. + (Lubomir Host) +Solution: When putting the cursor halfway the window start counting lines at + the end of a fold. +Files: src/move.c + +Patch 6.0.259 +Problem: MS-DOS: after editing the command line the cursor shape may remain + like in Insert mode. (Volker Kiefel) +Solution: Reset the cursor shape after editing the command line. +Files: src/ex_getln.c + +Patch 6.0.260 +Problem: GUI: May crash while starting up when giving an error message for + missing color. (Servatius Brandt) +Solution: Don't call gui_write() when still starting up. Don't give error + message for empty color name. Don't use 't_vb' while the GUI is + still starting up. +Files: src/fileio.c, src/gui.c, src/misc1.c, src/ui.c + +Patch 6.0.261 +Problem: nr2char() and char2nr() don't work with multi-byte characters. +Solution: Use 'encoding' for these functions. (Yasuhiro Matsumoto) +Files: runtime/doc/eval.txt, src/eval.c + +Patch 6.0.262 (extra) +Problem: Win32: IME doesn't work properly. OnImeComposition() isn't used + at all. +Solution: Adjust various things for IME. +Files: src/globals.h, src/gui_w32.c, src/mbyte.c, src/proto/ui.pro, + src/structs.h, src/ui.c + +Patch 6.0.263 +Problem: GTK: When a dialog is closed by the window manager, Vim hangs. + (Christian J. Robinson) +Solution: Use GTK_WIDGET_DRAWABLE() instead of GTK_WIDGET_VISIBLE(). +Files: src/gui_gtk.c, src/gui_gtk_x11.c + +Patch 6.0.264 +Problem: The amount of virtual memory is used to initialize 'maxmemtot', + which may be much more than the amount of physical memory, + resulting in a lot of swapping. +Solution: Get the amount of physical memory with sysctl(), sysconf() or + sysinfo() when possible. +Files: src/auto/configure, src/configure.in, src/config.h.in, + src/os_unix.c, src/os_unix.h + +Patch 6.0.265 +Problem: Win32: Using backspace while 'fkmap' is set causes a crash. + (Jamshid Oasjmoha) +Solution: Don't try mapping special keys. +Files: src/farsi.c + +Patch 6.0.266 +Problem: The rename() function deletes the file if the old and the new name + are the same. (Volker Kiefel) +Solution: Don't do anything if the names are equal. +Files: src/fileio.c + +Patch 6.0.267 +Problem: UTF-8: Although 'isprint' says a character is printable, + utf_char2cells() still considers it unprintable. +Solution: Use vim_isprintc() for characters upto 0x100. (Yasuhiro Matsumoto) +Files: src/mbyte.c + +Patch 6.0.268 (extra) (depends on patch 6.0.255) +Problem: Win32: ACL check crashes when using forward slash in file name. +Solution: Improve the check for the path in the file name. +Files: src/os_win32.c + +Patch 6.0.269 +Problem: Unprintable characters in a file name may cause problems when + using the 'statusline' option or when 'buftype' is "nofile". +Solution: call trans_characters() for the resulting statusline. (Yasuhiro + Matsumoto) +Files: src/buffer.c, src/screen.c, src/charset.c + +Patch 6.0.270 (depends on patch 6.0.267) +Problem: A tab causes UTF-8 text to be displayed in the wrong position. + (Ron Aaron) +Solution: Correct utf_char2cells() again. +Files: src/mbyte.c + +Patch 6.1a.001 (extra) +Problem: 32bit DOS: copying text to the clipboard may cause a crash. + (Jonathan D Johnston) +Solution: Don't copy one byte too much in SetClipboardData(). +Files: src/os_msdos.c + +Patch 6.1a.002 +Problem: GTK: On some configurations, when closing a dialog from the window + manager, Vim hangs. +Solution: Catch the "destroy" signal. (Aric Blumer) +Files: src/gui_gtk.c + +Patch 6.1a.003 +Problem: Multi-byte: With UTF-8 double-wide char and 'virtualedit' set: + yanking in Visual mode doesn't include the last byte. (Eric Long) +Solution: Don't add a space for a double-wide character. +Files: src/ops.c + +Patch 6.1a.004 (extra) +Problem: MINGW: undefined type. (Ron Aaron) +Solution: Make GetCompositionString_inUCS2() static. +Files: src/gui_w32.c, src/gui_w48.c, src/proto/gui_w32.pro + +Patch 6.1a.005 (extra) +Problem: Win32: ":hardcopy" doesn't work after ":hardcopy!". (Jonathan + Johnston) +Solution: Don't keep the driver context when using ":hardcopy!". (Vince + Negri) +Files: src/os_mswin.c + +Patch 6.1a.006 +Problem: multi-byte: after setting 'encoding' the window title might be + wrong. +Solution: Force resetting the title. (Yasuhiro Matsumoto) +Files: src/option.c + +Patch 6.1a.007 +Problem: Filetype detection for "*.inc" doesn't work. +Solution: Use a ":let" command. (David Schweikert) +Files: runtime/filetype.vim + +Patch 6.1a.008 (extra) +Problem: Win32: ACL detection for network shares doesn't work. +Solution: Include the trailing (back)slash in the root path. (Mike Williams) +Files: src/os_win32.c + +Patch 6.1a.009 +Problem: When using "\@<=" or "\@<!" in a pattern, a "\1" may refer to a () + part that follows, but it generates an error message. +Solution: Allow a forward reference when there is a following "\@<=" or + "\@<!". +Files: runtime/doc/pattern.txt, src/regexp.c + +Patch 6.1a.010 +Problem: When using ":help" and opening a new window, the alternate file + isn't set. +Solution: Set the alternate file to the previously edited file. +Files: src/ex_cmds.c + +Patch 6.1a.011 +Problem: GTK: ":set co=77", change width with the mouse, ":set co=77" + doesn't resize the window. (Darren Hiebert) +Solution: Set the form size after handling a resize event. +Files: src/gui_gtk_x11.c + +Patch 6.1a.012 +Problem: GTK: The file browser always returns a full path. (Lohner) +Solution: Shorten the file name if possible. +Files: src/gui_gtk.c + +Patch 6.1a.013 +Problem: When using "=~word" in 'cinkeys' or 'indentkeys', the case of the + last character of the word isn't ignored. (Raul Segura Acevedo) +Solution: Ignore case when checking the last typed character. +Files: src/edit.c + +Patch 6.1a.014 +Problem: After patch 6.1a.006 can't compile without the title feature. +Solution: Add an #ifdef. +Files: src/option.c + +Patch 6.1a.015 +Problem: MS-Windows: When expanding a file name that contains a '[' or '{' + an extra backslash is inserted. (Raul Segura Acevedo) +Solution: Avoid adding the backslash. +Files: src/ex_getln.c + +Patch 6.1a.016 +Problem: Completion after ":language" doesn't include "time". (Raul Segura + Acevedo) +Solution: Add the alternative to the completions. +Files: src/ex_cmds2.c + +Patch 6.1a.017 +Problem: Clicking the mouse in the top row of a window where the first line + doesn't fit moves the cursor to the wrong column. +Solution: Add the skipcol also for the top row of a window. +Files: src/ui.c + +Patch 6.1a.018 +Problem: When 'scrolloff' is one and the window height is one, "gj" can put + the cursor above the window. (Raul Segura Acevedo) +Solution: Don't let skipcol become bigger than the cursor column. +Files: src/move.c + +Patch 6.1a.019 +Problem: When using a composing character on top of an ASCII character, the + "l" command clears the composing character. Only when 'ruler' and + 'showcmd' are off. (Raphael Finkel) +Solution: Don't move the cursor by displaying characters when there are + composing characters. +Files: src/screen.c + +Patch 6.1a.020 +Problem: GTK: after patch 6.1a.011 resizing with the mouse doesn't always + work well for small sizes. (Adrien Beau) +Solution: Use another way to avoid the problem with ":set co=77". +Files: src/gui_gtk_x11.c + +Patch 6.1a.021 +Problem: Several Syntax menu entries are wrong or confusing. +Solution: Rephrase and correct the menu entries. (Adrien Beau) +Files: runtime/makemenu.vim, runtime/menu.vim + +Patch 6.1a.022 +Problem: A tags file might be used twice on case insensitive systems. + (Rick Swanton) +Solution: Don't use the same file name twice in the default for the 'tags' + option. Ignore case when comparing names of already visited + files. +Files: src/misc2.c, src/option.c + +Patch 6.1a.023 +Problem: When starting the GUI get "C" characters echoed in the terminal. +Solution: Don't try sending a clear-screen command while the GUI is starting + up. +Files: src/screen.c + +Patch 6.1a.024 +Problem: In other editors CTRL-F is often used for a find dialog. +Solution: In evim use CTRL-F for the find dialog. +Files: runtime/evim.vim + +Patch 6.1a.025 +Problem: The choices for the fileformat dialog can't be translated. +Solution: Add g:menutrans_fileformat_choices. (Adrien Beau) +Files: runtime/menu.vim + +Patch 6.1a.026 +Problem: Indenting Java files is wrong with "throws", "extends" and + "implements" clauses. +Solution: Update the Java indent script. +Files: runtime/indent/java.vim + +Patch 6.1a.027 +Problem: A few Syntax menu entries missing or incorrect. +Solution: Add and correct the menu entries. (Adrien Beau) + Shorten a few menus to avoid they become too long. +Files: runtime/makemenu.vim, runtime/menu.vim + +Patch 6.1a.028 +Problem: XIM: problems with feedback and some input methods. +Solution: Use iconv for calculating the cells. Remove the queue for + key_press_event only when text was changed. (Yasuhiro Matsumoto) +Files: src/globals.h, src/mbyte.c, src/screen.c + +Patch 6.1a.029 +Problem: After patch 6.1a.028 can't compile GTK version with XIM but + without multi-byte chars. +Solution: Add an #ifdef. (Aschwin Marsman) +Files: src/mbyte.c + +Patch 6.1a.030 +Problem: With double-byte encodings toupper() and tolower() may have wrong + results. +Solution: Skip double-byte characters. (Eric Long) +Files: src/eval.c + +Patch 6.1a.031 +Problem: Accessing the 'balloondelay' variable may cause a crash. +Solution: Make the variable for 'balloondelay' a long. (Olaf Seibert) +Files: src/option.h + +Patch 6.1a.032 (extra) +Problem: Some menu files used a wrong encoding name for "scriptencoding". +Solution: Move the translations to a separate file, which is sourced after + setting "scriptencoding". + Also add Czech menu translations in ASCII and update the other + encodings. +Files: runtime/lang/menu_cs_cz.iso_8859-1.vim, + runtime/lang/menu_cs_cz.iso_8859-2.vim, + runtime/lang/menu_czech_czech_republic.1250.vim, + runtime/lang/menu_czech_czech_republic.1252.vim, + runtime/lang/menu_czech_czech_republic.ascii.vim, + runtime/lang/menu_de_de.iso_8859-1.vim, + runtime/lang/menu_de_de.latin1.vim, + runtime/lang/menu_fr_fr.iso_8859-1.vim, + runtime/lang/menu_fr_fr.latin1.vim, + runtime/lang/menu_french_france.1252.vim, + runtime/lang/menu_german_germany.1252.vim, + runtime/lang/menu_ja_jp.euc-jp.vim, + runtime/lang/menu_ja_jp.utf-8.vim, + runtime/lang/menu_japanese_japan.932.vim + +Patch 6.1a.033 +Problem: XIM: doesn't reset input context. +Solution: call xim_reset() with im_set_active(FALSE). (Takuhiro Nishioka) +Files: src/mbyte.c + +Patch 6.1a.034 (extra) +Problem: Win32: The ACL checks for a readonly file still don't work well. +Solution: Remove the ACL checks, go back to how it worked in Vim 6.0. +Files: src/os_win32.c + +Patch 6.1a.035 +Problem: multi-byte: When using ":sh" in the GUI, typed and displayed + multi-byte characters are not handled correctly. +Solution: Deal with multi-byte characters to and from the shell. (Yasuhiro + Matsumoto) Also handle UTF-8 composing characters. +Files: src/os_unix.c + +Patch 6.1a.036 +Problem: GTK: the save-yourself event was not handled. +Solution: Catch the save-yourself event and preserve swap files. (Neil Bird) +Files: src/gui_gtk_x11.c + +Patch 6.1a.037 +Problem: The MS-Windows key mapping doesn't include CTRL-S for saving. + (Vlad Sandrini) +Solution: Map CTRL-S to ":update". +Files: runtime/mswin.vim + +Patch 6.1a.038 +Problem: Solaris: Including both sys/sysctl.h and sys/sysinfo.h doesn't + work. (Antonio Colombo) +Solution: Don't include sys/sysinfo.h when not calling sysinfo(). +Files: src/os_unix.c + +Patch 6.1a.039 +Problem: Not all visual basic files are recognized. +Solution: Add checks to catch *.ctl files. (Raul Segura Acevedo) +Files: runtime/filetype.vim + +Patch 6.1a.040 +Problem: A *.pl file is recognized as Perl, but it could be a prolog file. +Solution: Check the first non-empty line. (Kontra Gergely) +Files: runtime/filetype.vim + +Patch 6.1a.041 +Problem: When pressing the left mouse button in the command line and them + moving the mouse upwards, nearly all the text is selected. +Solution: Don't try extending a modeless selection when there isn't one. +Files: src/ui.c + +Patch 6.1a.042 +Problem: When merging files, ":diffput" and ":diffget" are used a lot, but + they require a lot of typing. +Solution: Add "dp" for ":diffput" and "do" for ":diffget". +Files: runtime/doc/diff.txt, src/diff.c, src/normal.c, src/proto/diff.pro + + +Patch 6.1b.001 (extra) +Problem: Checking for wildcards in a path does not handle multi-byte + characters with a trail byte which is a wildcard. +Solution: Handle multi-byte characters correctly. (Muraoka Taro) +Files: src/os_amiga.c, src/os_mac.c, src/os_msdos.c, src/os_mswin.c, + src/os_unix.c + +Patch 6.1b.002 +Problem: A regexp that ends in "\{" is not flagged as an error. May cause + a stack overflow when 'incsearch' is set. (Gerhard Hochholzer) +Solution: Handle a missing "}" as an error. +Files: src/regexp.c + +Patch 6.1b.003 (extra) +Problem: The RISC OS GUI doesn't compile. +Solution: Include changes since Vim 5.7. (Andy Wingate) +Files: src/Make_ro.mak, src/gui_riscos.c, src/os_riscos.c, + src/os_riscos.h, src/proto/gui_riscos.pro + +Patch 6.1b.004 +Problem: col("'>") returns a negative number for linewise selection. (Neil + Bird) +Solution: Don't add one to MAXCOL. +Files: src/eval.c + +Patch 6.1b.005 +Problem: Using a search pattern that causes an out-of-stack error while + 'hlsearch' is set keeps giving the hit-Enter prompt. + A search pattern that takes a long time delays typing when + 'incsearch' is set. +Solution: Stop 'hlsearch' highlighting when the regexp causes an error. + Stop searching for 'incsearch' when a character is typed. +Files: src/globals.h, src/message.c, src/screen.c, src/search.c, + src/vim.h + +Patch 6.1b.006 +Problem: When entering a composing character on the command line with + CTRL-V, the text isn't redrawn correctly. +Solution: Redraw the text under and after the cursor. +Files: src/ex_getln.c + +Patch 6.1b.007 +Problem: When the cursor is in the white space between two sentences, "dis" + deletes the first character of the following sentence, "das" + deletes a space after the sentence. +Solution: Backup the cursor one character in these situations. +Files: src/search.c + +Patch 6.1b.008 +Problem: *.xsl files are not recognized as xslt but xml. + Monk files are not recognized. +Solution: Delete the duplicate line for *.xsl. (Johannes Zellner) + Recognize monk files. +Files: runtime/filetype.vim + +Patch 6.1b.009 +Problem: Can't always compile small features and then adding eval feature, + "sandbox" is undefined. (Axel Kielhorn) +Solution: Always define "sandbox" when the eval feature is used. +Files: src/globals.h + +Patch 6.1b.010 (extra) +Problem: When compiling gvimext.cpp with MSVC 4.2 get a number of warnings. +Solution: Change "true" to "TRUE". (Walter Briscoe) +Files: GvimExt/gvimext.cpp + +Patch 6.1b.011 +Problem: When using a very long string for confirm(), can't quit the + displaying at the more prompt. (Hari Krishna Dara) +Solution: Jump to the end of the message to show the choices. +Files: src/message.c + +Patch 6.1b.012 +Problem: Multi-byte: When 'showbreak' is set and a double-wide character + doesn't fit at the right window edge the cursor gets stuck there. + Using cursor-left gets stuck when 'virtualedit' is set. (Eric + Long) +Solution: Fix the way the extra ">" character is counted when 'showbreak' is + set. Don't correct cursor for virtual editing on a double-wide + character. +Files: src/charset.c, src/edit.c + +Patch 6.1b.013 +Problem: A user command that partly matches with a buffer-local user + command and matches full with a global user command unnecessarily + gives an 'ambiguous command' error. +Solution: Find the full global match even after a partly local match. +Files: src/ex_docmd.c + +Patch 6.1b.014 +Problem: EBCDIC: switching mouse events off causes garbage on screen. + Positioning the cursor in the GUI causes garbage. +Solution: Insert an ESC in the terminal code. (Ralf Schandl) + Use "\b" instead of "\010" for KS_LE. +Files: src/os_unix.c, src/term.c + +Patch 6.1b.015 +Problem: Vimtutor has a typo. Get a warning for "tempfile" if it + doesn't exist. +Solution: Move a quote to the end of a line. (Max Ischenko) + Use "mktemp" first, more systems have it. +Files: src/vimtutor + +Patch 6.1b.016 +Problem: GTK: loading a fontset that works partly, Vim might hang or crash. +Solution: Avoid that char_width becomes zero. (Yasuhiro Matsumoto) +Files: src/gui_gtk_x11.c + +Patch 6.1b.017 +Problem: GUI: When using ":shell" and there is a beep, nothing happens. +Solution: Call vim_beep() to produce the beep from the shell. (Yasuhiro + Matsumoto) +Files: src/message.c + +Patch 6.1b.018 (depends on 6.1b.006) +Problem: When entering the encryption key, special keys may still reveal + the typed characters. +Solution: Make sure stars are used or nothing is shown in all cases. +Files: src/digraph.c, src/getchar.c, src/ex_getln.c + +Patch 6.1b.019 (depends on 6.1b.005) +Problem: A search pattern that takes a long time slows down typing when + 'incsearch' is set. +Solution: Pass SEARCH_PEEK to dosearch(). +Files: src/ex_getln.c + +Patch 6.1b.020 +Problem: When using the matchit plugin, "%" finds a match on the "end" of a + ":syntax region" command in Vim scripts. +Solution: Skip over ":syntax region" commands by setting b:match_skip. +Files: runtime/ftplugin/vim.vim + +Patch 6.1b.021 +Problem: when 'mousefocus' is set, CTRL-W CTRL-] sometimes doesn't warp the + pointer to the new window. (Robert Webb) +Solution: Don't reset need_mouse_correct when checking the timestamp of a + file. +Files: src/fileio.c + +Patch 6.1b.022 +Problem: With lots of folds "j" does not obey 'scrolloff' properly. + (Srinath Avadhanula) +Solution: Go to end of the fold before counting context lines. +Files: src/move.c + +Patch 6.1b.023 +Problem: On MS-Windows system() may cause checking timestamps, because Vim + looses and gains input focus, while this doesn't happen on Unix. +Solution: Don't check timestamps while system() is busy. +Files: src/ex_cmds2.c, src/fileio.c, src/globals.h, src/misc1.c + +Patch 6.1b.024 (extra) +Problem: Gettext 0.11 complains that "sjis" is not a standard name. +Solution: Use "cp932" instead. +Files: src/po/sjiscorr.c + +Patch 6.1b.025 (extra) +Problem: Win32: When closing gvim while it is minimized and has a changed + file, the file-changed dialog pops up in a corner of the screen. +Solution: Put the dialog in the middle of the screen. +Files: src/gui_w48.c + +Patch 6.1b.026 +Problem: When 'diffopt' contains 'iwhite' but not 'icase': differences in + case are not highlighted properly. (Gerhard Hochholzer) +Solution: Don't ignore case when ignoring white space differences. +Files: src/diff.c + +Patch 6.1b.027 +Problem: "vim --remote +" may cause a crash. +Solution: Check for missing file name argument. (Martin Kahlert) +Files: src/main.c + +Patch 6.1b.028 (extra) +Problem: Win16: Can't compile after patch 6.1b.025. +Solution: Add code specifically for Win16. (Vince Negri) +Files: src/gui_w48.c + +Patch 6.1b.029 +Problem: Win32: When a directory on an NTFS partition is read/execute (no + delete,modify,write) and the file has modify rights, trying to + write the file deletes it. Making the file read/write/execute + (not delete) solves it. (Mark Canup) +Solution: Use the Unix code to check for a writable directory. If not, then + make a backup copy and overwrite the file. +Files: src/fileio.c + +Patch 6.1b.030 (extra) +Problem: Mac: small mistake in the build script and prototypes. +Solution: Fix the build script and add the prototypes. (Axel Kielhorn) +Files: src/os_mac.build, src/gui_mac.c + +Patch 6.1b.031 (extra) +Problem: Win32 GUI: ":set guifont=*" doesn't set 'guifont' to the resulting + font name. (Vlad Sandrini) +Solution: Put the code back in gui_mch_init_font() to form the font name out + of the logfont. +Files: src/gui_w48.c + +Patch 6.1b.032 +Problem: Athena: Setting a color scheme before the GUI has started causes a + crash. (Todd Blumer) +Solution: Don't try using color names that haven't been set yet. +Files: src/gui_athena.c + +Patch 6.1b.033 +Problem: When using a count after a ":s" command may get ml_get errors. + (Dietmar Lang) +Solution: Check that the resulting range does not go past the end of the + buffer. +Files: src/ex_cmds.c + +Patch 6.1b.034 +Problem: After sourcing mswin.vim, when using <C-S-Right> after + auto-indenting and then <Del>, get warning for allocating + ridiculous amount of memory. (Dave Delgreco) +Solution: Adjust the start of the Visual area when deleting the auto-indent. +Files: src/edit.c + +Patch 6.1b.035 +Problem: When using evim, dropping a file on Vim and then double clicking + on a word, it is changed to "i". (Merlin Hansen) +Solution: Reset need_start_insertmode after editing the file. +Files: src/ex_docmd.c + + +============================================================================== +VERSION 6.2 *version-6.2* + +This section is about improvements made between version 6.1 and 6.2. + +This is mainly a bug-fix release. There are also a few new features. + +Main new features: +- Support for GTK 2. (Daniel Elstner) +- Support for editing Arabic text. (Nadim Shaikli & Isam Bayazidi) +- ":try" command and exception handling. (Servatius Brandt) +- Support for the neXtaw GUI toolkit (mostly like Athena). (Alexey Froloff) +- Cscope support for Win32. (Khorev Sergey) +- Support for PostScript printing in various 8-bit encodings. (Mike Williams) + + +Changed *changed-6.2* +------- + +Removed the scheme indent file, the internal Lisp indenting works well now. + +Moved the GvimEXt, OleVim and VisVim directories into the "src" directory. +This is more consistent with how xxd is handled. + +The VisVim.dll file is installed in the top directory, next to gvimext.dll, +instead of in a subdirectory "VisVim". Fixes that NSIS was uninstalling it +from the wrong directory. + +Removed the art indent file, it didn't do anything. + +submatch() returned line breaks with CR instead of LF. + +Changed the Win32 Makefiles to become more uniform and compile gvimext.dll. +(Dan Sharp) + +'cindent': Align a "//" comment with a "//" comment in a previous line. +(Helmut Stiegler) + +Previously only for xterm-like terminals parent widgets were followed to find +the title and icon label. Now do this for all terminal emulators. + +Made it possible to recognize backslashes for "%" matching. The 'M' flag in +'cpoptions' disables it. (Haakon Riiser) + +Removed the Make_tcc.mak makefile for Turbo C. It didn't work and we probably +can't make it work (the compiler runs out of memory). + +Even though the documentation refers to keywords, "[ CTRL-D" was using +'isident' to find matches. Changed it to use 'iskeyword'. Also applies to +other commands that search for defined words in included files such as +":dsearch", "[D" and "[d". + +Made 'keywordprg' global-local. (Christian Robinson) + +Enabled the Netbeans interface by default. Reversed the configure argument +from "--enable-netbeans" to "--disable-netbeans". + + +Added *added-6.2* +----- + +New options: + 'arabic' + 'arabicshape' + 'ambiwidth' + 'autochdir' + 'casemap' + 'copyindent' + 'cscopequickfix' + 'preserveindent' + 'printencoding' + 'rightleftcmd' + 'termbidi' + 'toolbariconsize' + 'winfixheight' + +New keymaps: + Serbian (Aleksandar Veselinovic) + Chinese Pinyin (Fredrik Roubert) + Esperanto (Antoine J. Mechelynck) + +New syntax files: + Valgrind (Roger Luethi) + Smarty template (Manfred Stienstra) + MySQL (Kenneth Pronovici) + RockLinux package description (Piotr Esden-Tempski) + MMIX (Dirk Huesken) + gkrellmrc (David Necas) + Tilde (Tobias Rundtrom) + Logtalk (Paulo Moura) + PLP (Juerd Waalboer) + fvwm2m4 (David Necas) + IPfilter (Hendrik Scholz) + fstab (Radu Dineiu) + Quake (Nikolai Weibull) + Occam (Mario Schweigler) + lpc (Shizhu Pan) + Exim conf (David Necas) + EDIF (Artem Zankovich) + .cvsrc (Nikolai Weibull) + .fetchmailrc (Nikolai Weibull) + GNU gpg (Nikolai Weibull) + Grub (Nikolai Weibull) + Modconf (Nikolai Weibull) + RCS (Dmitry Vasiliev) + Art (Dorai Sitaram) + Renderman Interface Bytestream (Andrew J Bromage) + Mailcap (Doug Kearns) + Subversion commit file (Dmitry Vasiliev) + Microsoft IDL (Vadim Zeitlin) + WildPackets EtherPeek Decoder (Christopher Shinn) + Spyce (Rimon Barr) + Resolv.conf (Radu Dineiu) + A65 (Clemens Kirchgatterer) + sshconfig and sshdconfig (David Necas) + Cheetah and HTMLCheetah (Max Ischenko) + Packet filter (Camiel Dobbelaar) + +New indent files: + Eiffel (David Clarke) + Tilde (Tobias Rundtrom) + Occam (Mario Schweigler) + Art (Dorai Sitaram) + PHP (Miles Lott) + Dylan (Brent Fulgham) + +New tutor translations: + Slovak (Lubos Celko) + Greek (Christos Kontas) + German (Joachim Hofmann) + Norwegian (yvind Holm) + +New filetype plugins: + Occam (Mario Schweigler) + Art (Dorai Sitaram) + ant.vim, aspvbs.vim, config.vim, csc.vim, csh.vim, dtd.vim, html.vim, + jsp.vim, pascal.vim, php.vim, sgml.vim, sh.vim, svg.vim, tcsh.vim, + xhtml.vim, xml.vim, xsd.vim. (Dan Sharp) + +New compiler plugins: + Checkstyle (Doug Kearns) + g77 (Ralf Wildenhues) + fortran (Johann-Guenter Simon) + Xmllint (Doug Kearns) + Ruby (Tim Hammerquist) + Modelsim vcom (Paul Baleme) + +New menu translations: + Brazilian (Jos de Paula) + British (Mike Williams) + Korean in UTF-8. (Nam SungHyun) + Norwegian (yvind Holm) + Serbian (Aleksandar Jelenak) + +New message translation for Norwegian. (yvind Holm) + +New color scheme: + desert (Hans Fugal) + +Arabic specific features. 'arabicshape', 'termbidi', 'arabic' and +'rightleftcmd' options. (Nadim Shaikli & Isam Bayazidi) + +Support for neXtaw GUI toolkit, mostly like Athena. (Alexey Froloff) + +Win32: cscope support. (Khorev Sergey) + +VMS: various improvements to documentation and makefiles. (Zoltan Arpadffy) + +Added "x" key to the explorer plugin: execute the default action. (Yasuhiro +Matsumoto) + +Compile gvimext.dll with MingW. (Rene de Zwart) + +Add the "tohtml.vim" plugin. It defines the ":TOhtml" user command, an easy +way to convert text to HTML. + +Added ":try" / ":catch" / ":finally" / ":endtry" commands. Add E999 numbers +to all error messages, so that they can be caught by the number. +(Servatius Brandt) +Moved part of ex_docmd.c to the new ex_eval.c source file. + +Include support for GTK+ 2.2.x (Daniel Elstner) +Adds the "~" register: drag & drop text. +Adds the 'toolbariconsize' option. +Add -Dalloca when running lint to work around a problem with alloca() +prototype. + +When selecting an item in the error window to jump to, take some effort to +find an ordinary window to show the file in (not a preview window). + +Support for PostScript printing of various 8-bit encodings. (Mike Williams) + +inputdialog() accepts a third argument that is used when the dialog is +cancelled. Makes it possible to see a difference between cancelling and +entering nothing. + +Included Aap recipes. Can be used to update Vim to the latest version, +building and installing. + +"/" option in 'cinoptions': extra indent for comment lines. (Helmut Stiegler) + +Vim variable "v:register" and functions setreg(), getreg() and getregtype(). +(Michael Geddes) + +"v" flag in 'cpoptions': Leave text on screen with backspace in Insert mode. +(Phillip Vandry) + +Dosinst.exe also finds gvimext.dll in the "GvimExt" directory. Useful when +running install in the "src" directory for testing. + +Support tag files that were sorted with case ignored. (Flemming Madsen) + +When completing a wildcard in a leading path element, as in "../*/Makefile", +only the last part ("Makefile") was listed. Support custom defined +command line completion. (Flemming Madsen) + +Also recognize "rxvt" as an xterm-like terminal. (Tomas Styblo) + +Proper X11 session management. Fixes that the WM_SAVE_YOURSELF event was not +used by popular desktops. (Neil Bird) +Not used for Gnome 2, it has its own handling. + +Support BOR, DEBUG and SPAWNO arguments for the Borland 3 Makefile. (Walter +Briscoe) + +Support page breaks for printing. Adds the "formfeed" field in +'printoptions'. (Mike Williams) + +Mac OSX: multi-language support: iconv and gettext. (Muraoka Taro, Axel +Kielhorn) + +"\Z" flag in patterns: ignore differences in combining characters. (Ron Aaron) + +Added 'preserveindent' and 'copyindent' options. They use existing white +space characters instead of using Tabs as much as possible. (Chris Leishman) + +Updated Unicode tables to Unicode 4.0. (Raphael Finkel) + +Support for the mouse wheel in rxvt. (AIDA Shinra) + +Win32: Added ":8" file modifier to get short filename. Test50 tests the ":8" +expansion on Win32 systems. (Michael Geddes) + +'cscopequickfix' option: Open quickfix window for Cscope commands. Also +cleanup the code for giving messages. (Khorev Sergey) + +GUI: Support more than 222 columns for mouse positions. + +":stopinsert" command: Don't return to Insert mode. + +"interrupt" command for debug mode. Useful for simulating CTRL-C. (Servatius +Brandt) + + +Fixed *fixed-6.2* +----- + +Removed a few unused #defines from config.h.in, os_os2_cfg.h and os_vms_conf.h. + +The Vim icons in PNG format didn't have a transparent background. (Greg +Roelofs) + +Fixed a large number of spelling mistakes in the docs. (Adri Verhoef) + +The #defines for prototype generation were causing trouble. Changed them to +typedefs. + +A new version of libintl.h uses __asm__, which confuses cproto. Define a +dummy __asm__ macro. + +When 'virtualedit' is set can't move to halfway an unprintable character. +Cripples CTRL-V selection. (Taro Muraoka) +Allow moving to halfway an unprintable character. Don't let getvvcol() change +the pos->coladd argument. + +When a tab wraps to the next line, 'listchars' is set and 'foldcolumn' is +non-zero, only one character of the foldcolumn is highlighted. (Muraoka Taro) + +When using ":catch" without an argument Vim crashes. (Yasuhiro Matsumoto) +When no argument given use the ".*" pattern. + +Win32: When gvim.exe is started from a shortcut with the window style property +set to maximize Vim doesn't start with a maximized window. (Yasuhiro +Matsumoto) Open the window with the default size and don't call ShowWindow() +again when it's already visible. (Helmut Stiegler) + +gui_gtk.c used MAX, but it's undefined to avoid a conflict with system header +files. + +Win32: When closing a window from a mapping some pixels remain on the +statusline. (Yasuhiro Matsumoto) + +A column number in an errorformat that goes beyond the end of the line may +cause a crash. + +":throw 'test'" crashes Vim. (Yasuhiro Matsumoto) + +The file selector's scrollbar colors are not set after doing a ":hi Scrollbar +guifg=color". And the file selector's colors are not changed by the +colorscheme command. (David Harrison) + +Motif: When compiling with FEAT_FOOTER defined, the text area gets a few +pixels extra space on the right. Remove the special case in +gui_get_base_width(). (David Harrison) + +Using CTRL-R CTRL-P in Insert mode puts the '] mark in the wrong position. +(Helmut Stiegler) + +When 'formatoptions' includes "awct" a non-comment wasn't auto-formatted. + +Using a "--cmd" argument more than 10 times caused a crash. + +DEC style mouse support didn't work if the page field is not empty. +(Uribarri) + +"vim -l one two" did only set 'lisp' in the first file. Vi does it for every +file. + +":set tw<" didn't work. Was checking for '^' instead of '<'. + +In ":hardcopy > %.ps" the "%" was not expanded to the current filename. + +Made ":redraw" also update the Visual area. + +When a not implemented command, such as ":perl", has wrong arguments the less +important error was reported, giving the user the idea the command could work. + +On non-Unix systems autocommands for writing did not attempt a match with the +short file name, causing a pattern like "a/b" to fail. + +VMS: e_screenmode was not defined and a few other fixes for VMS. (Zoltan +Arpadffy) + +redraw_msg() depended on FEAT_ARABIC instead of FEAT_RIGHTLEFT. (Walter +Briscoe) + +Various changes for the PC Makefiles. (Walter Briscoe) + +Use _truename() instead of our own code to expand a file name into a full +path. (Walter Briscoe) + +Error in filetype check for /etc/modutils. (Lubomir Host) + +Cscope interface: allocated a buffer too small. + +Win16: remove a trailing backslash from a path when obtaining the permission +flags. (Vince Negri) + +When searching for tags with case ignored Vim could hang. + +When searching directories with a stopdir could get a crash. Did not +re-allocate enough memory. (Vince Negri) + +A user command may cause a crash. Don't use the command index when it's +negative. (Vince Negri) + +putenv() didn't work for MingW and Cygwin. (Dan Sharp) + +Many functions were common between os_msdos.c and os_win16.c. Use os_msdos.c +for compiling the Win16 version and remove the functions from os_win16.c. +(Vince Negri) + +For terminals that behave like an xterm but didn't have a name that is +recognized, the window title would not always be set. + +When syntax highlighting is off ":hardcopy" could still attempt printing +colors. + +Crash when using ":catch" without an argument. (Servatius Brandt) + +Win32: ":n #" doubled the backslashes. + +Fixed Arabic shaping for the command line. (Nadim Shaikli) + +Avoid splitting up a string displayed on the command line into individual +characters, it breaks Arabic shaping. + +Updated Cygwin and MingW makefiles to use more dependencies. (Dan Sharp) + +2html.vim didn't work with 'nomagic' set. + +When a local argument list is used and doing ":only" Vim could crash later. +(Muraoka Taro) + +When using "%P" in 'statusline' and the fillchar is "-", a percentage of 3% +could result in "-3%". Also avoid changing a space inside a filename to the +fill character. + +MSwin: Handling of backslashes and double quotes for command line arguments +was not like what other applications do. (Walter Briscoe) + +Test32 sometimes didn't work, because test11.out was written as TEST11.OUT. + +Avoid pointer conversions warnings for Borland C 5.5 in dosinst.c and +uninstal.c. + +More improvements for Make_bc3.mak file. (Walter Briscoe) + +When ":syn sync linebreaks=1" is used, editing the first line caused a redraw +of the whole screen. + +Making translated messages didn't work, if_perl.xs wasn't found. (Vlad +Sandrini) + +Motif and Athena: moving Vim to the foreground didn't uniconify it. Use +XMapRaised() instead of XRaiseWindow(). (Srikanth Sankaran) + +When using ":ptag" in a window where 'scrollbind' is set the preview window +would also have 'scrollbind' set. Also reset 'foldcolumn' and 'diff'. + +Various commands that split a window took over 'scrollbind', which is hardly +ever desired. Esp. for "q:" and ":copen". Mostly reset 'scrollbind' when +splitting a window. + +When 'shellslash' is set in the vimrc file the first entry of ":scriptnames" +would still have backslashes. Entries in the quickfix list could also have +wrong (back)slashes. + +Win32: printer dialog texts were not translated. (Yasuhiro Matsumoto) + +When using a multi-byte character with a K_SPECIAL byte or a special key code +with "--remote-send" the received byte sequence was mangled. Put it in the +typeahead buffer instead of the input buffer. + +Win32: The cursor position was incorrect after changing cursor shape. +(Yasuhiro Matsumoto). + +Win32: When 'encoding' is not the current codepage the title could not be set +to non-ascii characters. + +"vim -d scp://machine/file1 scp://machine/file2" did not work, there was only +one window. Fixed the netrw plugin not to wipe out the buffer if it is +displayed in other windows. + +"/$" caused "e" in last column of screen to disappear, a highlighted blank was +displayed instead. + +":s/ *\ze\n//e" removed the line break and introduced arbitrary text. Was +using the line count including what matched after the "\ze". + +Using the "c" flag with ":s" changed the behavior when a line break is +replaced and "\@<=" is used. Without "c" a following match was not found. + +":%s/\vA@<=\nB@=//gce" got stuck on "A\nB" when entering "n". + +VMS: add HAVE_STRFTIME in the config file. (Zoltan Arpadffy) + +When a delete prompts if a delete should continue when yanking is not +possible, restore msg_silent afterwards. + +":sign" did not complain about a missing argument. + +When adding or deleting a sign 'hlsearch' highlighting could disappear. +Use the generic functions for updating signs. + +On MS-Windows NT, 2K and XP don't use command.com but cmd.exe for testing. +Makes the tests work on more systems. + +In the DOS tests don't create "/tmp" to avoid an error. + +Mac classic: Problems with reading files with CR vs CR/LF. Rely on the +library version of fgets() to work correctly for Metrowerks 2.2. (Axel +Kielhorn) + +When typing a password a "*" was shown for each byte instead of for each +character. Added multi-byte handling to displaying the stars. (Yasuhiro +Matsumoto) + +When using Perl 5.6 accessing $curbuf doesn't work. Add an #ifdef to use +different code for 5.6 and 5.8. (Dan Sharp) + +MingW and Cygwin: Don't strip the debug executable. (Dan Sharp) + +An assignment to a variable with curlies that includes "==" doesn't work. +Skip over the curlies before searching for an "=". (Vince Negri) + +When cancelling the selection of alternate matching tags the tag stack index +could be advanced too far, resulting in an error message when using CTRL-T. + + +Patch 6.1.001 +Problem: When formatting UTF-8 text it might be wrapped at a space that is + followed by a composing character. (Raphael Finkel) + Also correct a display error for removing a composing char on top + of a space. +Solution: Check for a composing character on a space. +Files: src/edit.c, src/misc1.c, src/screen.c + +Patch 6.1.002 (extra) +Problem: Win32: after a ":popup" command the mouse pointer stays hidden. +Solution: Unhide the mouse pointer before showing the menu. +Files: src/gui_w48.c + +Patch 6.1.003 +Problem: When 'laststatus' is zero and there is a vertical split, the + vertical separator is drawn in the command line. (Srikant + Sankaran) +Solution: Don't draw the vertical separator where there is no statusline. +Files: src/screen.c + +Patch 6.1.004 +Problem: Unicode 3.2 changes width and composing of a few characters. + (Markus Kuhn) +Solution: Adjust the Unicode functions for the character width and composing + characters. +Files: src/mbyte.c + +Patch 6.1.005 +Problem: When using more than 50 items in 'statusline' Vim might crash. + (Steve Hall) +Solution: Increment itemcnt in check_stl_option(). (Flemming Madsen) +Files: src/option.c + +Patch 6.1.006 +Problem: When using "P" in Visual mode to put linewise selected text, the + wrong text is deleted. (Jakub Turski) +Solution: Put the text before the Visual area and correct the text to be + deleted for the inserted lines. + Also fix that "p" of linewise text in Visual block mode doesn't + work correctly. +Files: src/normal.c, src/ops.c + +Patch 6.1.007 +Problem: Using ":filetype plugin off" when filetype plugins were never + enabled causes an error message. (Yiu Wing) +Solution: Use ":silent!" to avoid the error message. +Files: runtime/ftplugof.vim + +Patch 6.1.008 +Problem: The "%" command doesn't ignore \" inside a string, it's seen as + the end of the string. (Ken Clark) +Solution: Skip a double quote preceded by an odd number of backslashes. +Files: src/search.c + +Patch 6.1.009 +Problem: Vim crashes when using a huge number for the maxwid value in a + statusline. (Robert M. Nowotniak) +Solution: Check for an overflow that makes maxwid negative. +Files: src/buffer.c + +Patch 6.1.010 +Problem: Searching backwards for a question mark with "?\?" doesn't work. + (Alan Isaac) Same problem in ":s?\??" and ":g?\??". +Solution: Change the "\?" in a pattern to "?" when using "?" as delimiter. +Files: src/ex_cmds.c, src/ex_docmd.c, src/proto/regexp.pro, src/regexp.c, + src/search.c, src/syntax.c, src/tag.c + +Patch 6.1.011 +Problem: XIM: doesn't work correctly when 'number' is set. Also, a focus + problem when selecting candidates. +Solution: Fix the XIM problems. (Yasuhiro Matsumoto) +Files: src/mbyte.c, src/screen.c + +Patch 6.1.012 +Problem: A system() call might fail if fread() does CR-LF to LF + translation. +Solution: Open the output file in binary mode. (Pavol Huhas) +Files: src/misc1.c + +Patch 6.1.013 +Problem: Win32: The default for 'printexpr' doesn't work when there are + special characters in 'printdevice'. +Solution: Add double quotes around the device name. (Mike Williams) +Files: runtime/doc/option.txt, src/option.c + +Patch 6.1.014 +Problem: An operator like "r" used in Visual block mode doesn't use + 'virtualedit' when it's set to "block". +Solution: Check for 'virtualedit' being active in Visual block mode when the + operator was started. +Files: src/ex_docmd.c, src/globals.h, src/misc2.c, src/normal.c, + src/ops.c, src/undo.c + +Patch 6.1.015 +Problem: After patch 6.1.014 can't compile with tiny features. (Christian + J. Robinson) +Solution: Add the missing define of virtual_op. +Files: src/vim.h + +Patch 6.1.016 (extra) +Problem: Win32: Outputting Hebrew or Arabic text might have a problem with + reversing. +Solution: Replace the RevOut() function with ETO_IGNORELANGUAGE. (Ron Aaron) +Files: src/gui_w32.c + +Patch 6.1.017 +Problem: Cygwin: After patch 6.1.012 Still doesn't do binary file I/O. + (Pavol Juhas) +Solution: Define BINARY_FILE_IO for Cygwin. +Files: src/os_unix.h + +Patch 6.1.018 +Problem: Error message when using cterm highlighting. (Leonardo Di Lella) +Solution: Remove a backslash before a question mark. +Files: runtime/syntax/cterm.vim + +Patch 6.1.019 (extra) +Problem: Win32: File name is messed up when editing just a drive name. + (Walter Briscoe) +Solution: Append a NUL after the drive name. (Vince Negri) +Files: src/os_win32.c + +Patch 6.1.020 +Problem: col("'>") returns a huge number after using Visual line mode. +Solution: Return the length of the line instead. +Files: src/eval.c + +Patch 6.1.021 (depends on patch 6.1.009) +Problem: Vim crashes when using a huge number for the minwid value in a + statusline. (Robert M. Nowotniak) +Solution: Check for an overflow that makes minwid negative. +Files: src/buffer.c + +Patch 6.1.022 +Problem: Grabbing the status line above the command-line window works like + the bottom status line was grabbed. (Jim Battle) +Solution: Make it possible to grab the status line above the command-line + window, so that it can be resized. +Files: src/ui.c + +Patch 6.1.023 (extra) +Problem: VMS: running tests doesn't work properly. +Solution: Adjust the makefile. (Zoltan Arpadffy) +Files: src/testdir/Make_vms.mms + +Patch 6.1.024 +Problem: When header files use a new syntax for declaring functions, Vim + can't figure out missing prototypes properly. +Solution: Accept braces around a function name. (M. Warner Losh) +Files: src/osdef.sh + +Patch 6.1.025 +Problem: Five messages for "vim --help" don't start with a capital. (Vlad + Sandrini) +Solution: Make the messages consistent. +Files: src/main.c + +Patch 6.1.026 +Problem: *.patch files are not recognized as diff files. In a script a + "VAR=val" argument after "env" isn't ignored. PHP scripts are not + recognized. +Solution: Add *.patch for diff filetypes. Ignore "VAR=val". Recognize PHP + scripts. (Roman Neuhauser) +Files: runtime/filetype.vim, runtime/scripts.vim + +Patch 6.1.027 +Problem: When 'foldcolumn' is non-zero, a special character that wraps to + the next line disturbs the foldcolumn highlighting. (Yasuhiro + Matsumoto) +Solution: Only use the special highlighting when drawing text characters. +Files: src/screen.c + +Patch 6.1.028 +Problem: Client-server: When a --remote-expr fails, Vim still exits with + status zero. +Solution: Exit Vim with a non-zero status to indicate the --remote-expr + failed. (Thomas Scott Urban) +Files: src/main.c + +Patch 6.1.029 +Problem: When 'encoding' is an 8-bit encoding other than "latin1", editing + a utf-8 or other Unicode file uses the wrong conversion. (Jan + Fedak) +Solution: Don't use Unicode to latin1 conversion for 8-bit encodings other + than "latin1". +Files: src/fileio.c + +Patch 6.1.030 +Problem: When CTRL-N is mapped in Insert mode, it is also mapped after + CTRL-X CTRL-N, while it is not mapped after CTRL-X CTRL-F. + (Kontra Gergely) +Solution: Don't map CTRL-N after CTRL-X CTRL-N. Same for CTRL-P. +Files: src/getchar.c + +Patch 6.1.031 +Problem: Cygwin: Xxd could read a file in text mode instead of binary mode. +Solution: Use "rb" or "rt" when needed. (Pavol Juhas) +Files: src/xxd/xxd.c + +Patch 6.1.032 +Problem: Can't specify a quickfix file without jumping to the first error. +Solution: Add the ":cgetfile" command. (Yegappan Lakshmanan) +Files: runtime/doc/index.txt, runtime/doc/quickfix.txt, src/ex_cmds.h, + src/quickfix.c + +Patch 6.1.033 +Problem: GUI: When the selection is lost and the Visual highlighting is + changed to underlining, the cursor is left in a different + position. (Christian Michon) +Solution: Update the cursor position after redrawing the selection. +Files: src/ui.c + +Patch 6.1.034 +Problem: A CVS diff file isn't recognized as diff filetype. +Solution: Skip lines starting with "? " before checking for an "Index:" line. +Files: runtime/scripts.vim + +Patch 6.1.035 (extra, depends on 6.1.016) +Problem: Win32: Outputting Hebrew or Arabic text might have a problem with + reversing on MS-Windows 95/98/ME. +Solution: Restore the RevOut() function and use it in specific situations + only. (Ron Aaron) +Files: src/gui_w32.c + +Patch 6.1.036 +Problem: This command may cause a crash: ":v/./,//-j". (Ralf Arens) +Solution: Compute the right length of the regexp when it's empty. +Files: src/search.c + +Patch 6.1.037 +Problem: When 'lazyredraw' is set, pressing "q" at the hit-enter prompt + causes an incomplete redraw and the cursor isn't positioned. + (Lubomir Host) +Solution: Overrule 'lazyredraw' when do_redraw is set. +Files: src/main.c, src/screen.c + +Patch 6.1.038 +Problem: Multi-byte: When a ":s" command contains a multi-byte character + where the trail byte is '~' the text is messed up. +Solution: Properly skip multi-byte characters in regtilde() (Muraoka Taro) +Files: src/regexp.c + +Patch 6.1.039 +Problem: When folds are defined and the file is changed outside of Vim, + reloading the file doesn't update the folds. (Anders + Schack-Nielsen) +Solution: Recompute the folds after reloading the file. +Files: src/fileio.c + +Patch 6.1.040 +Problem: When changing directory for expanding a file name fails there is + no error message. +Solution: Give an error message for this situation. Don't change directory + if we can't return to the original directory. +Files: src/diff.c, src/ex_docmd.c, src/globals.h, src/misc1.c, + src/os_unix.c + +Patch 6.1.041 +Problem: ":mkvimrc" doesn't handle a mapping that has a leading space in + the rhs. (Davyd Ondrejko) +Solution: Insert a CTRL-V before the leading space. Also display leading + and trailing white space in <> form. +Files: src/getchar.c, src/message.c + +Patch 6.1.042 +Problem: "vim -r" doesn't show all matches when 'wildignore' removes swap + files. (Steve Talley) +Solution: Keep all matching swap file names. +Files: src/memline.c + +Patch 6.1.043 +Problem: After patch 6.1.040 a few warnings are produced. +Solution: Add a type cast to "char *" for mch_chdir(). (Axel Kielhorn) +Files: src/diff.c, src/ex_docmd.c.c, src/misc1.c, src/os_unix.c + +Patch 6.1.044 (extra) +Problem: GUI: When using the find/replace dialog with text that contains a + slash, an invalid substitute command is generated. + On Win32 a find doesn't work when 'insertmode' is set. +Solution: Escape slashes with a backslash. + Make the Win32, Motif and GTK gui use common code for the + find/replace dialog. + Add the "match case" option for Motif and GTK. +Files: src/feature.h, src/proto/gui.pro, src/gui.c, src/gui.h, + src/gui_motif.c, src/gui_gtk.c, src/gui_w48.c + +Patch 6.1.045 +Problem: In Visual mode, with lots of folds and 'scrolloff' set to 999, + moving the cursor down near the end of the file causes the text to + jump up and down. (Lubomir Host) +Solution: Take into account that the cursor may be on the last line of a + closed fold. +Files: src/move.c + +Patch 6.1.046 +Problem: X11 GUI: ":set lsp=2 gcr=n-v-i:hor1-blinkon0" draws a black + rectangle. ":set lsp=2 gcr=n-v-i:hor10-blinkon0" makes the cursor + disappear. (Nam SungHyun) +Solution: Correctly compute the height of the horizontal cursor. +Files: src/gui_gtk_x11.c, src/gui_x11.c + +Patch 6.1.047 +Problem: When skipping commands after an error was encountered, expressions + for ":if", ";elseif" and ":while" are still evaluated. +Solution: Skip the expression after an error. (Servatius Brandt) +Files: src/ex_docmd.c + +Patch 6.1.048 +Problem: Unicode 3.2 changes were missing a few Hangul Jamo characters. +Solution: Recognize more characters as composing characters. (Jungshik Shin) +Files: src/mbyte.c + +Patch 6.1.049 (extra) +Problem: On a 32 bit display a valid color may cause an error message, + because its pixel value is negative. (Chris Paulson-Ellis) +Solution: Check for -11111 instead of the color being negative. + Don't add one to the pixel value, -1 may be used for white. +Files: src/globals.h, src/gui.c, src/gui.h, src/gui_amiga.c, + src/gui_athena.c, src/gui_beos.cc, src/gui_gtk_x11.c, + src/gui_mac.c, src/gui_motif.c, src/gui_photon.c, + src/gui_riscos.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c, + src/gui_x11.c, src/mbyte.c, src/syntax.c + +Patch 6.1.050 (depends on 6.1.049) +Problem: After patch 6.1.049 the non-GUI version doesn't compile. +Solution: Add an #ifdef FEAT_GUI. (Robert Stanton) +Files: src/syntax.c + +Patch 6.1.051 (depends on 6.1.044) +Problem: Doesn't compile with GUI and small features. +Solution: Adjust the #if for ga_append(). +Files: src/misc2.c + +Patch 6.1.052 +Problem: Unix: The executable() function doesn't work when the "which" + command isn't available. +Solution: Go through $PATH manually. Also makes it work for VMS. +Files: src/os_unix.c + +Patch 6.1.053 +Problem: When 'sessionoptions' contains "globals", or "localoptions" and an + option value contains a line break, the resulting script is wrong. +Solution: Use "\n" and "\r" for a line break. (Srinath Avadhanula) +Files: src/eval.c + +Patch 6.1.054 +Problem: GUI: A mouse click is not recognized at the more prompt, even when + 'mouse' includes 'r'. +Solution: Recognize a mouse click at the more prompt. + Also accept a mouse click in the last line in the GUI. + Add "ml" entry in 'mouseshape'. +Files: src/gui.c, src/message.c, src/misc1.c, src/misc2.c, src/option.c, + src/structs.h + +Patch 6.1.055 +Problem: When editing a compressed file, Vim will inspect the contents to + guess the filetype. +Solution: Don't source scripts.vim for .Z, .gz, .bz2, .zip and .tgz files. +Files: runtime/filetype.vim, runtime/plugin/gzip.vim + +Patch 6.1.056 +Problem: Loading the Syntax menu can take quite a bit of time. +Solution: Add the "skip_syntax_sel_menu" variable. When it's defined the + available syntax files are not in the Syntax menu. +Files: runtime/doc/gui.txt, runtime/menu.vim + +Patch 6.1.057 +Problem: An ESC inside a mapping doesn't work as documented when + 'insertmode' is set, it does go from Visual or Normal mode to + Insert mode. (Benji Fisher) +Solution: Make it work as documented. +Files: src/normal.c + +Patch 6.1.058 +Problem: When there is a closed fold just above the first line in the + window, using CTRL-X CTRL-Y in Insert mode will show only one line + of the fold. (Alexey Marinichev) +Solution: Correct the topline by putting it at the start of the fold. +Files: src/move.c + +Patch 6.1.059 +Problem: ":redir > ~/file" doesn't work. (Stephen Rasku) +Solution: Expand environment variables in the ":redir >" argument. +Files: src/ex_docmd.c + +Patch 6.1.060 +Problem: When 'virtualedit' is set and 'selection' is "exclusive", deleting + a character just before a tab changes the tab into spaces. Undo + doesn't restore the tab. (Helmut Stiegler) +Solution: Don't replace the tab by spaces when it's not needed. Correctly + save the line before it's changed. +Files: src/ops.c + +Patch 6.1.061 +Problem: When 'virtualedit' is set and 'selection' is "exclusive", a Visual + selection that ends just after a tab doesn't include that tab in + the highlighting. (Helmut Stiegler) +Solution: Use a different way to exclude the character under the cursor. +Files: src/screen.c + +Patch 6.1.062 +Problem: The "man" filetype plugin doesn't work properly on Solaris 5. +Solution: Use a different way to detect that "man -s" should be used. (Hugh + Sasse) +Files: runtime/ftplugin/man.vim + +Patch 6.1.063 +Problem: Java indenting doesn't work properly. +Solution: Ignore comments when checking if the indent doesn't increase after + a "}". +Files: runtime/indent/java.vim + +Patch 6.1.064 +Problem: The URLs that the netrw plugin recognized for ftp and rcp did not + conform to the standard method://[user@]host[:port]/path. +Solution: Use ftp://[user@]host[[:#]port]/path, which supports both the new + and the previous style. Also added a bit of dav/cadaver support. + (Charles Campbell) +Files: runtime/plugin/netrw.vim + +Patch 6.1.065 +Problem: VMS: The colorscheme, keymap and compiler menus are not filled in. +Solution: Ignore case when looking for ".vim" files. (Coen Engelbarts) +Files: runtime/menu.vim + +Patch 6.1.066 (extra) +Problem: When calling system() in a plugin reading stdin hangs. +Solution: Don't set the terminal to RAW mode when it wasn't in RAW mode + before the system() call. +Files: src/os_amiga.c, src/os_msdos.c, src/os_riscos.c, src/os_unix.c, + src/os_win16.c, src/os_win32.c + +Patch 6.1.067 +Problem: ":set viminfo+=f0" is not working. (Benji Fisher) +Solution: Check the "f" flag instead of "'" in 'viminfo'. +Files: src/mark.c + +Patch 6.1.068 +Problem: When a file is reloaded after it was changed outside of Vim, diff + mode isn't updated. (Michael Naumann) +Solution: Invalidate the diff info so that it's updated when needed. +Files: src/fileio.c + +Patch 6.1.069 +Problem: When 'showmatch' is set and "$" is in 'cpoptions', using + "C}<Esc>" may forget to remove the "$". (Preben Guldberg) +Solution: Restore dollar_vcol after displaying the matching cursor position. +Files: src/search.c + +Patch 6.1.070 (depends on 6.1.060) +Problem: Compiler warning for signed/unsigned mismatch. (Mike Williams) +Solution: Add a typecast to int. +Files: src/ops.c + +Patch 6.1.071 +Problem: When 'selection' is exclusive, g CTRL-G in Visual mode counts one + character too much. (David Necas) +Solution: Subtract one from the end position. +Files: src/ops.c + +Patch 6.1.072 +Problem: When a file name in a tags file starts with http:// or something + else for which there is a BufReadCmd autocommand, the file isn't + opened anyway. +Solution: Check if there is a matching BufReadCmd autocommand and try to + open the file. +Files: src/fileio.c, src/proto/fileio.pro, src/tag.c + +Patch 6.1.073 (extra) +Problem: BC5: Can't easily specify a tiny, small, normal, big or huge + version. +Solution: Allow selecting the version with the FEATURES variable. (Ajit + Thakkar) +Files: src/Make_bc5.mak + +Patch 6.1.074 +Problem: When 'cdpath' includes "../..", changing to a directory in which + we currently already are doesn't work. ff_check_visited() adds + the directory both when using it as the root for searching and for + the actual matches. (Stephen Rasku) +Solution: Use a separate list for the already searched directories. +Files: src/misc2.c + +Patch 6.1.075 (depends on 6.1.072) +Problem: Can't compile fileio.c on MS-Windows. +Solution: Add a declaration for the "p" pointer. (Madoka Machitani) +Files: src/fileio.c + +Patch 6.1.076 (extra) +Problem: Macintosh: explorer plugin doesn't work on Mac Classic. + IME doesn't work. Dialog boxes don't work on Mac OS X +Solution: Fix explorer plugin and key modifiers. (Axel Kielhorn) + Fix IME support. (Muraoka Taro) + Disable dialog boxes. (Benji Fisher) +Files: src/edit.c, src/feature.h, src/gui_mac.c, src/os_mac.c + +Patch 6.1.077 +Problem: On a Debian system with ACL linking fails. (Lubomir Host) +Solution: When the "acl" library is used, check if the "attr" library is + present and use it. +Files: src/auto/configure, src/configure.in, src/link.sh + +Patch 6.1.078 +Problem: When using 'foldmethod' "marker" and the end marker appears before + the start marker in the file, no fold is found. (Nazri Ramliy) +Solution: Don't let the fold depth go negative. +Files: src/fold.c + +Patch 6.1.079 +Problem: When using "s" in Visual block mode with 'virtualedit' set, when + the selected block is after the end of some lines the wrong text + is inserted and some lines are skipped. (Servatius Brandt) +Solution: Insert the right text and extend short lines. +Files: src/ops.c + +Patch 6.1.080 +Problem: When using gcc with /usr/local already in the search path, adding + it again causes problems. +Solution: Adjust configure.in to avoid adding /usr/local/include and + /usr/local/lib when using GCC and they are already used. (Johannes + Zellner) +Files: src/auto/configure, src/configure.in + +Patch 6.1.081 +Problem: ":help CTRL-\_CTRL-N" doesn't work. (Christian J. Robinson) +Solution: Double the backslash to avoid the special meaning of "\_". +Files: src/ex_cmds.c + +Patch 6.1.082 +Problem: On MS-Windows the vimrc_example.vim script is sourced and then + mswin.vim. This enables using select mode, but since "p" is + mapped it doesn't replace the selection. +Solution: Remove the mapping of "p" from vimrc_example.vim, it's obsolete. + (Vlad Sandrini) +Files: runtime/vimrc_example.vim + +Patch 6.1.083 +Problem: When $LANG is "sk" or "sk_sk", the Slovak menu file isn't found. + (Martin Lacko) +Solution: Guess the right menu file based on the system. +Files: runtime/lang/menu_sk_sk.vim + +Patch 6.1.084 (depends on 6.1.080) +Problem: "include" and "lib" are mixed up when checking the directories gcc + already searches. +Solution: Swap the variable names. (SunHo Kim) +Files: src/auto/configure, src/configure.in + +Patch 6.1.085 +Problem: When using CTRL-O CTRL-\ CTRL-N from Insert mode, the displayed + mode "(insert)" isn't removed. (Benji Fisher) +Solution: Clear the command line. +Files: src/normal.c + +Patch 6.1.086 (depends on 6.1.049) +Problem: The guifg color for CursorIM doesn't take effect. +Solution: Use the foreground color when it's defined. (Muraoka Taro) +Files: src/gui.c + +Patch 6.1.087 +Problem: A thesaurus with Japanese characters has problems with characters + in different word classes. +Solution: Only separate words with single-byte non-word characters. + (Muraoka Taro) +Files: src/edit.c + +Patch 6.1.088 (extra) +Problem: Win32: no debugging info is generated. Tags file excludes .cpp + files. +Solution: Add "/map" to compiler flags. Add "*.cpp" to ctags command. + (Muraoka Taro) +Files: src/Make_mvc.mak + +Patch 6.1.089 +Problem: On BSDI systems there is no ss_sp field in stack_t. (Robert Jan) +Solution: Use ss_base instead. +Files: src/auto/configure, src/configure.in, src/config.h.in, + src/os_unix.c + +Patch 6.1.090 +Problem: CTRL-F gets stuck when 'scrolloff' is non-zero and there is a mix + of long wrapping lines and a non-wrapping line. +Solution: Check that CTRL-F scrolls at least one line. +Files: src/move.c + +Patch 6.1.091 +Problem: GTK: Can't change preeditstate without setting 'imactivatekey'. +Solution: Add some code to change preeditstate for OnTheSpot. (Yasuhiro + Matsumoto) +Files: src/mbyte.c + +Patch 6.1.092 +Problem: ":mapclear <buffer>" doesn't work. (Srikanth Adayapalam) +Solution: Allow an argument for ":mapclear". +Files: src/ex_cmds.h + +Patch 6.1.093 (extra) +Problem: Mac and MS-Windows GUI: when scrolling while ":s" is working the + results can be messed up, because the cursor is moved. +Solution: Disallow direct scrolling when not waiting for a character. +Files: src/gui_mac.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c + +Patch 6.1.094 +Problem: Cygwin: Passing a file name that has backslashes isn't handled + very well. +Solution: Convert file name arguments to Posix. (Chris Metcalf) +Files: src/main.c + +Patch 6.1.095 +Problem: When using signs can free an item on the stack. + Overruling sign colors doesn't work. (Srikanth Sankaran) +Solution: Don't free the item on the stack. Use NULL instead of "none" for + the value of the color. +Files: src/gui_x11.c + +Patch 6.1.096 +Problem: When erasing the right halve of a double-byte character, it may + cause further characters to be erased. (Yasuhiro Matsumoto) +Solution: Make sure only one character is erased. +Files: src/screen.c + +Patch 6.1.097 (depends on 6.1.090) +Problem: When 'scrolloff' is set to a huge value, CTRL-F at the end of the + file scrolls one line. (Lubomir Host) +Solution: Don't scroll when CTRL-F detects the end-of-file. +Files: src/move.c + +Patch 6.1.098 +Problem: MS-Windows: When the xxd program is under "c:\program files" the + "Convert to Hex" menu doesn't work. (Brian Mathis) +Solution: Put the path to xxd in double quotes. +Files: runtime/menu.vim + +Patch 6.1.099 +Problem: Memory corrupted when closing a fold with more than 99999 lines. +Solution: Allocate more space for the fold text. (Walter Briscoe) +Files: src/eval.c + +Patch 6.1.100 (extra, depends on 6.1.088) +Problem: Win32: VC5 and earlier don't support the /mapinfo option. +Solution: Add "/mapinfo" only when "MAP=lines" is specified. (Muraoka Taro) +Files: src/Make_mvc.mak + +Patch 6.1.101 +Problem: After using ":options" the tabstop of a new window is 15. Entry + in ":options" window for 'autowriteall' is wrong. (Antoine J + Mechelynck) Can't insert a space in an option value. +Solution: Use ":setlocal" instead of ":set". Change "aw" to "awa". + Don't map space in Insert mode. +Files: runtime/optwin.vim + +Patch 6.1.102 +Problem: Unprintable and multi-byte characters in a statusline item are not + truncated correctly. (Yasuhiro Matsumoto) +Solution: Count the width of characters instead of the number of bytes. +Files: src/buffer.c + +Patch 6.1.103 +Problem: A function returning from a while loop, with 'verbose' set to 12 + or higher, doesn't mention the return value. A function with the + 'abort' attribute may return -1 while the verbose message says + something else. +Solution: Move the verbose message about returning from a function to + call_func(). (Servatius Brandt) +Files: src/eval.c + +Patch 6.1.104 +Problem: GCC 3.1 appears to have an optimizer problem that makes test 3 + crash. +Solution: For GCC 3.1 add -fno-strength-reduce to avoid the optimizer bug. + Filter out extra info from "gcc --version". +Files: src/auto/configure, src/configure.in + +Patch 6.1.105 +Problem: Win32: The default for 'shellpipe' doesn't redirect stderr. (Dion + Nicolaas) +Solution: Redirect stderr, depending on the shell (like for 'shellredir'). +Files: src/option.c + +Patch 6.1.106 +Problem: The maze program crashes. +Solution: Change "11" to "27" and it works. (Greg Roelofs) +Files: runtime/macros/maze/mazeansi.c + +Patch 6.1.107 +Problem: When 'list' is set the current line in the error window may be + displayed wrong. (Muraoka Taro) +Solution: Don't continue the line after the $ has been displayed and the + rightmost column is reached. +Files: src/screen.c + +Patch 6.1.108 +Problem: When interrupting a filter command such as "!!sleep 20" the file + becomes read-only. (Mark Brader) +Solution: Only set the read-only flag when opening a buffer is interrupted. + When the shell command was interrupted, read the output that was + produced so far. +Files: src/ex_cmds.c, src/fileio.c + +Patch 6.1.109 +Problem: When 'eadirection' is "hor", using CTRL-W = doesn't equalize the + window heights. (Roman Neuhauser) +Solution: Ignore 'eadirection' for CTRL-W = +Files: src/window.c + +Patch 6.1.110 +Problem: When using ":badd file" when "file" is already present but not + listed, it stays unlisted. (David Frey) +Solution: Set 'buflisted'. +Files: src/buffer.c + +Patch 6.1.111 +Problem: It's not possible to detect using the Unix sources on Win32 or Mac. +Solution: Add has("macunix") and has("win32unix"). +Files: runtime/doc/eval.txt, src/eval.c + +Patch 6.1.112 +Problem: When using ":argdo", ":bufdo" or ":windo", CTRL-O doesn't go to + the cursor position from before this command but every position + where the argument was executed. +Solution: Only remember the cursor position from before the ":argdo", + ":bufdo" and ":windo". +Files: src/ex_cmds2.c, src/mark.c + +Patch 6.1.113 +Problem: ":bufdo bwipe" only wipes out half the buffers. (Roman Neuhauser) +Solution: Decide what buffer to go to next before executing the command. +Files: src/ex_cmds2.c + +Patch 6.1.114 +Problem: ":python import vim", ":python vim.current.buffer[0:0] = []" gives + a lalloc(0) error. (Chris Southern) +Solution: Don't allocate an array when it's size is zero. +Files: src/if_python.c + +Patch 6.1.115 +Problem: "das" on the white space at the end of a paragraph does not delete + the "." the sentence ends with. +Solution: Don't exclude the last character when it is not white space. +Files: src/search.c + +Patch 6.1.116 +Problem: When 'endofline' is changed while 'binary' is set a file should be + considered modified. (Olaf Buddenhagen) +Solution: Remember the 'eol' value when editing started and consider the + file changed when the current value is different and 'binary' is + set. Also fix that the window title isn't updated when 'ff' or + 'bin' changes. +Files: src/option.c, src/structs.h + +Patch 6.1.117 +Problem: Small problem with editing a file over ftp: and with Cygwin. +Solution: Remove a dot from a ":normal" command. Use "cygdrive" where + appropriate. (Charles Campbell) +Files: runtime/plugin/netrw.vim + +Patch 6.1.118 +Problem: When a file in diff mode is reloaded because it changed outside + of Vim, other windows in diff mode are not always updated. + (Michael Naumann) +Solution: After reloading a file in diff mode mark all windows in diff mode + for redraw. +Files: src/diff.c + +Patch 6.1.119 (extra) +Problem: With the Sniff interface, using Sniff 4.0.X on HP-UX, there may be + a crash when connecting to Sniff. +Solution: Initialize sniff_rq_sep such that its value can be changed. + (Martin Egloff) +Files: src/if_sniff.c + +Patch 6.1.120 (depends on 6.1.097) +Problem: When 'scrolloff' is non-zero and there are folds, CTRL-F at the + end of the file scrolls part of a closed fold. (Lubomir Host) +Solution: Adjust the first line to the start of a fold. +Files: src/move.c + +Patch 6.1.121 (depends on 6.1.098) +Problem: When starting Select mode from Insert mode, then using the Paste + menu entry, the cursor is left before the last pasted character. + (Mario Schweigler) +Solution: Set the cursor for Insert mode one character to the right. +Files: runtime/menu.vim + +Patch 6.1.122 +Problem: ":file name" creates a new buffer to hold the old buffer name, + which becomes the alternate file. This buffer is unexpectedly + listed. +Solution: Create the buffer for the alternate name unlisted. +Files: src/ex_cmds.c + +Patch 6.1.123 +Problem: A ":match" command with more than one argument doesn't report an + error. +Solution: Check for extra characters. (Servatius Brandt) +Files: src/ex_docmd.c + +Patch 6.1.124 +Problem: When trying to exit and there is a hidden buffer that had 'eol' + off and 'bin' set exiting isn't possible. (John McGowan) +Solution: Set b_start_eol when clearing the buffer. +Files: src/buffer.c + +Patch 6.1.125 +Problem: Explorer plugin asks for saving a modified buffer even when it's + open in another window as well. +Solution: Count the number of windows using the buffer. +Files: runtime/plugin/explorer.vim + +Patch 6.1.126 +Problem: Adding the choices in the syntax menu is consuming much of the + startup time of the GUI while it's not often used. +Solution: Only add the choices when the user wants to use them. +Files: Makefile, runtime/makemenu.vim, runtime/menu.vim, + runtime/synmenu.vim, src/Makefile + +Patch 6.1.127 +Problem: When using "--remote file" and the server has 'insertmode' set, + commands are inserted instead of being executed. (Niklas Volbers) +Solution: Go to Normal mode again after the ":drop" command. +Files: src/main.c + +Patch 6.1.128 +Problem: The expression "input('very long prompt')" puts the cursor in the + wrong line (column is OK). +Solution: Add the wrapped lines to the indent. (Yasuhiro Matsumoto) +Files: src/ex_getln.c + +Patch 6.1.129 +Problem: On Solaris editing "file/" and then "file" results in using the + same buffer. (Jim Battle) +Solution: Before using stat(), check that there is no illegal trailing + slash. +Files: src/auto/configure, src/config.h.in, src/configure.in, + src/macros.h src/misc2.c, src/proto/misc2.pro + +Patch 6.1.130 +Problem: The documentation for some of the 'errorformat' items is unclear. +Solution: Add more examples and explain hard to understand items. (Stefan + Roemer) +Files: runtime/doc/quickfix.txt + +Patch 6.1.131 +Problem: X11 GUI: when expanding a CSI byte in the input stream to K_CSI, + the CSI byte itself isn't copied. +Solution: Copy the CSI byte. +Files: src/gui_x11.c + +Patch 6.1.132 +Problem: Executing a register in Ex mode may cause commands to be skipped. + (John McGowan) +Solution: In Ex mode use an extra check if the register contents was + consumed, to avoid input goes into the typeahead buffer. +Files: src/ex_docmd.c + +Patch 6.1.133 +Problem: When drawing double-wide characters in the statusline, may clear + half of a character. (Yasuhiro Matsumoto) +Solution: Force redraw of the next character by setting the attributes + instead of putting a NUL in ScreenLines[]. Do put a NUL in + ScreenLines[] when overwriting half of a double-wide character. +Files: src/screen.c + +Patch 6.1.134 +Problem: An error for a trailing argument of ":match" should not be given + after ":if 0". (Servatius Brandt) +Solution: Only do the check when executing commands. +Files: src/ex_docmd.c + +Patch 6.1.135 +Problem: Passing a command to the shell that includes a newline always has + a backslash before the newline. +Solution: Remove one backslash before the newline. (Servatius Brandt) +Files: src/ex_docmd.c + +Patch 6.1.136 +Problem: When $TERM is "linux" the default for 'background' is "dark", even + though the GUI uses a light background. (Hugh Allen) +Solution: Don't mark the option as set when defaulting to "dark" for the + linux console. Also reset 'background' to "light" when the GUI + has a light background. +Files: src/option.c + +Patch 6.1.137 +Problem: Converting to HTML has a clumsy way of dealing with tabs which may + change the highlighting. +Solution: Replace tabs with spaces after converting a line to HTML. (Preben + Guldberg) +Files: runtime/syntax/2html.vim + +Patch 6.1.138 (depends on 6.1.126) +Problem: Adding extra items to the Syntax menu can't be done when the "Show + individual choices" menu is used. +Solution: Use ":runtime!" instead of ":source", so that all synmenu.vim + files in the runtime path are loaded. (Servatius Brandt) + Also fix that a translated menu can't be removed. +Files: runtime/menu.vim + +Patch 6.1.139 +Problem: Cygwin: PATH_MAX is not defined. +Solution: Include limits.h. (Dan Sharp) +Files: src/main.c + +Patch 6.1.140 +Problem: Cygwin: ":args `ls *.c`" does not work if the shell command + produces CR NL line separators. +Solution: Remove the CR characters ourselves. (Pavol Juhas) +Files: src/os_unix.c + +Patch 6.1.141 +Problem: ":wincmd gx" may cause problems when mixed with other commands. + ":wincmd c" doesn't close the window immediately. (Benji Fisher) +Solution: Pass the extra command character directly instead of using the + stuff buffer and call ex_close() directly. +Files: src/ex_docmd.c, src/normal.c, src/proto/normal.pro, + src/proto/window.pro, src/window.c + +Patch 6.1.142 +Problem: Defining paragraphs without a separating blank line isn't + possible. Paragraphs can't be formatted automatically. +Solution: Allow defining paragraphs with lines that end in white space. + Added the 'w' and 'a' flags in 'formatoptions'. +Files: runtime/doc/change.txt, src/edit.c, src/misc1.c, src/normal.c, + src/option.h, src/ops.c, src/proto/edit.pro, src/proto/ops.pro, + src/vim.h + +Patch 6.1.143 (depends on 6.1.142) +Problem: Auto formatting near the end of the file moves the cursor to a + wrong position. In Insert mode some lines are made one char too + narrow. When deleting a line undo might not always work properly. +Solution: Don't always move to the end of the line in the last line. Don't + position the cursor past the end of the line in Insert mode. + After deleting a line save the cursor line for undo. +Files: src/edit.c, src/ops.c, src/normal.c + +Patch 6.1.144 +Problem: Obtaining the size of a line in screen characters can be wrong. + A pointer may wrap around zero. +Solution: In win_linetabsize() check for a MAXCOL length argument. (Jim + Dunleavy) +Files: src/charset.c + +Patch 6.1.145 +Problem: GTK: Drag&drop with more than 3 files may cause a crash. (Mickael + Marchand) +Solution: Rewrite the code that parses the received list of files to be more + robust. +Files: src/charset.c, src/gui_gtk_x11.c + +Patch 6.1.146 +Problem: MS-Windows: When $HOME is constructed from $HOMEDRIVE and + $HOMEPATH, it is not used for storing the _viminfo file. (Normal + Diamond) +Solution: Set $HOME with the value obtained from $HOMEDRIVE and $HOMEPATH. +Files: src/misc1.c + +Patch 6.1.147 (extra) +Problem: MS-Windows: When a dialog has no default button, pressing Enter + ends it anyway and all buttons are selected. +Solution: Don't end a dialog when there is no default button. Don't select + all button when there is no default. (Vince Negri) +Files: src/gui_w32.c + +Patch 6.1.148 (extra) +Problem: MS-Windows: ACL is not properly supported. +Solution: Add an access() replacement that also works for ACL. (Mike + Williams) +Files: runtime/doc/editing.txt, src/os_win32.c + +Patch 6.1.149 (extra) +Problem: MS-Windows: Can't use diff mode from the file explorer. +Solution: Add a "diff with Vim" context menu entry. (Dan Sharp) +Files: GvimExt/gvimext.cpp, GvimExt/gvimext.h + +Patch 6.1.150 +Problem: OS/2, MS-Windows and MS-DOS: When 'shellslash' is set getcwd() + still uses backslash. (Yegappan Lakshmanan) +Solution: Adjust slashes in getcwd(). +Files: src/eval.c + +Patch 6.1.151 (extra) +Problem: Win32: The NTFS substream isn't copied. +Solution: Copy the substream when making a backup copy. (Muraoka Taro) +Files: src/fileio.c, src/os_win32.c, src/proto/os_win32.pro + +Patch 6.1.152 +Problem: When $LANG is iso8859-1 translated menus are not used. +Solution: Change iso8859 to iso_8859. +Files: runtime/menu.vim + +Patch 6.1.153 +Problem: Searching in included files may search recursively when the path + starts with "../". (Sven Berkvens-Matthijsse) +Solution: Compare full file names, use inode/device when possible. +Files: src/search.c + +Patch 6.1.154 (extra) +Problem: DJGPP: "vim -h" leaves the cursor in a wrong position. +Solution: Don't position the cursor using uninitialized variables. (Jim + Dunleavy) +Files: src/os_msdos.c + +Patch 6.1.155 +Problem: Win32: Cursor may sometimes disappear in Insert mode. +Solution: Change "hor10" in 'guicursor' to "hor15". (Walter Briscoe) +Files: src/option.c + +Patch 6.1.156 +Problem: Conversion between DBCS and UCS-2 isn't implemented cleanly. +Solution: Clean up a few things. +Files: src/mbyte.c, src/structs.h + +Patch 6.1.157 +Problem: 'hlsearch' highlights only the second comma in ",,,,," with + "/,\@<=[^,]*". (Preben Guldberg) +Solution: Also check for an empty match to start just after a previous + match. +Files: src/screen.c + +Patch 6.1.158 +Problem: "zs" and "ze" don't work correctly with ":set nowrap siso=1". + (Preben Guldberg) +Solution: Take 'siso' into account when computing the horizontal scroll + position for "zs" and "ze". +Files: src/normal.c + +Patch 6.1.159 +Problem: When expanding an abbreviation that includes a multi-byte + character too many characters are deleted. (Andrey Urazov) +Solution: Delete the abbreviation counting characters instead of bytes. +Files: src/getchar.c + +Patch 6.1.160 +Problem: ":$read file.gz" doesn't work. (Preben Guldberg) +Solution: Don't use the '[ mark after it has become invalid. +Files: runtime/plugin/gzip.vim + +Patch 6.1.161 (depends on 6.1.158) +Problem: Warning for signed/unsigned compare. Can set 'siso' to a negative + value. (Mike Williams) +Solution: Add a typecast. Add a check for 'siso' being negative. +Files: src/normal.c, src/option.c + +Patch 6.1.162 +Problem: Python interface: Didn't initialize threads properly. +Solution: Call PyEval_InitThreads() when starting up. +Files: src/if_python.c + +Patch 6.1.163 +Problem: Win32: Can't compile with Python after 6.1.162. +Solution: Dynamically load PyEval_InitThreads(). (Dan Sharp) +Files: src/if_python.c + +Patch 6.1.164 +Problem: If 'modifiable' is off, converting to xxd fails and 'filetype' is + changed to "xxd" anyway. +Solution: Don't change 'filetype' when conversion failed. +Files: runtime/menu.vim + +Patch 6.1.165 +Problem: Making changes in several lines and then a change in one of these + lines that splits it in two or more lines, undo information was + corrupted. May cause a crash. (Dave Fishburn) +Solution: When skipping to save a line for undo because it was already + saved, move it to become the last saved line, so that when the + command changes the line count other saved lines are not involved. +Files: src/undo.c + +Patch 6.1.166 +Problem: When 'autoindent' is set and mswin.vim has been sourced, pasting + with CTRL-V just after auto-indenting removes the indent. (Shlomi + Fish) +Solution: First insert an "x" and delete it again, so that the auto-indent + remains. +Files: runtime/mswin.vim + +Patch 6.1.167 +Problem: When giving a negative argument to ":retab" strange things start + happening. (Hans Ginzel) +Solution: Check for a negative value. +Files: src/ex_cmds.c + +Patch 6.1.168 +Problem: Pressing CTRL-C at the hit-enter prompt doesn't end the prompt. +Solution: Make CTRL-C stop the hit-enter prompt. +Files: src/message.c + +Patch 6.1.169 +Problem: bufexists() finds a buffer by using the name of a symbolic link to + it, but bufnr() doesn't. (Yegappan Lakshmanan) +Solution: When bufnr() can't find a buffer, try using the same method as + bufexists(). +Files: src/eval.c + +Patch 6.1.170 +Problem: Using ":mksession" uses the default session file name, but "vim + -S" doesn't. (Hans Ginzel) +Solution: Use the default session file name if "-S" is the last command + line argument or another option follows. +Files: runtime/doc/starting.txt, src/main.c + +Patch 6.1.171 +Problem: When opening a line just above a closed fold with "O" and the + comment leader is automatically inserted, the cursor is displayed + in the first column. (Sung-Hyun Nam) +Solution: Update the flag that indicates the cursor is in a closed fold. +Files: src/misc1.c + +Patch 6.1.172 +Problem: Command line completion of ":tag /pat" does not show the same + results as the tags the command actually finds. (Gilles Roy) +Solution: Don't modify the pattern to make it a regexp. +Files: src/ex_getln.c, src/tag.c + +Patch 6.1.173 +Problem: When using remote control to edit a position in a file and this + file is the current buffer and it's modified, the window is split + and the ":drop" command fails. +Solution: Don't split the window, keep editing the same buffer. + Use the ":drop" command in VisVim to avoid the problem there. +Files: src/ex_cmds.c, src/ex_cmds2.c, src/proto/ex_cmds2.pro, + VisVim/Commands.cpp + +Patch 6.1.174 +Problem: It is difficult to know in a script whether an option not only + exists but really works. +Solution: Add "exists('+option')". +Files: runtime/doc/eval.txt, src/eval.c + +Patch 6.1.175 +Problem: When reading commands from a pipe and a CTRL-C is pressed, Vim + will hang. (Piet Delport) +Solution: Don't keep reading characters to clear typeahead when an interrupt + was detected, stop when a single CTRL-C is read. +Files: src/getchar.c, src/ui.c + +Patch 6.1.176 +Problem: When the stack limit is very big a false out-of-stack error may + be detected. +Solution: Add a check for overflow of the stack limit computation. (Jim + Dunleavy) +Files: src/os_unix.c + +Patch 6.1.177 (depends on 6.1.141) +Problem: ":wincmd" does not allow a following command. (Gary Johnson) +Solution: Check for a following " | cmd". Also give an error for trailing + characters. +Files: src/ex_docmd.c + +Patch 6.1.178 +Problem: When 'expandtab' is set "r<C-V><Tab>" still expands the Tab. + (Bruce deVisser) +Solution: Replace with a literal Tab. +Files: src/normal.c + +Patch 6.1.179 (depends on 6.1.091) +Problem: When using X11R5 XIMPreserveState is undefined. (Albert Chin) +Solution: Include the missing definitions. +Files: src/mbyte.c + +Patch 6.1.180 +Problem: Use of the GUI code for forking is inconsistent. +Solution: Define MAY_FORK and use it for later #ifdefs. (Ben Fowlwer) +Files: src/gui.c + +Patch 6.1.181 +Problem: If the terminal doesn't wrap from the last char in a line to the + next line, the last column is blanked out. (Peter Karp) +Solution: Don't output a space to mark the wrap, but the same character + again. +Files: src/screen.c + +Patch 6.1.182 (depends on 6.1.142) +Problem: It is not possible to auto-format comments only. (Moshe Kaminsky) +Solution: When the 'a' and 'c' flags are in 'formatoptions' only auto-format + comments. +Files: runtime/doc/change.txt, src/edit.c + +Patch 6.1.183 +Problem: When 'fencs' is empty and 'enc' is utf-8, reading a file with + illegal bytes gives "CONVERSION ERROR" even though no conversion + is done. 'readonly' is set, even though writing the file results + in an unmodified file. +Solution: For this specific error use "ILLEGAL BYTE" and don't set + 'readonly'. +Files: src/fileio.c + +Patch 6.1.184 (extra) +Problem: The extra mouse buttons found on some mice don't work. +Solution: Support two extra buttons for MS-Windows. (Michael Geddes) +Files: runtime/doc/term.txt, src/edit.c, src/ex_getln.c, src/gui.c, + src/gui_w32.c, src/gui_w48.c, src/keymap.h, src/message.c, + src/misc1.c, src/misc2.c, src/normal.c, src/vim.h + +Patch 6.1.185 (depends on 6.1.182) +Problem: Can't compile without +comments feature. +Solution: Add #ifdef FEAT_COMMENTS. (Christian J. Robinson) +Files: src/edit.c + +Patch 6.1.186 (depends on 6.1.177) +Problem: ":wincmd" does not allow a following comment. (Aric Blumer) +Solution: Check for a following double quote. +Files: src/ex_docmd.c + +Patch 6.1.187 +Problem: Using ":doarg" with 'hidden' set and the current file is the only + argument and was modified gives an error message. (Preben + Guldberg) +Solution: Don't try re-editing the same file. +Files: src/ex_cmds2.c + +Patch 6.1.188 (depends on 6.1.173) +Problem: Unused variable in the small version. +Solution: Move the declaration for "p" inside #ifdef FEAT_LISTCMDS. +Files: src/ex_cmds2.c + +Patch 6.1.189 +Problem: inputdialog() doesn't work when 'c' is in 'guioptions'. (Aric + Blumer) +Solution: Fall back to the input() function in this situation. +Files: src/eval.c + +Patch 6.1.190 (extra) +Problem: VMS: doesn't build with GTK GUI. Various other problems. +Solution: Fix building for GTK. Improved Perl, Python and TCL support. + Improved VMS documentation. (Zoltan Arpadffy) + Added Vimtutor for VMS (T. R. Wyant) +Files: runtime/doc/os_vms.txt, src/INSTALLvms.txt, src/gui_gtk_f.h, + src/if_tcl.c, src/main.c, src/gui_gtk_vms.h, src/Make_vms.mms, + src/os_vms.opt, src/proto/if_tcl.pro, vimtutor.com, + src/testdir/Make_vms.mms + +Patch 6.1.191 +Problem: When using "vim -s script" and redirecting the output, the delay + for the "Output is not to a terminal" warning slows Vim down too + much. +Solution: Don't delay when reading commands from a script. +Files: src/main.c + +Patch 6.1.192 +Problem: ":diffsplit" doesn't add "hor" to 'scrollopt'. (Gary Johnson) +Solution: Add "hor" to 'scrollopt' each time ":diffsplit" is used. +Files: src/diff.c, src/main.c + +Patch 6.1.193 +Problem: Crash in in_id_list() for an item with a "containedin" list. (Dave + Fishburn) +Solution: Check for a negative syntax id, used for keywords. +Files: src/syntax.c + +Patch 6.1.194 +Problem: When "t_ti" is set but it doesn't cause swapping terminal pages, + "ZZ" may cause the shell prompt to appear on top of the file-write + message. +Solution: Scroll the text up in the Vim page before swapping to the terminal + page. (Michael Schroeder) +Files: src/os_unix.c + +Patch 6.1.195 +Problem: The quickfix and preview windows always keep their height, while + other windows can't fix their height. +Solution: Add the 'winfixheight' option, so that a fixed height can be + specified for any window. Also fix that the wildmenu may resize a + one-line window to a two-line window if 'ls' is zero. +Files: runtime/doc/options.txt, runtime/optwin.vim, src/ex_cmds.c, + src/ex_getln.c, src/globals.h, src/option.c, src/quickfix.c, + src/screen.c, src/structs.h, src/window.c + +Patch 6.1.196 (depends on 6.1.084) +Problem: On Mac OS X 10.2 generating osdef.h fails. +Solution: Add -no-cpp-precomp to avoid using precompiled header files, which + disables printing the search path. (Ben Fowler) +Files: src/auto/configure, src/configure.in + +Patch 6.1.197 +Problem: ":help <C-V><C-\><C-V><C-N>" (resulting in <1c><0e>) gives an + error message. (Servatius Brandt) +Solution: Double the backslash in "CTRL-\". +Files: src/ex_cmds.c + +Patch 6.1.198 (extra) (depends on 6.1.076) +Problem: Mac OS X: Dialogues don't work. +Solution: Fix a crashing problem for some GUI dialogues. Fix a problem when + saving to a new file from the GUI. (Peter Cucka) +Files: src/feature.h, src/gui_mac.c + +Patch 6.1.199 +Problem: 'guifontwide' doesn't work on Win32. +Solution: Output each wide character separately. (Michael Geddes) +Files: src/gui.c + +Patch 6.1.200 +Problem: ":syn sync fromstart" is not skipped after ":if 0". This can make + syntax highlighting very slow. +Solution: Check "eap->skip" appropriately. (Rob West) +Files: src/syntax.c + +Patch 6.1.201 (depends on 6.1.192) +Problem: Warning for illegal pointer combination. (Zoltan Arpadffy) +Solution: Add a typecast. +Files: src/diff.c + +Patch 6.1.202 (extra)(depends on 6.1.148) +Problem: Win32: filewritable() doesn't work properly on directories. +Solution: fix filewritable(). (Mike Williams) +Files: src/os_win32.c + +Patch 6.1.203 +Problem: ":%s/~//" causes a crash after ":%s/x//". (Gary Holloway) +Solution: Avoid reading past the end of a line when "~" is empty. +Files: src/regexp.c + +Patch 6.1.204 (depends on 6.1.129) +Problem: Warning for an illegal pointer on Solaris. +Solution: Add a typecast. (Derek Wyatt) +Files: src/misc2.c + +Patch 6.1.205 +Problem: The gzip plugin changes the alternate file when editing a + compressed file. (Oliver Fuchs) +Solution: Temporarily remove the 'a' and 'A' flags from 'cpo'. +Files: runtime/plugin/gzip.vim + +Patch 6.1.206 +Problem: The script generated with ":mksession" doesn't work properly when + some commands are mapped. +Solution: Use ":normal!" instead of ":normal". And use ":wincmd" where + possible. (Muraoka Taro) +Files: src/ex_docmd.c, src/fold.c + +Patch 6.1.207 +Problem: Indenting a Java file hangs below a line with a comment after a + command. +Solution: Break out of a loop. (Andre Pang) + Also line up } with matching {. +Files: runtime/indent/java.vim + +Patch 6.1.208 +Problem: Can't use the buffer number from the Python interface. +Solution: Add buffer.number. (Michal Vitecek) +Files: src/if_python.c + +Patch 6.1.209 +Problem: Printing doesn't work on Mac OS classic. +Solution: Use a ":" for path separator when opening the resource file. (Axel + Kielhorn) +Files: src/ex_cmds2.c + +Patch 6.1.210 +Problem: When there is an iconv() conversion error when reading a file + there can be an error the next time iconv() is used. +Solution: Reset the state of the iconv() descriptor. (Yasuhiro Matsumoto) +Files: src/fileio.c + +Patch 6.1.211 +Problem: The message "use ! to override" is confusing. +Solution: Make it "add ! to override". +Files: src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c, + src/globals.h + +Patch 6.1.212 +Problem: When Vim was started with "-R" ":new" creates a buffer + 'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg) +Solution: Don't set 'readonly in a new empty buffer for ":enew". +Files: src/ex_docmd.c + +Patch 6.1.213 +Problem: Using CTRL-W H may cause a big gap to appear below the last + window. (Aric Blumer) +Solution: Don't set the window height when there is a vertical split. + (Yasuhiro Matsumoto) +Files: src/window.c + +Patch 6.1.214 +Problem: When installing Vim and the runtime files were checked out from + CVS the CVS directories will also be installed. +Solution: Avoid installing the CVS dirs and their contents. +Files: src/Makefile + +Patch 6.1.215 +Problem: Win32: ":pwd" uses backslashes even when 'shellslash' is set. + (Xiangjiang Ma) +Solution: Adjust backslashes before printing the message. +Files: src/ex_docmd.c + +Patch 6.1.216 +Problem: When dynamically loading the iconv library, the error codes may be + confused. +Solution: Use specific error codes for iconv and redefine them for dynamic + loading. (Yasuhiro Matsumoto) +Files: src/fileio.c, src/mbyte.c, src/vim.h + +Patch 6.1.217 +Problem: When sourcing the same Vim script using a different name (symbolic + link or MS-Windows 8.3 name) it is listed twice with + ":scriptnames". (Tony Mechelynck) +Solution: Turn the script name into a full path before using it. On Unix + compare inode/device numbers. +Files: src/ex_cmds2.c + +Patch 6.1.218 +Problem: No error message for using the function argument "5+". (Servatius + Brandt) +Solution: Give an error message if a function or variable is expected but is + not found. +Files: src/eval.c + +Patch 6.1.219 +Problem: When using ":amenu :b 1<CR>" with a Visual selection and + 'insertmode' is set, Vim does not return to Insert mode. (Mickael + Marchand) +Solution: Add the command CTRL-\ CTRL-G that goes to Insert mode if + 'insertmode' is set and to Normal mode otherwise. Append this to + menus defined with ":amenu". +Files: src/edit.c, src/ex_getln.c, src/normal.c + +Patch 6.1.220 +Problem: When using a BufReadPost autocommand that changes the line count, + e.g., "$-1join", reloading a file that was changed outside Vim + does not work properly. (Alan G Isaac) +Solution: Make the buffer empty before reading the new version of the file. + Save the lines in a dummy buffer, so that they can be put back + when reading the file fails. +Files: src/buffer.c, src/ex_cmds.c, src/fileio.c, src/globals.h, + src/proto/buffer.pro + +Patch 6.1.221 +Problem: Changing case may not work properly, depending on the current + locale. +Solution: Add the 'casemap' option to let the user chose how changing case + is to be done. + Also fix lowering case when an UTF-8 character doesn't keep the + same byte length. +Files: runtime/doc/options.txt, src/ascii.h, src/auto/configure, + src/buffer.c, src/charset.c, src/config.h.in, src/configure.in, + src/diff.c, src/edit.c, src/eval.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/gui_amiga.c + src/gui_mac.c, src/gui_photon.c, src/gui_w48.c, src/gui_beos.cc, + src/macros.h, src/main.c, src/mbyte.c, src/menu.c, src/message.c, + src/misc1.c, src/misc2.c, src/option.c, src/os_msdos.c, + src/os_mswin.c, src/proto/charset.pro, src/regexp.c, src/option.h, + src/syntax.c + +Patch 6.1.222 (depends on 6.1.219) +Problem: Patch 6.1.219 was incomplete. +Solution: Add the changes for ":amenu". +Files: src/menu.c + +Patch 6.1.223 (extra) +Problem: Win32: When IME is activated 'iminsert' is set, but it might never + be reset when IME is disabled. (Muraoka Taro) + All systems: 'iminsert' is set to 2 when leaving Insert mode, even + when langmap is being used. (Peter Valach) +Solution: Don't set "b_p_iminsert" in _OnImeNotify(). (Muraoka Taro) + Don't store the status of the input method in 'iminsert' when + 'iminsert' is one. Also for editing the command line and for + arguments to Normal mode commands. +Files: src/edit.c, src/ex_getln.c, src/gui_w32.c, src/normal.c + +Patch 6.1.224 +Problem: "expand('$VAR')" returns an empty string when the expanded $VAR + is not an existing file. (Aric Blumer) +Solution: Included non-existing files, as documented. +Files: src/eval.c + +Patch 6.1.225 +Problem: Using <C-O><C-^> in Insert mode has a delay when starting "vim -u + NONE" and ":set nocp hidden". (Emmanuel) do_ecmd() uses + fileinfo(), the redraw is done after a delay to give the user time + to read the message. +Solution: Put the message from fileio() in "keep_msg", so that the redraw is + done before the delay (still needed to avoid the mode message + overwrites the fileinfo() message). +Files: src/buffer.c + +Patch 6.1.226 +Problem: Using ":debug" with a ":normal" command may cause a hang. (Colin + Keith) +Solution: Save the typeahead buffer when obtaining a debug command. +Files: src/ex_cmds2.c, src/getchar.c, src/proto/getchar.pro + +Patch 6.1.227 +Problem: It is possible to use a variable name "asdf:asdf" and ":let j:asdf + = 5" does not give an error message. (Mikolaj Machowski) +Solution: Check for a ":" inside the variable name. +Files: src/eval.c + +Patch 6.1.228 (extra) +Problem: Win32: The special output function for Hangul is used too often, + causing special handling for other situations to be skipped. + bInComposition is always FALSE, causing ImeGetTempComposition() + always to return NULL. +Solution: Remove HanExtTextOut(). Delete the dead code around + bInComposition and ImeGetTempComposition(). +Files: src/gui_w16.c, src/gui_w32.c, src/gui_w48.c + +Patch 6.1.229 +Problem: Win32: Conversion to/from often used codepages requires the iconv + library, which is not always available. +Solution: Use standard MS-Windows functions for the conversion when + possible. (mostly by Glenn Maynard) + Also fixes missing declaration for patch 6.1.220. +Files: src/fileio.c + +Patch 6.1.230 (extra) +Problem: Win16: building doesn't work. +Solution: Exclude the XBUTTON handling. (Vince Negri) +Files: src/gui_w48.c + +Patch 6.1.231 +Problem: Double clicking with the mouse to select a word does not work for + multi-byte characters. +Solution: Use vim_iswordc() instead of vim_isIDc(). This means 'iskeyword' + is used instead of 'isident'. Also fix that mixing ASCII with + multi-byte word characters doesn't work, the mouse class for + punctuation and word characters was mixed up. +Files: src/normal.c + +Patch 6.1.232 (depends on 6.1.226) +Problem: Using ex_normal_busy while it might not be available. (Axel + Kielhorn) +Solution: Only use ex_normal_busy when FEAT_EX_EXTRA is defined. +Files: src/ex_cmds2.c + +Patch 6.1.233 +Problem: ":help expr-||" does not work. +Solution: Don't use the '|' as a command separator +Files: src/ex_cmds.c + +Patch 6.1.234 (depends on 6.1.217) +Problem: Get a warning for using a negative value for st_dev. +Solution: Don't assign a negative value to st_dev. +Files: src/ex_cmds2.c + +Patch 6.1.235 (depends on 6.1.223) +Problem: 'iminsert' is changed from 1 to 2 when leaving Insert mode. (Peter + Valach) +Solution: Check "State" before resetting it to NORMAL. +Files: src/edit.c + +Patch 6.1.236 +Problem: Memory leaks when appending lines for ":diffget" or ":diffput" and + when reloading a changed buffer. +Solution: Free a line after calling ml_append(). +Files: src/diff.c, src/fileio.c + +Patch 6.1.237 +Problem: Putting in Visual block mode does not work correctly when "$" was + used or when the first line is short. (Christian Michon) +Solution: First delete the selected text and then put the new text. Save + and restore registers as necessary. +Files: src/globals.h, src/normal.c, src/ops.c, src/proto/ops.pro, + src/vim.h + +Patch 6.1.238 (extra) +Problem: Win32: The "icon=" argument for the ":menu" command does not + search for the bitmap file. +Solution: Expand environment variables and search for the bitmap file. + (Vince Negri) + Make it consistent, use the same mechanism for X11 and GTK. +Files: src/gui.c src/gui_gtk.c, src/gui_w32.c, src/gui_x11.c, + src/proto/gui.pro + +Patch 6.1.239 +Problem: Giving an error for missing :endif or :endwhile when being + interrupted. +Solution: Don't give these messages when interrupted. +Files: src/ex_docmd.c, src/os_unix.c + +Patch 6.1.240 (extra) +Problem: Win32 with BCC 5: CPU may be defined in the environment, which + causes a wrong argument for the compiler. (Walter Briscoe) +Solution: Use CPUNR instead of CPU. +Files: src/Make_bc5.mak + +Patch 6.1.241 +Problem: Something goes wrong when drawing or undrawing the cursor. +Solution: Remember when the cursor invalid in a better way. +Files: src/gui.c + +Patch 6.1.242 +Problem: When pasting a large number of lines on the command line it is not + possible to interrupt. (Jean Jordaan) +Solution: Check for an interrupt after each pasted line. +Files: src/ops.c + +Patch 6.1.243 (extra) +Problem: Win32: When the OLE version is started and wasn't registered, a + message pops up to suggest registering, even when this isn't + possible (when the registry is not writable). +Solution: Check if registering is possible before asking whether it should + be done. (Walter Briscoe) + Also avoid restarting Vim after registering. +Files: src/if_ole.cpp + +Patch 6.1.244 +Problem: Patch 6.1.237 was missing the diff for vim.h. (Igor Goldenberg) +Solution: Include it here. +Files: src/vim.h + +Patch 6.1.245 +Problem: Comparing with ignored case does not work properly for Unicode + with a locale where case folding an ASCII character results in a + multi-byte character. (Glenn Maynard) +Solution: Handle ignore-case compare for Unicode differently. +Files: src/mbyte.c + +Patch 6.1.246 +Problem: ":blast" goes to the first buffer if the last one is unlisted. + (Andrew Stryker) +Solution: From the last buffer search backwards for the first listed buffer + instead of forwards. +Files: src/ex_docmd.c + +Patch 6.1.247 +Problem: ACL support doesn't always work properly. +Solution: Add a configure argument to disable ACL "--disable-acl". (Thierry + Vignaud) +Files: src/auto/configure, src/configure.in + +Patch 6.1.248 +Problem: Typing 'q' at the more-prompt for ":let" does not quit the + listing. (Hari Krishna Dara) +Solution: Quit the listing when got_int is set. +Files: src/eval.c + +Patch 6.1.249 +Problem: Can't expand a path on the command line if it includes a "|" as a + trail byte of a multi-byte character. +Solution: Check for multi-byte characters. (Yasuhiro Matsumoto) +Files: src/ex_docmd.c + +Patch 6.1.250 +Problem: When changing the value of 'lines' inside the expression set with + 'diffexpr' Vim might crash. (Dave Fishburn) +Solution: Don't allow changing the screen size while updating the screen. +Files: src/globals.h, src/option.c, src/screen.c + +Patch 6.1.251 +Problem: Can't use completion for ":lcd" and ":lchdir" like ":cd". +Solution: Expand directory names for these commands. (Servatius Brandt) +Files: src/ex_docmd.c + +Patch 6.1.252 +Problem: "vi}" does not include a line break when the "}" is at the start + of a following line. (Kamil Burzynski) +Solution: Include the line break. +Files: src/search.c + +Patch 6.1.253 (extra) +Problem: Win32 with Cygwin: Changes the path of arguments in a wrong way. + (Xiangjiang Ma) +Solution: Don't use cygwin_conv_to_posix_path() for the Win32 version. + Update the Cygwin makefile to support more features. (Dan Sharp) +Files: src/Make_cyg.mak, src/if_ole.cpp, src/main.c + +Patch 6.1.254 +Problem: exists("foo{bar}") does not work. ':unlet v{"a"}r' does not work. + ":let v{a}r1 v{a}r2" does not work. ":func F{(1)}" does not work. + ":delfunc F{" does not give an error message. ':delfunc F{"F"}' + does not work. +Solution: Support magic braces for the exists() argument. (Vince Negri) + Check for trailing comments explicitly for ":unlet". Add support + for magic braces in further arguments of ":let". Look for a + parenthesis only after the function name. (Servatius Brandt) + Also expand magic braces for "exists('*expr')". Give an error + message for an invalid ":delfunc" argument. Allow quotes in the + ":delfunc" argument. +Files: src/eval.c, src/ex_cmds.h, src/ex_docmd.c + +Patch 6.1.255 (depends on 6.1.254) +Problem: Crash when loading menu.vim a second time. (Christian Robinson) + ":unlet garbage foo" tries unletting "foo" after an error message. + (Servatius Brandt) + Very long function arguments cause very long messages when + 'verbose' is 14 or higher. +Solution: Avoid reading from uninitialized memory. + Break out of a loop after an invalid argument for ":unlet". + Truncate long function arguments to 80 characters. +Files: src/eval.c + +Patch 6.1.256 (depends on 6.1.255) +Problem: Defining a function after ":if 0" could still cause an error + message for an existing function. + Leaking memory when there are trailing characters for ":delfunc". +Solution: Check the "skip" flag. Free the memory. (Servatius Brandt) +Files: src/eval.c + +Patch 6.1.257 +Problem: ":cwindow" always sets the previous window to the last but one + window. (Benji Fisher) +Solution: Set the previous window properly. +Files: src/globals.c, src/quickfix.c, src/window.c + +Patch 6.1.258 +Problem: Buffers menu doesn't work properly for multibyte buffer names. +Solution: Use a pattern to get the left and right part of the name. + (Yasuhiro Matsumoto) +Files: runtime/menu.vim + +Patch 6.1.259 (extra) +Problem: Mac: with 'patchmode' is used filenames are truncated. +Solution: Increase the BASENAMELEN for Mac OS X. (Ed Ralston) +Files: src/os_mac.h + +Patch 6.1.260 (depends on 6.1.104) +Problem: GCC 3.2 still seems to have an optimizer problem. (Zvi Har'El) +Solution: Use the same configure check as used for GCC 3.1. +Files: src/auto/configure, src/configure.in + +Patch 6.1.261 +Problem: When deleting a line in a buffer which is not the current buffer, + using the Perl interface Delete(), the cursor in the current + window may move. (Chris Houser) +Solution: Don't adjust the cursor position when changing another buffer. +Files: src/if_perl.xs + +Patch 6.1.262 +Problem: When jumping over folds with "z[", "zj" and "zk" the previous + position is not remembered. (Hari Krishna Dara) +Solution: Set the previous context mark before jumping. +Files: src/fold.c + +Patch 6.1.263 +Problem: When typing a multi-byte character that triggers an abbreviation + it is not inserted properly. +Solution: Handle adding the typed multi-byte character. (Yasuhiro Matsumoto) +Files: src/getchar.c + +Patch 6.1.264 (depends on patch 6.1.254) +Problem: exists() does not work for built-in functions. (Steve Wall) +Solution: Don't check for the function name to start with a capital. +Files: src/eval.c + +Patch 6.1.265 +Problem: libcall() can be used in 'foldexpr' to call any system function. + rename(), delete() and remote_send() can also be used in + 'foldexpr'. These are security problems. (Georgi Guninski) +Solution: Don't allow using libcall(), rename(), delete(), remote_send() and + similar functions in the sandbox. +Files: src/eval.c + +Patch 6.1.266 (depends on 6.1.265) +Problem: Win32: compile error in eval.c. (Bill McCarthy) +Solution: Move a variable declaration. +Files: src/eval.c + +Patch 6.1.267 +Problem: Using "p" to paste into a Visual selected area may cause a crash. +Solution: Allocate enough memory for saving the register contents. (Muraoka + Taro) +Files: src/ops.c + +Patch 6.1.268 +Problem: When triggering an abbreviation with a multi-byte character, this + character is not correctly inserted after expanding the + abbreviation. (Taro Muraoka) +Solution: Add ABBR_OFF to all characters above 0xff. +Files: src/edit.c, src/ex_getln.c, src/getchar.c + +Patch 6.1.269 +Problem: After using input() text written with ":redir" gets extra indent. + (David Fishburn) +Solution: Restore msg_col after using input(). +Files: src/ex_getln.c + +Patch 6.1.270 (depends on 6.1.260) +Problem: GCC 3.2.1 still seems to have an optimizer problem. +Solution: Use the same configure check as used for GCC 3.1. +Files: src/auto/configure, src/configure.in + +Patch 6.1.271 +Problem: When compiling without the +syntax feature there are errors. +Solution: Don't use some code for syntax highlighting. (Roger Cornelius) + Make test 45 work without syntax highlighting. + Also fix an error in a pattern matching: "\%(" was not supported. +Files: src/ex_cmds2.c, src/regexp.c, src/testdir/test45.in + +Patch 6.1.272 +Problem: After using ":set define<" a crash may happen. (Christian Robinson) +Solution: Make a copy of the option value in allocated memory. +Files: src/option.c + +Patch 6.1.273 +Problem: When the cursor doesn't blink, redrawing an exposed area may hide + the cursor. +Solution: Always draw the cursor, also when it didn't move. (Muraoka Taro) +Files: src/gui.c + +Patch 6.1.274 (depends on 6.1.210) +Problem: Resetting the iconv() state after each error is wrong for an + incomplete sequence. +Solution: Don't reset the iconv() state. +Files: src/fileio.c + +Patch 6.1.275 +Problem: When using "v" in a startup script, get warning message that + terminal cannot highlight. (Charles Campbell) +Solution: Only give the message after the terminal has been initialized. +Files: src/normal.c + +Patch 6.1.276 +Problem: "gvim --remote file" doesn't prompt for an encryption key. +Solution: The further characters the client sends to the server are used. + Added inputsave() and inputrestore() to allow prompting the + user directly and not using typeahead. + Also fix possible memory leak for ":normal". +Files: src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/getchar.c, + src/main.c, src/proto/getchar.pro, src/proto/ui.pro, + src/runtime/doc/eval.txt, src/structs.h, src/ui.c, src/vim.h + +Patch 6.1.277 (depends on 6.1.276) +Problem: Compilation error when building with small features. +Solution: Define trash_input_buf() when needed. (Kelvin Lee) +Files: src/ui.c + +Patch 6.1.278 +Problem: When using signs the line number of a closed fold doesn't line up + with the other line numbers. (Kamil Burzynski) +Solution: Insert two spaces for the sign column. +Files: src/screen.c + +Patch 6.1.279 +Problem: The prototype for smsg() and smsg_attr() do not match the function + definition. This may cause trouble for some compilers. (Nix) +Solution: Use va_list for systems that have stdarg.h. Use "int" instead of + "void" for the return type. +Files: src/auto/configure, src/config.h.in, src/configure.in, + src/proto.h, src/message.c + +Patch 6.1.280 +Problem: It's possible to use an argument "firstline" or "lastline" for a + function but using "a:firstline" or "a:lastline" in the function + won't work. (Benji Fisher) +Solution: Give an error message for these arguments. + Also avoid that the following function body causes a whole row of + errors, skip over it after an error in the first line. +Files: src/eval.c + +Patch 6.1.281 +Problem: In Insert mode CTRL-X CTRL-G leaves the cursor after the ruler. +Solution: Set the cursor position before waiting for the argument of CTRL-G. + (Yasuhiro Matsumoto) +Files: src/edit.c + +Patch 6.1.282 +Problem: Elvis uses "se" in a modeline, Vim doesn't recognize this. +Solution: Also accept "se " where "set " is accepted in a modeline. + (Yasuhiro Matsumoto) +Files: src/buffer.c + +Patch 6.1.283 +Problem: For ":sign" the icon file name cannot contain a space. +Solution: Handle backslashes in the file name. (Yasuhiro Matsumoto) +Files: src/ex_cmds.c + +Patch 6.1.284 +Problem: On Solaris there is a warning for "struct utimbuf". +Solution: Move including "utime.h" to outside the function. (Derek Wyatt) +Files: src/fileio.c + +Patch 6.1.285 +Problem: Can't wipe out a buffer with 'bufhide' option. +Solution: Add "wipe" value to 'bufhide'. (Yegappan Lakshmanan) +Files: runtime/doc/options.txt, src/buffer.c, src/option.c, + src/quickfix.c + +Patch 6.1.286 +Problem: 'showbreak' cannot contain multi-byte characters. +Solution: Allow using all printable characters for 'showbreak'. +Files: src/charset.c, src/move.c, src/option.c + +Patch 6.1.287 (depends on 6.1.285) +Problem: Effect of "delete" and "wipe" in 'bufhide' were mixed up. +Solution: Wipe out when wiping out is asked for. +Files: src/buffer.c + +Patch 6.1.288 +Problem: ":silent function F" hangs. (Hari Krishna Dara) +Solution: Don't use msg_col, it is not incremented when using ":silent". + Also made the function output look a bit better. Don't translate + "function". +Files: src/eval.c + +Patch 6.1.289 (depends on 6.1.278) +Problem: Compiler warning for pointer. (Axel Kielhorn) +Solution: Add a typecast for " ". +Files: src/screen.c + +Patch 6.1.290 (extra) +Problem: Truncating long text for message box may break multi-byte + character. +Solution: Adjust to start of multi-byte character. (Yasuhiro Matsumoto) +Files: src/os_mswin.c + +Patch 6.1.291 (extra) +Problem: Win32: CTRL-@ doesn't work. Don't even get a message for it. +Solution: Recognize the keycode for CTRL-@. (Yasuhiro Matsumoto) +Files: src/gui_w48.c + +Patch 6.1.292 (extra, depends on 6.1.253) +Problem: Win32: Can't compile with new MingW compiler. + Borland 5 makefile doesn't generate pathdef.c. +Solution: Remove -wwide-multiply argument. (Rene de Zwart) + Various fixes for other problems in Win32 makefiles. (Dan Sharp) +Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak, + src/Make_mvc.mak + +Patch 6.1.293 +Problem: byte2line() returns a wrong result for some values. +Solution: Change ">=" to ">" in ml_find_line_or_offset(). (Bradford C Smith) + Add one to the line number when at the end of a block. +Files: src/memline.c + +Patch 6.1.294 +Problem: Can't include a multi-byte character in a string by its hex value. + (Benji Fisher) +Solution: Add "\u....": a character specified with up to four hex numbers + and stored according to the value of 'encoding'. +Files: src/eval.c + +Patch 6.1.295 (extra) +Problem: Processing the cs.po file generates an error. (Rahul Agrawal) +Solution: Fix the printf format characters in the translation. +Files: src/po/cs.po + +Patch 6.1.296 +Problem: Win32: When cancelling the font dialog 'guifont' remains set to + "*". +Solution: Restore the old value of 'guifont' (Yasuhiro Matsumoto) +Files: src/option.c + +Patch 6.1.297 +Problem: "make test" fails in test6 in an UTF-8 environment. (Benji Fisher) +Solution: Before executing the BufReadPost autocommands save the current + fileencoding, so that the file isn't marked changed. +Files: src/fileio.c + +Patch 6.1.298 +Problem: When using signs and the first line of a closed fold has a sign + it can be redrawn as if the fold was open. (Kamil Burzynski) +Solution: Don't redraw a sign inside a closed fold. +Files: src/screen.c + +Patch 6.1.299 +Problem: ":edit +set\ ro file" doesn't work. +Solution: Halve the number of backslashes in the "+cmd" argument. +Files: src/ex_docmd.c + +Patch 6.1.300 (extra) +Problem: Handling of ETO_IGNORELANGUAGE is confusing. +Solution: Clean up the handling of ETO_IGNORELANGUAGE. (Glenn Maynard) +Files: src/gui_w32.c + +Patch 6.1.301 (extra) +Problem: French translation of file-save dialog doesn't show file name. +Solution: Insert a star in the printf string. (Francois Terrot) +Files: src/po/fr.po + +Patch 6.1.302 +Problem: Counting lines of the Visual area is incorrect for closed folds. + (Mikolaj Machowski) +Solution: Correct the start and end for the closed fold. +Files: src/normal.c + +Patch 6.1.303 (extra) +Problem: The Top/Bottom/All text does not always fit in the ruler when + translated to Japanese. Problem with a character being wider when + in a bold font. +Solution: Use ETO_PDY to specify the width of each character. (Yasuhiro + Matsumoto) +Files: src/gui_w32.c + +Patch 6.1.304 (extra, depends on 6.1.292) +Problem: Win32: Postscript is always enabled in the MingW Makefile. + Pathdef.c isn't generated properly with Make_bc5.mak. (Yasuhiro + Matsumoto) +Solution: Change an ifdef to an ifeq. (Madoka Machitani) + Use the Borland make redirection to generate pathdef.c. (Maurice + Barnum) +Files: src/Make_bc5.mak, src/Make_ming.mak + +Patch 6.1.305 +Problem: When 'verbose' is 14 or higher, a function call may cause reading + uninitialized data. (Walter Briscoe) +Solution: Check for end-of-string in trunc_string(). +Files: src/message.c + +Patch 6.1.306 +Problem: The AIX VisualAge cc compiler doesn't define __STDC__. +Solution: Use __EXTENDED__ like __STDC__. (Jess Thrysoee) +Files: src/os_unix.h + +Patch 6.1.307 +Problem: When a double-byte character has an illegal tail byte the display + is messed up. (Yasuhiro Matsumoto) +Solution: Draw "XX" instead of the wrong character. +Files: src/screen.c + +Patch 6.1.308 +Problem: Can't reset the Visual mode returned by visualmode(). +Solution: Use an optional argument to visualmode(). (Charles Campbell) +Files: runtime/doc/eval.txt, src/eval.c, src/normal.c, + src/structs.h + +Patch 6.1.309 +Problem: The tutor doesn't select German if the locale name is + "German_Germany.1252". (Joachim Hofmann) +Solution: Check for "German" in the locale name. Also check for + ".ge". And include the German and Greek tutors. +Files: runtime/tutor/tutor.de, runtime/tutor/tutor.vim, + runtime/tutor/tutor.gr, runtime/tutor/tutor.gr.cp737 + +Patch 6.1.310 (depends on 6.1.307) +Problem: All double-byte characters are displayed as "XX". +Solution: Use ">= 32" instead of "< 32". (Yasuhiro Matsumoto) +Files: src/screen.c + +Patch 6.1.311 (extra) +Problem: VMS: path in window title doesn't include necessary separator. + file version doesn't always work properly with Unix. + Crashes because of memory overwrite in GUI. + Didn't always handle files with lowercase and correct path. +Solution: Fix the problems. Remove unnecessary file name translations. + (Zoltan Arpadffy) +Files: src/buffer.c, src/ex_cmds2.c, src/fileio.c, src/memline.c, + src/misc1.c, src/misc2.c, src/os_unix.c, src/os_vms.c, src/tag.c + +Patch 6.1.312 +Problem: When using ":silent" debugging is also done silently. +Solution: Disable silence while at the debug prompt. +Files: src/ex_cmds2.c + +Patch 6.1.313 +Problem: When a ":drop fname" command is used and "fname" is open in + another window, it is also opened in the current window. +Solution: Change to the window with "fname" instead. + Don't redefine the argument list when dropping only one file. +Files: runtime/doc/windows.txt, src/ex_cmds2.c, src/ex_cmds.c, + src/ex_docmd.c, src/proto/ex_cmds2.pro, src/proto/ex_docmd.pro + +Patch 6.1.314 (depends on 6.1.126) +Problem: Missing backslash in "Generic Config file" syntax menu. +Solution: Insert the backslash. (Zak Beck) +Files: runtime/makemenu.vim, runtime/synmenu.vim + +Patch 6.1.315 (extra) +Problem: A very long hostname may lead to an unterminated string. Failing + to obtain a hostname may result in garbage. (Walter Briscoe) +Solution: Add a NUL at the end of the hostname buffer. +Files: src/os_mac.c, src/os_msdos.c, src/os_unix.c, src/os_win16.c, + src/os_win32.c + +Patch 6.1.316 +Problem: When exiting with "wq" and there is a hidden buffer, after the + "file changed" dialog there is a warning for a changed buffer. + (Ajit Thakkar) +Solution: Do update the buffer timestamps when exiting. +Files: src/fileio.c + +Patch 6.1.317 +Problem: Closing a window may cause some of the remaining windows to be + positioned wrong if there is a mix of horizontal and vertical + splits. (Stefan Ingi Valdimarsson) +Solution: Update the frame sizes before updating the window positions. +Files: src/window.c + +Patch 6.1.318 +Problem: auto/pathdef.c can include wrong quotes when a compiler flag + includes quotes. +Solution: Put a backslash before the quotes in compiler flags. (Shinra Aida) +Files: src/Makefile + +Patch 6.1.319 (depends on 6.1.276) +Problem: Using "--remote +cmd file" does not execute "cmd". +Solution: Call inputrestore() in the same command line as inputsave(), + otherwise it will never get executed. +Files: src/main.c + +Patch 6.1.320 (depends on 6.1.313) +Problem: When a ":drop one\ file" command is used the file "one\ file" is + opened, the backslash is not removed. (Taro Muraoka) +Solution: Handle backslashes correctly. Always set the argument list to + keep it simple. +Files: runtime/doc/windows.txt, src/ex_cmds.c + +Patch 6.1.321 +Problem: When 'mouse' includes 'n' but not 'v', don't allow starting Visual + mode with the mouse. +Solution: Don't use MOUSE_MAY_VIS when there is no 'v' in 'mouse'. (Flemming + Madsen) +Files: src/normal.c + +Patch 6.1.322 (extra, depends on 6.1.315) +Problem: Win32: The host name is always "PC " plus the real host name. +Solution: Don't insert "PC " before the host name. +Files: src/os_win32.c + +Patch 6.1.323 +Problem: ":registers" doesn't stop listing for a "q" at the more prompt. + (Hari Krishna Dara) +Solution: Check for interrupt and got_int. +Files: src/ops.c, src/proto/ops.pro + +Patch 6.1.324 +Problem: Crash when dragging a vertical separator when <LeftMouse> is + remapped to jump to another window. +Solution: Pass the window pointer to the function doing the dragging instead + of always using the current window. (Daniel Elstner) + Also fix that starting a drag changes window focus. +Files: src/normal.c, src/proto/window.pro, src/ui.c, src/vim.h, + src/window.c + +Patch 6.1.325 +Problem: Shift-Tab is not automatically recognized in an xterm. +Solution: Add <Esc>[Z as the termcap code. (Andrew Pimlott) +Files: src/term.c + +Patch 6.1.326 +Problem: Using a search pattern may read from uninitialized data (Yasuhiro + Matsumoto) +Solution: Initialize pointers to NULL. +Files: src/regexp.c + +Patch 6.1.327 +Problem: When opening the "mbyte.txt" help file the utf-8 characters are + unreadable, because the fileencoding is forced to be latin1. +Solution: Check for utf-8 encoding first in help files. (Daniel Elstner) +Files: runtime/doc/mbyte.txt, src/fileio.c + +Patch 6.1.328 +Problem: Prototype for enc_canon_search() is missing. +Solution: Add the prototype. (Walter Briscoe) +Files: src/mbyte.c + +Patch 6.1.329 +Problem: When editing a file "a b c" replacing "%" in ":Cmd %" or ":next %" + does not work properly. (Hari Krishna Dara) +Solution: Always escape spaces when expanding "%". Don't split argument for + <f-args> in a user command when only one argument is used. +Files: src/ex_docmd.c + +Patch 6.1.330 +Problem: GTK, Motif and Athena: Keypad keys produce the same code as + non-keypad keys, making it impossible to map them separately. +Solution: Use different termcap codes for the keypad keys. (Neil Bird) +Files: src/gui_gtk_x11.c, src/gui_x11.c + +Patch 6.1.331 +Problem: When translating the help files, "LOCAL ADDITIONS" no longer marks + the spot where help files from plugins are to be listed. +Solution: Add a "local-additions" tag and use that to find the right spot. +Files: runtime/doc/help.txt, src/ex_cmds.c + +Patch 6.1.332 (extra) +Problem: Win32: Loading Perl dynamically doesn't work with Perl 5.8. + Perl 5.8 also does not work with Cygwin and Ming. +Solution: Adjust the function calls. (Taro Muraoka) + Adjust the cyg and ming makefiles. (Dan Sharp) +Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak, + src/if_perl.xs + +Patch 6.1.333 (extra) +Problem: Win32: Can't handle Unicode text on the clipboard. + Can't pass NUL byte, it becomes a line break. (Bruce DeVisser) +Solution: Support Unicode for the clipboard (Ron Aaron and Glenn Maynard) + Also support copy/paste of NUL bytes. +Files: src/os_mswin.c, src/os_win16.c src/os_win32.c + +Patch 6.1.334 (extra, depends on 6.1.303) +Problem: Problem with drawing Hebrew characters. +Solution: Only use ETO_PDY for Windows NT and the like. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + +Patch 6.1.335 (extra) +Problem: Failure of obtaining the cursor position and window size is + ignored. +Solution: Remove a semicolon after an "if". (Walter Briscoe) +Files: src/gui_w32.c + +Patch 6.1.336 (extra) +Problem: Warning for use of function prototypes of smsg(). +Solution: Define HAVE_STDARG_H. (Walter Briscoe) +Files: src/os_win32.h + +Patch 6.1.337 +Problem: When using "finish" in debug mode in function B() for ":call + A(B())" does not stop after B() is finished. +Solution: Increase debug_level while evaluating a function. +Files: src/ex_docmd.c + +Patch 6.1.338 +Problem: When using a menu that checks out the current file from Insert + mode, there is no warning for the changed file until exiting + Insert mode. (Srikanth Sankaran) +Solution: Add a check for need_check_timestamps in the Insert mode loop. +Files: src/edit.c + +Patch 6.1.339 +Problem: Completion doesn't allow "g:" in ":let g:did_<Tab>". (Benji + Fisher) +Solution: Return "g:var" for global variables when that is what is being + expanded. (Flemming Madsen) +Files: src/eval.c + +Patch 6.1.340 (extra, depends on 6.1.332) +Problem: Win32: Can't compile the Perl interface with nmake. +Solution: Don't compare the version number as a string but as a number. + (Juergen Kraemer) +Files: src/Make_mvc.mak + +Patch 6.1.341 +Problem: In Insert mode with 'rightleft' set the cursor is drawn halfway a + double-wide character. For CTRL-R and CTRL-K in Insert mode the " + or ? is not displayed. +Solution: Draw the cursor in the next character cell. Display the " or ? + over the right half of the double-wide character. (Yasuhiro + Matsumoto) Also fix that cancelling a digraph doesn't redraw + a double-byte character correctly. +Files: src/edit.c, src/gui.c, src/mbyte.c + +Patch 6.1.342 (depends on 6.1.341) +Problem: With 'rightleft' set typing "c" on a double-wide character causes + the cursor to be displayed one cell to the left. +Solution: Draw the cursor in the next character cell. (Yasuhiro Matsumoto) +Files: src/gui.c + +Patch 6.1.343 (depends on 6.1.342) +Problem: Cannot compile with the +multi_byte feature but without +rightleft. + Cannot compile without the GUI. +Solution: Fix the #ifdefs. (partly by Nam SungHyun) +Files: src/gui.c, src/mbyte.c, src/ui.c + +Patch 6.1.344 +Problem: When using ":silent filetype" the output is still put in the + message history. (Hari Krishna Dara) +Solution: Don't add messages in the history when ":silent" is used. +Files: src/message.c + +Patch 6.1.345 (extra) +Problem: Win32: 'imdisable' doesn't work. +Solution: Make 'imdisable' work. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + +Patch 6.1.346 +Problem: The scroll wheel can only scroll the current window. +Solution: Make the scroll wheel scroll the window that the mouse points to. + (Daniel Elstner) +Files: src/edit.c, src/gui.c, src/normal.c, src/term.c + +Patch 6.1.347 +Problem: When using cscope to list matching tags, the listed number is + sometimes not equal to what cscope uses. (Vihren Milev) +Solution: For cscope tags use only one table, don't give tags in the current + file a higher priority. +Files: src/tag.c + +Patch 6.1.348 +Problem: Wildmode with wildmenu: ":set wildmode=list,full", ":colorscheme + <tab>" results in "zellner" instead of the first entry. (Anand + Hariharan) +Solution: Don't call ExpandOne() from globpath(). (Flemming Madsen) +Files: src/ex_getln.c + +Patch 6.1.349 +Problem: "vim --serverlist" when no server was ever started gives an error + message without "\n". + "vim --serverlist" doesn't exit when the X server can't be + contacted, it starts Vim unexpectedly. (Ricardo Signes) +Solution: Don't give an error when no Vim server was ever started. + Treat failing of opening the display equal to errors inside the + remote*() functions. (Flemming Madsen) +Files: src/if_xcmdsrv.c, src/main.c + +Patch 6.1.350 +Problem: When entering a buffer with ":bnext" for the first time, using an + autocommand to restore the last used cursor position doesn't work. + (Paolo Giarusso) +Solution: Don't use the last known cursor position of the current Vim + invocation if an autocommand changed the position. +Files: src/buffer.c + +Patch 6.1.351 (depends on 6.1.349) +Problem: Crash when starting Vim the first time in an X server. (John + McGowan) +Solution: Don't call xFree() with a fixed string. +Files: src/if_xcmdsrv.c + +Patch 6.1.352 (extra, depends on 6.1.345) +Problem: Win32: Crash when setting "imdisable" in _vimrc. +Solution: Don't call IME functions when imm32.dll was not loaded (yet). + Also add typecasts to avoid Compiler warnings for + ImmAssociateContext() argument. +Files: src/gui_w32.c + +Patch 6.1.353 (extra, depends on 6.1.334) +Problem: Problem with drawing Arabic characters. +Solution: Don't use ETO_PDY, do use padding. +Files: src/gui_w32.c + +Patch 6.1.354 (extra, depends on 6.1.333) +Problem: MS-Windows 98: Notepad can't paste text copied from Vim when + 'encoding' is "utf-8". +Solution: Also make CF_TEXT available on the clipboard. (Ron Aaron) +Files: src/os_mswin.c + +Patch 6.1.355 +Problem: In a regexp '\n' will never match anything in a string. +Solution: Make '\n' match a newline character. +Files: src/buffer.c, src/edit.c, src/eval.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/misc1.c, + src/option.c, src/os_mac.c, src/os_unix.c, src/quickfix.c, + src/regexp.c, src/search.c, src/syntax.c, src/tag.c, src/vim.h + +Patch 6.1.356 (extra, depends on, well, eh, several others) +Problem: Compiler warnings for using convert_setup() and a few other + things. +Solution: Add typecasts. +Files: src/mbyte.c, src/os_mswin.c, src/proto/os_win32.pro, src/os_win32.c + +Patch 6.1.357 +Problem: CR in the quickfix window jumps to the error under the cursor, but + this doesn't work in Insert mode. (Srikanth Sankaran) +Solution: Handle CR in Insert mode in the quickfix window. +Files: src/edit.c + +Patch 6.1.358 +Problem: The tutor doesn't select another locale version properly. +Solution: Insert the "let" command. (Yasuhiro Matsumoto) +Files: runtime/tutor/tutor.vim + +Patch 6.1.359 (extra) +Problem: Mac Carbon: Vim doesn't get focus when started from the command + line. Crash when using horizontal scroll bar. +Solution: Set Vim as the frontprocess. Fix scrolling. (Peter Cucka) +Files: src/gui_mac.c + +Patch 6.1.360 (depends on 6.1.341) +Problem: In Insert mode CTRL-K ESC messes up a multi-byte character. + (Anders Helmersson) +Solution: Save all bytes of a character when displaying a character + temporarily. +Files: src/edit.c, src/proto/screen.pro, src/screen.c + +Patch 6.1.361 +Problem: Cannot jump to a file mark with ":'M". +Solution: Allow jumping to another file for a mark in an Ex address when it + is the only thing in the command line. +Files: src/ex_docmd.c + +Patch 6.1.362 +Problem: tgetent() may return zero for success. tgetflag() may return -1 + for an error. +Solution: Check tgetflag() for returning a positive value. Add an autoconf + check for the value that tgetent() returns. +Files: src/auto/configure, src/config.h.in, src/configure.in, src/term.c + +Patch 6.1.363 +Problem: byte2line() can return one more than the number of lines. +Solution: Return -1 if the offset is one byte past the end. +Files: src/memline.c + +Patch 6.1.364 +Problem: That the FileChangedShell autocommand event never nests makes it + difficult to reload a file in a normal way. +Solution: Allow nesting for the FileChangedShell event but do not allow + triggering itself again. + Also avoid autocommands for the cmdline window in rare cases. +Files: src/ex_getln.c, src/fileio.c, src/window.c + +Patch 6.1.365 (depends on 6.1.217) +Problem: Setting a breakpoint in a sourced file with a relative path name + doesn't work. (Servatius Brandt) +Solution: Expand the file name to a full path. +Files: src/ex_cmds2.c + +Patch 6.1.366 +Problem: Can't use Vim with Netbeans. +Solution: Add the Netbeans interface. Includes support for sign icons and + "-fg" and "-bg" arguments for GTK. Add the 'autochdir' + option. (Gordon Prieur, George Hernandez, Dave Weatherford) + Make it possible to display both a sign with a text and one with + line highlighting in the same line. + Add support for Agide, interface version 2.1. + Also fix that when 'iskeyword' includes '?' the "*" command + doesn't work properly on a word that includes "?" (Bill McCarthy): + Don't escape "?" to "\?" when searching forward. +Files: runtime/doc/Makefile, runtime/doc/netbeans.txt, + runtime/doc/options.txt, runtime/doc/various.txt, + src/Makefile, src/auto/configure, src/buffer.c, src/config.h.in, + src/config.mk.in, src/configure.in, src/edit.c, src/ex_cmds.c, + src/ex_docmd.c, src/feature.h, src/fileio.c, src/globals.h, + src/gui.c, src/gui_beval.c, src/gui_gtk_x11.c, src/gui_x11.c, + src/main.c, src/memline.c, src/misc1.c, src/misc2.c, src/move.c, + src/nbdebug.c, src/nbdebug.h, src/netbeans.c, src/normal.c, + src/ops.c, src/option.c, src/option.h, src/proto/buffer.pro, + src/proto/gui_beval.pro, src/proto/gui_gtk_x11.pro, + src/proto/gui_x11.pro, src/proto/misc2.pro, + src/proto/netbeans.pro, src/proto/normal.pro, src/proto/ui.pro, + src/proto.h, src/screen.c, src/structs.h, src/ui.c, src/undo.c, + src/vim.h, src/window.c, src/workshop.c + +Patch 6.1.367 (depends on 6.1.365) +Problem: Setting a breakpoint in a function doesn't work. For a sourced + file it doesn't work when symbolic links are involved. (Servatius + Brandt) +Solution: Expand the file name in the same way as do_source() does. Don't + prepend the path to a function name. +Files: src/ex_cmds2.c + +Patch 6.1.368 +Problem: Completion for ":map" does not include <silent> and <script>. + ":mkexrc" do not save the <silent> attribute of mappings. +Solution: Add "<silent>" to the generated map commands when appropriate. + (David Elstner) + Add <silent> and <script> to command line completion. +Files: src/getchar.c + +Patch 6.1.369 (extra) +Problem: VMS: Vim hangs when attempting to edit a read-only file in the + terminal. Problem with VMS filenames for quickfix. +Solution: Rewrite low level input. Remove version number from file name in + a couple more places. Fix crash after patch 6.1.362. Correct + return code for system(). (Zoltan Arpadffy, Tomas Stehlik) +Files: src/misc1.c, src/os_unix.c, src/os_vms.c, src/proto/os_vms.pro, + src/os_vms_conf.h, src/quickfix.c, src/ui.c + +Patch 6.1.370 +Problem: #ifdef nesting is unclear. +Solution: Insert spaces to indicate the nesting. +Files: src/os_unix.c + +Patch 6.1.371 +Problem: "%V" in 'statusline' doesn't show "0-1" in an empty line. +Solution: Add one to the column when comparing with virtual column (Andrew + Pimlott) +Files: src/buffer.c + +Patch 6.1.372 +Problem: With 16 bit ints there are compiler warnings. (Walter Briscoe) +Solution: Change int into long. +Files: src/structs.h, src/syntax.c + +Patch 6.1.373 +Problem: The default page header for printing is not translated. +Solution: Add _() around the two places where "Page" is used. (Mike + Williams) Translate the default value of the 'titleold' and + 'printheader' options. +Files: src/ex_cmds2.c, src/option.c + +Patch 6.1.374 (extra) +Problem: MS-Windows: Cannot build GvimExt with MingW or Cygwin. +Solution: Add makefile and modified resource files. (Rene de Zwart) + Also support Cygwin. (Alejandro Lopez_Valencia) +Files: GvimExt/Make_cyg.mak, GvimExt/Make_ming.mak, GvimExt/Makefile, + GvimExt/gvimext_ming.def, GvimExt/gvimext_ming.rc + +Patch 6.1.375 +Problem: MS-Windows: ':!dir "%"' does not work for a file name with spaces. + (Xiangjiang Ma) +Solution: Don't insert backslashes for spaces in a shell command. +Files: src/ex_docmd.c + +Patch 6.1.376 +Problem: "vim --version" and "vim --help" have a non-zero exit code. + That is unusual. (Petesea) +Solution: Use a zero exit code. +Files: src/main.c + +Patch 6.1.377 +Problem: Can't add words to 'lispwords' option. +Solution: Add P_COMMA and P_NODUP flags. (Haakon Riiser) +Files: src/option.c + +Patch 6.1.378 +Problem: When two buffer-local user commands are ambiguous, a full match + with a global user command isn't found. (Hari Krishna Dara) +Solution: Detect this situation and accept the global command. +Files: src/ex_docmd.c + +Patch 6.1.379 +Problem: Linux with kernel 2.2 can't use the alternate stack in combination + with threading, causes an infinite loop. +Solution: Don't use the alternate stack in this situation. +Files: src/os_unix.c + +Patch 6.1.380 +Problem: When 'winminheight' is zero and the quickfix window is zero lines, + entering the window doesn't make it higher. (Christian J. + Robinson) +Solution: Make sure the current window is at least one line high. +Files: src/window.c + +Patch 6.1.381 +Problem: When a BufWriteCmd is used and it leaves the buffer modified, the + window may still be closed. (Hari Krishna Dara) +Solution: Return FAIL from buf_write() when the buffer is still modified + after a BufWriteCmd autocommand was used. +Files: src/fileio.c + +Patch 6.1.382 (extra) +Problem: Win32 GUI: When using two monitors, the code that checks/fixes the + window size and position (e.g. when a font changes) doesn't work + properly. (George Reilly) +Solution: Handle a double monitor situation. (Helmut Stiegler) +Files: src/gui_w32.c + +Patch 6.1.383 +Problem: The filling of the status line doesn't work properly for + multi-byte characters. (Nam SungHyun) + There is no check for going past the end of the buffer. +Solution: Properly distinguish characters and bytes. Properly check for + running out of buffer space. +Files: src/buffer.c, src/ex_cmds2.c, src/proto/buffer.pro, src/screen.c + +Patch 6.1.384 +Problem: It is not possible to find if a certain patch has been included. + (Lubomir Host) +Solution: Support using has() to check if a patch was included. +Files: runtime/doc/eval.txt, src/eval.c, src/proto/version.pro, + src/version.c + +Patch 6.1.385 (depends on 6.1.383) +Problem: Can't compile without the multi-byte feature. +Solution: Move an #ifdef. (Christian J. Robinson) +Files: src/buffer.c + +Patch 6.1.386 +Problem: Get duplicate tags when running ":helptags". +Solution: Do the other halve of moving a section to another help file. +Files: runtime/tagsrch.txt + +Patch 6.1.387 (depends on 6.1.373) +Problem: Compiler warning for pointer cast. +Solution: Add (char_u *). +Files: src/option.c + +Patch 6.1.388 (depends on 6.1.384) +Problem: Compiler warning for pointer cast. +Solution: Add (char *). Only include has_patch() when used. +Files: src/eval.c, src/version.c + +Patch 6.1.389 (depends on 6.1.366) +Problem: Balloon evaluation doesn't work for GTK. + has("balloon_eval") doesn't work. +Solution: Add balloon evaluation for GTK. Also improve displaying of signs. + (Daniel Elstner) + Also make ":gui" start the netbeans connection and avoid using + netbeans functions when the connection is not open. +Files: src/Makefile, src/feature.h, src/gui.c, src/gui.h, + src/gui_beval.c, src/gui_beval.h, src/gui_gtk.c, + src/gui_gtk_x11.c, src/eval.c, src/memline.c, src/menu.c, + src/netbeans.c, src/proto/gui_beval.pro, src/proto/gui_gtk.pro, + src/structs.h, src/syntax.c, src/ui.c, src/workshop.c + +Patch 6.1.390 (depends on 6.1.389) +Problem: It's not possible to tell Vim to save and exit through the + Netbeans interface. Would still try to send balloon eval text + after the connection is closed. + Can't use Unicode characters for sign text. +Solution: Add functions "saveAndExit" and "getModified". Check for a + working connection before sending a balloonText event. + various other cleanups. + Support any character for sign text. (Daniel Elstner) +Files: runtime/doc/netbeans.txt, runtime/doc/sign.txt, src/ex_cmds.c, + src/netbeans.c, src/screen.c + +Patch 6.1.391 +Problem: ml_get() error when using virtualedit. (Charles Campbell) +Solution: Get a line from a specific window, not the current one. +Files: src/charset.c + +Patch 6.1.392 (depends on 6.1.383) +Problem: Highlighting in the 'statusline' is in the wrong position when an + item is truncated. (Zak Beck) +Solution: Correct the start of 'statusline' items properly for a truncated + item. +Files: src/buffer.c + +Patch 6.1.393 +Problem: When compiled with Python and threads, detaching the terminal may + cause Vim to loop forever. +Solution: Add -pthread to $CFLAGS when using Python and gcc. (Daniel + Elstner) +Files: src/auto/configure,, src/configure.in + +Patch 6.1.394 (depends on 6.1.390) +Problem: The netbeans interface doesn't recognize multibyte glyph names. +Solution: Check the number of cells rather than bytes to decide + whether a glyph name is not a filename. (Daniel Elstner) +Files: src/netbeans.c + +Patch 6.1.395 (extra, depends on 6.1.369) +Problem: VMS: OLD_VMS is never defined. Missing function prototype. +Solution: Define OLD_VMS in Make_vms.mms. Add vms_sys_status() to + os_vms.pro. (Zoltan Arpadffy) +Files: src/Make_vms.mms, src/proto/os_vms.pro + +Patch 6.1.396 (depends on 6.1.330) +Problem: Compiler warnings for using enum. +Solution: Add typecast to char_u. +Files: src/gui_gtk_x11.c, src/gui_x11.c + +Patch 6.1.397 (extra) +Problem: The install program may use a wrong path for the diff command if + there is a space in the install directory path. +Solution: Use double quotes around the path if necessary. (Alejandro + Lopez-Valencia) Also use double quotes around the file name + arguments. +Files: src/dosinst.c + +Patch 6.1.398 +Problem: Saving the typeahead for debug mode causes trouble for a test + script. (Servatius Brandt) +Solution: Add the ":debuggreedy" command to avoid saving the typeahead. +Files: runtime/doc/repeat.txt, src/ex_cmds.h, src/ex_cmds2.c, + src/ex_docmd.c, src/proto/ex_cmds2.pro + +Patch 6.1.399 +Problem: Warning for unused variable. +Solution: Remove the variable two_or_more. +Files: src/ex_cmds.c + +Patch 6.1.400 (depends on 6.1.381) +Problem: When a BufWriteCmd wipes out the buffer it may still be accessed. +Solution: Don't try accessing a buffer that has been wiped out. +Files: src/fileio.c + +Patch 6.1.401 (extra) +Problem: Building the Win16 version with Borland 5.01 doesn't work. + "make test" doesn't work with Make_dos.mak. (Walter Briscoe) +Solution: Various fixes to the w16 makefile. (Walter Briscoe) + Don't use deltree. Use "mkdir \tmp" instead of "mkdir /tmp". +Files: src/Make_w16.mak, src/testdir/Make_dos.mak + +Patch 6.1.402 +Problem: When evaluating a function name with curly braces, an error + is not handled consistently. +Solution: Accept the result of an curly braces expression when an + error was encountered. Skip evaluating an expression in curly + braces when skipping. (Servatius Brandt) +Files: src/eval.c + +Patch 6.1.403 (extra) +Problem: MS-Windows 16 bit: compiler warnings. +Solution: Add typecasts. (Walter Briscoe) +Files: src/ex_cmds2.c, src/gui_w48.c, src/os_mswin.c, src/os_win16.c, + src/syntax.c + +Patch 6.1.404 (extra) +Problem: Various small problems. +Solution: Fix comments. Various small additions, changes in indent, removal + of unused items and fixes. +Files: Makefile, README.txt, runtime/menu.vim, runtime/vimrc_example.vim, + src/INSTALL, src/INSTALLole.txt, src/Make_bc5.mak, + src/Make_cyg.mak, src/Make_ming.mak, src/Makefile, + src/config.h.in, src/edit.c, src/eval.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/getchar.c, + src/gui.c, src/gui_gtk.c, src/gui_photon.c, src/if_cscope.c, + src/if_python.c, src/keymap.h, src/mark.c, src/mbyte.c, + src/message.c, src/misc1.c, src/misc2.c, src/normal.c, + src/option.c, src/os_os2_cfg.h, src/os_win32.c, + src/proto/getchar.pro, src/proto/message.pro, + src/proto/regexp.pro, src/screen.c, src/structs.h, src/syntax.c, + src/term.c, src/testdir/test15.in, src/testdir/test15.ok, + src/vim.rc, src/xxd/Make_cyg.mak, src/xxd/Makefile + +Patch 6.1.405 +Problem: A few files are missing from the toplevel Makefile. +Solution: Add the missing files. +Files: Makefile + +Patch 6.1.406 (depends on 6.1.392) +Problem: When a statusline item doesn't fit arbitrary text appears. + (Christian J. Robinson) +Solution: When there is just enough room but not for the "<" truncate the + statusline item like there is no room. +Files: src/buffer.c + +Patch 6.1.407 +Problem: ":set scrollbind | help" scrollbinds the help window. (Andrew + Pimlott) +Solution: Reset 'scrollbind' when opening a help window. +Files: src/ex_cmds.c + +Patch 6.1.408 +Problem: When 'rightleft' is set unprintable character 0x0c is displayed as + ">c0<". +Solution: Reverse the text of the hex character. +Files: src/screen.c + +Patch 6.1.409 +Problem: Generating tags for the help doesn't work for some locales. +Solution: Set LANG=C LC_ALL=C in the environment for "sort". (Daniel + Elstner) +Files: runtime/doc/Makefile + +Patch 6.1.410 (depends on 6.1.390) +Problem: Linking error when compiling with Netbeans but without sign icons. + (Malte Neumann) +Solution: Don't define buf_signcount() when sign icons are unavailable. +Files: src/buffer.c + +Patch 6.1.411 +Problem: When 'virtualedit' is set, highlighting a Visual block beyond the + end of a line may be wrong. +Solution: Correct the virtual column when the end of the line is before the + displayed part of the line. (Muraoka Taro) +Files: src/screen.c + +Patch 6.1.412 +Problem: When swapping terminal screens and using ":gui" to start the GUI, + the shell prompt may be after a hit-enter prompt. +Solution: Output a newline in the terminal when starting the GUI and there + was a hit-enter prompt.. +Files: src/gui.c + +Patch 6.1.413 +Problem: When 'clipboard' contains "unnamed", "p" in Visual mode doesn't + work correctly. +Solution: Save the register before overwriting it and put the resulting text + on the clipboard afterwards. (Muraoka Taro) +Files: src/normal.c, src/ops.c + +Patch 6.1.414 (extra, depends on 6.1.369) +Problem: VMS: Vim busy waits when waiting for input. +Solution: Delay for a short while before getting another character. (Zoltan + Arpadffy) +Files: src/os_vms.c + +Patch 6.1.415 +Problem: When there is a vertical split and a quickfix window, reducing the + size of the Vim window may result in a wrong window layout and a + crash. +Solution: When reducing the window size and there is not enough space for + 'winfixheight' set the frame height to the larger height, so that + there is a retry while ignoring 'winfixheight'. (Yasuhiro + Matsumoto) +Files: src/window.c + +Patch 6.1.416 (depends on 6.1.366) +Problem: When using the Netbeans interface, a line with a sign cannot be + changed. +Solution: Respect the GUARDEDOFFSET for sign IDs when checking for a guarded + area. +Files: src/netbeans.c + +Patch 6.1.417 +Problem: Unprintable multi-byte characters are not handled correctly. + Multi-byte characters above 0xffff are displayed as another + character. +Solution: Handle unprintable multi-byte characters. Display multi-byte + characters above 0xffff with a marker. Recognize UTF-16 words and + BOM words as unprintable. (Daniel Elstner) +Files: src/charset.c, src/mbyte.c, src/screen.c + +Patch 6.1.418 +Problem: The result of strftime() is in the current locals. Need to + convert it to 'encoding'. +Solution: Obtain the current locale and convert the argument for strftime() + to it and the result back to 'encoding'. (Daniel Elstner) +Files: src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/mbyte.c, + src/proto/mbyte.pro, src/option.c, src/os_mswin.c + +Patch 6.1.419 +Problem: Vim doesn't compile on AIX 5.1. +Solution: Don't define _NO_PROTO on this system. (Uribarri) +Files: src/auto/configure, src/configure.in + +Patch 6.1.420 (extra) +Problem: convert_input() has an unnecessary STRLEN(). + Conversion from UCS-2 to a codepage uses word count instead of + byte count. +Solution: Remove the STRLEN() call. (Daniel Elstner) + Always use byte count for string_convert(). +Files: src/gui_w32.c, src/mbyte.c + +Patch 6.1.421 (extra, depends on 6.1.354) +Problem: MS-Windows 9x: When putting text on the clipboard it can be in + the wrong encoding. +Solution: Convert text to the active codepage for CF_TEXT. (Glenn Maynard) +Files: src/os_mswin.c + +Patch 6.1.422 +Problem: Error in .vimrc doesn't cause hit-enter prompt when swapping + screens. (Neil Bird) +Solution: Set msg_didany also when sending a message to the terminal + directly. +Files: src/message.c + +Patch 6.1.423 +Problem: Can't find arbitrary text in help files. +Solution: Added the ":helpgrep" command. +Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c, + src/proto/quickfix.pro, src/quickfix.c + +Patch 6.1.424 (extra) +Problem: Win32: Gvim compiled with VC++ 7.0 run on Windows 95 does not show + menu items. +Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO. + (Muraoka Taro) +Files: src/Make_mvc.mak + +Patch 6.1.425 +Problem: ":helptags $VIMRUNTIME/doc" does not add the "help-tags" tag. +Solution: Do add the "help-tags" tag for that specific directory. +Files: src/ex_cmds.c + +Patch 6.1.426 +Problem: "--remote-wait +cmd file" waits forever. (Valery Kondakoff) +Solution: Don't wait for the "+cmd" argument to have been edited. +Files: src/main.c + +Patch 6.1.427 +Problem: Several error messages for regexp patterns are not translated. +Solution: Use _() properly. (Muraoka Taro) +Files: src/regexp.c + +Patch 6.1.428 +Problem: FreeBSD: wait() may hang when compiled with Python support and + doing a system() call in a startup script. +Solution: Use waitpid() instead of wait() and poll every 10 msec, just like + what is done in the GUI. +Files: src/os_unix.c + +Patch 6.1.429 (depends on 6.1.390) +Problem: Crash when using showmarks.vim plugin. (Charles Campbell) +Solution: Check for sign_get_text() returning a NULL pointer. +Files: src/screen.c + +Patch 6.1.430 +Problem: In Lisp code backslashed parens should be ignored for "%". (Dorai) +Solution: Skip over backslashed parens. +Files: src/search.c + +Patch 6.1.431 +Problem: Debug commands end up in redirected text. +Solution: Disable redirection while handling debug commands. +Files: src/ex_cmds2.c + +Patch 6.1.432 (depends on 6.1.375) +Problem: MS-Windows: ":make %:p" inserts extra backslashes. (David Rennalls) +Solution: Don't add backslashes, handle it like ":!cmd". +Files: src/ex_docmd.c + +Patch 6.1.433 +Problem: ":popup" only works for Win32. +Solution: Add ":popup" support for GTK. (Daniel Elstner) +Files: runtime/doc/gui.txt, src/ex_docmd.c, src/gui_gtk.c, src/menu.c, + src/proto/gui_gtk.pro + +Patch 6.1.434 (extra) +Problem: Win32: When there are more than 32767 lines, the scrollbar has a + roundoff error. +Solution: Make a click on an arrow move one line. Also move the code to + gui_w48.c, there is hardly any difference between the 16 bit and + 32 bit versions. (Walter Briscoe) +Files: src/gui_w16.c, src/gui_w32.c, src/gui_w48.c + +Patch 6.1.435 +Problem: ":winsize x" resizes the Vim window to the minimal size. (Andrew + Pimlott) +Solution: Give an error message for wrong arguments of ":winsize" and + ":winpos". +Files: src/ex_docmd.c + +Patch 6.1.436 +Problem: When a long UTF-8 file contains an illegal byte it's hard to find + out where it is. (Ron Aaron) +Solution: Add the line number to the error message. +Files: src/fileio.c + +Patch 6.1.437 (extra, depends on 6.1.421) +Problem: Using multi-byte functions when they are not available. +Solution: Put the clipboard conversion inside an #ifdef. (Vince Negri) + Also fix a pointer type mistake. (Walter Briscoe) +Files: src/os_mswin.c + +Patch 6.1.438 +Problem: When Perl has thread support Vim cannot use the Perl interface. +Solution: Add a configure check and disable Perl when it will not work. + (Aron Griffis) +Files: src/auto/configure, src/configure.in + +Patch 6.1.439 +Problem: Netbeans: A "create" function doesn't actually create a buffer, + following functions may fail. +Solution: Create a Vim buffer without a name when "create" is called. + (Gordon Prieur) +Files: runtime/doc/netbeans.txt, src/netbeans.c + +Patch 6.1.440 +Problem: The "@*" command doesn't obtain the actual contents of the + clipboard. (Hari Krishna Dara) +Solution: Obtain the clipboard text before executing the command. +Files: src/ops.c + +Patch 6.1.441 +Problem: "zj" and "zk" cannot be used as a motion command after an + operator. (Ralf Hetzel) +Solution: Accept these commands as motion commands. +Files: src/normal.c + +Patch 6.1.442 +Problem: Unicode 3.2 defines more space and punctuation characters. +Solution: Add the new characters to the Unicode tables. (Raphael Finkel) +Files: src/mbyte.c + +Patch 6.1.443 (extra) +Problem: Win32: The gvimext.dll build with Borland 5.5 requires another + DLL. +Solution: Build a statically linked version by default. (Dan Sharp) +Files: GvimExt/Make_bc5.mak + +Patch 6.1.444 (extra) +Problem: Win32: Enabling a build with gettext support is not consistent. +Solution: Use "GETTEXT" for Borland and msvc makefiles. (Dan Sharp) +Files: src/Make_bc5.mak, src/Make_mvc.mak + +Patch 6.1.445 (extra) +Problem: DJGPP: get warning for argument of putenv() +Solution: Define HAVE_PUTENV to use DJGPP's putenv(). (Walter Briscoe) +Files: src/os_msdos.h + +Patch 6.1.446 (extra) +Problem: Win32: The MingW makefile uses a different style of arguments than + other makefiles. + Dynamic IME is not supported for Cygwin. +Solution: Use "no" and "yes" style arguments. Remove the use of the + dyn-ming.h include file. (Dan Sharp) + Do not include the ime.h file and adjust the makefile. (Alejandro + Lopez-Valencia) +Files: src/Make_cyg.mak, src/Make_ming.mak, src/gui_w32.c, + src/if_perl.xs, src/if_python.c, src/if_ruby.c, src/os_win32.c + +Patch 6.1.447 +Problem: "make install" uses "make" directly for generating help tags. +Solution: Use $(MAKE) instead of "make". (Tim Mooney) +Files: src/Makefile + +Patch 6.1.448 +Problem: 'titlestring' has a default maximum width of 50 chars per item. +Solution: Remove the default maximum (also for 'statusline'). +Files: src/buffer.c + +Patch 6.1.449 +Problem: When "1" and "a" are in 'formatoptions', auto-formatting always + moves a newly added character to the next line. (Servatius Brandt) +Solution: Don't move a single character to the next line when it was just + typed. +Files: src/edit.c + +Patch 6.1.450 +Problem: Termcap entry "kB" for back-tab is not recognized. +Solution: Use back-tab as the shift-tab code. +Files: src/keymap.h, src/misc2.c, src/term.c + +Patch 6.1.451 +Problem: GUI: When text in the find dialog contains a slash, a backslash is + inserted the next time it is opened. (Mezz) +Solution: Remove escaped backslashes and question marks. (Daniel Elstner) +Files: src/gui.c + +Patch 6.1.452 (extra, after 6.1.446) +Problem: Win32: IME support doesn't work for MSVC. +Solution: Use _MSC_VER instead of __MSVC. (Alejandro Lopez-Valencia) +Files: src/gui_w32.c + +Patch 6.1.453 (after 6.1.429) +Problem: When compiled without sign icons but with sign support, adding a + sign may cause a crash. +Solution: Check for the text sign to exist before using it. (Kamil + Burzynski) +Files: src/screen.c + +Patch 6.1.454 (extra) +Problem: Win32: pasting Russian text in Vim with 'enc' set to cp1251 + results in utf-8 bytes. (Perelyubskiy) + Conversion from DBCS to UCS2 does not work when 'encoding' is not + the active codepage. +Solution: Introduce enc_codepage and use it for conversion to 'encoding' + (Glenn Maynard) + Use MultiByteToWideChar() and WideCharToMultiByte() instead of + iconv(). Should do most needed conversions without iconv.dll. +Files: src/globals.h, src/gui_w32.c, src/mbyte.c, src/os_mswin.c, + src/proto/mbyte.pro, src/proto/os_mswin.pro, src/structs.h + +Patch 6.1.455 +Problem: Some Unicode characters can be one or two character cells wide. +Solution: Add the 'ambiwidth' option to tell Vim how to display these + characters. (Jungshik Shin) + Also reset the script ID when setting an option to its default + value, so that ":verbose set" won't give wrong info. +Files: runtime/doc/options.txt, src/mbyte.c, src/option.c, src/option.h + +Patch 6.1.456 (extra, after 6.1.454) +Problem: Win32: IME doesn't work. +Solution: ImmGetCompositionStringW() returns the size in bytes, not words. + (Yasuhiro Matsumoto) Also fix typecast problem. +Files: src/gui_w32.c, src/os_mswin.c + +Patch 6.1.457 +Problem: An empty register in viminfo causes conversion to fail. +Solution: Don't convert an empty string. (Yasuhiro Matsumoto) +Files: src/ex_cmds.c, src/mbyte.c + +Patch 6.1.458 +Problem: Compiler warning for pointer. +Solution: Add a typecast. +Files: src/ex_cmds.c + +Patch 6.1.459 (extra) +Problem: Win32: libcall() may return an invalid pointer and cause Vim to + crash. +Solution: Add a strict check for the returned pointer. (Bruce Mellows) +Files: src/os_mswin.c + +Patch 6.1.460 +Problem: GTK: after scrolling the text one line with a key, clicking the + arrow of the scrollbar does not always work. (Nam SungHyun) +Solution: Always update the scrollbar thumb when the value changed, even + when it would not move, like for RISCOS. (Daniel Elstner) +Files: src/gui.c, src/gui.h + +Patch 6.1.461 +Problem: When a keymap is active, typing a character in Select mode does + not use it. (Benji Fisher) +Solution: Apply Insert mode mapping to the character typed in Select mode. +Files: src/normal.c + +Patch 6.1.462 +Problem: When autocommands wipe out a buffer, a crash may happen. (Hari + Krishna Dara) +Solution: Don't decrement the window count of a buffer before calling the + autocommands for it. When re-using the current buffer, watch out + for autocommands changing the current buffer. +Files: src/buffer.c, src/ex_cmds.c, src/proto/buffer.pro + +Patch 6.1.463 +Problem: When writing a compressed file, the file name that gzip stores in + the file is the weird temporary file name. (David Rennalls) +Solution: Use the real file name when possible. +Files: runtime/plugin/gzip.vim + +Patch 6.1.464 +Problem: Crash when using C++ syntax highlighting. (Gerhard Hochholzer) +Solution: Check for a negative index. +Files: src/syntax.c + +Patch 6.1.465 (after 6.1.454) +Problem: Compile error when using cygwin. +Solution: Change #ifdef WIN32 to #ifdef WIN3264. (Alejandro Lopez-Valencia) + Undefine WIN32 after including windows.h +Files: src/mbyte.c + +Patch 6.1.466 +Problem: The "-f" argument is a bit obscure. +Solution: Add the "--nofork" argument. Improve the help text a bit. +Files: runtime/doc/starting.txt, src/main.c + +Patch 6.1.467 +Problem: Setting the window title doesn't work for Chinese. +Solution: Use an X11 function to convert text to a text property. (Kentaro + Nakazawa) +Files: src/os_unix.c + +Patch 6.1.468 +Problem: ":mksession" also stores folds for buffers which will not be + restored. +Solution: Only store folds for a buffer with 'buftype' empty and help files. +Files: src/ex_docmd.c + +Patch 6.1.469 +Problem: 'listchars' cannot contain multi-byte characters. +Solution: Handle multi-byte UTF-8 list characters. (Matthew Samsonoff) +Files: src/message.c, src/option.c, src/screen.c + +Patch 6.1.470 (lang) +Problem: Polish messages don't show up correctly on MS-Windows. +Solution: Convert messages to cp1250. (Mikolaj Machowski) + Also add English message translations, because it got in the way + of the patch. +Files: Makefile, src/po/Makefile, src/po/en_gb.po, src/po/pl.po + +Patch 6.1.471 +Problem: ":jumps" output continues after pressing "q" at the more-prompt. + (Hari Krishna Dara) +Solution: Check for "got_int" being set. +Files: src/mark.c + +Patch 6.1.472 +Problem: When there is an authentication error when connecting to the X + server Vim exits. +Solution: Use XSetIOErrorHandler() to catch the error and longjmp() to avoid + the exit. Also do this in the main loop, so that when the X + server exits a Vim running in a console isn't killed. +Files: src/globals.h, src/main.c, src/os_unix.c + +Patch 6.1.473 +Problem: Referring to $curwin or $curbuf in Perl 5.6 causes a crash. +Solution: Add "pTHX_" to cur_val(). (Yasuhiro Matsumoto) +Files: src/if_perl.xs + +Patch 6.1.474 +Problem: When opening the command-line window in Ex mode it's impossible to + go back. (Pavol Juhas) +Solution: Reset "exmode_active" and restore it when the command-line window + is closed. +Files: src/ex_getln.c + + +Patch 6.2f.001 +Problem: The configure check for Ruby didn't work properly for Ruby 1.8.0. +Solution: Change the way the Ruby check is done. (Aron Griffis) +Files: src/auto/configure, src/configure.in + +Patch 6.2f.002 +Problem: The output of ":ls" doesn't show whether a buffer had read errors. +Solution: Add the "x" flag in the ":ls" output. +Files: runtime/doc/windows.txt, src/buffer.c + +Patch 6.2f.003 +Problem: Test49 doesn't properly test the behavior of ":catch" without an + argument. +Solution: Update test49. (Servatius Brandt) +Files: src/testdir/test49.ok, src/testdir/test49.vim + +Patch 6.2f.004 +Problem: "vim --version" always uses CR/LF in the output. +Solution: Omit the CR. +Files: src/message.c, src/os_unix.c + +Patch 6.2f.005 +Problem: Two error messages without a colon after the number. +Solution: Add the colon. (Taro Muraoka) +Files: src/if_cscope.c + +Patch 6.2f.006 +Problem: When saving a file takes a while and Vim regains focus this can + result in a "file changed outside of Vim" warning and ml_get() + errors. (Mike Williams) +Solution: Add the "b_saving" flag to avoid checking the timestamp while the + buffer is being saved. (Michael Schaap) +Files: src/fileio.c, src/structs.h + +Patch 6.2f.007 +Problem: Irix compiler complains about multiple defined symbols. + vsnprintf() is not available. (Charles Campbell) +Solution: Insert EXTERN for variables in globals.h. Change the configure + check for vsnprintf() from compiling to linking. +Files: src/auto/configure, src/configure.in, src/globals.h + +Patch 6.2f.008 +Problem: The Aap recipe doesn't work with Aap 0.149. +Solution: Change targetarg to TARGETARG. Update the mysign file. +Files: src/main.aap, src/mysign + +Patch 6.2f.009 (extra) +Problem: Small problem when building with Borland 5.01. +Solution: Use mkdir() instead of _mkdir(). (Walter Briscoe) +Files: src/dosinst.h + +Patch 6.2f.010 +Problem: Warning for missing prototypes. +Solution: Add missing prototypes. (Walter Briscoe) +Files: src/if_cscope.c + +Patch 6.2f.011 +Problem: The configure script doesn't work with autoconf 2.5x. +Solution: Add square brackets around a header check. (Aron Griffis) + Note: touch src/auto/configure after applying this patch. +Files: src/configure.in + +Patch 6.2f.012 +Problem: ":echoerr" doesn't work correctly inside try/endtry. +Solution: Don't reset did_emsg inside a try/endtry. (Servatius Brandt) +Files: src/eval.c + +Patch 6.2f.013 (extra) +Problem: Macintosh: Compiler warning for a trigraph. +Solution: Insert a backslash before each question mark. (Peter Cucka) +Files: src/os_mac.h + +Patch 6.2f.014 (extra) +Problem: Macintosh: ex_eval is not included in the project file. +Solution: Add ex_eval. (Dany St-Amant) +Files: src/os_mac.pbproj/project.pbxproj + +Patch 6.2f.015 (extra) +Problem: Win32: When changing header files not all source files involved + are recompiled. +Solution: Improve the dependency rules. (Dan Sharp) +Files: src/Make_cyg.mak, src/Make_ming.mak + +Patch 6.2f.016 +Problem: "vim --version > ff" on non-Unix systems results in a file with a + missing line break at the end. (Bill McCArthy) +Solution: Add a line break. +Files: src/main.c + +Patch 6.2f.017 +Problem: Unix: starting Vim in the background and then bringing it to the + foreground may cause the terminal settings to be wrong. +Solution: Check for tcsetattr() to return an error, retry when it does. + (Paul Tapper) +Files: src/os_unix.c + +Patch 6.2f.018 +Problem: Mac OS X 10.2: OK is defined to zero in cursus.h while Vim uses + one. Redefining it causes a warning message. +Solution: Undefine OK before defining it to one. (Taro Muraoka) +Files: src/vim.h + +Patch 6.2f.019 +Problem: Mac OS X 10.2: COLOR_BLACK and COLOR_WHITE are defined in + curses.h. +Solution: Rename them to PRCOLOR_BLACK and PRCOLOR_WHITE. +Files: src/ex_cmds2.c + +Patch 6.2f.020 +Problem: Win32: test50 produces beeps and fails with some versions of diff. +Solution: Remove empty lines and convert the output to dos fileformat. +Files: src/testdir/test50.in + +Patch 6.2f.021 +Problem: Running configure with "--enable-netbeans" disables Netbeans. + (Gordon Prieur) +Solution: Fix the tests in configure.in where the default is to enable a + feature. Fix that "--enable-acl" reported "yes" confusingly. +Files: src/auto/configure, src/configure.in, src/mysign + +Patch 6.2f.022 +Problem: A bogus value for 'foldmarker' is not rejected, possibly causing a + hang. (Derek Wyatt) +Solution: Check for a non-empty string before and after the comma. +Files: src/option.c + +Patch 6.2f.023 +Problem: When the help files are not in $VIMRUNTIME but 'helpfile' is + correct Vim still can't find the help files. +Solution: Also look for a tags file in the directory of 'helpfile'. +Files: src/tag.c + +Patch 6.2f.024 +Problem: When 'delcombine' is set and a character has more than two + composing characters "x" deletes them all. +Solution: Always delete only the last composing character. +Files: src/misc1.c + +Patch 6.2f.025 +Problem: When reading a file from stdin that has DOS line endings but a + missing end-of-line for the last line 'fileformat' becomes "unix". + (Bill McCarthy) +Solution: Don't add the missing line break when re-reading the text from the + buffer. +Files: src/fileio.c + +Patch 6.2f.026 +Problem: When typing new text at the command line, old composing characters + may be displayed. +Solution: Don't read composing characters from after the end of the + text to be displayed. +Files: src/ex_getln.c, src/mbyte.c, src/message.c, src/proto/mbyte.pro, + src/screen.c + +Patch 6.2f.027 +Problem: Compiler warnings for unsigned char pointers. (Tony Leneis) +Solution: Add typecasts to char pointer. +Files: src/quickfix.c + +Patch 6.2f.028 +Problem: GTK: When 'imactivatekey' is empty and XIM is inactive it can't be + made active again. Cursor isn't updated immediately when changing + XIM activation. Japanese XIM may hang when using 'imactivatekey'. + Can't activate XIM after typing fFtT command or ":sh". +Solution: Properly set the flag that indicates the IM is active. Update the + cursor right away. Do not send a key-release event. Handle + Normal mode and running an external command differently. + (Yasuhiro Matsumoto) +Files: src/mbyte.c + +Patch 6.2f.029 +Problem: Mixing use of int and enum. +Solution: Adjust argument type of cs_usage_msg(). Fix wrong typedef. +Files: src/if_cscope.c, src/if_cscope.h + +Patch 6.2f.030 (after 6.2f.028) +Problem: Cursor moves up when using XIM. +Solution: Reset im_preedit_cursor. (Yasuhiro Matsumoto) +Files: src/mbyte.c + +Patch 6.2f.031 +Problem: Crash when listing a function argument in the debugger. (Ron Aaron) +Solution: Init the name field of an argument to NULL. +Files: src/eval.c + +Patch 6.2f.032 +Problem: When a write fails for a ":silent!" while inside try/endtry the + BufWritePost autocommands are not triggered. +Solution: Check the emsg_silent flag in should_abort(). (Servatius Brandt) +Files: src/ex_eval.c, src/testdir/test49.ok, src/testdir/test49.vim + +Patch 6.2f.033 +Problem: Cscope: re-entrance problem for ":cscope" command. Checking for + duplicate database didn't work well for Win95. Didn't check for + duplicate databases after an empty entry. +Solution: Don't set postponed_split too early. Remember first empty + database entry. (Sergey Khorev) +Files: src/if_cscope.c + +Patch 6.2f.034 +Problem: The netbeans interface cannot be used on systems without + vsnprintf(). (Tony Leneis) +Solution: Use EMSG(), EMSGN() and EMSG2() instead. +Files: src/auto/configure, src/configure.in, src/netbeans.c + +Patch 6.2f.035 +Problem: The configure check for the netbeans interface doesn't work if the + socket and nsl libraries are required. +Solution: Check for the socket and nsl libraries before the netbeans check. +Files: src/auto/configure, src/configure.in + +Patch 6.2f.036 +Problem: Moving leftwards over text with an illegal UTF-8 byte moves one + byte instead of one character. +Solution: Ignore an illegal byte after the cursor position. +Files: src/mbyte.c + +Patch 6.2f.037 +Problem: When receiving a Netbeans command at the hit-enter or more prompt + the screen is redrawn but Vim is still waiting at the prompt. +Solution: Quit the prompt like a CTRL-C was typed. +Files: src/netbeans.c + +Patch 6.2f.038 +Problem: The dependency to run autoconf causes a patch for configure.in + to run autoconf, even though the configure script was updated as + well. +Solution: Only run autoconf with "make autoconf". +Files: src/Makefile + +Patch 6.2f.039 +Problem: CTRL-W K makes the new top window very high. +Solution: When 'equalalways' is set equalize the window heights. +Files: src/window.c + + +============================================================================== +VERSION 6.3 *version-6.3* + +This section is about improvements made between version 6.2 and 6.3. + +This is mainly a bug-fix release. There are also a few new features. +The major number of new items is in the runtime files and translations. + + +Changed *changed-6.3* +------- + +The intro message also displays a note about sponsoring Vim, mixed randomly +with the message about helping children in Uganda. + +Included the translated menus, keymaps and tutors with the normal runtime +files. The separate "lang" archive now only contains translated messages. + +Made the translated menu file names a bit more consistent. Use "latin1" for +"iso_8859-1" and "iso_8859-15". + +Removed the "file_select.vim" script from the distribution. It's not more +useful than other scripts that can be downloaded from www.vim.org. + +The "runtime/doc/tags" file is now always in unix fileformat. On MS-Windows +it used to be dos fileformat, but ":helptags" generates a unix format file. + + +Added *added-6.3* +----- + +New commands: + :cNfile go to last error in previous file + :cpfile idem + :changes print the change list + :keepmarks following command keeps marks where they are + :keepjumps following command keeps jumplist and marks + :lockmarks following command keeps marks where they are + :redrawstatus force a redraw of the status line(s) + +New options: + 'antialias' Mac OS X: use smooth, antialiased fonts + 'helplang' preferred help languages + +Syntax files: + Arch inventory (Nikolai Weibull) + Calendar (Nikolai Weibull) + Ch (Wayne Cheng) + Controllable Regex Mutilator (Nikolai Weibull) + D (Jason Mills) + Desktop (Mikolaj Machowski) + Dircolors (Nikolai Weibull) + Elinks configuration (Nikolai Weibull) + FASM (Ron Aaron) + GrADS scripts (Stefan Fronzek) + Icewm menu (James Mahler) + LDIF (Zak Johnson) + Locale input, fdcc. (Dwayne Bailey) + Pinfo config (Nikolai Weibull) + Pyrex (Marco Barisione) + Relax NG Compact (Nikolai Weibull) + Slice (Morel Bodin) + VAX Macro Assembly (Tom Uijldert) + grads (Stefan Fronzek) + libao (Nikolai Weibull) + mplayer (Nikolai Weibull) + rst (Nikolai Weibull) + tcsh (Gautam Iyer) + yaml (Nikolai Weibull) + +Compiler plugins: + ATT dot (Marcos Macedo) + Apple Project Builder (Alexander von Below) + Intel (David Harrison) + bdf (Nikolai Weibull) + icc (Peter Puck) + javac (Doug Kearns) + neato (Marcos Macedo) + onsgmls (Robert B. Rowsome) + perl (Christian J. Robinson) + rst (Nikolai Weibull) + se (SmartEiffel) (Doug Kearns) + tcl (Doug Kearns) + xmlwf (Robert B. Rowsome) + +Filetype plugins: + Aap (Bram Moolenaar) + Ch (Wayne Cheng) + Css (Nikolai Weibull) + Pyrex (Marco Barisione) + Rst (Nikolai Weibull) + +Indent scripts: + Aap (Bram Moolenaar) + Ch (Wayne Cheng) + DocBook (Nikolai Weibull) + MetaPost (Eugene Minkovskii) + Objective-C (Kazunobu Kuriyama) + Pyrex (Marco Barisione) + Rst (Nikolai Weibull) + Tcsh (Gautam Iyer) + XFree86 configuration file (Nikolai Weibull) + Zsh (Nikolai Weibull) + +Keymaps: + Greek for cp1253 (Panagiotis Louridas) + Hungarian (Magyar) (Laszlo Zavaleta) + Persian-Iranian (Behnam Esfahbod) + +Message translations: + Catalan (Ernest Adrogue) + Russian (Vassily Ragosin) + Swedish (Johan Svedberg) + +Menu translations: + Catalan (Ernest Adrogue) + Russian (Tim Alexeevsky) + Swedish (Johan Svedberg) + +Tutor translations: + Catalan (Ernest Adrogue) + Russian in cp1251 (Alexey Froloff) + Slovak in cp1250 and iso8859-2 (Lubos Celko) + Swedish (Johan Svedberg) + Korean (Kee-Won Seo) + UTF-8 version of the Japanese tutor (Yasuhiro Matsumoto) Use this as + the original, create the other Japanese tutor by conversion. + +Included "russian.txt" help file. (Vassily Ragosin) + +Include Encapsulated PostScript and PDF versions of the Vim logo in the extra +archive. + +The help highlighting finds the highlight groups and shows them in the color +that is actually being used. (idea from Yakov Lerner) + +The big Win32 version is now compiled with Ruby interface, version 1.8. For +Python version 2.3 is used. For Perl version 5.8 is used. + +The "ftdetect" directory is mentioned in the documentation. The DOS install +program creates it. + + +Fixed *fixed-6.3* +----- + +Test 42 failed on MS-Windows. Set and reset 'fileformat' and 'binary' options +here and there. (Walter Briscoe) + +The explorer plugin didn't work for double-byte 'encoding's. + +Use "copy /y" in Make_bc5.mak to avoid a prompt for overwriting. + +Patch 6.2.001 +Problem: The ":stopinsert" command doesn't have a help tag. +Solution: Add the tag. (Antoine J. Mechelynck) +Files: runtime/doc/insert.txt, runtime/doc/tags + +Patch 6.2.002 +Problem: When compiled with the +multi_byte feature but without +eval, + displaying UTF-8 characters may cause a crash. (Karsten Hopp) +Solution: Also set the default for 'ambiwidth' when compiled without the + +eval feature. +Files: src/option.c + +Patch 6.2.003 +Problem: GTK 2: double-wide characters below 256 are not displayed + correctly. +Solution: Check the cell width for characters above 127. (Yasuhiro + Matsumoto) +Files: src/gui_gtk_x11.c + +Patch 6.2.004 +Problem: With a line-Visual selection at the end of the file a "p" command + puts the text one line upwards. +Solution: Detect that the last line was deleted and put forward. (Taro + Muraoka) +Files: src/normal.c + +Patch 6.2.005 +Problem: GTK: the "Find" and "Find and Replace" tools don't work. (Aschwin + Marsman) +Solution: Show the dialog after creating it. (David Necas) +Files: src/gui_gtk.c + +Patch 6.2.006 +Problem: The Netbeans code contains an obsolete function that uses "vim61" + and sets the fall-back value for $VIMRUNTIME. +Solution: Delete the obsolete function. +Files: src/main.c, src/netbeans.c, src/proto/netbeans.pro + +Patch 6.2.007 +Problem: Listing tags for Cscope doesn't always work. +Solution: Avoid using smgs_attr(). (Sergey Khorev) +Files: src/if_cscope.c + +Patch 6.2.008 +Problem: XIM with GTK 2: After backspacing preedit characters are wrong. +Solution: Reset the cursor position. (Yasuhiro Matsumoto) +Files: src/mbyte.c + +Patch 6.2.009 +Problem: Win32: The self-installing executable "Full" selection only + selects some of the items to install. (Salman Mohsin) +Solution: Change commas to spaces in between section numbers. +Files: nsis/gvim.nsi + +Patch 6.2.010 +Problem: When 'virtualedit' is effective and a line starts with a + multi-byte character, moving the cursor right doesn't work. +Solution: Obtain the right character to compute the column offset. (Taro + Muraoka) +Files: src/charset.c + +Patch 6.2.011 +Problem: Alpha OSF1: stat() is a macro and doesn't allow an #ifdef halfway. + (Moshe Kaminsky) +Solution: Move the #ifdef outside of stat(). +Files: src/os_unix.c + +Patch 6.2.012 +Problem: May hang when polling for a character. +Solution: Break the wait loop when not waiting for a character. +Files: src/os_unix.c + +Patch 6.2.013 (extra) +Problem: Win32: The registry key for uninstalling GvimExt still uses "6.1". +Solution: Change the version number to "6.2". (Ajit Thakkar) +Files: src/GvimExt/GvimExt.reg + +Patch 6.2.014 (after 6.2.012) +Problem: XSMP doesn't work when using poll(). +Solution: Use xsmp_idx instead of gpm_idx. (Neil Bird) +Files: src/os_unix.c + +Patch 6.2.015 +Problem: The +xsmp feature is never enabled. +Solution: Move the #define for USE_XSMP to below where WANT_X11 is defined. + (Alexey Froloff) +Files: src/feature.h + +Patch 6.2.016 +Problem: Using ":scscope find" with 'cscopequickfix' does not always split + the window. (Gary Johnson) + Win32: ":cscope add" could make the script that contains it + read-only until the corresponding ":cscope kill". + Errors during ":cscope add" may not be handled properly. +Solution: When using the quickfix window may need to split the window. + Avoid file handle inheritance for the script. + Check for a failed connection and/or process. (Sergey Khorev) +Files: src/ex_cmds2.c, src/if_cscope.c + +Patch 6.2.017 +Problem: Test11 sometimes prompts the user, because a file would have been + changed outside of Vim. (Antonio Colombo) +Solution: Add a FileChangedShell autocommand to avoid the prompt. +Files: src/testdir/test11.in + +Patch 6.2.018 +Problem: When using the XSMP protocol and reading from stdin Vim may wait + for a key to be pressed. +Solution: Avoid that RealWaitForChar() is used recursively. +Files: src/os_unix.c + +Patch 6.2.019 (lang) +Problem: Loading the Portuguese menu causes an error message. +Solution: Join two lines. (Jose Pedro Oliveira, Jos de Paula) +Files: runtime/lang/menu_pt_br.vim + +Patch 6.2.020 +Problem: The "Syntax/Set syntax only" menu item causes an error message. + (Oyvind Holm) +Solution: Set the script-local variable in a function. (Benji Fisher) +Files: runtime/synmenu.vim + +Patch 6.2.021 +Problem: The user manual section on exceptions contains small mistakes. +Solution: Give a good example of an error that could be missed and other + improvements. (Servatius Brandt) +Files: runtime/doc/usr_41.txt + +Patch 6.2.022 (extra) +Problem: Win32: After deleting a menu item it still appears in a tear-off + window. +Solution: Set the mode to zero for the deleted item. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + +Patch 6.2.023 (extra) +Problem: Win32: Make_ivc.mak does not clean everything. +Solution: Delete more files in the clean rule. (Walter Briscoe) +Files: src/Make_ivc.mak + +Patch 6.2.024 (extra) +Problem: Win32: Compiler warnings for typecasts. +Solution: Use DWORD instead of WORD. (Walter Briscoe) +Files: src/gui_w32.c + +Patch 6.2.025 +Problem: Missing prototype for sigaltstack(). +Solution: Add the prototype when it is not found in a header file. +Files: src/os_unix.c + +Patch 6.2.026 +Problem: Warning for utimes() argument. +Solution: Add a typecast. +Files: src/fileio.c + +Patch 6.2.027 +Problem: Warning for uninitialized variable. +Solution: Set mb_l to one when not using multi-byte characters. +Files: src/message.c + +Patch 6.2.028 +Problem: Cscope connection may kill Vim process and others. +Solution: Check for pid being larger than one. (Khorev Sergey) +Files: src/if_cscope.c + +Patch 6.2.029 +Problem: When using the remote server functionality Vim may leak memory. + (Srikanth Sankaran) +Solution: Free the result of XListProperties(). +Files: src/if_xcmdsrv.c + +Patch 6.2.030 +Problem: Mac: Warning for not being able to use precompiled header files. +Solution: Don't redefine select. Use -no-cpp-precomp for compiling, so that + function prototypes are still found. +Files: src/os_unix.c, src/osdef.sh + +Patch 6.2.031 +Problem: The langmenu entry in the options window doesn't work. (Rodolfo + Lima) + With GTK 1 the ":options" command causes an error message. + (Michael Naumann) +Solution: Change "lmenu" to "langmenu". Only display the 'tbis' option for + GTK 2. +Files: runtime/optwin.vim + +Patch 6.2.032 +Problem: The lpc filetype is never recognized. (Shizhu Pan) +Solution: Check for g:lpc_syntax_for_c instead of the local variable + lpc_syntax_for_c. (Benji Fisher) +Files: runtime/filetype.vim + +Patch 6.2.033 (extra) +Problem: Mac: Various compiler warnings. +Solution: Don't include Classic-only headers in Unix version. + Remove references to several unused variables. (Ben Fowler) + Fix double definition of DEFAULT_TERM. + Use int instead of unsigned short for pixel values, so that the + negative error values are recognized. +Files: src/gui_mac.c, src/term.c + +Patch 6.2.034 +Problem: Mac: Compiler warning for redefining DEFAULT_TERM. +Solution: Fix double definition of DEFAULT_TERM. +Files: src/term.c + +Patch 6.2.035 +Problem: Mac: Compiler warnings in Python interface. +Solution: Make a difference between pure Mac and Unix-Mac. (Peter Cucka) +Files: src/if_python.c + +Patch 6.2.036 (extra) +Problem: Mac Unix version: If foo is a directory, then ":e f<Tab>" should + expand to ":e foo/" instead of ":e foo" . (Vadim Zeitlin) +Solution: Define DONT_ADD_PATHSEP_TO_DIR only for pure Mac. (Benji Fisher) +Files: src/os_mac.h + +Patch 6.2.037 +Problem: Win32: converting an encoding name to a codepage could result in + an arbitrary number. +Solution: make encname2codepage() return zero if the encoding name doesn't + contain a codepage number. +Files: src/mbyte.c + +Patch 6.2.038 (extra) +Problem: Warning messages when using the MingW compiler. (Bill McCarthy) + Can't compile console version without +mouse feature. +Solution: Initialize variables, add parenthesis. + Add an #ifdef around g_nMouseClick. (Ajit Thakkar) +Files: src/eval.c, src/os_win32.c, src/gui_w32.c, src/dosinst.c + +Patch 6.2.039 (extra) +Problem: More warning messages when using the MingW compiler. +Solution: Initialize variables. (Bill McCarthy) +Files: src/os_mswin.c + +Patch 6.2.040 +Problem: FreeBSD: Crash while starting up when compiled with +xsmp feature. +Solution: Pass a non-NULL argument to IceAddConnectionWatch(). +Files: src/os_unix.c + +Patch 6.2.041 (extra, after 6.2.033) +Problem: Mac: Compiler warnings for conversion types, missing prototype, + missing return type. +Solution: Change sscanf "%hd" to "%d", the argument is an int now. Add + gui_mch_init_check() prototype. Add "int" to termlib functions. +Files: src/gui_mac.c, src/proto/gui_mac.pro, src/termlib.c. + +Patch 6.2.042 (extra) +Problem: Cygwin: gcc 3.2 has an optimizer problem, sometimes causing a + crash. +Solution: Add -fno-strength-reduce to the compiler arguments. (Dan Sharp) +Files: src/Make_cyg.mak + +Patch 6.2.043 +Problem: Compiling with both netbeans and workshop doesn't work. +Solution: Move the shellRectangle() function to gui_x11.c. (Gordon Prieur) +Files: src/gui_x11.c, src/integration.c, src/netbeans.c, + src/proto/netbeans.pro + +Patch 6.2.044 +Problem: ":au filetypedetect" gives an error for a non-existing event name, + but it's actually a non-existing group name. (Antoine Mechelynck) +Solution: Make the error message clearer. +Files: src/fileio.c + +Patch 6.2.045 +Problem: Obtaining the '( mark changes the '' mark. (Gary Holloway) +Solution: Don't set the '' mark when searching for the start/end of the + current sentence/paragraph. +Files: src/mark.c + +Patch 6.2.046 +Problem: When evaluating an argument of a function throws an exception the + function is still called. (Hari Krishna Dara) +Solution: Don't call the function when an exception was thrown. +Files: src/eval.c + +Patch 6.2.047 (extra) +Problem: Compiler warnings when using MingW. (Bill McCarthy) +Solution: Give the s_dwLastClickTime variable a type. Initialize dwEndTime. +Files: src/os_win32.c + +Patch 6.2.048 +Problem: The Python interface doesn't compile with Python 2.3 when + dynamically loaded. +Solution: Use dll_PyObject_Malloc and dll_PyObject_Free. (Paul Moore) +Files: src/if_python.c + +Patch 6.2.049 +Problem: Using a "-range=" argument with ":command" doesn't work and + doesn't generate an error message. +Solution: Generate an error message. +Files: src/ex_docmd.c + +Patch 6.2.050 +Problem: Test 32 didn't work on MS-Windows. +Solution: Write the temp file in Unix fileformat. (Walter Briscoe) +Files: src/testdir/test32.in + +Patch 6.2.051 +Problem: When using "\=submatch(0)" in a ":s" command, line breaks become + NUL characters. +Solution: Change NL to CR characters, so that they become line breaks. +Files: src/regexp.c + +Patch 6.2.052 +Problem: A few messages are not translated. +Solution: Add _() to the messages. (Muraoka Taro) +Files: src/ex_cmds.c + +Patch 6.2.053 +Problem: Prototype for bzero() doesn't match most systems. +Solution: Use "void *" instead of "char *" and "size_t" instead of "int". +Files: src/osdef1.h.in + +Patch 6.2.054 +Problem: A double-byte character with a second byte that is a backslash + causes problems inside a string. +Solution: Skip over multi-byte characters in a string properly. (Yasuhiro + Matsumoto) +Files: src/eval.c + +Patch 6.2.055 +Problem: Using col('.') from CTRL-O in Insert mode does not return the + correct value for multi-byte characters. +Solution: Correct the cursor position when it is necessary, move to the + first byte of a multi-byte character. (Yasuhiro Matsumoto) +Files: src/edit.c + +Patch 6.2.056 (extra) +Problem: Building with Sniff++ doesn't work. +Solution: Use the multi-threaded libc when needed. (Holger Ditting) +Files: src/Make_mvc.mak + +Patch 6.2.057 (extra) +Problem: Mac: With -DMACOS_X putenv() is defined twice, it is in a system + library. Get a warning for redefining OK. Unused variables in + os_mac.c +Solution: Define HAVE_PUTENV. Undefine OK after including curses.h. + Remove declarations for unused variables. +Files: src/os_mac.c, src/os_mac.h, src/vim.h + +Patch 6.2.058 +Problem: When 'autochdir' is set ":bnext" to a buffer without a name causes + a crash. +Solution: Don't call vim_chdirfile() when the file name is NULL. (Taro + Muraoka) +Files: src/buffer.c + +Patch 6.2.059 +Problem: When 'scrolloff' is a large number and listing completion results + on the command line, then executing a command that jumps close to + where the cursor was before, part of the screen is not updated. + (Yakov Lerner) +Solution: Don't skip redrawing part of the window when it was scrolled. +Files: src/screen.c + +Patch 6.2.060 (extra) +Problem: Win32: When 'encoding' is set to "iso-8859-7" copy/paste to/from + the clipboard gives a lalloc(0) error. (Kriton Kyrimis) +Solution: When the string length is zero allocate one byte. Also fix that + when the length of the Unicode text is zero (conversion from + 'encoding' to UCS-2 was not possible) the normal text is used. +Files: src/os_mswin.c + +Patch 6.2.061 +Problem: GUI: Using the left mouse button with the shift key should work + like "*" but it scrolls instead. (Martin Beller) +Solution: Don't recognize an rxvt scroll wheel event when using the GUI. +Files: src/term.c + +Patch 6.2.062 +Problem: When one buffer uses a syntax with "containedin" and another + buffer does not, redrawing depends on what the current buffer is. + (Brett Pershing Stahlman) +Solution: Use "syn_buf" instead of "curbuf" to get the b_syn_containedin + flag. +Files: src/syntax.c + +Patch 6.2.063 +Problem: When using custom completion end up with no matches. +Solution: Make cmd_numfiles and cmd_files local to completion to avoid that + they are overwritten when ExpandOne() is called recursively by + f_glob(). +Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/proto/ex_getln.pro, + src/misc1.c, src/structs.h, src/tag.c + +Patch 6.2.064 +Problem: resolve() only handles one symbolic link, need to repeat it to + resolve all of them. Then need to simplify the file name. +Solution: Make resolve() resolve all symbolic links and simplify the result. + Add simplify() to just simplify a file name. Fix that test49 + doesn't work if /tmp is a symbolic link. (Servatius Brandt) +Files: runtime/doc/eval.txt, src/eval.c, src/tag.c, + src/testdir/test49.vim + +Patch 6.2.065 +Problem: ":windo 123" only updates other windows when entering them. + (Walter Briscoe) +Solution: Update the topline before going to the next window. +Files: src/ex_cmds2.c + +Patch 6.2.066 (extra) +Problem: Ruby interface doesn't work with Ruby 1.8.0. +Solution: Change "defout" to "stdout". (Aron Grifis) + Change dynamic loading. (Taro Muraoka) +Files: src/if_ruby.c, src/Make_mvc.mak + +Patch 6.2.067 +Problem: When searching for a string that starts with a composing character + the command line isn't drawn properly. +Solution: Don't count the space to draw the composing character on and + adjust the cursor column after drawing the string. +Files: src/message.c + +Patch 6.2.068 +Problem: Events for the netbeans interface that include a file name with + special characters don't work properly. +Solution: Use nb_quote() on the file name. (Sergey Khorev) +Files: src/netbeans.c + +Patch 6.2.069 (after 6.2.064) +Problem: Unused variables "limit" and "new_st" and unused label "fail" in + some situation. (Bill McCarthy) +Solution: Put the declarations inside an #ifdef. (Servatius Brandt) +Files: src/eval.c, src/tag.c + +Patch 6.2.070 (after 6.2.069) +Problem: Still unused variable "new_st". (Bill McCarthy) +Solution: Move the declaration to the right block this time. +Files: src/tag.c + +Patch 6.2.071 +Problem: 'statusline' can only contain 50 % items. (Antony Scriven) +Solution: Allow 80 items and mention it in the docs. +Files: runtime/doc/option.txt, src/vim.h + +Patch 6.2.072 +Problem: When using expression folding, foldexpr() mostly returns -1 for + the previous line, which makes it difficult to write a fold + expression. +Solution: Make the level of the previous line available while still looking + for the end of a fold. +Files: src/fold.c + +Patch 6.2.073 +Problem: When adding detection of a specific filetype for a plugin you need + to edit "filetype.vim". +Solution: Source files from the "ftdetect" directory, so that a filetype + detection plugin only needs to be dropped in a directory. +Files: runtime/doc/filetype.txt, runtime/doc/usr_05.txt, + runtime/doc/usr_41.txt, runtime/filetype.vim + +Patch 6.2.074 +Problem: Warnings when compiling the Python interface. (Ajit Thakkar) +Solution: Use ANSI function declarations. +Files: src/if_python.c + +Patch 6.2.075 +Problem: When the temp file for writing viminfo can't be used "NULL" + appears in the error message. (Ben Lavender) +Solution: Print the original file name when there is no temp file name. +Files: src/ex_cmds.c + +Patch 6.2.076 +Problem: The tags listed for cscope are in the wrong order. (Johannes + Stezenbach) +Solution: Remove the reordering of tags for the current file. (Sergey + Khorev) +Files: src/if_cscope.c + +Patch 6.2.077 +Problem: When a user function specifies custom completion, the function + gets a zero argument instead of an empty string when there is no + word before the cursor. (Preben Guldberg) +Solution: Don't convert an empty string to a zero. +Files: src/eval.c + +Patch 6.2.078 +Problem: "make test" doesn't work if Vim wasn't compiled yet. (Ed Avis) +Solution: Build Vim before running the tests. +Files: src/Makefile + +Patch 6.2.079 +Problem: ":w ++enc=utf-8 !cmd" doesn't work. +Solution: Check for the "++" argument before the "!". +Files: src/ex_docmd.c + +Patch 6.2.080 +Problem: When 't_ti' is not empty but doesn't swap screens, using "ZZ" in + an unmodified file doesn't clear the last line. +Solution: Call msg_clr_eos() when needed. (Michael Schroeder) +Files: src/os_unix.c + +Patch 6.2.081 +Problem: Problem when using a long multibyte string for the statusline. +Solution: Use the right pointer to get the cell size. (Taro Muraoka) +Files: src/buffer.c + +Patch 6.2.082 +Problem: Can't compile with Perl 5.8.1. +Solution: Rename "e_number" to "e_number_exp". (Sascha Blank) +Files: src/digraph.c, src/globals.h + +Patch 6.2.083 +Problem: When a compiler uses ^^^^ to mark a word the information is not + visible in the quickfix window. (Srikanth Sankaran) +Solution: Don't remove the indent for a line that is not recognized as an + error message. +Files: src/quickfix.c + +Patch 6.2.084 +Problem: "g_" in Visual mode always goes to the character after the line. + (Jean-Rene David) +Solution: Ignore the NUL at the end of the line. +Files: src/normal.c + +Patch 6.2.085 +Problem: ":verbose set ts" doesn't say an option was set with a "-c" or + "--cmd" argument. +Solution: Remember the option was set from a Vim argument. +Files: src/main.c, src/ex_cmds2.c, src/vim.h + +Patch 6.2.086 +Problem: "{" and "}" stop inside a closed fold. +Solution: Only stop once inside a closed fold. (Stephen Riehm) +Files: src/search.c + +Patch 6.2.087 +Problem: CTRL-^ doesn't use the 'confirm' option. Same problem with + ":bnext". (Yakov Lerner) +Solution: Put up a dialog for a changed file when 'confirm' is set in more + situations. +Files: src/buffer.c, src/ex_cmds.c + +Patch 6.2.088 +Problem: When 'sidescrolloff' is set 'showmatch' doesn't work correctly if + the match is less than 'sidescrolloff' off from the side of the + window. (Roland Stahn) +Solution: Set 'sidescrolloff' to zero while displaying the match. +Files: src/search.c + +Patch 6.2.089 +Problem: ":set isk+=" adds a comma. (Mark Waggoner) +Solution: Don't add a comma when the added value is empty. +Files: src/option.c + +Patch 6.2.090 (extra) +Problem: Win32: MingW compiler complains about #pragmas. (Bill McCarthy) +Solution: Put an #ifdef around the #pragmas. +Files: src/os_win32.c + +Patch 6.2.091 +Problem: When an autocommand is triggered when a file is dropped on Vim and + it produces output, messages from a following command may be + scrolled unexpectedly. (David Rennalls) +Solution: Save and restore msg_scroll in handle_drop(). +Files: src/ex_docmd.c + +Patch 6.2.092 +Problem: Invalid items appear in the help file tags. (Antonio Colombo) +Solution: Only accept tags with white space before the first "*". +Files: runtime/doc/doctags.c, src/ex_cmds.c + +Patch 6.2.093 +Problem: ":nnoremenu" also defines menu for Visual mode. (Klaus Bosau) +Solution: Check the second command character for an "o", not the third. +Files: src/menu.c + +Patch 6.2.094 +Problem: Can't compile with GTK and tiny features. +Solution: Include handle_drop() and vim_chdirfile() when FEAT_DND is defined. + Do not try to split the window. +Files: src/ex_docmd.c, src/misc2.c + +Patch 6.2.095 +Problem: The message "Cannot go to buffer x" is confusing for ":buf 6". + (Frans Englich) +Solution: Make it "Buffer x does not exist". +Files: src/buffer.c + +Patch 6.2.096 +Problem: Win32: ":let @* = ''" put a newline on the clipboard. (Klaus + Bosau) +Solution: Put zero bytes on the clipboard for an empty string. +Files: src/ops.c + +Patch 6.2.097 +Problem: Setting or resetting 'insertmode' in a BufEnter autocommand + doesn't always have immediate effect. (Nagger) +Solution: When 'insertmode' is set, set need_start_insertmode, when it's + reset set stop_insert_mode. +Files: src/option.c + +Patch 6.2.098 (after 6.2.097) +Problem: Can't build Vim with tiny features. (Christian J. Robinson) +Solution: Declare stop_insert_mode always. +Files: src/edit.c, src/globals.h + +Patch 6.2.099 (extra) +Problem: Test 49 fails. (Mikolaj Machowski) +Solution: The Polish translation must not change "E116" to "R116". +Files: src/po/pl.po + +Patch 6.2.100 +Problem: "make proto" fails when compiled with the Perl interface. +Solution: Remove "-fno.*" from PERL_CFLAGS, cproto sees it as its option. +Files: src/auto/configure, src/configure.in + +Patch 6.2.101 +Problem: When using syntax folding, opening a file slows down a lot when + it's size increases by only 20%. (Gary Johnson) +Solution: The array with cached syntax states is leaking entries. After + cleaning up the list obtain the current entry again. +Files: src/syntax.c + +Patch 6.2.102 +Problem: The macros equal() and CR conflict with a Carbon header file. +Solution: Rename equal() to equalpos(). Rename CR to CAR. + Do this in the non-extra files only. +Files: src/ascii.h, src/buffer.c, src/charset.c, src/edit.c, src/eval.c, + src/ex_cmds.c, src/ex_cmds2.c, src/ex_getln.c, src/fileio.c, + src/getchar.c, src/gui.c, src/gui_athena.c, src/gui_gtk_x11.c, + src/gui_motif.c, src/macros.h, src/mark.c, src/message.c, + src/misc1.c, src/misc2.c, src/normal.c, src/ops.c, src/os_unix.c, + src/regexp.c, src/search.c, src/ui.c, src/workshop.c + +Patch 6.2.103 (extra) +Problem: The macros equal() and CR conflict with a Carbon header file. +Solution: Rename equal() to equalpos(). Rename CR to CAR. + Do this in the extra files only. +Files: src/gui_photon.c, src/gui_w48.c + +Patch 6.2.104 +Problem: Unmatched braces in the table with options. +Solution: Move the "}," outside of the #ifdef. (Yakov Lerner) +Files: src/option.c + +Patch 6.2.105 +Problem: When the cursor is past the end of the line when calling + get_c_indent() a crash might occur. +Solution: Don't look past the end of the line. (NJ Verenini) +Files: src/misc1.c + +Patch 6.2.106 +Problem: Tag searching gets stuck on a very long line in the tags file. +Solution: When skipping back to search the first matching tag remember the + offset where searching started looking for a line break. +Files: src/tag.c + +Patch 6.2.107 (extra) +Problem: The NetBeans interface cannot be used on Win32. +Solution: Add support for the NetBeans for Win32. Add support for reading + XPM files on Win32. Also fixes that a sign icon with a space in + the file name did not work through the NetBeans interface. + (Sergey Khorev) + Also: avoid repeating error messages when the connection is lost. +Files: Makefile, runtime/doc/netbeans.txt, src/Make_bc5.mak, + src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak, + src/bigvim.bat, src/feature.h, src/gui_beval.c, src/gui_beval.h, + src/gui_w32.c, src/gui_w48.c, src/menu.c, src/nbdebug.c, + src/nbdebug.h, src/netbeans.c, src/os_mswin.c, src/os_win32.h, + src/proto/gui_beval.pro, src/proto/gui_w32.pro, + src/proto/netbeans.pro, src/proto.h, src/version.c, src/vim.h, + src/xpm_w32.c, src/xpm_w32.h + +Patch 6.2.108 +Problem: Crash when giving a message about ignoring case in a tag. (Manfred + Kuehn) +Solution: Use a longer buffer for the message. +Files: src/tag.c + +Patch 6.2.109 +Problem: Compiler warnings with various Amiga compilers. +Solution: Add typecast, prototypes, et al. that are also useful for other + systems. (Flavio Stanchina) +Files: src/eval.c, src/ops.c + +Patch 6.2.110 +Problem: When $LANG includes the encoding, a menu without an encoding name + is not found. +Solution: Also look for a menu file without any encoding. +Files: runtime/menu.vim + +Patch 6.2.111 +Problem: Encoding "cp1251" is not recognized. +Solution: Add "cp1251" to the table of encocings. (Alexey Froloff) +Files: src/mbyte.c + +Patch 6.2.112 +Problem: After applying patches test32 fails. (Antonio Colombo) +Solution: Have "make clean" in the testdir delete *.rej and *.orig files. + Use this when doing "make clean" in the src directory. +Files: src/Makefile, src/testdir/Makefile + +Patch 6.2.113 +Problem: Using ":startinsert" after "$" works like "a" instead of "i". + (Ajit Thakkar) +Solution: Reset "w_curswant" for ":startinsert" and reset o_eol in edit(). +Files: src/edit.c, src/ex_docmd.c + +Patch 6.2.114 +Problem: When stdout is piped through "tee", the size of the screen may not + be correct. +Solution: Use stdin instead of stdout for ioctl() when stdin is a tty and + stdout isn't. +Files: src/os_unix.c + +Patch 6.2.115 (extra) +Problem: Compiler warnings with various Amiga compilers. +Solution: Add typecast, prototypes, et al. Those changes that are + Amiga-specific. (Flavio Stanchina) +Files: src/fileio.c, src/memfile.c, src/os_amiga.c, src/os_amiga.h, + src/vim.h + +Patch 6.2.116 (extra) +Problem: German keyboard with Numlock set different from system startup + causes problems. +Solution: Ignore keys with code 0xff. (Helmut Stiegler) +Files: src/gui_w48.c + +Patch 6.2.117 +Problem: Breakpoints in loops of sourced files and functions are not + detected. (Hari Krishna Dara) +Solution: Check for breakpoints when using lines that were previously read. + (Servatius Brandt) +Files: src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/proto/eval.pro, + src/proto/ex_cmds2.pro + +Patch 6.2.118 (extra) +Problem: Mac: Compiling is done in a non-standard way. +Solution: Use the Unix method for Mac OS X, with autoconf. Add "CARBONGUI" + to Makefile and configure. (Eric Kow) + Move a few prototypes from os_mac.pro to gui_mac.pro. +Files: src/Makefile, src/auto/configure, src/configure.in, + src/config.mk.in, src/gui_mac.c, src/os_mac.h, src/os_macosx.c, + src/proto/gui_mac.pro, src/proto/os_mac.pro, + src/infplist.xml, src/vim.h + +Patch 6.2.119 (after 6.2.107) +Problem: When packing the MS-Windows archives a few files are missing. + (Guopeng Wen) +Solution: Add gui_beval.* to the list of generic source files. +Files: Makefile + +Patch 6.2.120 +Problem: Win32 GUI: The console dialogs are not supported on MS-Windows, + disabling the 'c' flag of 'guioptions'. (Servatius Brandt) +Solution: Define FEAT_CON_DIALOG also for GUI-only builds. +Files: src/feature.h + +Patch 6.2.121 (after 6.2.118) +Problem: Not all make programs support "+=". (Charles Campbell) +Solution: Use a normal assignment. +Files: src/Makefile + +Patch 6.2.122 (after 6.2.119) +Problem: Not all shells can expand [^~]. File missing. (Guopeng Wen) +Solution: Use a simpler pattern. Add the Aap recipe for the maze program + and a clean version of the source code. +Files: Makefile, runtime/macros/maze/Makefile, + runtime/macros/maze/README.txt, runtime/macros/maze/main.aap, + runtime/macros/maze/mazeclean.c + +Patch 6.2.123 (after 6.2.118) +Problem: Running configure fails. (Tony Leneis) +Solution: Change "==" to "=" for a test. +Files: src/auto/configure, src/configure.in + +Patch 6.2.124 (after 6.2.121)(extra) +Problem: Mac: Recursive use of M4FLAGS causes problems. When running Vim + directly it can't find the runtime files. (Emily Jackson) + Using GNU constructs causes warnings with other make programs. + (Ronald Schild) +Solution: Use another name for the M4FLAGS variable. + Don't remove "Vim.app" from the path. + Update the explanation for compiling on the Mac. (Eric Kow) + Don't use $(shell ) and $(addprefix ). +Files: src/INSTALLmac.txt, src/Makefile, src/misc1.c + +Patch 6.2.125 (after 6.2.107) +Problem: The "winsock2.h" file isn't always available. +Solution: Don't include this header file. +Files: src/netbeans.c + +Patch 6.2.126 +Problem: Typing CTRL-C at a confirm() prompt doesn't throw an exception. +Solution: Reset "mapped_ctrl_c" in get_keystroke(), so that "got_int" is set + in _OnChar(). +Files: src/misc1.c + +Patch 6.2.127 (extra) +Problem: Win32 console: Typing CTRL-C doesn't throw an exception. +Solution: Set got_int immediately when CTRL-C is typed, don't wait for + mch_breakcheck() being called. +Files: src/os_win32.c + +Patch 6.2.128 (after 6.2.118) +Problem: src/auto/configure is not consistent with src/configure.in. +Solution: Use the newly generated configure script. +Files: src/auto/configure + +Patch 6.2.129 +Problem: When 'number' is set 'wrapmargin' does not work Vi-compatible. + (Yasuhiro Matsumoto) +Solution: Reduce the textwidth when 'number' is set. Also for 'foldcolumn' + and similar things. +Files: src/edit.c + +Patch 6.2.130 (extra) +Problem: Win32 console: When 'restorescreen' is not set exiting Vim causes + the screen to be cleared. (Michael A. Mangino) +Solution: Don't clear the screen when exiting and 'restorescreen' isn't set. +Files: src/os_win32.c + +Patch 6.2.131 (extra) +Problem: Win32: Font handles are leaked. +Solution: Free italic, bold and bold-italic handles before overwriting them. + (Michael Wookey) +Files: src/gui_w48.c + +Patch 6.2.132 (extra) +Problem: Win32: console version doesn't work on latest Windows Server 2003. +Solution: Copy 12000 instead of 15000 cells at a time to avoid running out + of memory. +Files: src/os_win32.c + +Patch 6.2.133 +Problem: When starting the GUI a bogus error message about 'imactivatekey' + may be given. +Solution: Only check the value of 'imactivatekey' when the GUI is running. +Files: src/gui.c, src/option.c + +Patch 6.2.134 (extra) +Problem: Win32: When scrolling parts of the window are redrawn when this + isn't necessary. +Solution: Only invalidate parts of the window when they are obscured by + other windows. (Michael Wookey) +Files: src/gui_w48.c + +Patch 6.2.135 +Problem: An item <> in the ":command" argument is interpreted as <args>. +Solution: Avoid that <> is recognized as <args>. +Files: src/ex_docmd.c + +Patch 6.2.136 +Problem: ":e ++enc=latin1 newfile" doesn't set 'fenc' when the file doesn't + exist. (Miroslaw Dobrzanski-Neumann) +Solution: Set 'fileencoding' to the specified encoding when editing a file + that does not exist. +Files: src/fileio.c + +Patch 6.2.137 +Problem: "d:cmd<CR>" cannot be repeated with ".". Breaks repeating "d%" + when using the matchit plugin. +Solution: Store the command to be repeated. This is restricted to + single-line commands. +Files: src/ex_docmd.c, src/globals.h, src/normal.c, src/vim.h + +Patch 6.2.138 (extra) +Problem: Compilation problem on VMS with dynamic buffer on the stack. +Solution: Read one byte less than the size of the buffer, so that we can + check for the string length without an extra buffer. +Files: src/os_vms.c + +Patch 6.2.139 +Problem: Code is repeated in the two Perl files. +Solution: Move common code from if_perl.xs and if_perlsfio.c to vim.h. + Also fix a problem with generating prototypes. +Files: src/if_perl.xs, src/if_perlsfio.c, src/vim.h + +Patch 6.2.140 (after 6.2.121) +Problem: Mac: Compiling with Python and Perl doesn't work. +Solution: Adjust the configure check for Python to use "-framework Python" + for Python 2.3 on Mac OS/X. + Move "-ldl" after "DynaLoader.a" in the link command. + Change "perllibs" to "PERL_LIBS". +Files: src/auto/configure, src/configure.in, src/config.mk.in + +Patch 6.2.141 (extra) +Problem: Mac: The b_FSSpec field is sometimes unused. +Solution: Change the #ifdef to FEAT_CW_EDITOR and defined it in feature.h +Files: src/fileio.c, src/gui_mac.c, src/structs.h, src/feature.h + +Patch 6.2.142 (after 6.2.124) +Problem: Mac: building without GUI through configure doesn't work. + When the system is slow, unpacking the resource file takes too + long. +Solution: Don't always define FEAT_GUI_MAC when MACOS is defined, define it + in the Makefile. + Add a configure option to skip Darwin detection. + Use a Python script to unpack the resources to avoid a race + condition. (Taro Muraoka) +Files: Makefile, src/Makefile, src/auto/configure, src/configure.in, + src/dehqx.py, src/vim.h + +Patch 6.2.143 +Problem: Using "K" on Visually selected text doesn't work if it ends in + a multi-byte character. +Solution: Include all the bytes of the last character. (Taro Muraoka) +Files: src/normal.c + +Patch 6.2.144 +Problem: When "g:html_use_css" is set the HTML header generated by the + 2html script is wrong. +Solution: Add the header after adding HREF for links. + Also use ":normal!" instead of ":normal" to avoid mappings + getting in the way. +Files: runtime/syntax/2html.vim + +Patch 6.2.145 (after 6.2.139) +Problem: Undefining "bool" doesn't work for older systems. (Wojtek Pilorz) +Solution: Only undefine "bool" on Mac OS. +Files: src/vim.h + +Patch 6.2.146 +Problem: On some systems the prototype for iconv() is wrong, causing a + warning message. +Solution: Use a cast (void *) to avoid the warning. (Charles Campbell) +Files: src/fileio.c, src/mbyte.c + +Patch 6.2.147 +Problem: ":s/pat/\=col('.')" always replaces with "1". +Solution: Set the cursor to the start of the match before substituting. + (Helmut Stiegler) +Files: src/ex_cmds.c + +Patch 6.2.148 +Problem: Can't break an Insert into several undoable parts. +Solution: Add the CTRL-G u command. +Files: runtime/doc/insert.txt, src/edit.c + +Patch 6.2.149 +Problem: When the cursor is on a line past 21,474,748 the indicated + percentage of the position is invalid. With that many lines + "100%" causes a negative cursor line number, resulting in a crash. + (Daniel Goujot) +Solution: Divide by 100 instead of multiplying. Avoid overflow when + computing the line number for "100%". +Files: src/buffer.c, src/ex_cmds2.c, src/normal.c + +Patch 6.2.150 +Problem: When doing "vim - < file" lines are broken at NUL chars. + (Daniel Goujot) +Solution: Change NL characters back to NUL when reading from the temp + buffer. +Files: src/fileio.c + +Patch 6.2.151 +Problem: When doing "vim --remote +startinsert file" some commands are + inserted as text. (Klaus Bosau) +Solution: Put all the init commands in one Ex line, not using a <CR>, so + that Insert mode isn't started too early. +Files: src/main.c + +Patch 6.2.152 +Problem: The cursor() function doesn't reset the column offset for + 'virtualedit'. +Solution: Reset the offset to zero. (Helmut Stiegler) +Files: src/eval.c + +Patch 6.2.153 +Problem: Win32: ":lang german" doesn't use German messages. +Solution: Add a table to translate the Win32 language names to two-letter + language codes. +Files: src/ex_cmds2.c + +Patch 6.2.154 +Problem: Python bails out when giving a warning message. (Eugene + Minkovskii) +Solution: Set sys.argv[] to an empty string. +Files: src/if_python.c + +Patch 6.2.155 +Problem: Win32: Using ":tjump www" in a help file gives two results. + (Dave Roberts) +Solution: Ignore differences between slashes and backslashes when checking + for identical tag matches. +Files: src/tag.c + +Patch 6.2.156 (after 6.2.125) +Problem: Win32: Netbeans fails to build, EINTR is not defined. +Solution: Redefine EINTR to WSAEINTR. (Mike Williams) +Files: src/netbeans.c + +Patch 6.2.157 +Problem: Using "%p" in 'errorformat' gives a column number that is too + high. +Solution: Set the flag to use the number as a virtual column. (Lefteris + Koutsoloukas) +Files: src/quickfix.c + +Patch 6.2.158 +Problem: The sed command on Solaris and HPUX doesn't work for a line that + doesn't end in a newline. +Solution: Add a newline when feeding text to sed. (Mark Waggoner) +Files: src/configure.in, src/auto/configure + +Patch 6.2.159 +Problem: When using expression folding and 'foldopen' is "undo" an undo + command doesn't always open the fold. +Solution: Save and restore the KeyTyped variable when evaluating 'foldexpr'. + (Taro Muraoka) +Files: src/fold.c + +Patch 6.2.160 +Problem: When 'virtualedit' is "all" and 'selection is "exclusive", + selecting a double-width character below a single-width character + may cause a crash. +Solution: Avoid overflow on unsigned integer decrement. (Taro Muraoka) +Files: src/normal.c + +Patch 6.2.161 (extra) +Problem: VMS: Missing header file. Reading input busy loops. +Solution: Include termdef.h. Avoid the use of a wait function in + vms_read(). (Frank Ries) +Files: src/os_unix.h, src/os_vms.c + +Patch 6.2.162 +Problem: ":redraw" doesn't always display the text that includes the cursor + position, e.g. after ":call cursor(1, 0)". (Eugene Minkovskii) +Solution: Call update_topline() before redrawing. +Files: src/ex_docmd.c + +Patch 6.2.163 +Problem: "make install" may also copy AAPDIR directories. +Solution: Delete AAPDIR directories, just like CVS directories. +Files: src/Makefile + +Patch 6.2.164 (after 6.2.144) +Problem: When "g:html_use_css" is set the HTML header generated by the + 2html script is still wrong. +Solution: Search for a string instead of jumping to a fixed line number. + Go to the start of the line before inserting the header. + (Jess Thrysoee) +Files: runtime/syntax/2html.vim + +Patch 6.2.165 +Problem: The configure checks hang when using autoconf 2.57. +Solution: Invoke AC_PROGRAM_EGREP to set $EGREP. (Aron Griffis) +Files: src/auto/configure, src/configure.in + +Patch 6.2.166 +Problem: When $GZIP contains "-N" editing compressed files doesn't work + properly. +Solution: Add "-n" to "gzip -d" to avoid restoring the file name. (Oyvind + Holm) +Files: runtime/plugin/gzip.vim + +Patch 6.2.167 +Problem: The Python interface leaks memory when assigning lines to a + buffer. (Sergey Khorev) +Solution: Do not copy the line when calling ml_replace(). +Files: src/if_python.c + +Patch 6.2.168 +Problem: Python interface: There is no way to get the indices from a range + object. +Solution: Add the "start" and "end" attributes. (Maurice S. Barnum) +Files: src/if_python.c, runtime/doc/if_pyth.txt + +Patch 6.2.169 +Problem: The prototype for _Xmblen() appears in a recent XFree86 header + file, causing a warning for our prototype. (Hisashi T Fujinaka) +Solution: Move the prototype to an osdef file, so that it's filtered out. +Files: src/mbyte.c, src/osdef2.h.in + +Patch 6.2.170 +Problem: When using Sun WorkShop the current directory isn't changed to + where the file is. +Solution: Set the 'autochdir' option when using WorkShop. And avoid using + the basename when 'autochdir' is not set. +Files: src/gui_x11.c, src/ex_cmds.c + +Patch 6.2.171 (after 6.2.163) +Problem: The "-or" argument of "find" doesn't work for SysV systems. +Solution: Use "-o" instead. (Gordon Prieur) +Files: src/Makefile + +Patch 6.2.172 (after 6.2.169) +Problem: The prototype for _Xmblen() still causes trouble. +Solution: Include the X11 header file that defines the prototype. +Files: src/osdef2.h.in, src/osdef.sh + +Patch 6.2.173 (extra) +Problem: Win32: Ruby interface doesn't work with Ruby 1.8.0 for other + compilers than MSVC. +Solution: Fix the BC5, Cygwin and Mingw makefiles. (Dan Sharp) +Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak + +Patch 6.2.174 +Problem: After the ":intro" message only a mouse click in the last line + gets past the hit-return prompt. +Solution: Accept a click at or below the hit-return prompt. +Files: src/gui.c, src/message.c + +Patch 6.2.175 +Problem: Changing 'backupext' in a *WritePre autocommand doesn't work. + (William Natter) +Solution: Move the use of p_bex to after executing the *WritePre + autocommands. Also avoids reading allocated memory after freeing. +Files: src/fileio.c + +Patch 6.2.176 +Problem: Accented characters in translated help files are not handled + correctly. (Fabien Vayssiere) +Solution: Include "192-255" in 'iskeyword' for the help window. +Files: src/ex_cmds.c + +Patch 6.2.177 (extra) +Problem: VisVim: Opening a file with a space in the name doesn't work. (Rob + Retter) Arbitrary commands are being executed. (Neil Bird) +Solution: Put a backslash in front of every space in the file name. + (Gerard Blais) Terminate the CTRL-\ CTRL-N command with a NUL. +Files: src/VisVim/Commands.cpp, src/VisVim/VisVim.rc + +Patch 6.2.178 +Problem: People who don't know how to exit Vim try pressing CTRL-C. +Solution: Give a message how to exit Vim when CTRL-C is pressed and it + doesn't cancel anything. +Files: src/normal.c + +Patch 6.2.179 (extra) +Problem: The en_gb messages file isn't found on case sensitive systems. +Solution: Rename en_gb to en_GB. (Mike Williams) +Files: src/po/en_gb.po, src/po/en_GB.po, src/po/Make_ming.mak, + src/po/Make_mvc.mak, src/po/Makefile, src/po/README_mvc.txt + +Patch 6.2.180 +Problem: Compiling with GTK2 on Win32 doesn't work. +Solution: Include gdkwin32.h instead of gdkx.h. (Srinath Avadhanula) +Files: src/gui_gtk.c, src/gui_gtk_f.c, src/gui_gtk_x11.c, src/mbyte.c + +Patch 6.2.181 (after 6.2.171) +Problem: The "-o" argument of "find" has lower priority than the implied + "and" with "-print". +Solution: Add parenthesis around the "-o" expression. (Gordon Prieur) +Files: src/Makefile + +Patch 6.2.182 (after 6.2.094) +Problem: Compilation with tiny features fails because of missing + get_past_head() function. +Solution: Adjust the #ifdef for get_past_head(). +Files: src/misc1.c + +Patch 6.2.183 (after 6.2.178) +Problem: Warning for char/unsigned char mixup. +Solution: Use MSG() instead of msg(). (Tony Leneis) +Files: src/normal.c + +Patch 6.2.184 +Problem: With 'formatoptions' set to "1aw" inserting text may cause the + paragraph to be ended. (Alan Schmitt) +Solution: Temporarily add an extra space to make the paragraph continue + after moving the word after the cursor to the next line. + Also format when pressing Esc. +Files: src/edit.c, src/normal.c, src/proto/edit.pro + +Patch 6.2.185 +Problem: Restoring a session with zero-height windows does not work + properly. (Charles Campbell) +Solution: Accept a zero argument to ":resize" as intended. Add a window + number argument to ":resize" to be able to set the size of other + windows, because the current window cannot be zero-height. + Fix the explorer plugin to avoid changing the window sizes. Add + the winrestcmd() function for this. +Files: runtime/doc/eval.txt, runtime/plugin/explorer.vim, src/eval.c, + src/ex_cmds.h, src/ex_docmd.c, src/proto/window.pro, src/window.c + +Patch 6.2.186 (after 6.2.185) +Problem: Documentation file eval.txt contains examples without indent. +Solution: Insert the indent. Also fix other mistakes. +Files: runtime/doc/eval.txt + +Patch 6.2.187 +Problem: Using Insure++ reveals a number of bugs. (Dominuque Pelle) +Solution: Initialize variables where needed. Free allocated memory to avoid + leaks. Fix comparing tags to avoid reading past allocated memory. +Files: src/buffer.c, src/diff.c, src/fileio.c, src/mark.c, src/misc1.c, + src/misc2.c, src/ops.c, src/option.c, src/tag.c, src/ui.c + +Patch 6.2.188 (extra) +Problem: MS-Windows: Multi-byte characters in a filename cause trouble for + the window title. +Solution: Return when the wide function for setting the title did its work. +Files: src/gui_w48.c + +Patch 6.2.189 +Problem: When setting 'viminfo' after editing a new buffer its marks are + not stored. (Keith Roberts) +Solution: Set the "b_marks_read" flag when skipping to read marks from the + viminfo file. +Files: src/fileio.c + +Patch 6.2.190 +Problem: When editing a compressed files, marks are lost. +Solution: Add the ":lockmarks" modifier and use it in the gzip plugin. + Make exists() also check for command modifiers, so that the + existence of ":lockmarks" can be checked for. + Also add ":keepmarks" to avoid that marks are deleted when + filtering text. + When deleting lines put marks 'A - 'Z and '0 - '9 at the first + deleted line instead of clearing the mark. They were kept in the + viminfo file anyway. + Avoid that the gzip plugin puts deleted text in registers. +Files: runtime/doc/motion.txt, runtime/plugin/gzip.vim, src/ex_cmds.c, + src/ex_docmd.c, src/mark.c, src/structs.h + +Patch 6.2.191 +Problem: The intro message is outdated. Information about sponsoring and + registering is missing. +Solution: Show info about sponsoring and registering Vim in the intro + message now and then. Add help file about sponsoring. +Files: runtime/doc/help.txt, runtime/doc/sponsor.txt, runtime/doc/tags, + runtime/menu.vim, src/version.c + +Patch 6.2.192 +Problem: Using CTRL-T and CTRL-D with "gR" messes up the text. (Jonahtan + Hankins) +Solution: Avoid calling change_indent() recursively. +Files: src/edit.c + +Patch 6.2.193 +Problem: When recalling a search pattern from the history from a ":s,a/c," + command the '/' ends the search string. (JC van Winkel) +Solution: Store the separator character with the history entries. Escape + characters when needed, replace the old separator with the new one. + Also fixes that recalling a "/" search for a "?" command messes up + trailing flags. +Files: src/eval.c, src/ex_getln.c, src/normal.c, src/proto/ex_getln.pro, + src/search.c, src/tag.c + +Patch 6.2.194 (after 6.2.068) +Problem: For NetBeans, instead of writing the file and sending an event + about it, tell NetBeans to write the file. +Solution: Add the "save" command, "netbeansBuffer" command and + "buttonRelease" event to the netbeans protocol. Updated the + interface to version 2.2. (Gordon Prieur) + Also: open a fold when the cursor has been positioned. + Also: fix memory leak, free result of nb_quote(). +Files: runtime/doc/netbeans.txt, src/fileio.c, src/netbeans.c, + src/normal.c, src/proto/netbeans.pro, src/structs.h + +Patch 6.2.195 (after 6.2.190) +Problem: Compiling fails for missing CPO_REMMARK symbol. +Solution: Add the patch I forgot to include... +Files: src/option.h + +Patch 6.2.196 (after 6.2.191) +Problem: Rebuilding the documentation doesn't use the sponsor.txt file. +Solution: Add sponsor.txt to the Makefile. (Christian J. Robinson) +Files: runtime/doc/Makefile + +Patch 6.2.197 +Problem: It is not possible to force a redraw of status lines. (Gary + Johnson) +Solution: Add the ":redrawstatus" command. +Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c, + src/screen.c + +Patch 6.2.198 +Problem: A few messages are not translated. (Ernest Adrogue) +Solution: Mark the messages to be translated. +Files: src/ex_cmds.c + +Patch 6.2.199 (after 6.2.194) +Problem: Vim doesn't work perfectly well with NetBeans. +Solution: When NetBeans saves the file, reset the timestamp to avoid "file + changed" warnings. Close a buffer in a proper way. Don't try + giving a debug message with an invalid pointer. Send a + newDotAndMark message when needed. Report a change by the "r" + command to NetBeans. (Gordon Prieur) +Files: src/netbeans.c, src/normal.c + +Patch 6.2.200 +Problem: When recovering a file, 'fileformat' is always the default, thus + writing the file may result in differences. (Penelope Fudd) +Solution: Before recovering the file try reading the original file to obtain + the values of 'fileformat', 'fileencoding', etc. +Files: src/memline.c + +Patch 6.2.201 +Problem: When 'autowriteall' is set ":qall" still refuses to exit if there + is a modified buffer. (Antoine Mechelynck) +Solution: Attempt writing modified buffers as intended. +Files: src/ex_cmds2.c + +Patch 6.2.202 +Problem: Filetype names of CHILL and ch script are confusing. +Solution: Rename "ch" to "chill" and "chscript" to "ch". +Files: runtime/filetype.vim, runtime/makemenu.vim, runtime/synmenu.vim + runtime/syntax/ch.vim, runtime/syntax/chill.vim + +Patch 6.2.203 +Problem: With characterwise text that has more than one line, "3P" works + wrong. "3p" has the same problem. There also is a display + problem. (Daniel Goujot) +Solution: Perform characterwise puts with a count in the right position. +Files: src/ops.c + +Patch 6.2.204 (after 6.2.086) +Problem: "]]" in a file with closed folds moves to the end of the file. + (Nam SungHyun) +Solution: Find one position in each closed fold, then move to after the fold. +Files: src/search.c + +Patch 6.2.205 (extra) +Problem: MS-Windows: When the taskbar is at the left or top of the screen, + the Vim window placement is wrong. +Solution: Compute the size and position of the window correctly. (Taro + Muraoka) +Files: src/gui_w32.c, src/gui_w48.c + +Patch 6.2.206 +Problem: Multi-byte characters cannot be used as hotkeys in a console + dialog. (Mattias Erkisson) +Solution: Handle multi-byte characters properly. Also put () or [] around + default hotkeys. +Files: src/message.c, src/macros.h + +Patch 6.2.207 +Problem: When 'encoding' is a multi-byte encoding, expanding an + abbreviation that starts where insertion started results in + characters before the insertion to be deleted. (Xiangjiang Ma) +Solution: Stop searching leftwards for the start of the word at the position + where insertion started. +Files: src/getchar.c + +Patch 6.2.208 +Problem: When using fold markers, three lines in a row have the start + marker and deleting the first one with "dd", a nested fold is not + deleted. (Kamil Burzynski) + Using marker folding, a level 1 fold doesn't stop when it is + followed by "{{{2", starting a level 2 fold. +Solution: Don't stop updating folds at the end of a change when the nesting + level of folds is larger than the fold level. + Correctly compute the number of folds that start at "{{{2". + Also avoid a crash for a NULL pointer. +Files: src/fold.c + +Patch 6.2.209 +Problem: A bogus fold is created when using "P" while the cursor is in the + middle of a closed fold. (Kamil Burzynski) +Solution: Correct the line number where marks are modified for closed folds. +Files: src/ops.c + +Patch 6.2.210 (extra) +Problem: Mac OSX: antialiased fonts are not supported. +Solution: Add the 'antialias' option to switch on antialiasing on Mac OSX + 10.2 and later. (Peter Cucka) +Files: runtime/doc/options.txt, src/gui_mac.c, src/option.h, src/option.c + +Patch 6.2.211 (extra) +Problem: Code for handling file dropped on Vim is duplicated. +Solution: Move the common code to gui_handle_drop(). + Add code to drop the files in the window under the cursor. + Support drag&drop on the Macintosh. (Taro Muraoka) + When dropping a directory name edit that directory (using the + explorer plugin) + Fix that changing directory with Shift pressed didn't work for + relative path names. +Files: src/fileio.c, src/gui.c, src/gui_gtk_x11.c, src/gui_mac.c, + src/gui_w48.c, src/proto/fileio.pro, src/proto/gui.pro + +Patch 6.2.212 (after 6.2.199) +Problem: NetBeans: Replacing with a count is not handled correctly. +Solution: Move reporting the change outside of the loop for the count. + (Gordon Prieur) +Files: src/normal.c + +Patch 6.2.213 (after 6.2.208) +Problem: Using marker folding, "{{{1" doesn't start a new fold when already + at fold level 1. (Servatius Brandt) +Solution: Correctly compute the number of folds that start at "{{{1". +Files: src/fold.c + +Patch 6.2.214 (after 6.2.211) (extra) +Problem: Warning for an unused variable. +Solution: Delete the declaration. (Bill McCarthy) +Files: src/gui_w48.c + +Patch 6.2.215 +Problem: NetBeans: problems saving an unmodified file. +Solution: Add isNetbeansModified() function. Disable netbeans_unmodified(). + (Gordon Prieur) +Files: src/fileio.c, src/netbeans.c, src/proto/netbeans.pro, + runtime/doc/netbeans.txt, runtime/doc/tags + +Patch 6.2.216 (after 6.2.206) +Problem: Multi-byte characters still cannot be used as hotkeys in a console + dialog. (Mattias Erkisson) +Solution: Make get_keystroke() handle multi-byte characters. +Files: src/misc1.c + +Patch 6.2.217 +Problem: GTK: setting the title doesn't always work correctly. +Solution: Invoke gui_mch_settitle(). (Tomas Stehlik) +Files: src/os_unix.c + +Patch 6.2.218 +Problem: Warning for function without prototype. +Solution: Add argument types to the msgCB field of the BalloonEval struct. +Files: src/gui_beval.h + +Patch 6.2.219 +Problem: Syntax highlighting hangs on an empty match of an item with a + nextgroup. (Charles Campbell) +Solution: Remember that the item has already matched and don't match it + again at the same position. +Files: src/syntax.c + +Patch 6.2.220 +Problem: When a Vim server runs in a console a remote command isn't handled + before a key is typed. (Joshua Neuheisel) +Solution: Don't try reading more input when a client-server command has been + received. +Files: src/os_unix.c + +Patch 6.2.221 +Problem: No file name completion for ":cscope add". +Solution: Add the XFILE flag to ":cscope". (Gary Johnson) +Files: src/ex_cmds.h + +Patch 6.2.222 +Problem: Using "--remote" several times on a row only opens some of the + files. (Dany St-Amant) +Solution: Don't delete all typeahead when the server receives a command from + a client, only delete typed characters. +Files: src/main.c + +Patch 6.2.223 +Problem: Cscope: Avoid a hang when cscope waits for a response while Vim + waits for a prompt. + Error messages from Cscope mess up the display. +Solution: Detect the hit-enter message and respond by sending a return + character to cscope. (Gary Johnson) + Use EMSG() and strerror() when possible. Replace perror() with + PERROR() everywhere, add emsg3(). +Files: src/diff.c, src/if_cscope.c, src/integration.c, src/message.c, + src/proto/message.pro, src/misc2.c, src/netbeans.c, src/vim.h + +Patch 6.2.224 +Problem: Mac: Can't compile with small features. (Axel Kielhorn) +Solution: Also include vim_chdirfile() when compiling for the Mac. +Files: src/misc2.c + +Patch 6.2.225 +Problem: NetBeans: Reported modified state isn't exactly right. +Solution: Report a file being modified in the NetBeans way. +Files: src/netbeans.c + +Patch 6.2.226 (after 6.2.107) (extra) +Problem: The "ws2-32.lib" file isn't always available. +Solution: Use "WSock32.lib" instead. (Taro Muraoka, Dan Sharp) +Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak + +Patch 6.2.227 (extra) +Problem: The "PC" symbol is defined but not used anywhere. +Solution: Remove "-DPC" from the makefiles. +Files: src/Make_bc3.mak, src/Make_bc5.mak, src/Make_cyg.mak, + src/Make_ming.mak + +Patch 6.2.228 +Problem: Receiving CTRL-\ CTRL-N after typing "f" or "m" doesn't switch Vim + back to Normal mode. Same for CTRL-\ CTRL-G. +Solution: Check if the character typed after a command is CTRL-\ and obtain + another character to check for CTRL-N or CTRL-G, waiting up to + 'ttimeoutlen' msec. +Files: src/normal.c + +Patch 6.2.229 +Problem: ":function" with a name that uses magic curlies does not work + inside a function. (Servatius Brandt) +Solution: Skip over the function name properly. +Files: src/eval.c + +Patch 6.2.230 (extra) +Problem: Win32: a complex pattern may cause a crash. +Solution: Use __try and __except to catch the exception and handle it + gracefully, when possible. Add myresetstkoflw() to reset the + stack overflow. (Benjamin Peterson) +Files: src/Make_bc5.mak, src/os_mswin.c src/os_win32.c, src/os_win32.h, + src/proto/os_win32.pro, src/regexp.c + +Patch 6.2.231 (after 6.2.046) +Problem: Various problems when an error exception is raised from within a + builtin function. When it is invoked while evaluating arguments + to a function following arguments are still evaluated. When + invoked with a line range it will be called for remaining lines. +Solution: Update "force_abort" also after calling a builtin function, so + that aborting() always returns the correct value. (Servatius + Brandt) +Files: src/eval.c, src/ex_eval.c, src/proto/ex_eval.pro, + src/testdir/test49.ok, src/testdir/test49.vim + +Patch 6.2.232 +Problem: ":python vim.command('python print 2*2')" crashes Vim. (Eugene + Minkovskii) +Solution: Disallow executing a Python command recursively and give an error + message. +Files: src/if_python.c + +Patch 6.2.233 +Problem: On Mac OSX adding -pthread for Python only generates a warning. + The test for Perl threads rejects Perl while it's OK. + Tcl doesn't work at all. + The test for Ruby fails if ruby exists but there are no header + files. The Ruby library isn't detected properly +Solution: Avoid adding -pthread on Mac OSX. Accept Perl threads when it's + not the 5.5 threads. + Use the Tcl framework for header files. For Ruby rename cWindow + to cVimWindow to avoid a name clash. (Ken Scott) + Only enable Ruby when the header files can be found. Use "-lruby" + instead of "libruby.a" when it can't be found. +Files: src/auto/configure, src/configure.in, src/if_ruby.c + +Patch 6.2.234 +Problem: GTK 2 GUI: ":sp" and the ":q" leaves the cursor on the command + line. +Solution: Flush output before removing scrollbars. Also do this in other + places where gui_mch_*() functions are invoked. +Files: src/ex_cmds.c, src/option.c, src/window.c + +Patch 6.2.235 (extra) +Problem: Win32: Cursor isn't removed with a 25x80 window and doing: + "1830ia<Esc>400a-<Esc>0w0". (Yasuhiro Matsumoto) +Solution: Remove the call to gui_undraw_cursor() from gui_mch_insert_lines(). +Files: src/gui_w48.c + +Patch 6.2.236 +Problem: Using gvim with Agide gives "connection lost" error messages. +Solution: Only give the "connection lost" message when the buffer was once + owned by NetBeans. +Files: src/netbeans.c, src/structs.h + +Patch 6.2.237 +Problem: GTK 2: Thai text is drawn wrong. It changes when moving the + cursor over it. +Solution: Disable the shaping engine, it moves combining characters to a + wrong position and combines characters, while drawing the cursor + doesn't combine characters. +Files: src/gui_gtk_x11.c + +Patch 6.2.238 (after 6.2.231) +Problem: ":function" does not work inside a while loop. (Servatius Brandt) +Solution: Add get_while_line() and pass it to do_one_cmd() when in a while + loop, so that all lines are stored and can be used again when + repeating the loop. + Adjust test 49 so that it checks for the fixed problems. + (Servatius Brandt) +Files: src/digraph.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c, + src/proto/ex_cmds2.pro, src/proto/ex_docmd.pro, + src/testdir/test49.in, src/testdir/test49.ok, + src/testdir/test49.vim + +Patch 6.2.239 +Problem: GTK 2: With closed folds the arrow buttons of a vertical scrollbar + often doesn't scroll. (Moshe Kaminsky) +Solution: Hackish solution: Detect that the button was pressed from the + mouse pointer position. +Files: src/gui_gtk.c, src/gui.c + +Patch 6.2.240 +Problem: GTK 2: Searching for bitmaps for the toolbar doesn't work as with + other systems. Need to explicitly use "icon=name". (Ned Konz, + Christian J. Robinson) +Solution: Search for icons like done for Motif. +Files: src/gui_gtk.c + +Patch 6.2.241 +Problem: GTK 2: Search and Search/Replace dialogs are synced, that makes no + sense. Buttons are sometimes greyed-out. (Jeremy Messenger) +Solution: Remove the code to sync the two dialogs. Adjust the code to react + to an empty search string to also work for GTK2. (David Necas) +Files: src/gui_gtk.c + +Patch 6.2.242 +Problem: Gnome: "vim --help" only shows the Gnome arguments, not the Vim + arguments. +Solution: Don't let the Gnome code remove the "--help" argument and don't + exit at the end of usage(). +Files: src/gui_gtk_x11.c, src/main.c + +Patch 6.2.243 (extra) +Problem: Mac: Dropping a file on a Vim icon causes a hit-enter prompt. +Solution: Move the dropped files to the global argument list, instead of the + usual drop handling. (Eckehard Berns) +Files: src/main.c, src/gui_mac.c + +Patch 6.2.244 +Problem: ':echo "\xf7"' displays the illegal byte as if it was a character + and leaves "cho" after it. +Solution: When checking the length of a UTF-8 byte sequence and it's shorter + than the number of bytes available, assume it's an illegal byte. +Files: src/mbyte.c + +Patch 6.2.245 +Problem: Completion doesn't work for ":keepmarks" and ":lockmarks". +Solution: Add the command modifiers to the table of commands. (Madoka + Machitani) +Files: src/ex_cmds.h, src/ex_docmd.c + +Patch 6.2.246 +Problem: Mac: Starting Vim from Finder doesn't show error messages. +Solution: Recognize that output is being displayed by stderr being + "/dev/console". (Eckehard Berns) +Files: src/main.c, src/message.c + +Patch 6.2.247 (after 6.2.193) +Problem: When using a search pattern from the viminfo file the last + character is replaced with a '/'. +Solution: Store the separator character in the right place. (Kelvin Lee) +Files: src/ex_getln.c + +Patch 6.2.248 +Problem: GTK: When XIM is enabled normal "2" and keypad "2" cannot be + distinguished. +Solution: Detect that XIM changes the keypad key to the expected ASCII + character and fall back to the non-XIM code. (Neil Bird) +Files: src/gui_gtk_x11.c, src/mbyte.c, src/proto/mbyte.pro + +Patch 6.2.249 +Problem: ":cnext" moves to the error in the next file, but there is no + method to go back. +Solution: Add ":cpfile" and ":cNfile". +Files: src/ex_cmds.h, src/quickfix.c, src/vim.h, runtime/doc/quickfix.txt + +Patch 6.2.250 +Problem: Memory leaks when using signs. (Xavier de Gaye) +Solution: Delete the list of signs when unloading a buffer. +Files: src/buffer.c + +Patch 6.2.251 +Problem: GTK: The 'v' flag in 'guioptions' doesn't work. (Steve Hall) + Order of buttons is reversed for GTK 2.2.4. Don't always get + focus back after handling a dialog. +Solution: Make buttons appear vertically when desired. Reverse the order in + which buttons are added to a dialog. Move mouse pointer around + when the dialog is done and we don't have focus. +Files: src/gui_gtk.c + +Patch 6.2.252 (extra, after 6.2.243) +Problem: Mac: Dropping a file on a Vim icon causes a hit-enter prompt for + Mac OS classic. +Solution: Remove the #ifdef from the code that fixes it for Mac OSX. +Files: src/gui_mac.c + +Patch 6.2.253 +Problem: When 'tagstack' is not set a ":tag id" command does not work after + a ":tjump" command. +Solution: Set "new_tag" when 'tagstack' isn't set. (G. Narendran) +Files: src/tag.c + +Patch 6.2.254 +Problem: May run out of space for error messages. +Solution: Keep room for two more bytes. +Files: src/quickfix.c + +Patch 6.2.255 +Problem: GTK: A new item in the popup menu is put just after instead of + just before the right item. (Gabriel Zachmann) +Solution: Don't increment the menu item index. +Files: src/gui_gtk.c + +Patch 6.2.256 +Problem: Mac: "macroman" encoding isn't recognized, need to use + "8bit-macroman. +Solution: Recognize "macroman" with an alias "mac". (Eckehard Berns) +Files: src/mbyte.c + +Patch 6.2.257 (after 6.2.250) +Problem: Signs are deleted for ":bdel", but they could still be useful. +Solution: Delete signs only for ":bwipe". +Files: src/buffer.c + +Patch 6.2.258 +Problem: GUI: can't disable (grey-out) a popup menu item. (Ajit Thakkar) +Solution: Loop over the popup menus for all modes. +Files: src/menu.c + +Patch 6.2.259 +Problem: If there are messages when exiting, on the console there is a + hit-enter prompt while the message can be read; in the GUI the + message may not be visible. +Solution: Use the hit-enter prompt when there is an error message from + writing the viminfo file or autocommands, or when there is any + output in the GUI and 'verbose' is set. Don't use a hit-enter + prompt for the non-GUI version unless there is an error message. +Files: src/main.c + +Patch 6.2.260 +Problem: GTK 2: Can't quit a dialog with <Esc>. + GTK 1 and 2: <Enter> always gives a result, even when the default + button has been disabled. +Solution: Handle these keys explicitly. When no default button is specified + use the first one (works mostly like it was before). +Files: src/gui_gtk.c + +Patch 6.2.261 +Problem: When 'autoindent' and 'cindent' are set and a line is recognized + as a comment, starting a new line won't do 'cindent' formatting. +Solution: Also use 'cindent' formatting for lines that are used as a + comment. (Servatius Brandt) +Files: src/misc1.c + +Patch 6.2.262 +Problem: 1 CTRL-W w beeps, even though going to the first window is + possible. (Charles Campbell) +Solution: Don't beep. +Files: src/window.c + +Patch 6.2.263 +Problem: Lint warnings: Duplicate function prototypes, duplicate macros, + use of a zero character instead of a zero pointer, unused + variable. Clearing allocated memory in a complicated way. +Solution: Remove the function prototypes from farsi.h. Remove the + duplicated lines in keymap.h. Change getvcol() argument from NUL + to NULL. Remove the "col" variable in regmatch(). Use + lalloc_clear() instead of lalloc(). (Walter Briscoe) +Files: src/farsi.h, src/keymap.h, src/ops.c, src/regexp.c, src/search.c + +Patch 6.2.264 (after 6.2.247) +Problem: Writing past allocated memory when using a command line from the + viminfo file. +Solution: Store the NUL in the right place. +Files: src/ex_getln.c + +Patch 6.2.265 +Problem: Although ":set" is not allowed in the sandbox, ":let &opt = val" + works. +Solution: Do allow changing options in the sandbox, but not the ones that + can't be changed from a modeline. +Files: src/ex_cmds.h, src/options.c + +Patch 6.2.266 +Problem: When redirecting output and using ":silent", line breaks are + missing from output of ":map" and ":tselect". Alignment of + columns is wrong. +Solution: Insert a line break where "msg_didout" was tested. Update msg_col + when redirecting and using ":silent". +Files: src/getchar.c, src/message.c + +Patch 6.2.267 (extra) +Problem: Win32: "&&" in a tearoff menu is not shown. (Luc Hermitte) +Solution: Use the "name" item from the menu instead of the "dname" item. +Files: src/gui_w32.c, src/menu.c + +Patch 6.2.268 +Problem: GUI: When changing 'guioptions' part of the window may be off + screen. (Randall Morris) +Solution: Adjust the size of the window when changing 'guioptions', but only + when adding something. +Files: src/gui.c + +Patch 6.2.269 +Problem: Diff mode does not highlight a change in a combining character. + (Raphael Finkel) +Solution: Make diff_find_change() multi-byte aware: find the start byte of + a character that contains a change. +Files: src/diff.c + +Patch 6.2.270 +Problem: Completion in Insert mode, then repeating with ".", doesn't handle + composing characters in the completed text. (Raphael Finkel) +Solution: Don't skip over composing chars when adding completed text to the + redo buffer. +Files: src/getchar.c + +Patch 6.2.271 +Problem: NetBeans: Can't do "tail -f" on the log. Passing socket info with + an argument or environment variable is not secure. +Solution: Wait after initializing the log. Allow passing the socket info + through a file. (Gordon Prieur) +Files: runtime/doc/netbeans.txt, src/main.c, src/netbeans.c + +Patch 6.2.272 +Problem: When the "po" directory exists, but "po/Makefile" doesn't, + building fails. Make loops when the "po" directory has been + deleted after running configure. +Solution: Check for the "po/Makefile" instead of just the "po" directory. + Check this again before trying to run make with that Makefile. +Files: src/auto/configure, src/configure.in, src/Makefile + +Patch 6.2.273 +Problem: Changing the sort order in an explorer window for an empty + directory produces error messages. (Doug Kearns) +Solution: When an invalid range is used for a function that is not going to + be executed, skip over the arguments anyway. +Files: src/eval.c + +Patch 6.2.274 +Problem: ":print" skips empty lines when 'list' is set and there is no + "eol" in 'listchars'. (Yakov Lerner) +Solution: Skip outputting a space for an empty line only when 'list' is set + and the end-of-line character is not empty. +Files: src/message.c + +Patch 6.2.275 (extra, after 6.2.267) +Problem: Warning for uninitialized variable when using gcc. +Solution: Initialize "acLen" to zero. (Bill McCarthy) +Files: src/gui_w32.c + +Patch 6.2.276 +Problem: ":echo X()" does not put a line break between the message that X() + displays and the text that X() returns. (Yakov Lerner) +Solution: Invoke msg_start() after evaluating the argument. +Files: src/eval.c + +Patch 6.2.277 +Problem: Vim crashes when a ":runtime ftplugin/ada.vim" causes a recursive + loop. (Robert Nowotniak) +Solution: Restore "msg_list" before returning from do_cmdline(). +Files: src/ex_docmd.c + +Patch 6.2.278 +Problem: Using "much" instead of "many". +Solution: Correct the error message. +Files: src/eval.c + +Patch 6.2.279 +Problem: There is no default choice for a confirm() dialog, now that it is + possible not to have a default choice. +Solution: Make the first choice the default choice. +Files: runtime/doc/eval.txt, src/eval.c + +Patch 6.2.280 +Problem: "do" and ":diffget" don't work in the first line and the last line + of a buffer. (Aron Griffis) +Solution: Find a difference above the first line and below the last line. + Also fix a few display updating bugs. +Files: src/diff.c, src/fold.c, src/move.c + +Patch 6.2.281 +Problem: PostScript printing doesn't work on Mac OS X 10.3.2. +Solution: Adjust the header file. (Mike Williams) +Files: runtime/print/prolog.ps + +Patch 6.2.282 +Problem: When using CTRL-O to go back to a help file, it becomes listed. + (Andrew Nesbit) + Using ":tag" or ":tjump" in a help file doesn't keep the help file + settings (e.g. for 'iskeyword'). +Solution: Don't mark a buffer as listed when its help flag is set. Put all + the option settings for a help buffer together in do_ecmd(). +Files: src/ex_cmds.c + +Patch 6.2.283 +Problem: The "local additions" in help.txt are used without conversion, + causing latin1 characters showing up wrong when 'enc' is utf-8. + (Antoine J. Mechelynck) +Solution: Convert the text to 'encoding'. +Files: src/ex_cmds.c + +Patch 6.2.284 +Problem: Listing a function puts "endfunction" in the message history. + Typing "q" at the more prompt isn't handled correctly when listing + variables and functions. (Hara Krishna Dara) +Solution: Don't use msg() for "endfunction". Check "got_int" regularly. +Files: src/eval.c + +Patch 6.2.285 +Problem: GUI: In a single wrapped line that fills the window, "gj" in the + last screen line leaves the cursor behind. (Ivan Tarasov) +Solution: Undraw the cursor before scrolling the text up. +Files: src/gui.c + +Patch 6.2.286 +Problem: When trying to rename a file and it doesn't exist, the destination + file is deleted anyway. (Luc Deux) +Solution: Don't delete the destination when the source doesn't exist. (Taro + Muraoka) +Files: src/fileio.c + +Patch 6.2.287 (after 6.2.264) +Problem: Duplicate lines are added to the viminfo file. +Solution: Compare with existing entries without an offset. Also fixes + reading very long history lines from viminfo. +Files: src/ex_getln.c + +Patch 6.2.288 (extra) +Problem: Mac: An external program can't be interrupted. +Solution: Don't use the 'c' key for backspace. (Eckehard Berns) +Files: src/gui_mac.c + +Patch 6.2.289 +Problem: Compiling the Tcl interface with thread support causes ":make" to + fail. (Juergen Salk) +Solution: Use $TCL_DEFS from the Tcl config script to obtain the required + compile flags for using the thread library. +Files: src/auto/configure, src/configure.in + +Patch 6.2.290 (extra) +Problem: Mac: The mousewheel doesn't work. +Solution: Add mousewheel support. Also fix updating the thumb after a drag + and then using another way to scroll. (Eckehard Berns) +Files: src/gui_mac.c + +Patch 6.2.291 (extra) +Problem: Mac: the plus button and close button don't do anything. +Solution: Make the plus button maximize the window and the close button + close Vim. (Eckehard Berns) +Files: src/gui.c, src/gui_mac.c + +Patch 6.2.292 +Problem: Motif: When removing GUI arguments from argv[] a "ps -ef" shows + the last argument repeated. +Solution: Set argv[argc] to NULL. (Michael Jarvis) +Files: src/gui_x11.c + +Patch 6.2.293 (after 6.2.255) +Problem: GTK: A new item in a menu is put before the tearoff item. +Solution: Do increment the menu item index for non-popup menu items. +Files: src/gui_gtk.c + +Patch 6.2.294 (extra) +Problem: Mac: Cannot use modifiers with Space, Tab, Enter and Escape. +Solution: Handle all modifiers for these keys. (Eckehard Berns) +Files: src/gui_mac.c + +Patch 6.2.295 +Problem: When in debug mode, receiving a message from a remote client + causes a crash. Evaluating an expression causes Vim to wait for + "cont" to be typed, without a prompt. (Hari Krishna Dara) +Solution: Disable debugging when evaluating an expression for a client. + (Michael Geddes) Don't try reading into the typeahead buffer when + it may have been filled in another way. +Files: src/ex_getln.c, src/getchar.c, src/if_xcmdsrv.c, src/main.c, + src/misc1.c, src/proto/getchar.pro, src/proto/main.pro, + src/proto/os_unix.pro, src/proto/ui.pro, src/structs.h, + src/os_unix.c, src/ui.c + +Patch 6.2.296 (extra) +Problem: Same as 6.2.295. +Solution: Extra files for patch 6.2.295. +Files: src/os_amiga.c, src/os_msdos.c, src/os_riscos.c, src/os_win32.c, + src/proto/os_amiga.pro, src/proto/os_msdos.pro, + src/proto/os_riscos.pro, src/proto/os_win32.pro + +Patch 6.2.297 (after 6.2.232) +Problem: Cannot invoke Python commands recursively. +Solution: With Python 2.3 and later use the available mechanisms to invoke + Python recursively. (Matthew Mueller) +Files: src/if_python.c + +Patch 6.2.298 +Problem: A change always sets the '. mark and an insert always sets the '^ + mark, even when this is not wanted. + Cannot go back to the position of older changes without undoing + those changes. +Solution: Add the ":keepjumps" command modifier. + Add the "g," and "g;" commands. +Files: runtime/doc/motion.txt, src/ex_cmds.h, src/ex_docmd.c, src/edit.c, + src/mark.c, src/misc1.c, src/normal.c, src/proto/mark.pro, + src/structs.h, src/undo.c + +Patch 6.2.299 +Problem: Can only use one language for help files. +Solution: Add the 'helplang' option to select the preferred language(s). + Make ":helptags" generate tags files for all languages. +Files: runtime/doc/options.txt, runtime/doc/various.txt, src/Makefile, + src/ex_cmds.c, src/ex_cmds2.c, src/ex_cmds.h, src/ex_getln.c, + src/normal.c, src/option.c, src/option.h, src/proto/ex_cmds.pro, + src/proto/ex_cmds2.pro, src/proto/option.pro, src/structs.h, + src/tag.c, src/vim.h + +Patch 6.2.300 (after 6.2.297) +Problem: Cannot build Python interface with Python 2.2 or earlier. +Solution: Add a semicolon. +Files: src/if_python.c + +Patch 6.2.301 +Problem: The "select all" item from the popup menu doesn't work for Select + mode. +Solution: Use the same commands as for the "Edit.select all" menu. + (Benji Fisher) +Files: runtime/menu.vim + +Patch 6.2.302 +Problem: Using "CTRL-O ." in Insert mode doesn't work properly. (Benji + Fisher) +Solution: Restore "restart_edit" after an insert command that was not typed. + Avoid waiting with displaying the mode when there is no text to be + overwritten. + Fix that "CTRL-O ." sometimes doesn't put the cursor back after + the end-of-line. Only reset the flag that CTRL-O was used past + the end of the line when restarting editing. Update "o_lnum" + number when inserting text and "o_eol" is set. +Files: src/edit.c, src/normal.c + +Patch 6.2.303 +Problem: Cannot use Unicode digraphs while 'encoding' is not Unicode. +Solution: Convert the character from Unicode to 'encoding' when needed. + Use the Unicode digraphs for the Macintosh. (Eckehard Berns) +Files: src/digraph.c + +Patch 6.2.304 (extra, after 6.2.256) +Problem: Mac: No proper support for 'encoding'. Conversion without iconv() + is not possible. +Solution: Convert input from 'termencoding' to 'encoding'. Add + mac_string_convert(). Convert text for the clipboard when needed. + (Eckehard Berns) +Files: src/gui_mac.c, src/mbyte.c, src/structs.h, src/vim.h + +Patch 6.2.305 (after 6.2.300) +Problem: Win32: Cannot build Python interface with Python 2.3. (Ajit + Thakkar) +Solution: Add two functions to the dynamic loading feature. +Files: src/if_python.c + +Patch 6.2.306 (extra) +Problem: Win32: Building console version with BCC 5.5 gives a warning for + get_cmd_args() prototype missing. (Ajit Thakkar) +Solution: Don't build os_w32exe.c for the console version. +Files: src/Make_bc5.mak + +Patch 6.2.307 (after 6.2.299) +Problem: Installing help files fails. +Solution: Expand wildcards for translated help files separately. +Files: src/Makefile + +Patch 6.2.308 +Problem: Not all systems have "whoami", resulting in an empty user name. +Solution: Use "logname" when possible, "whoami" otherwise. (David Boyce) +Files: src/Makefile + +Patch 6.2.309 +Problem: "3grx" waits for two ESC to be typed. (Jens Paulus) +Solution: Append the ESC to the stuff buffer when redoing the "gr" insert. +Files: src/edit.c + +Patch 6.2.310 +Problem: When setting 'undolevels' to -1, making a change and setting + 'undolevels' to a positive value an "undo list corrupt" error + occurs. (Madoka Machitani) +Solution: Sync undo before changing 'undolevels'. +Files: src/option.c + +Patch 6.2.311 (after 6.2.298) +Problem: When making several changes in one line the changelist grows + quickly. There is no error message for reaching the end of the + changelist. Reading changelist marks from viminfo doesn't work + properly. +Solution: Only make a new entry in the changelist when making a change in + another line or 'textwidth' columns away. Add E662, E663 and E664 + error messages. Put a changelist mark from viminfo one position + before the end. +Files: runtime/doc/motion.txt, src/mark.c, src/misc1.c, src/normal.c + +Patch 6.2.312 (after 6.2.299) +Problem: "make install" clears the screen when installing the docs. +Solution: Execute ":helptags" in silent mode. +Files: runtime/doc/Makefile + +Patch 6.2.313 +Problem: When opening folds in a diff window, other diff windows no longer + show the same text. +Solution: Sync the folds in diff windows. +Files: src/diff.c, src/fold.c, src/move.c, src/proto/diff.pro, + src/proto/move.pro + +Patch 6.2.314 +Problem: When 'virtualedit' is set "rx" may cause a crash with a blockwise + selection and using "$". (Moritz Orbach) +Solution: Don't try replacing chars in a line that has no characters in the + block. +Files: src/ops.c + +Patch 6.2.315 +Problem: Using CTRL-C in a Visual mode mapping while 'insertmode' is set + stops Vim from returning to Insert mode. +Solution: Don't reset "restart_edit" when a CTRL-C is found and 'insertmode' + is set. +Files: src/normal.c + +Patch 6.2.316 (after 6.2.312) +Problem: "make install" tries connecting to the X server when installing + the docs. (Stephen Thomas) +Solution: Add the "-X" argument. +Files: runtime/doc/Makefile + +Patch 6.2.317 (after 6.2.313) +Problem: When using "zi" in a diff window, other diff windows are not + adjusted. (Richard Curnow) +Solution: Distribute a change in 'foldenable' to other diff windows. +Files: src/normal.c + +Patch 6.2.318 +Problem: When compiling with _THREAD_SAFE external commands don't echo + typed characters. +Solution: Don't set the terminal mode to TMODE_SLEEP when it's already at + TMODE_COOK. +Files: src/os_unix.c + +Patch 6.2.319 (extra) +Problem: Building gvimext.dll with Mingw doesn't work properly. +Solution: Use gcc instead of dllwrap. Use long option names. (Alejandro + Lopez-Valencia) +Files: src/GvimExt/Make_ming.mak + +Patch 6.2.320 +Problem: Win32: Adding and removing the menubar resizes the Vim window. + (Jonathon Merz) +Solution: Don't let a resize event change 'lines' unexpectedly. +Files: src/gui.c + +Patch 6.2.321 +Problem: When using modeless selection, wrapping lines are not recognized, + a line break is always inserted. +Solution: Add LineWraps[] to remember whether a line wrapped or not. +Files: src/globals.h, src/screen.c, src/ui.c + +Patch 6.2.322 +Problem: With 'showcmd' set, after typing "dd" the next "d" may not be + displayed. (Jens Paulus) +Solution: Redraw the command line after updating the screen, scrolling may + have set "clear_cmdline". +Files: src/screen.c + +Patch 6.2.323 +Problem: Win32: expanding "~/file" in an autocommand pattern results in + backslashes, while this pattern should only have forward slashes. +Solution: Make expanding environment variables respect 'shellslash' and set + p_ssl when expanding the autocommand pattern. +Files: src/fileio.c, src/misc1.c, src/proto/fileio.pro + +Patch 6.2.324 (extra) +Problem: Win32: when "vimrun.exe" has a path with white space, such as + "Program Files", executing external commands may fail. +Solution: Put double quotes around the path to "vimrun". +Files: src/os_win32.c + +Patch 6.2.325 +Problem: When $HOME includes a space, doing ":set tags=~/tags" doesn't + work, the space is used to separate file names. (Brett Stahlman) +Solution: Escape the space with a backslash. +Files: src/option.c + +Patch 6.2.326 +Problem: ":windo set syntax=foo" doesn't work. (Tim Chase) +Solution: Don't change 'eventignore' for ":windo". +Files: src/ex_cmds2.c + +Patch 6.2.327 +Problem: When formatting text all marks in the formatted lines are lost. + A word is not joined to a previous line when this would be + possible. (Mikolaj Machowski) +Solution: Try to keep marks in the same position as much as possible. + Also keep mark positions when joining lines. + Start auto-formatting in the previous line when appropriate. + Add the "gw" operator: Like "gq" but keep the cursor where it is. +Files: runtime/doc/change.txt, src/edit.c, src/globals.h, src/mark.c, + src/misc1.c, src/normal.c, src/ops.c, src/proto/edit.pro, + src/proto/mark.pro, src/proto/ops.pro, src/structs.h, src/vim.h + +Patch 6.2.328 +Problem: XIM with GTK: It is hard to understand what XIM is doing. +Solution: Add xim_log() to log XIM events and help with debugging. +Files: src/mbyte.c + +Patch 6.2.329 +Problem: ":=" does not work Vi compatible. (Antony Scriven) +Solution: Print the last line number instead of the current line. Don't + print "line". +Files: src/ex_cmds.h, src/ex_docmd.c + +Patch 6.2.330 (extra, after 6.2.267) +Problem: Win32: Crash when tearing off a menu. +Solution: Terminate a string with a NUL. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + +Patch 6.2.331 (after 6.2.327) +Problem: "gwap" leaves cursor in the wrong line. +Solution: Remember the cursor position before finding the ends of the + paragraph. +Files: src/normal.c, src/ops.c, src/structs.h + +Patch 6.2.332 (extra) +Problem: Amiga: Compile error for string array. Compiling the Amiga GUI + doesn't work. +Solution: Use a char pointer instead. Move including "gui_amiga.h" to after + including "vim.h". Add a semicolon. (Ali Akcaagac) +Files: src/gui_amiga.c, src/os_amiga.c + +Patch 6.2.333 (extra) +Problem: Win32: printing doesn't work with specified font charset. +Solution: Use the specified font charset. (Mike Williams) +Files: src/os_mswin.c + +Patch 6.2.334 (extra, after 6.2.296) +Problem: Win32: evaluating client expression in debug mode requires typing + "cont". +Solution: Use eval_client_expr_to_string(). +Files: src/os_mswin.c + +Patch 6.2.335 +Problem: The ":sign" command cannot be followed by another command. +Solution: Add TRLBAR to the command flags. +Files: src/ex_cmds.h + +Patch 6.2.336 (after 6.2.327) +Problem: Mixup of items in an expression. +Solution: Move "== NUL" to the right spot. +Files: src/edit.c + +Patch 6.2.337 (extra, after 6.2.319) +Problem: Building gvimext.dll with Mingw doesn't work properly. +Solution: Fix white space and other details. (Alejandro Lopez-Valencia) +Files: src/GvimExt/Make_ming.mak + +Patch 6.2.338 (after 6.2.331) +Problem: When undoing "gwap" the cursor is always put at the start of the + paragraph. When undoing auto-formatting the cursor may be above + the change. +Solution: Try to move the cursor back to where it was or to the first line + that actually changed. +Files: src/normal.c, src/ops.c, src/undo.c + +Patch 6.2.339 +Problem: Crash when using many different highlight groups and a User + highlight group. (Juergen Kraemer) +Solution: Do not use the sg_name_u pointer when it is NULL. Also simplify + use of the highlight group table. +Files: src/syntax.c + +Patch 6.2.340 +Problem: ":reg" doesn't show the actual contents of the clipboard if it was + filled outside of Vim. (Stuart MacDonald) +Solution: Obtain the clipboard contents before displaying it. +Files: src/ops.c + +Patch 6.2.341 (extra) +Problem: Win32: When the path to diff.exe contains a space and using the + vimrc generated by the install program, diff mode does not work. +Solution: Put the first double quote just before the space instead of before + the path. +Files: src/dosinst.c + +Patch 6.2.342 (extra) +Problem: Win32: macros are not always used as expected. +Solution: Define WINVER to 0x0400 instead of 0x400. (Alejandro + Lopez-Valencia) +Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_mvc.mak + +Patch 6.2.343 +Problem: Title doesn't work with some window managers. X11: Setting the + text property for the window title is hard coded. +Solution: Use STRING format when possible. Use the UTF-8 function when + it's available and 'encoding' is utf-8. Use + XStringListToTextProperty(). Do the same for the icon name. + (David Harrison) +Files: src/os_unix.c + +Patch 6.2.344 (extra, after 6.2.337) +Problem: Cannot build gvimext.dll with MingW on Linux. +Solution: Add support for cross compiling. (Ronald Hoellwarth) +Files: src/GvimExt/Make_ming.mak + +Patch 6.2.345 (extra) +Problem: Win32: Copy/paste between two Vims fails if 'encoding' is not set + properly or there are illegal bytes. +Solution: Use a raw byte format. Always set it when copying. When pasting + use the raw format if 'encoding' is the same. +Files: src/os_mswin.c, src/os_win16.c, src/os_win32.c, src/vim.h + +Patch 6.2.346 +Problem: Win32 console: After using "chcp" Vim does not detect the + different codepage. +Solution: Use GetConsoleCP() and when it is different from GetACP() set + 'termencoding'. +Files: src/option.c + +Patch 6.2.347 (extra) +Problem: Win32: XP theme support is missing. +Solution: Add a manifest and refer to it from the resource file. (Michael + Wookey) +Files: Makefile, src/gvim.exe.mnf, src/vim.rc + +Patch 6.2.348 +Problem: Win32: "vim c:\dir\(test)" doesn't work, because the 'isfname' + default value doesn't contain parenthesis. +Solution: Temporarily add '(' and ')' to 'isfname' when expanding file name + arguments. +Files: src/main.c + +Patch 6.2.349 +Problem: Finding a match using 'matchpairs' may cause a crash. + 'matchpairs' is not used for 'showmatch'. +Solution: Don't look past the NUL in 'matchpairs'. Use 'matchpairs' for + 'showmatch'. (Dave Olszewkski) +Files: src/misc1.c, src/normal.c, src/proto/search.pro, src/search.c + +Patch 6.2.350 +Problem: Not enough info about startup timing. +Solution: Add a few more TIME_MSG() calls. +Files: src/main.c + +Patch 6.2.351 +Problem: Win32: $HOME may be set to %USERPROFILE%. +Solution: Expand %VAR% at the start of $HOME. +Files: src/misc1.c + +Patch 6.2.352 (after 6.2.335) +Problem: ":sign texthl=||" does not work. +Solution: Remove the check for a following command. Give an error for extra + arguments after "buff=1". +Files: src/ex_cmds.c, src/ex_cmds.h + +Patch 6.2.353 (extra) +Problem: Win32: Supported server name length is limited. (Paul Bossi) +Solution: Use MAX_PATH instead of 25. +Files: src/os_mswin.c + +Patch 6.2.354 (extra) +Problem: Win32: When the mouse pointer is on a tear-off menu it is hidden + when typing but is not redisplayed when moved. (Markx Hackmann) +Solution: Handle the pointer move event for the tear-off menu window. +Files: src/gui_w32.c + +Patch 6.2.355 (after 6.2.303) +Problem: When 'encoding' is a double-byte encoding different from the + current locale, the width of characters is not correct. + Possible failure and memory leak when using iconv, Unicode + digraphs and 'encoding' is not "utf-8". +Solution: Use iconv() to discover the actual width of characters. + Add the "vc_fail" field to vimconv_T. + When converting a digraph, init the conversion type to NONE and + cleanup afterwards. +Files: src/digraph.c, src/mbyte.c, src/structs.h + +Patch 6.2.356 +Problem: When using a double-byte 'encoding' and 'selection' is + "exclusive", "vy" only yanks the first byte of a double-byte + character. (Xiangjiang Ma) +Solution: Correct the column in unadjust_for_sel() to position on the first + byte, always include the trailing byte of the selected text. +Files: src/normal.c + +Patch 6.2.357 (after 6.2.321) +Problem: Memory leak when resizing the Vim window. +Solution: Free the LineWraps array. +Files: src/screen.c + +Patch 6.2.358 (after 6.2.299) +Problem: Memory leak when using ":help" and the language doesn't match. +Solution: Free the array with matching tags. +Files: src/ex_cmds.c + +Patch 6.2.359 (after 6.2.352) +Problem: Compiler warning for long to int type cast. +Solution: Add explicit type cast. +Files: src/ex_cmds.c + +Patch 6.2.360 +Problem: "100|" in an empty line results in a ruler "1,0-100". (Pavol + Juhas) +Solution: Recompute w_virtcol if the target column was not reached. +Files: src/misc2.c + +Patch 6.2.361 (extra) +Problem: Win32: Run gvim, ":set go-=m", use Alt-Tab, keep Alt pressed while + pressing Esc, then release Alt: Cursor disappears and typing a key + causes a beep. (Hari Krishna Dara) +Solution: Don't ignore the WM_SYSKEYUP event when the menu is disabled. +Files: src/gui_w32.c + +Patch 6.2.362 (extra, after 6.2.347) +Problem: Win32: The manifest causes Gvim not to work. (Dave Roberts) +Solution: Change "x86" to "X86". (Serge Pirotte) +Files: src/gvim.exe.mnf + +Patch 6.2.363 +Problem: In an empty file with 'showmode' off, "i" doesn't change the ruler + from "0-1" to "1". Typing "x<BS>" does show "1", but then <Esc> + doesn't make it "0-1" again. Same problem for ruler in + statusline. (Andrew Pimlott) +Solution: Remember the "empty line" flag with Insert mode and'ed to it. +Files: src/screen.c + +Patch 6.2.364 +Problem: HTML version of the documentation doesn't mention the encoding, + which is a problem for mbyte.txt. +Solution: Adjust the awk script. (Ilya Sher) +Files: runtime/doc/makehtml.awk + +Patch 6.2.365 +Problem: The configure checks for Perl and Python may add compile and link + arguments that break building Vim. +Solution: Do a sanity check: try building with the arguments. +Files: src/auto/configure, src/configure.in + +Patch 6.2.366 +Problem: When the GUI can't start because no valid font is found, there is + no error message. (Ugen) +Solution: Add an error message. +Files: src/gui.c + +Patch 6.2.367 +Problem: Building the help tags file while installing may fail if there is + another Vim in $PATH. +Solution: Specify the just installed Vim executable. (Gordon Prieur) +Files: src/Makefile + +Patch 6.2.368 +Problem: When 'autochdir' is set, closing a window doesn't change to the + directory of the new current window. (Salman Halim) +Solution: Handle 'autochdir' always when a window becomes the current one. +Files: src/window.c + +Patch 6.2.369 +Problem: Various memory leaks: when using globpath(), when searching for + help tags files, when defining a function inside a function, when + giving an error message through an exception, for the final "." + line in ":append", in expression "cond ? a : b" that fails and for + missing ")" in an expression. Using NULL pointer when adding + first user command and for pointer computations with regexp. + (tests by Dominique Pelle) +Solution: Fix the leaks by freeing the allocated memory. Don't use the + array of user commands when there are no entries. Use a macro + instead of a function call for saving and restoring regexp states. +Files: src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c, + src/misc2.c, src/regexp.c, src/screen.c, src/tag.c + +Patch 6.2.370 (extra, after6.2.341) +Problem: Win32: When the path to diff.exe contains a space and using the + vimrc generated by the install program, diff mode may not work. + (Alejandro Lopez-Valencia) +Solution: Do not use double quotes for arguments that do not have a space. +Files: src/dosinst.c + +Patch 6.2.371 +Problem: When 'virtualedit' is set and there is a Tab before the next "x", + "dtx" does not delete the whole Tab. (Ken Hashishi) +Solution: Move the cursor to the last position of the Tab. Also for + "df<Tab>". +Files: src/normal.c + +Patch 6.2.372 +Problem: When using balloon evaluation, no value is displayed for members + of structures and items of an array. +Solution: Include "->", "." and "[*]" in the expression. +Files: src/gui_beval.c, src/normal.c, src/vim.h + +Patch 6.2.373 +Problem: When 'winminheight' is zero and a window is reduced to zero + height, the ruler always says "Top" instead of the cursor + position. (Antoine J. Mechelynck) +Solution: Don't recompute w_topline for a zero-height window. +Files: src/window.c + +Patch 6.2.374 +Problem: ":echo "hello" | silent normal n" removes the "hello" message. + (Servatius Brandt) +Solution: Don't echo the search string when ":silent" was used. Also don't + show the mode. In general: don't clear to the end of the screen. +Files: src/gui.c, src/message.c, src/os_unix.c, src/proto/message.pro, + src/screen.c, src/search.c, src/window.c + +Patch 6.2.375 +Problem: When changing 'guioptions' the hit-enter prompt may be below the + end of the Vim window. +Solution: Call screen_alloc() before showing the prompt. +Files: src/message.c + +Patch 6.2.376 +Problem: Win32: Ruby interface cannot be dynamically linked with Ruby 1.6. +Solution: Add #ifdefs around use of rb_w32_snprintf(). (Benot Cerrina) +Files: src/if_ruby.c + +Patch 6.2.377 (after 6.2.372) +Problem: Compiler warnings for signed/unsigned compare. (Michael Wookey) +Solution: Add type cast. +Files: src/normal.c + +Patch 6.2.378 (extra, after 6.2.118) +Problem: Mac: cannot build with Project Builder. +Solution: Add remove_tail_with_ext() to locate and remove the "build" + directory from the runtime path. Include os_unix.c when needed. + (Dany St Amant) +Files: src/misc1.c, src/os_macosx.c, src/vim.h + +Patch 6.2.379 +Problem: Using ":mkvimrc" in the ":options" window sets 'bufhidden' to + "delete". (Michael Naumann) +Solution: Do not add buffer-specific option values to a global vimrc file. +Files: src/option.c + +Patch 6.2.380 (extra) +Problem: DOS: "make test" fails when running it again. Can't "make test" + with Borland C. +Solution: Make sure ".out" files are deleted when they get in the way. Add + a "test" target to the Borland C Makefile. +Files: src/Make_bc5.mak, src/testdir/Make_dos.mak + +Patch 6.2.381 +Problem: Setting 'fileencoding' to a comma separated list (confusing it + with 'fileencodings') does not result in an error message. + Setting 'fileencoding' in an empty file marks it as modified. + There is no "+" in the title after setting 'fileencoding'. +Solution: Check for a comma in 'fileencoding'. Only consider a non-empty + file modified by changing 'fileencoding'. Update the title after + changing 'fileencoding'. +Files: src/option.c + +Patch 6.2.382 +Problem: Running "make test" puts marks from test files in viminfo. +Solution: Specify a different viminfo file to use. +Files: src/testdir/test15.in, src/testdir/test49.in + +Patch 6.2.383 +Problem: ":hi foo term='bla" crashes Vim. (Antony Scriven) +Solution: Check that the closing ' is there. +Files: src/syntax.c + +Patch 6.2.384 +Problem: ":menu a.&b" ":unmenu a.b" only works if "&b" isn't translated. +Solution: Also compare the names without '&' characters. +Files: src/menu.c + +Patch 6.2.385 (extra) +Problem: Win32: forward_slash() and trash_input_buf() are undefined when + compiling with small features. (Ajit Thakkar) +Solution: Change the #ifdefs for forward_slash(). Don't call + trash_input_buf() if the input buffer isn't used. +Files: src/fileio.c, src/os_win32.c + +Patch 6.2.386 +Problem: Wasting time trying to read marks from the viminfo file for a + buffer without a name. +Solution: Skip reading marks when the buffer has no name. +Files: src/fileio.c + +Patch 6.2.387 +Problem: There is no highlighting of translated items in help files. +Solution: Search for a "help_ab.vim" syntax file when the help file is + called "*.abx". Also improve the help highlighting a bit. +Files: runtime/syntax/help.vim + +Patch 6.2.388 +Problem: GTK: When displaying some double-width characters they are drawn + as single-width, because of conversion to UTF-8. +Solution: Check the width that GTK uses and add a space if it's one instead + of two. +Files: src/gui_gtk_x11.c + +Patch 6.2.389 +Problem: When working over a slow connection, it's very annoying that the + last line is partly drawn and then cleared for every change. +Solution: Don't redraw the bottom line if no rows were inserted or deleted. + Don't draw the line if we know "@" lines will be used. +Files: src/screen.c + +Patch 6.2.390 +Problem: Using "r*" in Visual mode on multi-byte characters only replaces + every other character. (Tyson Roberts) +Solution: Correct the cursor position after replacing each character. +Files: src/ops.c + +Patch 6.2.391 (extra) +Problem: The ":highlight" command is not tested. +Solution: Add a test script for ":highlight". +Files: src/testdir/Makefile, src/testdir/Make_amiga.mak, + src/testdir/Make_dos.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/test51.in, + src/testdir/test51.ok + +Patch 6.2.392 (after 6.2.384) +Problem: Unused variable. +Solution: Remove "dlen". +Files: src/menu.c + +Patch 6.2.393 +Problem: When using very long lines the viminfo file can become very big. +Solution: Add the "s" flag to 'viminfo': skip registers with more than the + specified Kbyte of text. +Files: runtime/doc/options.txt, src/ops.c, src/option.c + +Patch 6.2.394 (after 6.2.391) +Problem: Test 51 fails on a terminal with 8 colors. (Tony Leneis) +Solution: Use "DarkBlue" instead of "Blue" to avoid the "bold" attribute. +Files: src/testdir/test51.in + +Patch 6.2.395 +Problem: When using ":tag" or ":pop" the previous matching tag is used. + But since the current file is different, the ordering of the tags + may change. +Solution: Remember what the current buffer was for when re-using cur_match. +Files: src/edit.c, src/ex_cmds.c, src/proto/tag.pro, src/structs.h, + src/tag.c + +Patch 6.2.396 +Problem: When CTRL-T jumps to another file and an autocommand moves the + cursor to the '" mark, don't end up on the right line. (Michal + Malecki) +Solution: Set the line number after loading the file. +Files: src/tag.c + +Patch 6.2.397 +Problem: When using a double-byte 'encoding' mapping <M-x> doesn't work. + (Yasuhiro Matsumoto) +Solution: Do not set the 8th bit of the character but use a modifier. +Files: src/gui_gtk_x11.c, src/gui_x11.c, src/misc2.c + +Patch 6.2.398 (extra) +Problem: Win32 console: no extra key modifiers are supported. +Solution: Encode the modifiers into the input stream. Also fix that special + keys are converted and stop working when 'tenc' is set. Also fix + that when 'tenc' is initialized the input and output conversion is + not setup properly until 'enc' or 'tenc' is set. +Files: src/getchar.c, src/option.c, src/os_win32.c + +Patch 6.2.399 +Problem: A ":set" command that fails still writes a message when it is + inside a try/catch block. +Solution: Include all the text of the message in the error message. +Files: src/charset.c, src/option.c + +Patch 6.2.400 +Problem: Can't compile if_xcmdsrv.c on HP-UX 11.0. +Solution: Include header file poll.h. (Malte Neumann) +Files: src/if_xcmdsrv.c + +Patch 6.2.401 +Problem: When opening a buffer that was previously opened, Vim does not + restore the cursor position if the first line starts with white + space. (Gregory Margo) +Solution: Don't skip restoring the cursor position if it is past the blanks + in the first line. +Files: src/buffer.c + +Patch 6.2.402 +Problem: Mac: "make install" doesn't generate help tags. (Benji Fisher) +Solution: Generate help tags before copying the runtime files. +Files: src/Makefile + +Patch 6.2.403 +Problem: ":@y" checks stdin if there are more commands to execute. This + fails if stdin is not connected, e.g., when starting the GUI from + KDE. (Ned Konz) +Solution: Only check for a next command if there still is typeahead. +Files: src/ex_docmd.c + +Patch 6.2.404 +Problem: Our own function to determine width of Unicode characters may get + outdated. (Markus Kuhn) +Solution: Use wcwidth() when it is available. Also use iswprint(). +Files: src/auto/configure, src/configure.in, src/config.h.in, src/mbyte.c + +Patch 6.2.405 +Problem: Cannot map zero without breaking the count before a command. + (Benji Fisher) +Solution: Disable mapping zero when entering a count. +Files: src/getchar.c, src/globals.h, src/normal.c + +Patch 6.2.406 +Problem: ":help \zs", ":help \@=" and similar don't find useful help. +Solution: Prepend "/\" to the arguments to find the desired help tag. +Files: src/ex_cmds.c + +Patch 6.2.407 (after 6.2.299) +Problem: ":help \@<=" doesn't find help. +Solution: Avoid that ":help \@<=" searches for the "<=" language. +Files: src/tag.c + +Patch 6.2.408 +Problem: ":compiler" is not consistent: Sets local options and a global + variable. (Douglas Potts) There is no error message when a + compiler is not supported. +Solution: Use ":compiler!" to set a compiler globally, otherwise it's local + to the buffer and "b:current_compiler" is used. Give an error + when no compiler script could be found. + Note: updated compiler plugins can be found at + ftp://ftp.vim.org/pub/vim/runtime/compiler/ +Files: runtime/compiler/msvc.vim, runtime/doc/quickfix.txt, src/eval.c, + src/ex_cmds2.c + +Patch 6.2.409 +Problem: The cursor ends up in the last column instead of after the line + when doing "i//<Esc>o" with 'indentexpr' set to "cindent(v:lnum)". + (Toby Allsopp) +Solution: Adjust the cursor as if in Insert mode. +Files: src/misc1.c + +Patch 6.2.410 (after 6.2.389) +Problem: In diff mode, when there are more filler lines than fit in the + window, they are not drawn. +Solution: Check for filler lines when skipping to draw a line that doesn't + fit. +Files: src/screen.c + +Patch 6.2.411 +Problem: A "\n" inside a string is not seen as a line break by the regular + expression matching. (Hari Krishna Dara) +Solution: Add the vim_regexec_nl() function for strings where "\n" is to be + matched with a line break. +Files: src/eval.c, src/ex_eval.c, src/proto/regexp.c, src/regexp.c + +Patch 6.2.412 +Problem: Ruby: "ruby << EOF" inside a function doesn't always work. Also + for ":python", ":tcl" and ":perl". +Solution: Check for "<< marker" and skip until "marker" before checking for + "endfunction". +Files: src/eval.c + +Patch 6.2.413 (after 6.2.411) +Problem: Missing prototype for vim_regexec_nl(). (Marcel Svitalsky) +Solution: Now really include the prototype. +Files: src/proto/regexp.pro + +Patch 6.2.414 +Problem: The function used for custom completion of user commands cannot + have <SID> to make it local. (Hari Krishna Dara) +Solution: Pass the SID of the script where the user command was defined on + to the completion. Also clean up #ifdefs. +Files: src/ex_docmd.c, src/eval.c, src/ex_getln.c, src/structs.h + +Patch 6.2.415 +Problem: Vim may crash after a sequence of events that change the window + size. The window layout assumes a larger window than is actually + available. (Servatius Brandt) +Solution: Invoke win_new_shellsize() from screenalloc() instead of from + set_shellsize(). +Files: src/screen.c, src/term.c + +Patch 6.2.416 +Problem: Compiler warning for incompatible pointer. +Solution: Remove the "&" in the call to poll(). (Xavier de Gaye) +Files: src/os_unix.c + +Patch 6.2.417 (after 6.2.393) +Problem: Many people forget that the '"' item in 'viminfo' needs to be + preceded with a backslash, +Solution: Add '<' as an alias for the '"' item. +Files: runtime/doc/options.txt, src/ops.c, src/option.c + +Patch 6.2.418 +Problem: Using ":nnoremap <F12> :echo "cheese" and ":cabbr cheese xxx": + when pressing <F12> still uses the abbreviation. (Hari Krishna) +Solution: Also apply "noremap" to abbreviations. +Files: src/getchar.c + +Patch 6.2.419 (extra) +Problem: Win32: Cannot open the Vim window inside another application. +Solution: Add the "-P" argument to specify the window title of the + application to run inside. (Zibo Zhao) +Files: runtime/doc/starting.txt, src/main.c, src/gui_w32.c, + src/gui_w48.c, src/if_ole.cpp, src/os_mswin.c, + src/proto/gui_w32.pro + +Patch 6.2.420 +Problem: Cannot specify a file to be edited in binary mode without setting + the global value of the 'binary' option. +Solution: Support ":edit ++bin file". +Files: runtime/doc/editing.txt, src/buffer.c, src/eval.c, src/ex_cmds.h, + src/ex_docmd.c, src/fileio.c, src/misc2.c + +Patch 6.2.421 +Problem: Cannot set the '[ and '] mark, which may be necessary when an + autocommand simulates reading a file. +Solution: Allow using "m[" and "m]". +Files: runtime/doc/motion.txt, src/mark.c + +Patch 6.2.422 +Problem: In CTRL-X completion messages the "/" makes them less readable. +Solution: Remove the slashes. (Antony Scriven) +Files: src/edit.c + +Patch 6.2.423 +Problem: ":vertical wincmd ]" does not split vertically. +Solution: Add "postponed_split_flags". +Files: src/ex_docmd.c, src/globals.h, src/if_cscope.c, src/tag.c + +Patch 6.2.424 +Problem: A BufEnter autocommand that sets an option stops 'mousefocus' from + working in Insert mode (Normal mode is OK). (Gregory Seidman) +Solution: In the Insert mode loop invoke gui_mouse_correct() when needed. +Files: src/edit.c + +Patch 6.2.425 +Problem: Vertical split and command line window: can only drag status line + above the cmdline window on the righthand side, not lefthand side. +Solution: Check the status line row instead of the window pointer. +Files: src/ui.c + +Patch 6.2.426 +Problem: A syntax region end match with a matchgroup that includes a line + break only highlights the last line with matchgroup. (Gary + Holloway) +Solution: Also use the line number of the position where the region + highlighting ends. +Files: src/syntax.c + +Patch 6.2.427 (extra) +Problem: When pasting a lot of text in a multi-byte encoding, conversion + from 'termencoding' to 'encoding' may fail for some characters. + (Kuang-che Wu) +Solution: When there is an incomplete byte sequence at the end of the read + text keep it for the next time. +Files: src/mbyte.c, src/os_amiga.c, src/os_mswin.c, src/proto/mbyte.pro, + src/proto/os_mswin.pro, src/ui.c + +Patch 6.2.428 +Problem: The X11 clipboard supports the Vim selection for char/line/block + mode, but since the encoding is not included can't copy/paste + between two Vims with a different 'encoding'. +Solution: Add a new selection format that includes the 'encoding'. Perform + conversion when necessary. +Files: src/gui_gtk_x11.c, src/ui.c, src/vim.h + +Patch 6.2.429 +Problem: Unix: glob() doesn't work for a directory with a single quote in + the name. (Nazri Ramliy) +Solution: When using the shell to expand, only put double quotes around + spaces and single quotes, not the whole thing. +Files: src/os_unix.c + +Patch 6.2.430 +Problem: BOM at start of a vim script file is not recognized and causes an + error message. +Solution: Detect the BOM and skip over it. Also fix that after using + ":scriptencoding" the iconv() file descriptor was not closed + (memory leak). +Files: src/ex_cmds2.c + +Patch 6.2.431 +Problem: When using the horizontal scrollbar, the scrolling is limited to + the length of the cursor line. +Solution: Make the scroll limit depend on the longest visible line. The + cursor is moved when necessary. Including the 'h' flag in + 'guioptions' disables this. +Files: runtime/doc/gui.txt, runtime/doc/options.txt, src/gui.c, + src/misc2.c, src/option.h + +Patch 6.2.432 (after 6.2.430 and 6.2.431) +Problem: Lint warnings. +Solution: Add type casts. +Files: src/ex_cmds2.c, src/gui.c + +Patch 6.2.433 +Problem: Translating "VISUAL" and "BLOCK" separately doesn't give a good + result. (Alejandro Lopez Valencia) +Solution: Use a string for each combination. +Files: src/screen.c + +Patch 6.2.434 (after 6.2.431) +Problem: Compiler warning. (Salman Halim) +Solution: Add type casts. +Files: src/gui.c + +Patch 6.2.435 +Problem: When there are vertically split windows the minimal Vim window + height is computed wrong. +Solution: Use frame_minheight() to correctly compute the minimal height. +Files: src/window.c + +Patch 6.2.436 +Problem: Running the tests changes the user's viminfo file. +Solution: In test 49 tell the extra Vim to use the test viminfo file. +Files: src/testdir/test49.vim + +Patch 6.2.437 +Problem: ":mksession" always puts "set nocompatible" in the session file. + This changes option settings. (Ron Aaron) +Solution: Add an "if" to only change 'compatible' when needed. +Files: src/ex_docmd.c + +Patch 6.2.438 +Problem: When the 'v' flag is present in 'cpoptions', backspacing and then + typing text again: one character too much is overtyped before + inserting is done again. +Solution: Set "dollar_vcol" to the right column. +Files: src/edit.c + +Patch 6.2.439 +Problem: GTK 2: Changing 'lines' may cause a mismatch between the window + layout and the size of the window. +Solution: Disable the hack with force_shell_resize_idle(). +Files: src/gui_gtk_x11.c + +Patch 6.2.440 +Problem: When 'lazyredraw' is set the window title is still updated. + The size of the Visual area and the ruler are displayed too often. +Solution: Postpone redrawing the window title. Only show the Visual area + size when waiting for a character. Don't draw the ruler + unnecessary. +Files: src/buffer.c, src/normal.c, src/screen.c + +Patch 6.2.441 +Problem: ":unabbreviate foo " doesn't work, because of the trailing space, + while an abbreviation with a trailing space is not possible. (Paul + Jolly) +Solution: Accept a match with the lhs of an abbreviation without the + trailing space. +Files: src/getchar.c + +Patch 6.2.442 +Problem: Cannot manipulate the command line from a function. +Solution: Add getcmdline(), getcmdpos() and setcmdpos() functions and the + CTRL-\ e command. +Files: runtime/doc/cmdline.txt, runtime/doc/eval.txt, src/eval.c + src/ex_getln.c, src/ops.c, src/proto/ex_getln.pro, + src/proto/ops.pro + +Patch 6.2.443 +Problem: With ":silent! echoerr something" you don't get the position of + the error. emsg() only writes the message itself and returns. +Solution: Also redirect the position of the error. +Files: src/message.c + +Patch 6.2.444 +Problem: When adding the 'c' flag to a ":substitute" command it may replace + more times than without the 'c' flag. Happens for a match that + starts with "\ze" (Marcel Svitalsk) and when using "\@<=" (Klaus + Bosau). +Solution: Correct "prev_matchcol" when replacing the line. Don't replace + the line when the pattern uses look-behind matching. +Files: src/ex_cmds.c, src/proto/regexp.pro, src/regexp.c + +Patch 6.2.445 +Problem: Copying vimtutor to /tmp/something is not secure, a symlink may + cause trouble. +Solution: Create a directory and create the file in it. Use "umask" to + create the directory with mode 700. (Stefan Nordhausen) +Files: src/vimtutor + +Patch 6.2.446 (after 6.2.404) +Problem: Using library functions wcwidth() and iswprint() results in + display problems for Hebrew characters. (Ron Aaron) +Solution: Disable the code to use the library functions, use our own. +Files: src/mbyte.c + +Patch 6.2.447 (after 6.2.440) +Problem: Now that the title is only updated when redrawing, it is no longer + possible to show it while executing a function. (Madoka Machitani) +Solution: Make ":redraw" also update the title. +Files: src/ex_docmd.c + +Patch 6.2.448 (after 6.2.427) +Problem: Mac: conversion done when 'termencoding' differs from 'encoding' + fails when pasting a longer text. +Solution: Check for an incomplete sequence at the end of the chunk to be + converted. (Eckehard Berns) +Files: src/mbyte.c + +Patch 6.2.449 (after 6.2.431) +Problem: Get error messages when switching files. +Solution: Check for a valid line number when calculating the width of the + horizontal scrollbar. (Helmut Stiegler) +Files: src/gui.c + +Patch 6.2.450 +Problem: " #include" and " #define" are not recognized with the default + option values for 'include' and 'defined'. (RG Kiran) +Solution: Adjust the default values to allow white space before the #. +Files: runtime/doc/options.txt, src/option.c + +Patch 6.2.451 +Problem: GTK: when using XIM there are various problems, including setting + 'modified' and breaking undo at the wrong moment. +Solution: Add "xim_changed_while_preediting", "preedit_end_col" and + im_is_preediting(). (Yasuhiro Matsumoto) +Files: src/ex_getln.c, src/globals.h, src/gui_gtk.c, src/gui_gtk_x11.c, + src/mbyte.c, src/misc1.c, src/proto/mbyte.pro, src/screen.c, + src/undo.c + +Patch 6.2.452 +Problem: In diff mode, when DiffAdd and DiffText highlight settings are + equal, an added line is highlighted with DiffChange. (Tom Schumm) +Solution: Remember the diff highlight type instead of the attributes. +Files: src/screen.c + +Patch 6.2.453 +Problem: ":s/foo\|\nbar/x/g" does not replace two times in "foo\nbar". + (Pavel Papushev) +Solution: When the pattern can match a line break also try matching at the + NUL at the end of a line. +Files: src/ex_cmds.c, src/regexp.c + +Patch 6.2.454 +Problem: ":let b:changedtick" doesn't work. (Alan Schmitt) ":let + b:changedtick = 99" does not give an error message. +Solution: Add code to recognize ":let b:changedtick". +Files: src/eval.c + +Patch 6.2.455 (after 6.2.297) +Problem: In Python commands the current locale changes how certain Python + functions work. (Eugene M. Minkovskii) +Solution: Set the LC_NUMERIC locale to "C" while executing a Python command. +Files: src/if_python.c + +Patch 6.2.456 (extra) +Problem: Win32: Editing a file by its Unicode name (dropping it on Vim or + using the file selection dialog) doesn't work. (Yakov Lerner, Alex + Jakushev) +Solution: Use wide character functions when file names are involved and + convert from/to 'encoding' where needed. +Files: src/gui_w48.c, src/macros.h, src/memfile.c, src/memline.c, + src/os_mswin.c, src/os_win32.c + +Patch 6.2.457 (after 6.2.244) +Problem: When 'encoding' is "utf-8" and writing text with chars above 0x80 + in latin1, conversion is wrong every 8200 bytes. (Oyvind Holm) +Solution: Correct the utf_ptr2len_check_len() function and fix the problem + of displaying 0xf7 in utfc_ptr2len_check_len(). +Files: src/mbyte.c + +Patch 6.2.458 +Problem: When 'virtualedit' is set "$" doesn't move to the end of an + unprintable character, causing "y$" not to include that character. + (Fred Ma) +Solution: Set "coladd" to move the cursor to the end of the character. +Files: src/misc2.c + +Patch 6.2.459 (after 6.2.454) +Problem: Variable "b" cannot be written. (Salman Halim) +Solution: Compare strings properly. +Files: src/eval.c + +Patch 6.2.460 (extra, after 6.2.456) +Problem: Compiler warnings for missing prototypes. +Solution: Include the missing prototypes. +Files: src/proto/os_win32.pro + +Patch 6.2.461 +Problem: After using a search command "x" starts putting single characters + in the numbered registers. +Solution: Reset "use_reg_one" at the right moment. +Files: src/normal.c + +Patch 6.2.462 +Problem: Finding a matching parenthesis does not correctly handle a + backslash in a trailing byte. +Solution: Handle multi-byte characters correctly. (Taro Muraoka) +Files: src/search.c + +Patch 6.2.463 (extra) +Problem: Win32: An NTFS file system may contain files with extra info + streams. The current method to copy them creates one and then + deletes it again. (Peter Toennies) Also, only three streams with + hard coded names are copied. +Solution: Use BackupRead() to check which info streams the original file + contains and only copy these streams. +Files: src/os_win32.c + +Patch 6.2.464 (extra, after 6.2.427) +Problem: Amiga: Compilation error with gcc. (Ali Akcaagac) +Solution: Move the #ifdef outside of Read(). +Files: src/os_amiga.c + +Patch 6.2.465 +Problem: When resizing the GUI window the window manager sometimes moves it + left of or above the screen. (Michael McCarty) +Solution: Check the window position after resizing it and move it onto the + screen when it isn't. +Files: src/gui.c + +Patch 6.2.466 (extra, after 6.2.456) +Problem: Win32: Compiling with Borland C fails, and an un/signed warning. +Solution: Redefine wcsicmp() to wcscmpi() and add type casts. (Yasuhiro + Matsumoto) +Files: src/os_win32.c + +Patch 6.2.467 (extra, after 6.2.463) +Problem: Win32: can't compile without multi-byte feature. (Ajit Thakkar) +Solution: Add #ifdefs around the info stream code. +Files: src/os_win32.c + +Patch 6.2.468 +Problem: Compiler warnings for shadowed variables. (Matthias Mohr) +Solution: Delete superfluous variables and rename others. +Files: src/eval.c, src/ex_docmd.c, src/ex_eval.c, src/if_cscope.c, + src/fold.c, src/option.c, src/os_unix.c, src/quickfix.c, + src/regexp.c + +Patch 6.2.469 (extra, after 6.2.456) +Problem: Win32: Can't create swap file when 'encoding' differs from the + active code page. (Kriton Kyrimis) +Solution: In enc_to_ucs2() terminate the converted string with a NUL +Files: src/os_mswin.c + +Patch 6.2.470 +Problem: The name returned by tempname() may be equal to the file used for + shell output when ignoring case. +Solution: Skip 'O' and 'I' in tempname(). +Files: src/eval.c + +Patch 6.2.471 +Problem: "-L/usr/lib" is used in the link command, even though it's + supposed to be filtered out. "-lw" and "-ldl" are not + automatically added when needed for "-lXmu". (Antonio Colombo) +Solution: Check for a space after the argument instead of before. Also + remove "-R/usr/lib" if it's there. Check for "-lw" and "-ldl" + before trying "-lXmu". +Files: src/auto/configure, src/configure.in, src/link.sh + +Patch 6.2.472 +Problem: When using a FileChangedShell autocommand that changes the current + buffer, a buffer exists that can't be wiped out. + Also, Vim sometimes crashes when executing an external command + that changes the buffer and a FileChangedShell autocommand is + used. (Hari Krishna Dara) + Users are confused by the warning for a file being changed outside + of Vim. +Solution: Avoid that the window counter for a buffer is incremented twice. + Avoid that buf_check_timestamp() is used recursively. + Add a hint to look in the help for more info. +Files: src/ex_cmds.c, src/fileio.c + +Patch 6.2.473 +Problem: Using CTRL-] in a help buffer without a name causes a crash. +Solution: Check for name to be present before using it. (Taro Muraoka) +Files: src/tag.c + +Patch 6.2.474 (extra, after 6.2.456) +Problem: When Vim is starting up conversion is done unnecessarily. Failure + to find the runtime files on Windows 98. (Randall W. Morris) +Solution: Init enc_codepage negative, only use it when not negative. + Don't use GetFileAttributesW() on Windows 98 or earlier. +Files: src/globals.h, src/gui_w32.c, src/gui_w48.c, src/os_mswin.c, + src/os_win32.c + +Patch 6.2.475 +Problem: Commands after "perl <<EOF" are parsed as Vim commands when they + are not executed. +Solution: Properly skip over the perl commands. +Files: src/ex_docmd.c, src/ex_getln.c, src/if_perl.xs, src/if_python.c, + src/if_ruby.c, src/if_tcl.c, src/misc2.c + +Patch 6.2.476 +Problem: When reloading a hidden buffer changed outside of Vim and the + current buffer is read-only, the reloaded buffer becomes + read-only. (Hari Krishna Dara) +Solution: Save the 'readonly' flag of the reloaded buffer instead of the + current buffer. +Files: src/fileio.c + +Patch 6.2.477 +Problem: Using remote_send(v:servername, "\<C-V>") causes Vim to hang. + (Yakov Lerner) +Solution: When the resulting string is empty don't set received_from_client. +Files: src/main.c + +Patch 6.2.478 +Problem: Win32: "--remote file" fails changing directory if the current + directory name starts with a single quote. (Iestyn Walters) +Solution: Add a backslash where it will be removed later. +Files: src/main.c, src/misc2.c, src/proto/misc2.pro + +Patch 6.2.479 +Problem: The error message for errors during recovery goes unnoticed. +Solution: Avoid that the hit-enter prompt overwrites the message. Add a few + lines to make the error stand out. +Files: src/main.c, src/message.c, src/memline.c + +Patch 6.2.480 +Problem: NetBeans: Using negative index in array. backslash at end of + message may cause Vim to crash. (Xavier de Gaye) +Solution: Initialize buf_list_used to zero. Check for trailing backslash. +Files: src/netbeans.c + +Patch 6.2.481 +Problem: When writing a file it is not possible to specify that hard and/or + symlinks are to be broken instead of preserved. +Solution: Add the "breaksymlink" and "breakhardlink" values to 'backupcopy'. + (Simon Ekstrand) +Files: runtime/doc/options.txt, src/fileio.c, src/option.c, src/option.h + +Patch 6.2.482 +Problem: Repeating insert of CTRL-K 1 S doesn't work. The superscript 1 is + considered to be a digit. (Juergen Kraemer) +Solution: In vim_isdigit() only accept '0' to '9'. Use VIM_ISDIGIT() for + speed where possible. Also add vim_isxdigit(). +Files: src/buffer.c, src/charset.c, src/diff.c, src/digraph.c, + src/edit.c, src/eval.c,, src/ex_cmds.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_eval.c, src/ex_getln.c, + src/if_xcmdsrv.c, src/farsi.c, src/fileio.c, src/fold.c, + src/getchar.c, src/gui.c, src/if_cscope.c, src/macros.h, + src/main.c, src/mark.c, src/mbyte.c, src/menu.c, src/misc1.c, + src/misc2.c, src/normal.c, src/ops.c, src/option.c, + src/proto/charset.pro, src/regexp.c, src/screen.c, src/search.c, + src/syntax.c, src/tag.c, src/term.c, src/termlib.c + +Patch 6.2.483 (extra, after 6.2.482) +Problem: See 6.2.482. +Solution: Extra part of patch 6.2.482. +Files: src/gui_photon.c, src/gui_w48.c, src/os_msdos.c, src/os_mswin.c + +Patch 6.2.484 +Problem: MS-Windows: With the included diff.exe, differences after a CTRL-Z + are not recognized. (Peter Keresztes) +Solution: Write the files with unix fileformat and invoke diff with --binary + if possible. +Files: src/diff.c + +Patch 6.2.485 +Problem: A BufWriteCmd autocommand cannot know if "!" was used or not. + (Hari Krishna Dara) +Solution: Add the v:cmdbang variable. +Files: runtime/doc/eval.txt, src/eval.c, src/proto/eval.pro, + src/fileio.c, src/vim.h + +Patch 6.2.486 (6.2.482) +Problem: Diff for eval.c is missing. +Solution: Addition to patch 6.2.482. +Files: src/eval.c + +Patch 6.2.487 (extra, after 6.2.456) +Problem: Compiler warnings for wrong prototype. (Alejandro Lopez Valencia) +Solution: Delete the prototype for Handle_WM_Notify(). +Files: src/proto/gui_w32.pro + +Patch 6.2.488 +Problem: Missing ")" in *.ch filetype detection. +Solution: Add the ")". (Ciaran McCreesh) +Files: runtime/filetype.vim + +Patch 6.2.489 +Problem: When accidentally opening a session in Vim which has already been + opened in another Vim there is a long row of ATTENTION prompts. + Need to quit each of them to get out. (Robert Webb) +Solution: Add the "Abort" alternative to the dialog. +Files: src/memline.c + +Patch 6.2.490 +Problem: With 'paragraph' it is not possible to use a single dot as a + paragraph boundary. (Dorai Sitaram) +Solution: Allow using " " (two spaces) in 'paragraph' to match ".$" or + ". $" +Files: src/search.c + +Patch 6.2.491 +Problem: Decrementing a position doesn't take care of multi-byte chars. +Solution: Adjust the column for multi-byte characters. Remove mb_dec(). + (Yasuhiro Matsumoto) +Files: src/mbyte.c, src/misc2.c, src/proto/mbyte.pro + +Patch 6.2.492 +Problem: When using ":redraw" while there is a message, the next ":echo" + still causes text to scroll. (Yasuhiro Matsumoto) +Solution: Reset msg_didout and msg_col, so that after ":redraw" the next + message overwrites an existing one. +Files: src/ex_docmd.c + +Patch 6.2.493 +Problem: "@x" doesn't work when 'insertmode' is set. (Benji Fisher) +Solution: Put "restart_edit" in the typeahead buffer, so that it's used + after executing the register contents. +Files: src/ops.c + +Patch 6.2.494 +Problem: Using diff mode with two windows, when moving horizontally in + inserted lines, a fold in the other window may open. +Solution: Compute the line number in the other window correctly. +Files: src/diff.c + +Patch 6.2.495 (extra, after 6.2.456) +Problem: Win32: The file dialog doesn't work on Windows 95. +Solution: Put the wide code of gui_mch_browse() in gui_mch_browseW() and use + it only on Windows NT/2000/XP. +Files: src/gui_w32.c, src/gui_w48.c + +Patch 6.2.496 +Problem: FreeBSD 4.x: When compiled with the pthread library (Python) a + complicated pattern may cause Vim to crash. Catching the signal + doesn't work. +Solution: When compiled with threads, instead of using the normal stacksize + limit, use the size of the initial stack. +Files: src/auto/configure, src/config.h.in, src/configure.in, + src/os_unix.c + +Patch 6.2.497 (extra) +Problem: Russian messages are only available in one encoding. +Solution: Convert the messages to MS-Windows codepages. (Vassily Ragosin) +Files: src/po/Makefile + +Patch 6.2.498 +Problem: Non-latin1 help files are not properly supported. +Solution: Support utf-8 help files and convert them to 'encoding' when + needed. +Files: src/fileio.c + +Patch 6.2.499 +Problem: When writing a file and halting the system, the file might be lost + when using a journalling file system. +Solution: Use fsync() to flush the file data to disk after writing a file. + (Radim Kolar) +Files: src/fileio.c + +Patch 6.2.500 (extra) +Problem: The DOS/MS-Windows the installer doesn't use the --binary flag for + diff. +Solution: Add --binary to the diff argument in MyDiff(). (Alejandro Lopez- + Valencia) +Files: src/dosinst.c + +Patch 6.2.501 +Problem: Vim does not compile with MorphOS. +Solution: Add a Makefile and a few changes to make Vim work with MorphOS. + (Ali Akcaagac) +Files: runtime/doc/os_amiga.txt, src/INSTALLami.txt, + src/Make_morphos.mak, src/memfile.c, src/term.c + +Patch 6.2.502 +Problem: Building fails for generating message files. +Solution: Add dummy message files. +Files: src/po/ca.po, src/po/ru.po, src/po/sv.po + +Patch 6.2.503 +Problem: Mac: Can't compile MacRoman conversions without the GUI. +Solution: Also link with the Carbon framework for the terminal version, for + the MacRoman conversion functions. (Eckehard Berns) + Remove -ltermcap from the GUI link command, it is not needed. +Files: src/auto/configure, src/Makefile, src/configure.in + +Patch 6.2.504 +Problem: Various problems with 'cindent', among which that a + list of variable declarations is not indented properly. +Solution: Fix the wrong indenting. Improve indenting of C++ methods. + Add the 'i', 'b' and 'W' options to 'cinoptions'. (mostly by + Helmut Stiegler) + Improve indenting of preprocessor-continuation lines. +Files: runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in, + src/testdir/test3.ok + +Patch 6.2.505 +Problem: Help for -P argument is missing. (Ronald Hoellwarth) +Solution: Add the patch that was missing in 6.2.419. +Files: runtime/doc/starting.txt + +Patch 6.2.506 (extra) +Problem: Win32: When 'encoding' is a codepage then reading a utf-8 file + only works when iconv is available. Writing a file in another + codepage uses the wrong kind of conversion. +Solution: Use internal conversion functions. Enable reading and writing + files with 'fileencoding' different from 'encoding' for all valid + codepages and utf-8 without the need for iconv. +Files: src/fileio.c, src/testdir/Make_dos.mak, src/testdir/test52.in, + src/testdir/test52.ok + +Patch 6.2.507 +Problem: The ownership of the file with the password for the NetBeans + connection is not checked. "-nb={file}" doesn't work for GTK. +Solution: Only accept the file when owned by the user and not accessible by + others. Detect "-nb=" for GTK. +Files: src/netbeans.c, src/gui_gtk_x11.c + +Patch 6.2.508 +Problem: Win32: "v:lang" does not show the current language for messages if + it differs from the other locale settings. +Solution: Use the value of the $LC_MESSAGES environment variable. +Files: src/ex_cmds2.c + +Patch 6.2.509 (after 6.2.508) +Problem: Crash when $LANG is not set. +Solution: Add check for NULL pointer. (Ron Aaron) +Files: src/ex_cmds2.c + +Patch 6.2.510 (after 6.2.507) +Problem: Warning for pointer conversion. +Solution: Add a type cast. +Files: src/gui_gtk_x11.c + +Patch 6.2.511 +Problem: Tags in Russian help files are in utf-8 encoding, which may be + different from 'encoding'. +Solution: Use the "TAG_FILE_ENCODING" field in the tags file to specify the + encoding of the tags. Convert help tags from 'encoding' to the + tag file encoding when searching for matches, do the reverse when + listing help tags. +Files: runtime/doc/tagsrch.txt, src/ex_cmds.c, src/tag.c + +Patch 6.2.512 +Problem: Translating "\"\n" is useless. (Gerfried Fuchs) +Solution: Remove the _() around it. +Files: src/main.c, src/memline.c + +Patch 6.2.513 (after 6.2.507) +Problem: NetBeans: the check for owning the connection info file can be + simplified. (Nikolay Molchanov) +Solution: Only check if the access mode is right. +Files: src/netbeans.c + +Patch 6.2.514 +Problem: When a highlight/syntax group name contains invalid characters + there is no warning. +Solution: Add an error for unprintable characters and a warning for other + invalid characters. +Files: src/syntax.c + +Patch 6.2.515 +Problem: When using the options window 'swapfile' is reset. +Solution: Use ":setlocal" instead of ":set". +Files: runtime/optwin.vim + +Patch 6.2.516 +Problem: The sign column cannot be seen, looks like there are two spaces + before the text. (Rob Retter) +Solution: Add the SignColumn highlight group. +Files: runtime/doc/options.txt, runtime/doc/sign.txt, src/option.c, + src/screen.c, src/syntax.c, src/vim.h + +Patch 6.2.517 +Problem: Using "r*" in Visual mode on multi-byte characters replaces + too many characters. In Visual Block mode replacing with a + multi-byte character doesn't work. +Solution: Adjust the operator end for the difference in byte length of the + original and the replaced character. Insert all bytes of a + multi-byte character, take care of double-wide characters. +Files: src/ops.c + +Patch 6.2.518 +Problem: Last line of a window is not updated after using "J" and then "D". + (Adri Verhoef) +Solution: When no line is found below a change that doesn't need updating, + update all lines below the change. +Files: src/screen.c + +Patch 6.2.519 +Problem: Mac: cannot read/write files in MacRoman format. +Solution: Do internal conversion from/to MacRoman to/from utf-8 and latin1. + (Eckehard Berns) +Files: src/fileio.c + +Patch 6.2.520 (extra) +Problem: The NSIS installer is outdated. +Solution: Make it work with NSIS 2.0. Also include console executables for + Win 95/98/ME and Win NT/2000/XP. Use LZWA compression. Use + "/oname" to avoid having to rename files before running NSIS. +Files: Makefile, nsis/gvim.nsi + +Patch 6.2.521 +Problem: When using silent Ex mode the "changing a readonly file" warning + is omitted but the one second wait isn't. (Yakov Lerner) +Solution: Skip the delay when "silent_mode" is set. +Files: src/misc1.c + +Patch 6.2.522 +Problem: GUI: when changing 'cmdheight' in the gvimrc file the window + layout is messed up. (Keith Dart) +Solution: Skip updating the window layout when changing 'cmdheight' while + still starting up. +Files: src/option.c + +Patch 6.2.523 +Problem: When loading a session and aborting when a swap file already + exists, the user is left with useless windows. (Robert Webb) +Solution: Load one file before creating the windows. +Files: src/ex_docmd.c + +Patch 6.2.524 (extra, after 6.2.520) +Problem: Win32: (un)installing gvimext.dll may fail if it was used. + The desktop and start menu links are created for the current user + instead of all users. + Using the home directory as working directory for the links is a + bad idea for multi-user systems. + Cannot use Vim from the "Open With..." menu. +Solution: Force a reboot if necessary. (Alejandro Lopez-Valencia) Also use + macros for the directory of the source and runtime files. Use + "CSIDL_COMMON_*" instead of "CSIDL_*" when possible. + Do not specify a working directory in the links. + Add Vim to the "Open With..." menu. (Giuseppe Bilotta) +Files: nsis/gvim.nsi, src/dosinst.c, src/dosinst.h, src/uninstal.c + +Patch 6.2.525 +Problem: When the history contains a very long line ":history" causes a + crash. (Volker Kiefel) +Solution: Shorten the history entry to fit it in one line. +Files: src/ex_getln.c + +Patch 6.2.526 +Problem: When s:lang is "ja" the Japanese menus are not used. +Solution: Add 'encoding' to the language when there is no charset. +Files: runtime/menu.vim + +Patch 6.2.527 +Problem: The 2html script uses ":wincmd p", which breaks when using some + autocommands. +Solution: Remember the window numbers and jump to them with ":wincmd w". + Also add XHTML support. (Panagiotis Issaris) +Files: runtime/syntax/2html.vim + +Patch 6.2.528 +Problem: NetBeans: Changes of the "~" command are not reported. +Solution: Call netbeans_inserted() after performing "~". (Gordon Prieur) + Also change NetBeans debugging to append to the log file. + Also fix that "~" in Visual block mode changes too much if there + are multi-byte characters. +Files: src/nbdebug.c, src/normal.c, src/ops.c + +Patch 6.2.529 (extra) +Problem: VisVim only works for Admin. Doing it for one user doesn't work. + (Alexandre Gouraud) +Solution: When registering the module fails, simply continue. +Files: src/VisVim/VisVim.cpp + +Patch 6.2.530 +Problem: Warning for missing prototype on the Amiga. +Solution: Include time.h +Files: src/version.c + +Patch 6.2.531 +Problem: In silent ex mode no messages are given, which makes debugging + very difficult. +Solution: Do output messages when 'verbose' is set. +Files: src/message.c, src/ui.c + +Patch 6.2.532 (extra) +Problem: Compiling for Win32s with VC 4.1 doesn't work. +Solution: Don't use CP_UTF8 if it's not defined. Don't use CSIDL_COMMON* + when not defined. +Files: src/dosinst.h, src/fileio.c + +Win32 console: After patch 6.2.398 Ex mode did not work. (Yasuhiro Matsumoto) + +Patch 6.3a.001 +Problem: Win32: if testing for the "--binary" option fails, diff isn't used + at all. +Solution: Handle the "ok" flag properly. (Yasuhiro Matsumoto) +Files: src/diff.c + +Patch 6.3a.002 +Problem: NetBeans: An insert command from NetBeans beyond the end of a + buffer crashes Vim. (Xavier de Gaye) +Solution: Use a local pos_T structure for the position. +Files: src/netbeans.c + +Patch 6.3a.003 +Problem: E315 error with auto-formatting comments. (Henry Van Roessel) +Solution: Pass the line number to same_leader(). +Files: src/ops.c + +Patch 6.3a.004 +Problem: Test32 fails on Windows XP for the DJGPP version. Renaming + test11.out fails. +Solution: Don't try renaming, create new files to use for the test. +Files: src/testdir/test32.in, src/testdir/test32.ok + +Patch 6.3a.005 +Problem: ":checkpath!" does not use 'includeexpr'. +Solution: Use a file name that was found directly. When a file was not + found and the located name is empty, use the rest of the line. +Files: src/search.c + +Patch 6.3a.006 +Problem: "yip" moves the cursor to the first yanked line, but not to the + first column. Looks like not all text was yanked. (Jens Paulus) +Solution: Move the cursor to the first column. +Files: src/search.c + +Patch 6.3a.007 +Problem: 'cindent' recognizes "enum" but not "typedef enum". +Solution: Skip over "typedef" before checking for "enum". (Helmut Stiegler) + Also avoid that searching for this item goes too far back. +Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok + +Patch 6.3a.008 (extra) +Problem: Windows 98: Some of the wide functions are not implemented, + resulting in file I/O to fail. This depends on what Unicode + support is installed. +Solution: Handle the failure and fall back to non-wide functions. +Files: src/os_win32.c + +Patch 6.3a.009 +Problem: Win32: Completion of filenames does not work properly when + 'encoding' differs from the active code page. +Solution: Use wide functions for expanding wildcards when appropriate. +Files: src/misc1.c + +Patch 6.3a.010 (extra) +Problem: Win32: Characters in the window title that do not appear in the + active codepage are replaced by a question mark. +Solution: Use DefWindowProcW() instead of DefWindowProc() when possible. +Files: src/glbl_ime.cpp, src/globals.h, src/proto/gui_w16.pro, + src/proto/gui_w32.pro, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c + +Patch 6.3a.011 +Problem: Using the explorer plugin changes a local directory to the global + directory. +Solution: Don't use ":chdir" to restore the current directory. Make + "expand('%:p')" remove "/../" and "/./" items from the path. +Files: runtime/plugin/explorer.vim, src/eval.c, src/os_unix.c + +Patch 6.3a.012 (extra) +Problem: On Windows 98 the installer doesn't work, don't even get the "I + agree" button. The check for the path ending in "vim" makes the + browse dialog hard to use. The default path when no previous Vim + is installed is "c:\vim" instead of "c:\Program Files\Vim". +Solution: Remove the background gradient command. Change the + .onVerifyInstDir function to a leave function for the directory + page. Don't let the install program default to c:\vim when no + path could be found. +Files: nsis/gvim.nsi, src/dosinst.c + +Patch 6.3a.013 (extra) +Problem: Win32: Characters in the menu that are not in the active codepage + are garbled. +Solution: Convert menu strings from 'encoding' to the active codepage. +Files: src/gui_w32.c, src/gui_w48.c + +Patch 6.3a.014 +Problem: Using multi-byte text and highlighting in a statusline causes gaps + to appear. (Helmut Stiegler) +Solution: Advance the column by text width instead of number of bytes. Add + the vim_strnsize() function. +Files: src/charset.c, src/proto/charset.pro, src/screen.c + +Patch 6.3a.015 +Problem: Using the "select all" menu item when 'insertmode' is set and + clicking the mouse button doesn't return to Insert mode. The + Buffers/Delete menu doesn't offer a choice to abandon a changed + buffer. (Jens Paulus) +Solution: Don't use CTRL-\ CTRL-N. Add ":confirm" for the Buffers menu + items. +Files: runtime/menu.vim + +Patch 6.3a.016 +Problem: After cancelling the ":confirm" dialog the error message and + hit-enter prompt may not be displayed properly. +Solution: Flush output after showing the dialog. +Files: src/message.c + +Patch 6.3a.017 +Problem: servername() doesn't work when Vim was started with the "-X" + argument or when the "exclude" in 'clipboard' matches the terminal + name. (Robert Nowotniak) +Solution: Force connecting to the X server when using client-server + commands. +Files: src/eval.c, src/globals.h, src/os_unix.c + +Patch 6.3a.018 (after 6.3a.017) +Problem: Compiler warning for return value of make_connection(). +Solution: Use void return type. +Files: src/eval.c + +Patch 6.3a.019 (extra) +Problem: Win32: typing non-latin1 characters doesn't work. +Solution: Invoke _OnChar() directly to avoid that the argument is truncated + to a byte. Convert the UTF-16 character to bytes according to + 'encoding' and ignore 'termencoding'. Same for _OnSysChar(). +Files: src/gui_w32.c, src/gui_w48.c + +Patch 6.3a.020 (extra) +Problem: Missing support for AROS (AmigaOS reimplementation). Amiga GUI + doesn't work. +Solution: Add AROS support. (Adam Chodorowski) + Fix Amiga GUI problems. (Georg Steger, Ali Akcaagac) +Files: Makefile, src/Make_aros.mak, src/gui_amiga.c, src/gui_amiga.h, + src/memfile.c, src/os_amiga.c, src/term.c + +Patch 6.3a.021 (after 6.3a.017) +Problem: Can't compile with X11 but without GUI. +Solution: Put use of "gui.in_use" inside an #ifdef. +Files: src/eval.c + +Patch 6.3a.022 +Problem: When typing Tabs when 'softtabstop' is used and 'list' is set a + tab is counted for two spaces. +Solution: Use the "L" flag in 'cpoptions' to tell whether a tab is counted + as two spaces or as 'tabstop'. (Antony Scriven) +Files: runtime/doc/options.txt, src/edit.c + +Patch 6.3a.023 +Problem: Completion on the command line doesn't handle backslashes + properly. Only the tail of matches is shown, even when not + completing filenames. +Solution: When turning the string into a pattern double backslashes. Don't + omit the path when not expanding files or directories. +Files: src/ex_getln.c + +Patch 6.3a.024 +Problem: The "save all" toolbar item fails for buffers that don't have a + name. When using ":wa" or closing the Vim window and there are + nameless buffers, browsing for a name may cause the name being + given to the wrong buffer or not stored properly. ":browse" only + worked for one file. +Solution: Use ":confirm browse" for "save all". + Pass buffer argument to setfname(). Restore "browse" flag and + "forceit" after doing the work for one file. +Files: runtime/menu.vim, src/buffer.c, src/ex_cmds.c, src/ex_cmds2.c, + src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/memline.c, + src/message.c, src/window.c, src/proto/buffer.pro, + src/proto/ex_cmds2.pro, src/proto/memline.pro + +Patch 6.3a.025 +Problem: Setting 'virtualedit' moves the cursor. (Benji Fisher) +Solution: Update the virtual column before using it. +Files: src/option.c + +Patch 6.3a.026 (extra, after 6.3a.008) +Problem: Editing files on Windows 98 doesn't work when 'encoding' is + "utf-8" (Antoine Mechelynck) + Warning for missing function prototype. +Solution: For all wide functions check if it failed because it is not + implemented. Use ANSI function declaration for char_to_string(). +Files: src/gui_w48.c, src/os_mswin.c, src/os_win32.c + +Patch 6.3a.027 (extra, after 6.3a.026) +Problem: Compiler warning for function argument. +Solution: Declare both char and WCHAR arrays. +Files: src/gui_w48.c + +Patch 6.3a.028 +Problem: ":normal ." doesn't work inside a function, because redo is saved + and restored. (Benji Fisher) +Solution: Make a copy of the redo buffer when executing a function. +Files: src/getchar.c + +Patch 6.3b.001 (extra) +Problem: Bcc 5: The generated auto/pathdef can't be compiled. +Solution: Fix the way quotes and backslashes are escaped. +Files: src/Make_bc5.mak + +Patch 6.3b.002 +Problem: Win32: conversion during file write fails when a double-byte + character is split over two writes. +Solution: Fix the conversion retry without a trailing byte. (Taro Muraoka) +Files: src/fileio.c + +Patch 6.3b.003 (extra) +Problem: Win32: When compiling with Borland C 5.5 and 'encoding' is "utf-8" + then Vim can't open files under MS-Windows 98. (Antoine J. + Mechelynck) +Solution: Don't use _wstat(), _wopen() and _wfopen() in this situation. +Files: src/os_mswin.c, src/os_win32.c + +Patch 6.3b.004 +Problem: ":helpgrep" includes a trailing CR in the text line. +Solution: Remove the CR. +Files: src/quickfix.c + +Patch 6.3b.005 +Problem: ":echo &g:ai" results in the local option value. (Salman Halim) +Solution: Pass the flags from find_option_end() to get_option_value(). +Files: src/eval.c + +Patch 6.3b.006 +Problem: When using "mswin.vim", CTRL-V in Insert mode leaves cursor before + last pasted character. (Mathew Davis) +Solution: Use the same Paste() function as in menu.vim. +Files: runtime/mswin.vim + +Patch 6.3b.007 +Problem: Session file doesn't restore view on windows properly. (Robert + Webb) +Solution: Restore window sizes both before and after restoring the view, so + that the view, cursor position and size are restored properly. +Files: src/ex_docmd.c + +Patch 6.3b.008 +Problem: Using ":finally" in a user command doesn't always work. (Hari + Krishna Dara) +Solution: Don't assume that using getexline() means the command was typed. +Files: src/ex_docmd.c + +Patch 6.3b.009 (extra) +Problem: Win32: When the -P argument is not found in a window title, there + is no error message. +Solution: When the window can't be found give an error message and exit. + Also use try/except to catch failing to open the MDI window. + (Michael Wookey) +Files: src/gui_w32.c + +Patch 6.3b.010 +Problem: Win32: Using the "-D" argument and expanding arguments may cause a + hang, because the terminal isn't initialized yet. (Vince Negri) +Solution: Don't go into debug mode before the terminal is initialized. +Files: src/main.c + +Patch 6.3b.011 +Problem: Using CTRL-\ e while obtaining an expression aborts the command + line. (Hari Krishna Dara) +Solution: Insert the CTRL-\ e as typed. +Files: src/ex_getln.c + +Patch 6.3b.012 (after 6.3b.010) +Problem: Can't compile with tiny features. (Norbert Tretkowski) +Solution: Add #ifdefs. +Files: src/main.c + +Patch 6.3b.013 +Problem: Loading a session file results in editing the wrong file in the + first window when this is not the file at the current position in + the argument list. (Robert Webb) +Solution: Check w_arg_idx_invalid to decide whether to edit a file. +Files: src/ex_docmd.c + +Patch 6.3b.014 +Problem: ":runtime! foo*.vim" may using freed memory when a sourced script + changes the value of 'runtimepath'. +Solution: Make a copy of 'runtimepath' when looping over the matches. +Files: src/ex_cmds2.c + +Patch 6.3b.015 +Problem: Get lalloc(0) error when using "p" in Visual mode while + 'clipboard' contains "autoselect,unnamed". (Mark Wagonner) +Solution: Avoid allocating zero bytes. Obtain the clipboard when necessary. +Files: src/ops.c + +Patch 6.3b.016 +Problem: When 'virtualedit' is used "x" doesn't delete the last character + of a line that has as many characters as 'columns'. (Yakov Lerner) +Solution: When the cursor isn't moved let oneright() return FAIL. +Files: src/edit.c + +Patch 6.3b.017 +Problem: Win32: "vim --remote-wait" doesn't exit when the server finished + editing the file. (David Fishburn) +Solution: In the rrhelper plugin change backslashes to forward slashes and + escape special characters. +Files: runtime/plugin/rrhelper.vim + +Patch 6.3b.018 +Problem: The list of help files in the "local additions" table doesn't + recognize utf-8 encoding. (Yasuhiro Matsumoto) +Solution: Recognize utf-8 characters. +Files: src/ex_cmds.c + +Patch 6.3b.019 +Problem: When $VIMRUNTIME is not a full path name the "local additions" + table lists all the help files. +Solution: Use fullpathcmp() instead of fnamecmp() to compare the directory + names. +Files: src/ex_cmds.c + +Patch 6.3b.020 +Problem: When using CTRL-^ when entering a search string, the item in the + statusline that indicates the keymap is not updated. (Ilya + Dogolazky) +Solution: Mark the statuslines for updating. +Files: src/ex_getln.c + +Patch 6.3b.021 +Problem: The swapfile is not readable for others, the ATTENTION prompt does + not show all info when someone else is editing the same file. + (Marcel Svitalsky) +Solution: Use the protection of original file for the swapfile and set it + after creating the swapfile. +Files: src/fileio.c + +Patch 6.3b.022 +Problem: Using "4v" to select four times the old Visual area may put the + cursor beyond the end of the line. (Jens Paulus) +Solution: Correct the cursor column. +Files: src/normal.c + +Patch 6.3b.023 +Problem: When "3dip" starts in an empty line, white lines after the + non-white lines are not deleted. (Jens Paulus) +Solution: Include the white lines. +Files: src/search.c + +Patch 6.3b.024 +Problem: "2daw" does not delete leading white space like "daw" does. (Jens + Paulus) +Solution: Include the white space when a count is used. +Files: src/search.c + +Patch 6.3b.025 +Problem: Percentage in ruler isn't updated when a line is deleted. (Jens + Paulus) +Solution: Check for a change in line count when deciding to update the ruler. +Files: src/screen.c, src/structs.h + +Patch 6.3b.026 +Problem: When selecting "abort" at the ATTENTION prompt for a file that is + already being edited Vim crashes. +Solution: Don't abort creating a new buffer when we really need it. +Files: src/buffer.c, src/vim.h + +Patch 6.3b.027 +Problem: Win32: When enabling the menu in a maximized window, Vim uses more + lines than what is room for. (Shizhu Pan) +Solution: When deciding to call shell_resized(), also compare the text area + size with Rows and Columns, not just with screen_Rows and + screen_Columns. +Files: src/gui.c + +Patch 6.3b.028 +Problem: When in diff mode, setting 'rightleft' causes a crash. (Eddine) +Solution: Check for last column differently when 'rightleft' is set. +Files: src/screen.c + +Patch 6.3b.029 +Problem: Win32: warning for uninitialized variable. +Solution: Initialize to zero. +Files: src/misc1.c + +Patch 6.3b.030 +Problem: After Visually selecting four characters, changing it to other + text, Visually selecting and yanking two characters: "." changes + four characters, another "." changes two characters. (Robert Webb) +Solution: Don't store the size of the Visual area when redo is active. +Files: src/normal.c + +============================================================================== +VERSION 6.4 *version-6.4* + +This section is about improvements made between version 6.3 and 6.4. + +This is a bug-fix release. There are also a few new features. The major +number of new items is in the runtime files and translations. + +The big MS-Windows version now uses: + Ruby version 1.8.3 + Perl version 5.8.7 + Python version 2.4.2 + + +Changed *changed-6.4* +------- + +Removed runtime/tools/tcltags, Exuberant ctags does it better. + + +Added *added-6.4* +----- + +Alsaconf syntax file (Nikolai Weibull) +Eruby syntax, indent, compiler and ftplugin file (Doug Kearns) +Esterel syntax file (Maurizio Tranchero) +Mathematica indent file (Steve Layland) +Netrc syntax file (Nikolai Weibull) +PHP compiler file (Doug Kearns) +Pascal indent file (Neil Carter) +Prescribe syntax file (Klaus Muth) +Rubyunit compiler file (Doug Kearns) +SMTPrc syntax file (Kornel Kielczewski) +Sudoers syntax file (Nikolai Weibull) +TPP syntax file (Gerfried Fuchs) +VHDL ftplugin file (R. Shankar) +Verilog-AMS syntax file (S. Myles Prather) + +Bulgarian keymap (Alberto Mardegan) +Canadian keymap (Eric Joanis) + +Hungarian menu translations in UTF-8 (Kantra Gergely) +Ukrainian menu translations (Bohdan Vlasyuk) + +Irish message translations (Kevin Patrick Scannell) + +Configure also checks for tclsh8.4. + + +Fixed *fixed-6.4* +----- + +"dFxd;" deleted the character under the cursor, "d;" didn't remember the +exclusiveness of the motion. + +When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one +line for the cmdline. (Christian Robinson) Invoke command_height() after the +GUI has started up. + +Gcc would warn "dereferencing type-punned pointer will break strict -aliasing +rules". Avoid using typecasts for variable pointers. + +Gcc 3.x interprets the -MM argument differently. Change "-I /path" to +"-isystem /path" for "make depend". + + +Patch 6.3.001 +Problem: ":browse split" gives the file selection dialog twice. (Gordon + Bazeley) Same problem for ":browse diffpatch". +Solution: Reset cmdmod.browse before calling do_ecmd(). +Files: src/diff.c, src/ex_docmd.c + +Patch 6.3.002 +Problem: When using translated help files with non-ASCII latin1 characters + in the first line the utf-8 detection is wrong. +Solution: Properly detect utf-8 characters. When a mix of encodings is + detected continue with the next language and avoid a "no matches" + error because of "got_int" being set. Add the directory name to + the error message for a duplicate tag. +Files: src/ex_cmds.c + +Patch 6.3.003 +Problem: Crash when using a console dialog and the first choice does not + have a default button. (Darin Ohashi) +Solution: Allocate two more characters for the [] around the character for + the default choice. +Files: src/message.c + +Patch 6.3.004 +Problem: When searching for a long string (140 chars in a 80 column + terminal) get three hit-enter prompts. (Robert Webb) +Solution: Avoid the hit-enter prompt when giving the message for wrapping + around the end of the buffer. Don't give that message again when + the string was not found. +Files: src/message.c, src/search.c + +Patch 6.3.005 +Problem: Crash when searching for a pattern with a character offset and + starting in a closed fold. (Frank Butler) +Solution: Check for the column to be past the end of the line. Also fix + that a pattern with a character offset relative to the end isn't + read back from the viminfo properly. +Files: src/search.c + +Patch 6.3.006 +Problem: ":breakadd file *foo" prepends the current directory to the file + pattern. (Hari Krishna Dara) +Solution: Keep the pattern as-is. +Files: src/ex_cmds2.c + +Patch 6.3.007 +Problem: When there is a buffer with 'buftype' set to "nofile" and using a + ":cd" command, the swap file is not deleted when exiting. +Solution: Use the full path of the swap file also for "nofile" buffers. +Files: src/fileio.c + +Patch 6.3.008 +Problem: Compiling fails under OS/2. +Solution: Include "e_screenmode" also for OS/2. (David Sanders) +Files: src/globals.h + +Patch 6.3.009 (after 6.3.006) +Problem: ":breakadd file /path/foo.vim" does not match when a symbolic link + is involved. (Servatius Brandt) +Solution: Do expand the pattern when it does not start with "*". +Files: runtime/doc/repeat.txt, src/ex_cmds2.c + +Patch 6.3.010 +Problem: When writing to a named pipe there is an error for fsync() + failing. +Solution: Ignore the fsync() error for devices. +Files: src/fileio.c + +Patch 6.3.011 +Problem: Crash when the completion function of a user-command uses a + "normal :cmd" command. (Hari Krishna Dara) +Solution: Save the command line when invoking the completion function. +Files: src/ex_getln.c + +Patch 6.3.012 +Problem: Internal lalloc(0) error when using a complicated multi-line + pattern in a substitute command. (Luc Hermitte) +Solution: Avoid going past the end of a line. +Files: src/ex_cmds.c + +Patch 6.3.013 +Problem: Crash when editing a command line and typing CTRL-R = to evaluate + a function that uses "normal :cmd". (Hari Krishna Dara) +Solution: Save and restore the command line when evaluating an expression + for CTRL-R =. +Files: src/ex_getln.c, src/ops.c, src/proto/ex_getln.pro, + src/proto/ops.pro + +Patch 6.3.014 +Problem: When using Chinese or Taiwanese the default for 'helplang' is + wrong. (Simon Liang) +Solution: Use the part of the locale name after "zh_". +Files: src/option.c + +Patch 6.3.015 +Problem: The string that winrestcmd() returns may end in garbage. +Solution: NUL-terminate the string. (Walter Briscoe) +Files: src/eval.c + +Patch 6.3.016 +Problem: The default value for 'define' has "\s" before '#'. +Solution: Add a star after "\s". (Herculano de Lima Einloft Neto) +Files: src/option.c + +Patch 6.3.017 +Problem: "8zz" may leave the cursor beyond the end of the line. (Niko + Maatjes) +Solution: Correct the cursor column after moving to another line. +Files: src/normal.c + +Patch 6.3.018 +Problem: ":0argadd zero" added the argument after the first one, instead of + before it. (Adri Verhoef) +Solution: Accept a zero range for ":argadd". +Files: src/ex_cmds.h + +Patch 6.3.019 +Problem: Crash in startup for debug version. (David Rennals) +Solution: Move the call to nbdebug_wait() to after allocating NameBuff. +Files: src/main.c + +Patch 6.3.020 +Problem: When 'encoding' is "utf-8" and 'delcombine' is set, "dw" does not + delete a word but only a combining character of the first + character, if there is one. (Raphael Finkel) +Solution: Correctly check that one character is being deleted. +Files: src/misc1.c + +Patch 6.3.021 +Problem: When the last character of a file name is a multi-byte character + and the last byte is a path separator, the file cannot be edited. +Solution: Check for the last byte to be part of a multi-byte character. + (Taro Muraoka) +Files: src/fileio.c + +Patch 6.3.022 (extra) +Problem: Win32: When the last character of a file name is a multi-byte + character and the last byte is a path separator, the file cannot + be written. A trail byte that is a space makes that a file cannot + be opened from the command line. +Solution: Recognize double-byte characters when parsing the command line. + In mch_stat() check for the last byte to be part of a multi-byte + character. (Taro Muraoka) +Files: src/gui_w48.c, src/os_mswin.c + +Patch 6.3.023 +Problem: When the "to" part of a mapping starts with its "from" part, + abbreviations for the same characters is not possible. For + example, when <Space> is mapped to something that starts with a + space, typing <Space> does not expand abbreviations. +Solution: Only disable expanding abbreviations when a mapping is not + remapped, don't disable it when the RHS of a mapping starts with + the LHS. +Files: src/getchar.c, src/vim.h + +Patch 6.3.024 +Problem: In a few places a string in allocated memory is not terminated + with a NUL. +Solution: Add ga_append(NUL) in script_get(), gui_do_findrepl() and + serverGetVimNames(). +Files: src/ex_getln.c, src/gui.c, src/if_xcmdsrv.c, src/os_mswin.c + +Patch 6.3.025 (extra) +Problem: Missing NUL for list of server names. +Solution: Add ga_append(NUL) in serverGetVimNames(). +Files: src/os_mswin.c + +Patch 6.3.026 +Problem: When ~/.vim/after/syntax/syncolor.vim contains a command that + reloads the colors an endless loop and/or a crash may occur. +Solution: Only free the old value of an option when it was originally + allocated. Limit recursiveness of init_highlight() to 5 levels. +Files: src/option.c, src/syntax.c + +Patch 6.3.027 +Problem: VMS: Writing a file may insert extra CR characters. Not all + terminals are recognized correctly. Vt320 doesn't support colors. + Environment variables are not expanded correctly. +Solution: Use another method to write files. Add vt320 termcap codes for + colors. (Zoltan Arpadffy) +Files: src/fileio.c, src/misc1.c, src/os_unix.c, src/structs.h, + src/term.c + +Patch 6.3.028 +Problem: When appending to a file the BOM marker may be written. (Alex + Jakushev) +Solution: Do not write the BOM marker when appending. +Files: src/fileio.c + +Patch 6.3.029 +Problem: Crash when inserting a line break. (Walter Briscoe) +Solution: In the syntax highlighting code, don't use an old state after a + change was made, current_col may be past the end of the line. +Files: src/syntax.c + +Patch 6.3.030 +Problem: GTK 2: Crash when sourcing a script that deletes the menus, sets + 'encoding' to "utf-8" and loads the menus again. GTK error + message when tooltip text is in a wrong encoding. +Solution: Don't copy characters from the old screen to the new screen when + switching 'encoding' to utf-8, they may be invalid. Only set the + tooltip when it is valid utf-8. +Files: src/gui_gtk.c, src/mbyte.c, src/proto/mbyte.pro, src/screen.c + +Patch 6.3.031 +Problem: When entering a mapping and pressing Tab halfway the command line + isn't redrawn properly. (Adri Verhoef) +Solution: Reposition the cursor after drawing over the "..." of the + completion attempt. +Files: src/ex_getln.c + +Patch 6.3.032 +Problem: Using Python 2.3 with threads doesn't work properly. +Solution: Release the lock after initialization. +Files: src/if_python.c + +Patch 6.3.033 +Problem: When a mapping ends in a Normal mode command of more than one + character Vim doesn't return to Insert mode. +Solution: Check that the mapping has ended after obtaining all characters of + the Normal mode command. +Files: src/normal.c + +Patch 6.3.034 +Problem: VMS: crash when using ":help". +Solution: Avoid using "tags-??", some Open VMS systems can't handle the "?" + wildcard. (Zoltan Arpadffy) +Files: src/tag.c + +Patch 6.3.035 (extra) +Problem: RISC OS: Compile errors. +Solution: Change e_screnmode to e_screenmode. Change the way + __riscosify_control is set. Improve the makefile. (Andy Wingate) +Files: src/os_riscos.c, src/search.c, src/Make_ro.mak + +Patch 6.3.036 +Problem: ml_get errors when the whole file is a fold, switching + 'foldmethod' and doing "zj". (Christian J. Robinson) Was not + deleting the fold but creating a fold with zero lines. +Solution: Delete the fold properly. +Files: src/fold.c + +Patch 6.3.037 (after 6.3.032) +Problem: Warning for unused variable. +Solution: Change the #ifdefs for the saved thread stuff. +Files: src/if_python.c + +Patch 6.3.038 (extra) +Problem: Win32: When the "file changed" dialog pops up after a click that + gives gvim focus and not moving the mouse after that, the effect + of the click may occur when moving the mouse later. (Ken Clark) + Happened because the release event was missed. +Solution: Clear the s_button_pending variable when any input is received. +Files: src/gui_w48.c + +Patch 6.3.039 +Problem: When 'number' is set and inserting lines just above the first + displayed line (in another window on the same buffer), the line + numbers are not updated. (Hitier Sylvain) +Solution: When 'number' is set and lines are inserted/deleted redraw all + lines below the change. +Files: src/screen.c + +Patch 6.3.040 +Problem: Error handling does not always work properly and may cause a + buffer to be marked as if it's viewed in a window while it isn't. + Also when selecting "Abort" at the attention prompt. +Solution: Add enter_cleanup() and leave_cleanup() functions to move + saving/restoring things for error handling to one place. + Clear a buffer read error when it's unloaded. +Files: src/buffer.c, src/ex_docmd.c, src/ex_eval.c, + src/proto/ex_eval.pro, src/structs.h, src/vim.h + +Patch 6.3.041 (extra) +Problem: Win32: When the path to a file has Russian characters, ":cd %:p:h" + doesn't work. (Valery Kondakoff) +Solution: Use a wide function to change directory. +Files: src/os_mswin.c + +Patch 6.3.042 +Problem: When there is a closed fold at the top of the window, CTRL-X + CTRL-E in Insert mode reduces the size of the fold instead of + scrolling the text up. (Gautam) +Solution: Scroll over the closed fold. +Files: src/move.c + +Patch 6.3.043 +Problem: 'hlsearch' highlighting sometimes disappears when inserting text + in PHP code with syntax highlighting. (Marcel Svitalsky) +Solution: Don't use pointers to remember where a match was found, use an + index. The pointers may become invalid when searching in other + lines. +Files: src/screen.c + +Patch 6.3.044 (extra) +Problem: Mac: When 'linespace' is non-zero the Insert mode cursor leaves + pixels behind. (Richard Sandilands) +Solution: Erase the character cell before drawing the text when needed. +Files: src/gui_mac.c + + +Patch 6.3.045 +Problem: Unusual characters in an option value may cause unexpected + behavior, especially for a modeline. (Ciaran McCreesh) +Solution: Don't allow setting termcap options or 'printdevice' in a + modeline. Don't list options for "termcap" and "all" in a + modeline. Don't allow unusual characters in 'filetype', 'syntax', + 'backupext', 'keymap', 'patchmode' and 'langmenu'. +Files: src/option.c, runtime/doc/options.txt + +Patch 6.3.046 +Problem: ":registers" doesn't show multi-byte characters properly. + (Valery Kondakoff) +Solution: Get the length of each character before displaying it. +Files: src/ops.c + +Patch 6.3.047 (extra) +Problem: Win32 with Borland C 5.5 on Windows XP: A new file is created with + read-only attributes. (Tony Mechelynck) +Solution: Don't use the _wopen() function for Borland. +Files: src/os_win32.c + +Patch 6.3.048 (extra) +Problem: Build problems with VMS on IA64. +Solution: Add dependencies to the build file. (Zoltan Arpadffy) +Files: src/Make_vms.mms + +Patch 6.3.049 (after 6.3.045) +Problem: Compiler warning for "char" vs "char_u" mixup. (Zoltan Arpadffy) +Solution: Add a typecast. +Files: src/option.c + +Patch 6.3.050 +Problem: When SIGHUP is received while busy exiting, non-reentrant + functions such as free() may cause a crash. +Solution: Ignore SIGHUP when exiting because of an error. (Scott Anderson) +Files: src/misc1.c, src/main.c + +Patch 6.3.051 +Problem: When 'wildmenu' is set and completed file names contain multi-byte + characters Vim may crash. +Solution: Reserve room for multi-byte characters. (Yasuhiro Matsumoto) +Files: src/screen.c + +Patch 6.3.052 (extra) +Problem: Windows 98: typed keys that are not ASCII may not work properly. + For example with a Russian input method. (Jiri Jezdinsky) +Solution: Assume that the characters arrive in the current codepage instead + of UCS-2. Perform conversion based on that. +Files: src/gui_w48.c + +Patch 6.3.053 +Problem: Win32: ":loadview" cannot find a file with non-ASCII characters. + (Valerie Kondakoff) +Solution: Use mch_open() instead of open() to open the file. +Files: src/ex_cmds2.c + +Patch 6.3.054 +Problem: When 'insertmode' is set <C-L>4ixxx<C-L> hangs Vim. (Jens Paulus) + Vim is actually still working but redraw is disabled. +Solution: When stopping Insert mode with CTRL-L don't put an Esc in the redo + buffer but a CTRL-L. +Files: src/edit.c + +Patch 6.3.055 (after 6.3.013) +Problem: Can't use getcmdline(), getcmdpos() or setcmdpos() with <C-R>= + when editing a command line. Using <C-\>e may crash Vim. (Peter + Winters) +Solution: When moving ccline out of the way for recursive use, make it + available to the functions that need it. Also save and restore + ccline when calling get_expr_line(). Make ccline.cmdbuf NULL at + the end of getcmdline(). +Files: src/ex_getln.c + +Patch 6.3.056 +Problem: The last characters of a multi-byte file name may not be displayed + in the window title. +Solution: Avoid to remove a multi-byte character where the last byte looks + like a path separator character. (Yasuhiro Matsumoto) +Files: src/buffer.c, src/ex_getln.c + +Patch 6.3.057 +Problem: When filtering lines folds are not updated. (Carl Osterwisch) +Solution: Update folds for filtered lines. +Files: src/ex_cmds.c + +Patch 6.3.058 +Problem: When 'foldcolumn' is equal to the window width and 'wrap' is on + Vim may crash. Disabling the vertical split feature breaks + compiling. (Peter Winters) +Solution: Check for zero room for wrapped text. Make compiling without + vertical splits possible. +Files: src/move.c, src/quickfix.c, src/screen.c, src/netbeans.c + +Patch 6.3.059 +Problem: Crash when expanding an ":edit" command containing several spaces + with the shell. (Brian Hirt) +Solution: Allocate enough space for the quotes. +Files: src/os_unix.c + +Patch 6.3.060 +Problem: Using CTRL-R CTRL-O in Insert mode with an invalid register name + still causes something to be inserted. +Solution: Check the register name for being valid. +Files: src/edit.c + +Patch 6.3.061 +Problem: When editing a utf-8 file in an utf-8 xterm and there is a + multi-byte character in the last column, displaying is messed up. + (Jol Rio) +Solution: Check for a multi-byte character, not a multi-column character. +Files: src/screen.c + +Patch 6.3.062 +Problem: ":normal! gQ" hangs. +Solution: Quit getcmdline() and do_exmode() when out of typeahead. +Files: src/ex_getln.c, src/ex_docmd.c + +Patch 6.3.063 +Problem: When a CursorHold autocommand changes to another window + (temporarily) 'mousefocus' stops working. +Solution: Call gui_mouse_correct() after triggering CursorHold. +Files: src/gui.c + +Patch 6.3.064 +Problem: line2byte(line("$") + 1) sometimes returns the wrong number. + (Charles Campbell) +Solution: Flush the cached line before counting the bytes. +Files: src/memline.c + +Patch 6.3.065 +Problem: The euro digraph doesn't always work. +Solution: Add an "e=" digraph for Unicode euro character and adjust the + help files. +Files: src/digraph.c, runtime/doc/digraph.txt + +Patch 6.3.066 +Problem: Backup file may get wrong permissions. +Solution: Use permissions of original file for backup file in more places. +Files: src/fileio.c + +Patch 6.3.067 (after 6.3.066) +Problem: Newly created file gets execute permission. +Solution: Check for "perm" to be negative before using it. +Files: src/fileio.c + +Patch 6.3.068 +Problem: When editing a compressed file xxx.gz which is a symbolic link to + the actual file a ":write" renames the link. +Solution: Resolve the link, so that the actual file is renamed and + compressed. +Files: runtime/plugin/gzip.vim + +Patch 6.3.069 +Problem: When converting text with illegal characters Vim may crash. +Solution: Avoid that too much is subtracted from the length. (Da Woon Jung) +Files: src/mbyte.c + +Patch 6.3.070 +Problem: After ":set number linebreak wrap" and a vertical split, moving + the vertical separator far left will crash Vim. (Georg Dahn) +Solution: Avoid dividing by zero. +Files: src/charset.c + +Patch 6.3.071 +Problem: The message for CTRL-X mode is still displayed after an error for + 'thesaurus' or 'dictionary' being empty. +Solution: Clear "edit_submode". +Files: src/edit.c + +Patch 6.3.072 +Problem: Crash in giving substitute message when language is Chinese and + encoding is utf-8. (Yongwei) +Solution: Make the msg_buf size larger when using multi-byte. +Files: src/vim.h + +Patch 6.3.073 +Problem: Win32 GUI: When the Vim window is partly above or below the + screen, scrolling causes display errors when the taskbar is not on + that side. +Solution: Use the SW_INVALIDATE flag when the Vim window is partly below or + above the screen. +Files: src/gui_w48.c + +Patch 6.3.074 +Problem: When mswin.vim is used and 'insertmode' is set, typing text in + Select mode and then using CTRL-V results in <SNR>99_Pastegi. + (Georg Dahn) +Solution: When restart_edit is set use "d" instead of "c" to remove the + selected text to avoid calling edit() twice. +Files: src/normal.c + +Patch 6.3.075 +Problem: After unloading another buffer, syntax highlighting in the current + buffer may be wrong when it uses "containedin". (Eric Arnold) +Solution: Use "buf" intead of "curbuf" in syntax_clear(). +Files: src/syntax.c + +Patch 6.3.076 +Problem: Crash when using cscope and there is a parse error (e.g., line too + long). (Alexey I. Froloff) +Solution: Pass the actual number of matches to cs_manage_matches() and + correctly handle the error situation. +Files: src/if_cscope.c + +Patch 6.3.077 (extra) +Problem: VMS: First character input after ESC was not recognized. +Solution: Added TRM$M_TM_TIMED in vms_read(). (Zoltan Arpadffy) +Files: src/os_vms.c + +Patch 6.3.078 (extra, after 6.3.077) +Problem: VMS: Performance issue after patch 6.3.077 +Solution: Add a timeout in the itemlist. (Zoltan Arpadffy) +Files: src/os_vms.c + +Patch 6.3.079 +Problem: Crash when executing a command in the command line window while + syntax highlighting is enabled. (Pero Brbora) +Solution: Don't use a pointer to a buffer that has been deleted. +Files: src/syntax.c + +Patch 6.3.080 (extra) +Problem: Win32: With 'encoding' set to utf-8 while the current codepage is + Chinese editing a file with some specific characters in the name + fails. +Solution: Use _wfullpath() instead of _fullpath() when necessary. +Files: src/os_mswin.c + +Patch 6.3.081 +Problem: Unix: glob() may execute a shell command when it's not wanted. + (Georgi Guninski) +Solution: Verify the sandbox flag is not set. +Files: src/os_unix.c + +Patch 6.3.082 (after 6.3.081) +Problem: Unix: expand() may execute a shell command when it's not wanted. + (Georgi Guninski) +Solution: A more generic solution than 6.3.081. +Files: src/os_unix.c + +Patch 6.3.083 +Problem: VMS: The vt320 termcap entry is incomplete. +Solution: Add missing function keys. (Zoltan Arpadffy) +Files: src/term.c + +Patch 6.3.084 (extra) +Problem: Cygwin: compiling with DEBUG doesn't work. Perl path was ignored. + Failure when $(OUTDIR) already exists. "po" makefile is missing. +Solution: Use changes tested in Vim 7. (Tony Mechelynck) +Files: src/Make_cyg.mak, src/po/Make_cyg.mak + +Patch 6.3.085 +Problem: Crash in syntax highlighting code. (Marc Espie) +Solution: Prevent current_col going past the end of the line. +Files: src/syntax.c + +Patch 6.3.086 (extra) +Problem: Can't produce message translation file with msgfmt that checks + printf strings. +Solution: Fix the Russian translation. +Files: src/po/ru.po, src/po/ru.cp1251.po + +Patch 6.3.087 +Problem: MS-DOS: Crash. (Jason Hood) +Solution: Don't call fname_case() with a NULL pointer. +Files: src/ex_cmds.c + +Patch 6.3.088 +Problem: Editing ".in" causes error E218. (Stefan Karlsson) +Solution: Require some characters before ".in". Same for ".orig" and others. +Files: runtime/filetype.vim + +Patch 6.3.089 +Problem: A session file doesn't work when created while the current + directory contains a space or the directory of the session files + contains a space. (Paolo Giarrusso) +Solution: Escape spaces with a backslash. +Files: src/ex_docmd.c + +Patch 6.3.090 +Problem: A very big value for 'columns' or 'lines' may cause a crash. +Solution: Limit the values to 10000 and 1000. +Files: src/option.c + +Patch 6.4a.001 +Problem: The Unix Makefile contained too many dependencies and a few + uncommented lines. +Solution: Run "make depend" with manual changes to avoid a gcc + incompatibility. Comment a few lines. +Files: src/Makefile + +Patch 6.4b.001 +Problem: Vim reports "Vim 6.4a" in the ":version" output. +Solution: Change "a" to "b". (Tony Mechelynck) +Files: src/version.h + +Patch 6.4b.002 +Problem: In Insert mode, pasting a multi-byte character after the end of + the line leaves the cursor just before that character. +Solution: Make sure "gP" leaves the cursor in the right place when + 'virtualedit' is set. +Files: src/ops.c + +Patch 6.4b.003 (after 6.4b.002) +Problem: The problem still exists when 'encoding' is set to "cp936". +Solution: Fix the problem in getvvcol(), compute the coladd field correctly. +Files: src/charset.c, src/ops.c + +Patch 6.4b.004 +Problem: Selecting a {} block with "viB" includes the '}' when there is an + empty line before it. +Solution: Don't advance the cursor to include a line break when it's already + at the line break. +Files: src/search.c + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/version7.txt b/Aufgabe5/doc.lang/version7.txt new file mode 100644 index 0000000..4a6059c --- /dev/null +++ b/Aufgabe5/doc.lang/version7.txt @@ -0,0 +1,2972 @@ +*version7.txt* For Vim version 7.0. Last change: 2006 May 07 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Welcome to Vim 7! A large number of features has been added. This file +mentions all the new items, changes to existing features and bug fixes +since Vim 6.x. Use this command to see the version you are using: > + :version + +See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0. +See |version4.txt| for differences between Vim 3.x and Vim 4.x. +See |version5.txt| for differences between Vim 4.x and Vim 5.x. +See |version6.txt| for differences between Vim 5.x and Vim 6.x. + +INCOMPATIBLE CHANGES |incompatible-7| + +NEW FEATURES |new-7| + +Vim script enhancements |new-vim-script| +Spell checking |new-spell| +Omni completion |new-omni-completion| +MzScheme interface |new-MzScheme| +Printing multi-byte text |new-print-multi-byte| +Tab pages |new-tab-pages| +Undo branches |new-undo-branches| +Extended Unicode support |new-more-unicode| +More highlighting |new-more-highlighting| +Translated manual pages |new-manpage-trans| +Internal grep |new-vimgrep| +Scroll back in messages |new-scroll-back| +Cursor past end of the line |new-onemore| +POSIX compatibility |new-posix| +Debugger support |new-debug-support| +Remote file explorer |new-netrw-explore| +Define an operator |new-define-operator| +Mapping to an expression |new-map-expression| +Visual and Select mode mappings |new-map-select| +Location list |new-location-list| +Various new items |new-items-7| + +IMPROVEMENTS |improvements-7| + +COMPILE TIME CHANGES |compile-changes-7| + +BUG FIXES |bug-fixes-7| + +============================================================================== +INCOMPATIBLE CHANGES *incompatible-7* + +These changes are incompatible with previous releases. Check this list if you +run into a problem when upgrading from Vim 6.x to 7.0. + +A ":write file" command no longer resets the 'modified' flag of the buffer, +unless the '+' flag is in 'cpoptions' |cpo-+|. This was illogical, since the +buffer is still modified compared to the original file. And when undoing +all changes the file would actually be marked modified. It does mean that +":quit" fails now. + +":helpgrep" now uses a help window to display a match. + +In an argument list double quotes could be used to include spaces in a file +name. This caused a difference between ":edit" and ":next" for escaping +double quotes and it is incompatible with some versions of Vi. + Command Vim 6.x file name Vim 7.x file name ~ + :edit foo\"888 foo"888 foo"888 + :next foo\"888 foo888 foo"888 + :next a\"b c\"d ab cd a"b and c"d + +In a |literal-string| a single quote can be doubled to get one. +":echo 'a''b'" would result in "a b", but now that two quotes stand for one it +results in "a'b". + +When overwriting a file with ":w! fname" there was no warning for when "fname" +was being edited by another Vim. Vim now gives an error message |E768|. + +The support for Mac OS 9 has been removed. + +Files ending in .tex now have 'filetype' set to "context", "plaintex", or +"tex". |ft-tex-plugin| + + +Minor incompatibilities: + +For filetype detection: For many types, use */.dir/filename instead of +~/.dir/filename, so that it also works for other user's files. + +For quite a few filetypes the indent settings have been moved from the +filetype plugin to the indent plugin. If you used: > + :filetype plugin on +Then some indent settings may be missing. You need to use: > + :filetype plugin indent on + +":0verbose" now sets 'verbose' to zero instead of one. + +Removed the old and incomplete "VimBuddy" code. + +Buffers without a name report "No Name" instead of "No File". It was +confusing for buffers with a name and 'buftype' set to "nofile". + +When ":file xxx" is used in a buffer without a name, the alternate file name +isn't set. This avoids creating buffers without a name, they are not useful. + +The "2html.vim" script now converts closed folds to HTML. This means the HTML +looks like it's displayed, with the same folds open and closed. Use "zR", or +"let html_ignore_folding=1", if no folds should appear in the HTML. (partly by +Carl Osterwisch) +Diff mode is now also converted to HTML as it is displayed. + +Win32: The effect of the <F10> key depended on 'winaltkeys'. Now it depends +on whether <F10> has been mapped or not. This allows mapping <F10> without +changing 'winaltkeys'. + +When 'octal' is in 'nrformats' and using CTRL-A on "08" it became "018", which +is illogical. Now it becomes "9". The leading zero(s) is(are) removed to +avoid the number becoming octal after incrementing "009" to "010". + +When 'encoding' is set to a Unicode encoding, the value for 'fileencodings' +now includes "default" before "latin1". This means that for files with 8-bit +encodings the default is to use the encoding specified by the environment, if +possible. Previously latin1 would always be used, which is wrong in a +non-latin1 environment, such as Russian. + +Previously Vim would exit when there are two windows, both of them displaying +a help file, and using ":quit". Now only the window is closed. + +"-w {scriptout}" only works when {scriptout} doesn't start with a digit. +Otherwise it's used to set the 'window' option. + +Previously <Home> and <xHome> could be mapped separately. This had the +disadvantage that all mappings (with modifiers) had to be duplicated, since +you can't be sure what the keyboard generates. Now all <xHome> are internally +translated to <Home>, both for the keys and for mappings. Also for <xEnd>, +<xF1>, etc. + +":put" now leaves the cursor on the last inserted line. + +When a .gvimrc file exists then 'compatible' is off, just like when a ".vimrc" +file exists. + +When making a string upper-case with "vlllU" or similar then the German sharp +s is replaced with "SS". This does not happen with "~" to avoid backwards +compatibility problems and because "SS" can't be changed back to a sharp s. + +"gd" previously found the very first occurrence of a variable in a function, +that could be the function argument without type. Now it finds the position +where the type is given. + +The line continuation in functions was not taken into account, line numbers in +errors were logical lines, not lines in the sourced file. That made it +difficult to locate errors. Now the line number in the sourced file is +reported, relative to the function start. This also means that line numbers +for ":breakadd func" are different. + +When defining a user command with |:command| the special items could be +abbreviated. This caused unexpected behavior, such as <li> being recognized +as <line1>. The items can no longer be abbreviated. + +When executing a FileChangedRO autocommand it is no longer allowed to switch +to another buffer or edit another file. This is to prevent crashes (the event +is triggered deep down in the code where changing buffers is not anticipated). +It is still possible to reload the buffer. + +At the |more-prompt| and the |hit-enter-prompt|, when the 'more' option is +set, the 'k', 'u', 'g' and 'b' keys are now used to scroll back to previous +messages. Thus they are no longer used as typeahead. + +============================================================================== +NEW FEATURES *new-7* + +Vim script enhancements *new-vim-script* +----------------------- + +In Vim scripts the following types have been added: + + |List| ordered list of items + |Dictionary| associative array of items + |Funcref| reference to a function + +Many functions and commands have been added to support the new types. + +The |string()| function can be used to get a string representation of a +variable. Works for Numbers, Strings and composites of them. Then |eval()| +can be used to turn the string back into the variable value. + +The |:let| command can now use "+=", "-=" and ".=": > + :let var += expr " works like :let var = var + expr + :let var -= expr " works like :let var = var - expr + :let var .= string " works like :let var = var . string + +With the |:profile| command you can find out where your function or script +is wasting time. + +In the Python interface vim.eval() also handles Dictionaries and Lists. +|python-eval| (G. Sumner Hayes) + +The |getscript| plugin was added as a convenient way to update scripts from +www.vim.org automatically. (Charles Campbell) + +The |vimball| plugin was added as a convenient way to distribute a set of +files for a plugin (plugin file, autoload script, documentation). (Charles +Campbell) + + +Spell checking *new-spell* +-------------- + +Spell checking has been integrated in Vim. There were a few implementations +with scripts, but they were slow and/or required an external program. + +The 'spell' option is used to switch spell checking on or off +The 'spelllang' option is used to specify the accepted language(s) +The 'spellfile' option specifies where new words are added +The 'spellsuggest' option specifies the methods used for making suggestions + +The |[s| and |]s| commands can be used to move to the next or previous error +The |zg| and |zw| commands can be used to add good and wrong words +The |z=| command can be used to list suggestions and correct the word +The |:mkspell| command is used to generate a Vim spell file from word lists + +The "undercurl" highlighting attribute was added to nicely point out spelling +mistakes in the GUI (based on patch from Marcin Dalecki). +The "guisp" color can be used to give it a color different from foreground and +background. +The number of possible different highlight attributes was raised from about +220 to over 30000. This allows for the attributes of spelling to be combined +with syntax highlighting attributes. This is also used for syntax +highlighting and marking the Visual area. + +Much more info here: |spell|. + + +Omni completion *new-omni-completion* +--------------- + +This could also be called "intellisense", but that is a trademark. It is a +smart kind of completion. The text in front of the cursor is inspected to +figure out what could be following. This may suggest struct and class +members, system functions, etc. + +Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O| + +The 'omnifunc' option is set by filetype plugins to define the function that +figures out the completion. + +Currently supported languages: + C |ft-c-omni| + (X)HTML with CSS |ft-html-omni| + JavaScript |ft-javascript-omni| + PHP |ft-php-omni| + Python + Ruby |ft-ruby-omni| + SQL |ft-sql-omni| + XML |ft-xml-omni| + any language wih syntax highligting |ft-syntax-omni| + +You can add your own omni completion scripts. + +When the 'completeopt' option contains "menu" then matches for Insert mode +completion are displayed in a (rather primitive) popup menu. + + +MzScheme interface *new-MzScheme* +------------------ + +The MzScheme interpreter is supported. |MzScheme| + +The |:mzscheme| command can be used to execute MzScheme commands +The |:mzfile| command can be used to execute an MzScheme script file + +This depends on Vim being compiled with the |+mzscheme| feature. + + +Printing multi-byte text *new-print-multi-byte* +------------------------ + +The |:hardcopy| command now supports printing multi-byte characters when using +PostScript. + +The 'printmbcharset' and 'printmbfont' options are used for this. +Also see |postscript-cjk-printing|. (Mike Williams) + + +Tab pages *new-tab-pages* +--------- + +A tab page is page with one or more windows with a label (aka tab) at the top. +By clicking on the label you can quickly switch between the tab pages. And +with the keyboard, using the |gt| (Goto Tab) command. This is a convenient +way to work with many windows. + +To start Vim with each file argument in a separate tab page use the |-p| +argument. The maximum number of pages can be set with 'tabpagemax'. + +The line with tab labels is either made with plain text and highlighting or +with a GUI mechanism. The GUI labels look better but are only available on a +few systems. The line can be customized with 'tabline', 'guitablabel' and +'guitabtooltip'. Whether it is displayed is set with 'showtabline'. Whether +to use the GUI labels is set with the "e" flag in 'guioptions'. + +The |:tab| command modifier can be used to have most commands that open a new +window open a new tab page instead. + +The |--remote-tab| argument can be used to edit a file in a new tab page in an +already running Vim server. + +Variables starting with "t:" are local to a tab page. + +More info here: |tabpage| +Most of the GUI stuff was implemented by Yegappan Lakshmanan. + + +Undo branches *new-undo-branches* +------------- + +Previously there was only one line of undo-redo. If, after undoing a number +of changes, a new change was made all the undone changes were lost. This +could lead to accidentally losing work. + +Vim now makes an undo branch in this situation. Thus you can go back to the +text after any change, even if they were undone. So long as you do not run +into 'undolevels', when undo information is freed up to limit the memory used. + +To be able to navigate the undo branches each change is numbered sequentially. +The commands |g-| and |:earlier| go back in time, to older changes. The +commands |g+| and |:later| go forward in time, to newer changes. + +The changes are also timestamped. Use ":earlier 10m" to go to the text as it +was about ten minutes earlier. + +The |:undolist| command can be used to get an idea of which undo branches +exist. The |:undo| command now takes an argument to directly jump to a +specific position in this list. The |changenr()| function can be used to +obtain the change number. + +There is no graphical display of the tree with changes, navigation can be +quite confusing. + + +Extended Unicode support *new-more-unicode* +------------------------ + +Previously only two combining characters were displayed. The limit is now +raised to 6. This can be set with the 'maxcombine' option. The default is +still 2. + +|ga| now shows all combining characters, not just the first two. + +Previously only 16 bit Unicode characters were supported for displaying. Now +the full 32 bit character set can be used. Unless manually disabled at +compile time to save a bit of memory. + +For pattern matching it is now possible to search for individual composing +characters. |patterns-composing| + +The |8g8| command searches for an illegal UTF-8 byte sequence. + + +More highlighting *new-more-highlighting* +----------------- + +Highlighting matching parens: + +When moving the cursor through the text and it is on a paren, then the +matching paren can be highlighted. This uses the new |CursorMoved| +autocommand event. + +This means some commands are executed every time you move the cursor. If this +slows you down too much switch it off with: > + :NoMatchParen + +See |matchparen| for more information. + +The plugin uses the |:match| command. It now supports three match patterns. +The plugin uses the third one. The first one is for the user and the second +one can be used by another plugin. + +Highlighting the cursor line and column: + +The 'cursorline' and 'cursorcolumn' options have been added. These highlight +the screen line and screen column of the cursor. This makes the cursor +position easier to spot. 'cursorcolumn' is also useful to align text. This +may make screen updating quite slow. The CursorColumn and CursorLine +highlight groups allow changing the colors used. |hl-CursorColumn| +|hl-CursorLine| + +The number of possible different highlight attributes was raised from about +220 to over 30000. This allows for the attributes of spelling to be combined +with syntax highlighting attributes. This is also used for syntax +highlighting, marking the Visual area, CursorColumn, etc. + + +Translated manual pages *new-manpage-trans* +----------------------- + +The manual page of Vim and associated programs is now also available in +several other languages. + +French - translated by David Blanchet +Italian - translated by Antonio Colombo +Russian - translated by Vassily Ragosin +Polish - translated by Mikolaj Machowski + +The Unix Makefile installs the Italian manual pages in .../man/it/man1/, +.../man/it.ISO8859-1/man1/ and .../man/it.UTF-8/man1/. There appears to be no +standard for what encoding goes in the "it" directory, the 8-bit encoded file +is used there as a best guess. +Other languages are installed in similar places. +The translated pages are not automatically installed when Vim was configured +with "--disable-nls", but "make install-languages install-tool-languages" will +do it anyway. + + +Internal grep *new-vimgrep* +------------- + +The ":vimgrep" command can be used to search for a pattern in a list of files. +This is like the ":grep" command, but no external program is used. Besides +better portability, handling of different file encodings and using multi-line +patterns, this also allows grepping in compressed and remote files. +|:vimgrep|. + +If you want to use the search results in a script you can use the +|getqflist()| function. + +To grep files in various directories the "**" pattern can be used. It expands +into an arbitrary depth of directories. "**" can be used in all places where +file names are expanded, thus also with |:next| and |:args|. + + +Scroll back in messages *new-scroll-back* +----------------------- + +When displaying messages, at the |more-prompt| and the |hit-enter-prompt|, The +'k', 'u', 'g' and 'b' keys can be used to scroll back to previous messages. +This is especially useful for commands such as ":syntax", ":autocommand" and +":highlight". This is implemented in a generic way thus it works for all +commands and highlighting is kept. Only works when the 'more' option is set. +Previously it only partly worked for ":clist". + +The |g<| command can be used to see the last page of messages after you have +hit <Enter> at the |hit-enter-prompt|. Then you can scroll further back. + + +Cursor past end of the line *new-onemore* +--------------------------- + +When the 'virtualedit' option contains "onemore" the cursor can move just past +the end of the line. As if it's on top of the line break. + +This makes some commands more consistent. Previously the cursor was always +past the end of the line if the line was empty. But it is far from Vi +compatible. It may also break some plugins or Vim scripts. Use with care! + +The patch was provided by Mattias Flodin. + + +POSIX compatibility *new-posix* +------------------- + +The POSIX test suite was used to verify POSIX compatibility. A number of +problems have been fixed to make Vim more POSIX compatible. Some of them +conflict with traditional Vi or expected behavior. The $VIM_POSIX environment +variable can be set to get POSIX compatibility. See |posix|. + +Items that were fixed for both Vi and POSIX compatibilty: +- repeating "R" with a count only overwrites text once; added the 'X' flag to + 'cpoptions' |cpo-X| +- a vertical movement command that moves to a non-existing line fails; added + the '-' flag to 'cpoptions' |cpo--| +- when preserving a file and doing ":q!" the file can be recovered; added the + '&' flag to 'cpoptions' |cpo-&| +- The 'window' option is partly implemented. It specifies how much CTRL-F and + CTRL-B scroll when there is one window. The "-w {number}" argument is now + accepted. "-w {scriptout}" only works when {scriptout} doesn't start with a + digit. +- Allow "-c{command}" argument, no space between "-c" and {command}. +- When writing a file with ":w!" don't reset 'readonly' when 'Z' is present in + 'cpoptions'. +- Allow 'l' and '#' flags for ":list", ":print" and ":number". +- Added the '.' flag to 'cpoptions': ":cd" fails when the buffer is modified. +- In Ex mode with an empty buffer ":read file" doesn't keep an empty line + above or below the new lines. +- Remove a backslash before a NL for the ":global" command. +- When ":append", ":insert" or ":change" is used with ":global", get the + inserted lines from the command. Can use backslash-NL to separate lines. +- Can use ":global /pat/ visual" to execute Normal mode commands at each + matched line. Use "Q" to continue and go to the next line. +- The |:open| command has been partially implemented. It stops Ex mode, but + redraws the whole screen, not just one line as open mode is supposed to do. +- Support using a pipe to read the output from and write input to an external + command. Added the 'shelltemp' option and has("filterpipe"). +- In ex silent mode the ":set" command output is displayed. +- The ":@@" and ":**" give an error message when no register was used before. +- The search pattern "[]-`]" matches ']', '^', '_' and '`'. +- Autoindent for ":insert" is using the line below the insert. +- Autoindent for ":change" is using the first changed line. +- Editing Ex command lines is not done in cooked mode, because CTRL-D and + CTRL-T cannot be handled then. +- In Ex mode, "1,3" prints three lines. "%" prints all lines. +- In Ex mode "undo" would undo all changes since Ex mode was started. +- Implemented the 'prompt' option. + + +Debugger support *new-debug-support* +---------------- + +The 'balloonexpr' option has been added. This is a generic way to implement +balloon functionality. You can use it to show info for the word under the +mouse pointer. + + +Remote file explorer *new-netrw-explore* +-------------------- + +The netrw plugin now also supports viewing a directory, when "scp://" is used. +Deleting and renaming files is possible. + +To avoid duplicating a lot of code, the previous file explorer plugin has been +integrated in the netrw plugin. This means browsing local and remote files +works the same way. + +":browse edit" and ":browse split" use the netrw plugin when it's available +and a GUI dialog is not possible. + +The netrw plugin is maintained by Charles Campbell. + + +Define an operator *new-define-operator* +------------------ + +Previously it was not possible to define your own operator; a command that is +followed by a {motion}. Vim 7 introduces the 'operatorfunc' option and the +|g@| operator. This makes it possible to define a mapping that works like an +operator. The actual work is then done by a function, which is invoked +through the |g@| operator. + +See |:map-operator| for the explanation and an example. + + +Mapping to an expression *new-map-expression* +------------------------ + +The {rhs} argument of a mapping can be an expression. That means the +resulting characters can depend on the context. Example: > + :inoremap <expr> . InsertDot() +Here the dot will be mapped to whatever InsertDot() returns. + +This also works for abbreviations. See |:map-<expr>| for the details. + + +Visual and Select mode mappings *new-map-select* +------------------------------- + +Previously Visual mode mappings applied both to Visual and Select mode. With +a trick to have the mappings work in Select mode like they would in Visual +mode. + +Commands have been added to define mappings for Visual and Select mode +separately: |:xmap| and |:smap|. With the associated "noremap" and "unmap" +commands. + +The same is done for menus: |:xmenu|, |:smenu|, etc. + + +Location list *new-location-list* +------------- + +The support for a per-window quickfix list (location list) is added. The +location list can be displayed in a location window (similar to the quickfix +window). You can open more than one location list window. A set of commands +similar to the quickfix commands are added to browse the location list. +(Yegappan Lakshmanan) + + +Various new items *new-items-7* +----------------- + +Normal mode commands: ~ + +a", a' and a` New text objects to select quoted strings. |a'| +i", i' and i` (Taro Muraoka) + +CTRL-W <Enter> In the quickfix window: opens a new window to show the + location of the error under the cursor. + +|at| and |it| text objects select a block of text between HTML or XML tags. + +<A-LeftMouse> ('mousemodel' "popup" or "popup-setpos") +<A-RightMouse> ('mousemodel' "extend") + Make a blockwise selection. |<A-LeftMouse>| + +gF Start editing the filename under the cursor and jump + to the line number following the file name. + (Yegappan Lakshmanan) + +CTRL-W F Start editing the filename under the cursor in a new + window and jump to the line number following the file + name. (Yegappan Lakshmanan) + +Insert mode commands: ~ + +CTRL-\ CTRL-O Execute a Normal mode command. Like CTRL-O but + without moving the cursor. |i_CTRL-\_CTRL-O| + +Options: ~ + +'balloonexpr' expression for text to show in evaluation balloon +'completefunc' The name of the function used for user-specified + Insert mode completion. CTRL-X CTRL-U can be used in + Insert mode to do any kind of completion. (Taro + Muraoka) +'completeopt' Enable popup menu and other settings for Insert mode + completion. +'cursorcolumn' highlight column of the cursor +'cursorline' highlight line of the cursor +'formatexpr' expression for formatting text with |gq| and when text + goes over 'textwidth' in Insert mode. +'formatlistpat' pattern to recognize a numbered list for formatting. + (idea by Hugo Haas) +'fsync' Whether fsync() is called after writing a file. + (Ciaran McCreesh) +'guitablabel' expression for text to display in GUI tab page label +'guitabtooltip' expression for text to display in GUI tab page tooltip +'macatsui' Mac: use ATSUI text display functions +'maxcombine' maximum number of combining characters displayed +'maxmempattern' maximum amount of memory to use for pattern matching +'mkspellmem' parameters for |:mkspell| memory use +'mzquantum' Time in msec to schedule MzScheme threads. +'numberwidth' Minimal width of the space used for the 'number' + option. (Emmanuel Renieris) +'omnifunc' The name of the function used for omni completion. +'operatorfunc' function to be called for |g@| operator +'printmbcharset' CJK character set to be used for :hardcopy +'printmbfont' font names to be used for CJK output of :hardcopy +'pumheight' maximum number of items to show in the popup menu +'quoteescape' Characters used to escape quotes inside a string. + Used for the a", a' and a` text objects. |a'| +'shelltemp' whether to use a temp file or pipes for shell commands +'showtabline' whether to show the tab pages line +'spell' switch spell checking on/off +'spellcapcheck' pattern to locate the end of a sentence +'spellfile' file where good and wrong words are added +'spelllang' languages to check spelling for +'spellsuggest' methods for spell suggestions +'synmaxcol' maximum column to look for syntax items; avoids very + slow redrawing when there are very long lines +'tabline' expression for text to display in the tab pages line +'tabpagemax' maximum number of tab pages to open for |-p| +'verbosefile' Log messages in a file. +'wildoptions' "tagfile" value enables listing the file name of + matching tags for CTRL-D command line completion. + (based on an idea from Yegappan Lakshmanan) +'winfixwidth' window with fixed width, similar to 'winfixheight' + + +Ex commands: ~ + +Win32: The ":winpos" command now also works in the console. (Vipin Aravind) + +|:startreplace| Start Replace mode. (Charles Campbell) +|:startgreplace| Start Virtual Replace mode. + +|:0file| Removes the name of the buffer. (Charles Campbell) + +|:diffoff| Switch off diff mode in the current window or in all + windows. + +|:delmarks| Delete marks. + +|:exusage| Help for Ex commands (Nvi command). +|:viusage| Help for Vi commands (Nvi command). + +|:sort| Sort lines in the buffer without depending on an + external command. (partly by Bryce Wagner) + +|:vimgrep| Internal grep command, search for a pattern in files. +|:vimgrepadd| Like |:vimgrep| but don't make a new list. + +|:caddfile| Add error messages to an existing quickfix list + (Yegappan Lakshmanan). +|:cbuffer| Read error lines from a buffer. (partly by Yegappan + Lakshmanan) +|:cgetbuffer| Create a quickfix list from a buffer but don't jump to + the first error. +|:caddbuffer| Add errors from the current buffer to the quickfix + list. +|:cexpr| Read error messages from a Vim expression (Yegappan + Lakshmanan). +|:caddexpr| Add error messages from a Vim expression to an + existing quickfix list. (Yegappan Lakshmanan). +|:cgetexpr| Create a quickfix list from a Vim expression, but + don't jump to the first error. (Yegappan Lakshmanan). + +|:lfile| Like |:cfile| but use the location list. +|:lgetfile| Like |:cgetfile| but use the location list. +|:laddfile| Like |:caddfile| but use the location list. +|:lbuffer| Like |:cbuffer| but use the location list. +|:lgetbuffer| Like |:cgetbuffer| but use the location list. +|:laddbuffer| Like |:caddbuffer| but use the location list. +|:lexpr| Like |:cexpr| but use the location list. +|:lgetexpr| Like |:cgetexpr| but use the location list. +|:laddexpr| Like |:caddexpr| but use the location list. +|:ll| Like |:cc| but use the location list. +|:llist| Like |:clist| but use the location list. +|:lnext| Like |:cnext| but use the location list. +|:lprevious| Like |:cprevious| but use the location list. +|:lNext| Like |:cNext| but use the location list. +|:lfirst| Like |:cfirst| but use the location list. +|:lrewind| Like |:crewind| but use the location list. +|:llast| Like |:clast| but use the location list. +|:lnfile| Like |:cnfile| but use the location list. +|:lpfile| Like |:cpfile| but use the location list. +|:lNfile| Like |:cNfile| but use the location list. +|:lolder| Like |:colder| but use the location list. +|:lnewer| Like |:cnewer| but use the location list. +|:lwindow| Like |:cwindow| but use the location list. +|:lopen| Like |:copen| but use the location list. +|:lclose| Like |:cclose| but use the location list. +|:lmake| Like |:make| but use the location list. +|:lgrep| Like |:grep| but use the location list. +|:lgrepadd| Like |:grepadd| but use the location list. +|:lvimgrep| Like |:vimgrep| but use the location list. +|:lvimgrepadd| Like |:vimgrepadd| but use the location list. +|:lhelpgrep| Like |:helpgrep| but use the location list. +|:lcscope| Like |:cscope| but use the location list. +|:ltag| Jump to a tag and add matching tags to a location list. + +|:undojoin| Join a change with the previous undo block. +|:undolist| List the leafs of the undo tree. + +|:earlier| Go back in time for changes in the text. +|:later| Go forward in time for changes in the text. + +|:for| Loop over a |List|. +|:endfor| + +|:lockvar| Lock a variable, prevents it from being changed. +|:unlockvar| Unlock a locked variable. + +|:mkspell| Create a Vim spell file. +|:spellgood| Add a word to the list of good words. +|:spellwrong| Add a word to the list of bad words +|:spelldump| Dump list of good words. +|:spellinfo| Show information about the spell files used. +|:spellrepall| Repeat a spelling correction for the whole buffer. +|:spellundo| Remove a word from list of good and bad words. + +|:mzscheme| Execute MzScheme commands. +|:mzfile| Execute an MzScheme script file. + +|:nbkey| Pass a key to NetBeans for processing. + +|:profile| Commands for Vim script profiling. +|:profdel| Stop profiling for specified items. + +|:smap| Select mode mapping. +|:smapclear| +|:snoremap| +|:sunmap| + +|:xmap| Visual mode mapping, not used for Select mode. +|:xmapclear| +|:xnoremap| +|:xunmap| + +|:smenu| Select mode menu. +|:snoremenu| +|:sunmenu| + +|:xmenu| Visual mode menu, not used for Select mode. +|:xnoremenu| +|:xunmenu| + +|:tabclose| Close the current tab page. +|:tabdo| Perform a command in every tab page. +|:tabedit| Edit a file in a new tab page. +|:tabnew| Open a new tab page. +|:tabfind| Search for a file and open it in a new tab page. +|:tabnext| Go to the next tab page. +|:tabprevious| Go to the previous tab page. +|:tabNext| Go to the previous tab page. +|:tabfirst| Go to the first tab page. +|:tabrewind| Go to the first tab page. +|:tablast| Go to the last tab page. +|:tabmove| Move the current tab page elsewhere. +|:tabonly| Close all other tab pages. +|:tabs| List the tab pages and the windows they contain. + +Ex command modifiers: ~ + +|:keepalt| Do not change the alternate file. + +|:noautocmd| Do not trigger autocommand events. + +|:sandbox| Execute a command in the sandbox. + +|:tab| When opening a new window create a new tab page. + + +Ex command arguments: ~ + +|++bad| Specify what happens with characters that can't be + converted and illegal bytes. (code example by Yasuhiro + Matsumoto) + Also, when a conversion error occurs or illegal bytes + are found include the line number in the error + message. + + +New and extended functions: ~ + +|add()| append an item to a List +|append()| append List of lines to the buffer +|argv()| without an argument return the whole argument list +|browsedir()| dialog to select a directory +|bufnr()| takes an extra argument: create buffer +|byteidx()| index of a character (Ilya Sher) +|call()| call a function with List as arguments +|changenr()| number of current change +|complete()| set matches for Insert mode completion +|complete_add()| add match for 'completefunc' +|complete_check()| check for key pressed, for 'completefunc' +|copy()| make a shallow copy of a List or Dictionary +|count()| count nr of times a value is in a List or Dictionary +|cursor()| also accepts an offset for 'virtualedit', and + the first argument can be a list: [lnum, col, off] +|deepcopy()| make a full copy of a List or Dictionary +|diff_filler()| returns number of filler lines above line {lnum}. +|diff_hlID()| returns the highlight ID for diff mode +|empty()| check if List or Dictionary is empty +|eval()| evaluate {string} and return the result +|extend()| append one List to another or add items from one + Dictionary to another +|feedkeys()| put characters in the typeahead buffer +|filter()| remove selected items from a List or Dictionary +|finddir()| find a directory in 'path' +|findfile()| find a file in 'path' (Johannes Zellner) +|foldtextresult()| the text displayed for a closed fold at line "lnum" +|function()| make a Funcref out of a function name +|garbagecollect()| cleanup unused |Lists| and |Dictionaries| with circular + references +|get()| get an item from a List or Dictionary +|getbufline()| get a list of lines from a specified buffer + (Yegappan Lakshmanan) +|getcmdtype()| return the current command-line type + (Yegappan Lakshmanan) +|getfontname()| get actual font name being used +|getfperm()| get file permission string (Nikolai Weibull) +|getftype()| get type of file (Nikolai Weibull) +|getline()| with second argument: get List with buffer lines +|getloclist()| list of location list items (Yegappan Lakshmanan) +|getpos()| return a list with the position of cursor, mark, etc. +|getqflist()| list of quickfix errors (Yegappan Lakshmanan) +|getreg()| get contents of a register +|gettabwinvar()| get variable from window in specified tab page. +|has_key()| check whether a key appears in a Dictionary +|hasmapto()| check for a mapping to a string +|inputlist()| select an entry from a list +|index()| index of item in List +|inputlist()| prompt the user to make a selection from a list +|insert()| insert an item somewhere in a List +|islocked()| check if a variable is locked +|items()| get List of Dictionary key-value pairs +|join()| join List items into a String +|keys()| get List of Dictionary keys +|len()| number of items in a List or Dictionary +|map()| change each List or Dictionary item +|maparg()| extra argument: use abbreviation +|mapcheck()| extra argument: use abbreviation +|match()| extra argument: count +|matcharg()| return arguments of |:match| command +|matchend()| extra argument: count +|matchlist()| list with match and submatches of a pattern in a string +|matchstr()| extra argument: count +|max()| maximum value in a List or Dictionary +|min()| minimum value in a List or Dictionary +|mkdir()| create a directory +|pathshorten()| reduce directory names to a single character +|printf()| format text +|pumvisible()| check whether the popup menu is displayed +|range()| generate a List with numbers +|readfile()| read a file into a list of lines +|reltime()| get time value, possibly relative +|reltimestr()| turn a time value into a string +|remove()| remove one or more items from a List or Dictionary +|repeat()| repeat "expr" "count" times (Christophe Poucet) +|reverse()| reverse the order of a List +|search()| extra argument: +|searchdecl()| search for declaration of variable +|searchpair()| extra argument: line to stop searching +|searchpairpos()| return a List with the position of the match +|searchpos()| return a List with the position of the match +|setloclist()| modify a location list (Yegappan Lakshmanan) +|setpos()| set cursor or mark to a position +|setqflist()| modify a quickfix list (Yegappan Lakshmanan) +|settabwinvar()| set variable in window of specified tab page +|sort()| sort a List +|soundfold()| get the sound-a-like equivalent of a word +|spellbadword()| get a badly spelled word +|spellsuggest()| get suggestions for correct spelling +|split()| split a String into a List +|str2nr()| convert a string to a number, base 8, 10 or 16 +|stridx()| extra argument: start position +|strridx()| extra argument: start position +|string()| string representation of a List or Dictionary +|system()| extra argument: filters {input} through a shell command +|tabpagebuflist()| List of buffers in a tab page +|tabpagenr()| number of current or last tab page +|tabpagewinnr()| window number in a tab page +|tagfiles()| List with tags file names +|taglist()| get list of matching tags (Yegappan Lakshmanan) +|tr()| translate characters (Ron Aaron) +|values()| get List of Dictionary values +|winnr()| takes an argument: what window to use +|winrestview()| restore the view of the current window +|winsaveview()| save the view of the current window +|writefile()| write a list of lines into a file + +User defined functions can now be loaded automatically from the "autoload" +directory in 'runtimepath'. See |autoload-functions|. + + +New Vim variables: ~ + +|v:insertmode| used for |InsertEnter| and |InsertChange| autocommands +|v:val| item value in a |map()| or |filter()| function +|v:key| item key in a |map()| or |filter()| function +|v:profiling| non-zero after a ":profile start" command +|v:fcs_reason| the reason why |FileChangedShell| was triggered +|v:fcs_choice| what should happen after |FileChangedShell| +|v:beval_bufnr| buffer number for 'balloonexpr' +|v:beval_winnr| window number for 'balloonexpr' +|v:beval_lnum| line number for 'balloonexpr' +|v:beval_col| column number for 'balloonexpr' +|v:beval_text| text under the mouse pointer for 'balloonexpr' +|v:scrollstart| what caused the screen to be scrolled up +|v:swapname| name of the swap file for the |SwapExists| event +|v:swapchoice| what do do for an existing swap file +|v:swapcommand| command to be executed after handling |SwapExists| +|v:char| argument for evaluating 'formatexpr' + + +New autocommand events: ~ + +|ColorScheme| after loading a color scheme + +|CursorHoldI| the user doesn't press a key for a while in Insert mode +|CursorMoved| the cursor was moved in Normal mode +|CursorMovedI| the cursor was moved in Insert mode + +|FileChangedShellPost| after handling a file changed outside of Vim + +|InsertEnter| starting Insert or Replace mode +|InsertChange| going from Insert to Replace mode or back +|InsertLeave| leaving Insert or Replace mode + +|MenuPopup| just before showing popup menu + +|QuickFixCmdPre| before :make, :grep et al. (Ciaran McCreesh) +|QuickFixCmdPost| after :make, :grep et al. (Ciaran McCreesh) + +|SessionLoadPost| after loading a session file. (Yegappan Lakshmanan) + +|ShellCmdPost| after executing a shell command +|ShellFilterPost| after filtering with a shell command + +|SourcePre| before sourcing a Vim script + +|SpellFileMissing| when a spell file can't be found + +|SwapExists| found existing swap file when editing a file + +|TabEnter| just after entering a tab page +|TabLeave| just before leaving a tab page + +|VimResized| after the Vim window size changed (Yakov Lerner) + + +New highlight groups: ~ + +Pmenu Popup menu: normal item |hl-Pmenu| +PmenuSel Popup menu: selected item |hl-PmenuSel| +PmenuThumb Popup menu: scrollbar |hl-PmenuThumb| +PmenuSbar Popup menu: Thumb of the scrollbar |hl-PmenuSbar| + +TabLine tab pages line, inactive label |hl-TabLine| +TabLineSel tab pages line, selected label |hl-TabLineSel| +TabLineFill tab pages line, filler |hl-TabLineFill| + +SpellBad badly spelled word |hl-SpellBad| +SpellCap word with wrong caps |hl-SpellCap| +SpellRare rare word |hl-SpellRare| +SpellLocal word only exists in other region |hl-SpellLocal| + +CursorColumn 'cursorcolumn' |hl-CursorColumn| +CursorLine 'cursorline' |hl-CursorLine| + +MatchParen matching parens |pi_paren.txt| |hl-MatchParen| + + +New items in search patterns: ~ +|/\%d| \%d123 search for character with decimal number +|/\]| [\d123] idem, in a colletion +|/\%o| \%o103 search for character with octal number +|/\]| [\o1o3] idem, in a colletion +|/\%x| \%x1a search for character with 2 pos. hex number +|/\]| [\x1a] idem, in a colletion +|/\%u| \%u12ab search for character with 4 pos. hex number +|/\]| [\u12ab] idem, in a colletion +|/\%U| \%U1234abcd search for character with 8 pos. hex number +|/\]| [\U1234abcd] idem, in a colletion + (The above partly by Ciaran McCreesh) + +|/[[=| [[=a=]] an equivalence class (only for latin1 characters) +|/[[.| [[.a.]] a collation element (only works with single char) + +|/\%'m| \%'m match at mark m +|/\%<'m| \%<'m match before mark m +|/\%>'m| \%>'m match after mark m +|/\%V| \%V match in Visual area + +Nesting |/multi| items no longer is an error when an empty match is possible. + +It is now possible to use \{0}, it matches the preceding atom zero times. Not +useful, just for compatibility. + + +New Syntax/Indent/FTplugin files: ~ + +Moved all the indent settings from the filetype plugin to the indent file. +Implemented b:undo_indent to undo indent settings when setting 'filetype' to a +different value. + +a2ps syntax and ftplugin file. (Nikolai Weibull) +ABAB/4 syntax file. (Marius van Wyk) +alsaconf ftplugin file. (Nikolai Weibull) +AppendMatchGroup ftplugin file. (Dave Silvia) +arch ftplugin file. (Nikolai Weibull) +asterisk and asteriskvm syntax file. (Tilghman Lesher) +BDF ftplugin file. (Nikolai Weibull) +BibTeX indent file. (Dorai Sitaram) +BibTeX Bibliography Style syntax file. (Tim Pope) +BTM ftplugin file. (Bram Moolenaar) +calendar ftplugin file. (Nikolai Weibull) +Changelog indent file. (Nikolai Weibull) +ChordPro syntax file. (Niels Bo Andersen) +Cmake indent and syntax file. (Andy Cedilnik) +conf ftplugin file. (Nikolai Weibull) +context syntax and ftplugin file. (Nikolai Weibull) +CRM114 ftplugin file. (Nikolai Weibull) +cvs RC ftplugin file. (Nikolai Weibull) +D indent file. (Jason Mills) +Debian Sources.list syntax file. (Matthijs Mohlmann) +dictconf and dictdconf syntax, indent and ftplugin files. (Nikolai Weibull) +diff ftplugin file. (Bram Moolenaar) +dircolors ftplugin file. (Nikolai Weibull) +django and htmldjango syntax file. (Dave Hodder) +doxygen syntax file. (Michael Geddes) +elinks ftplugin file. (Nikolai Weibull) +eterm ftplugin file. (Nikolai Weibull) +eviews syntax file. (Vaidotas Zemlys) +fetchmail RC ftplugin file. (Nikolai Weibull) +FlexWiki syntax and ftplugin file. (George Reilly) +Generic indent file. (Dave Silvia) +gpg ftplugin file. (Nikolai Weibull) +gretl syntax file. (Vaidotas Zemlys) +groovy syntax file. (Alessio Pace) +group syntax and ftplugin file. (Nikolai Weibull) +grub ftplugin file. (Nikolai Weibull) +Haskell ftplugin file. (Nikolai Weibull) +help ftplugin file. (Nikolai Weibull) +indent ftplugin file. (Nikolai Weibull) +Javascript ftplugin file. (Bram Moolenaar) +Kconfig ftplugin and syntax file. (Nikolai Weibull) +ld syntax, indent and ftplugin file. (Nikolai Weibull) +lftp ftplugin file. (Nikolai Weibull) +libao config ftplugin file. (Nikolai Weibull) +limits syntax and ftplugin file. (Nikolai Weibull) +Lisp indent file. (Sergey Khorev) +loginaccess and logindefs syntax and ftplugin file. (Nikolai Weibull) +m4 ftplugin file. (Nikolai Weibull) +mailaliases syntax file. (Nikolai Weibull) +mailcap ftplugin file. (Nikolai Weibull) +manconf syntax and ftplugin file. (Nikolai Weibull) +matlab ftplugin file. (Jake Wasserman) +Maxima syntax file. (Robert Dodier) +MGL syntax file. (Gero Kuhlmann) +modconf ftplugin file. (Nikolai Weibull) +mplayer config ftplugin file. (Nikolai Weibull) +Mrxvtrc syntax and ftplugin file. (Gautam Iyer) +MuPAD source syntax, indent and ftplugin. (Dave Silvia) +mutt RC ftplugin file. (Nikolai Weibull) +nanorc syntax and ftplugin file. (Nikolai Weibull) +netrc ftplugin file. (Nikolai Weibull) +pamconf syntax and ftplugin file. (Nikolai Weibull) +Pascal indent file. (Neil Carter) +passwd syntax and ftplugin file. (Nikolai Weibull) +PHP compiler plugin. (Doug Kearns) +pinfo ftplugin file. (Nikolai Weibull) +plaintex syntax and ftplugin files. (Nikolai Weibull, Benji Fisher) +procmail ftplugin file. (Nikolai Weibull) +prolog ftplugin file. (Nikolai Weibull) +protocols syntax and ftplugin file. (Nikolai Weibull) +quake ftplugin file. (Nikolai Weibull) +racc syntax and ftplugin file. (Nikolai Weibull) +rd syntax file. (Johannes Ranke) +readline ftplugin file. (Nikolai Weibull) +rhelp syntax file. (Johannes Ranke) +rnoweb syntax file. (Johannes Ranke) +Relax NG compact ftplugin file. (Nikolai Weibull) +Scheme indent file. (Sergey Khorev) +screen ftplugin file. (Nikolai Weibull) +sensors syntax and ftplugin file. (Nikolai Weibull) +services syntax and ftplugin file. (Nikolai Weibull) +setserial syntax and ftplugin file. (Nikolai Weibull) +sieve syntax and ftplugin file. (Nikolai Weibull) +SiSU syntax file (Ralph Amissah) +Sive syntax file. (Nikolai Weibull) +slp config, reg and spi syntax and ftplugin files. (Nikolai Weibull) +SML indent file. (Saikat Guha) +SQL anywhere syntax and indent file. (David Fishburn) +SQL indent file. +SQL-Informix syntax file. (Dean L Hill) +SQL: Handling of various variants. (David Fishburn) +sshconfig ftplugin file. (Nikolai Weibull) +Stata and SMCL syntax files. (Jeff Pitblado) +sudoers ftplugin file. (Nikolai Weibull) +sysctl syntax and ftplugin file. (Nikolai Weibull) +terminfo ftplugin file. (Nikolai Weibull) +trustees syntax file. (Nima Talebi) +Vera syntax file. (David Eggum) +udev config, permissions and rules syntax and ftplugin files. (Nikolai Weibull) +updatedb syntax and ftplugin file. (Nikolai Weibull) +VHDL indent file (Gerald Lai) +WSML syntax file. (Thomas Haselwanter) +Xdefaults ftplugin file. (Nikolai Weibull) +XFree86 config ftplugin file. (Nikolai Weibull) +xinetd syntax, indent and ftplugin file. (Nikolai Weibull) +xmodmap ftplugin file. (Nikolai Weibull) +Xquery syntax file. (Jean-Marc Vanel) +xsd (XML schema) indent file. +YAML ftplugin file. (Nikolai Weibull) +Zsh ftplugin file. (Nikolai Weibull) + + +New Keymaps: ~ + +Sinhala (Sri Lanka) (Harshula Jayasuriya) +Tamil in TSCII encoding (Yegappan Lakshmanan) +Greek in cp737 (Panagiotis Louridas) +Polish-slash (HS6_06) +Ukrainian-jcuken (Anatoli Sakhnik) +Kana (Edward L. Fo) + + +New message translations: ~ + +The Ukranian messages are now also available in cp1251. +Vietnamese message translations and menu. (Phan Vinh Thinh) + + +Others: ~ + +The |:read| command has the |++edit| argument. This means it will use the +detected 'fileformat', 'fileencoding' and other options for the buffer. This +also fixes the problem that editing a compressed file didn't set these +options. + +The Netbeans interface was updated for Sun Studio 10. The protocol number +goes from 2.2 to 2.3. (Gordon Prieur) + +Mac: When starting up Vim will load the $VIMRUNTIME/macmap.vim script to +define default command-key mappings. (mostly by Benji Fisher) + +Mac: Add the selection type to the clipboard, so that Block, line and +character selections can be used between two Vims. (Eckehard Berns) +Also fixes the problem that setting 'clipboard' to "unnamed" breaks using +"yyp". + +Mac: GUI font selector. (Peter Cucka) + +Mac: support for multi-byte characters. (Da Woon Jung) +This doesn't always work properly. If you see text drawing problems try +switching the 'macatsui' option off. + +Mac: Support the xterm mouse in the non-GUI version. + +Mac: better integration with Xcode. Post a fake mouse-up event after the odoc +event and the drag receive handler to work around a stall after Vim loads a +file. Fixed an off-by-one line number error. (Da Woon Jung) + +Mac: When started from Finder change directory to the file being edited or the +user home directory. + +Added the t_SI and t_EI escape sequences for starting and ending Insert mode. +To be used to set the cursor shape to a bar or a block. No default values, +they are not supported by termcap/terminfo. + +GUI font selector for Motif. (Marcin Dalecki) + +Nicer toolbar buttons for Motif. (Marcin Dalecki) + +Mnemonics for the Motif find/replace dialog. (Marcin Dalecki) + +Included a few improvements for Motif from Marcin Dalecki. Draw label +contents ourselves to make them handle fonts in a way configurable by Vim and +a bit less dependent on the X11 font management. + +Autocommands can be defined local to a buffer. This means they will also work +when the buffer does not have a name or no specific name. See +|autocmd-buflocal|. (Yakov Lerner) + +For xterm most combinations of modifiers with function keys are recognized. +|xterm-modifier-keys| + +When 'verbose' is set the output of ":highlight" will show where a highlight +item was last set. +When 'verbose' is set the output of the ":map", ":abbreviate", ":command", +":function" and ":autocmd" commands will show where it was last defined. +(Yegappan Lakshmanan) + +":function /pattern" lists functions matching the pattern. + +"1gd" can be used like "gd" but ignores matches in a {} block that ends before +the cursor position. Likewise for "1gD" and "gD". + +'scrolljump' can be set to a negative number to scroll a percentage of the +window height. + +The |v:scrollstart| variable has been added to help finding the location in +your script that causes the hit-enter prompt. + +To make it possible to handle the situation that a file is being edited that +is already being edited by another Vim instance, the |SwapExists| event has +been added. The |v:swapname|, |v:swapchoice| and |v:swapcommand| variables +can be used, for example to use the |client-server| functionality to bring the +other Vim to the foreground. +When starting Vim with a "-t tag" argument, there is an existing swapfile and +the user selects "quit" or "abort" then exit Vim. + +Undo now also restores the '< and '> marks. "gv" selects the same area as +before the change and undo. + +When editing a search pattern for a "/" or "?" command and 'incsearch' is set +CTRL-L can be used to add a character from the current match. CTRL-R CTRL-W +will add a word, but exclude the part of the word that was already typed. + +Ruby interface: add line number methods. (Ryan Paul) + +The $MYVIMRC environment variable is set to the first found vimrc file. +The $MYGVIMRC environment variable is set to the first found gvimrc file. + +============================================================================== +IMPROVEMENTS *improvements-7* + +":helpgrep" accepts a language specifier after the pattern: "pat@it". + +Moved the help for printing to a separate help file. It's quite a lot now. + +When doing completion for ":!cmd", ":r !cmd" or ":w !cmd" executable files are +found in $PATH instead of looking for ordinary files in the current directory. + +When ":silent" is used and a backwards range is given for an Ex command the +range is swapped automatically instead of asking if that is OK. + +The pattern matching code was changed from a recursive function to an +iterative mechanism. This avoids out-of-stack errors. State is stored in +allocated memory, running out of memory can always be detected. Allows +matching more complex things, but Vim may seem to hang while doing that. + +Previously some options were always evaluated in the |sandbox|. Now that only +happens when the option was set from a modeline or in secure mode. Applies to +'balloonexpr', 'foldexpr', 'foldtext' and 'includeexpr'. (Sumner Hayes) + +Some commands and expressions could have nasty side effects, such as using +CTRL-R = while editing a search pattern and the expression invokes a function +that jumps to another window. The |textlock| has been added to prevent this +from happening. + +":breakadd here" and ":breakdel here" can be used to set or delete a +breakpoint at the cursor. + +It is now possible to define a function with: > + :exe "func Test()\n ...\n endfunc" + +The tutor was updated to make it simpler to use and text was added to explain +a few more important commands. Used ideas from Gabriel Zachmann. + +Unix: When libcall() fails obtain an error message with dlerror() and display +it. (Johannes Zellner) + +Mac and Cygwin: When editing an existing file make the file name the same case +of the edited file. Thus when typing ":e os_UNIX.c" the file name becomes +"os_unix.c". + +Added "nbsp" in 'listchars'. (David Blanchet) + +Added the "acwrite" value for the 'buftype' option. This is for a buffer that +does not have a name that refers to a file and is written with BufWriteCmd +autocommands. + +For lisp indenting and matching parenthesis: (Sergey Khorev) +- square brackets are recognized properly +- #\(, #\), #\[ and #\] are recognized as character literals +- Lisp line comments (delimited by semicolon) are recognized + +Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher) + +winnr() takes an optional "$" or "#" argument. (Nikolai Weibull, Yegappan +Lakshmanan) + +Added 's' flag to search(): set ' mark if cursor moved. (Yegappan Lakshmanan) +Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull) +Added 'c' flag to search(): accept match at the cursor. +Added 'e' flag to search(): move to end of the match. (Benji Fisher) +Added 'p' flag to search(): return number of sub-pattern. (Benji Fisher) +These also apply to searchpos(), searchpair() and searchpairpos(). + +The search() and searchpair() functions have an extra argument to specify +where to stop searching. Speeds up searches that should not continue too far. + +When uncompressing fails in the gzip plugin, give an error message but don't +delete the raw text. Helps if the file has a .gz extension but is not +actually compressed. (Andrew Pimlott) + +When C, C++ or IDL syntax is used, may additionally load doxygen syntax. +(Michael Geddes) + +Support setting 'filetype' and 'syntax' to "aaa.bbb" for "aaa" plus "bbb" +filetype or syntax. + +The ":registers" command now displays multi-byte characters properly. + +VMS: In the usage message mention that a slash can be used to make a flag +upper case. Add color support to the builtin vt320 terminal codes. +(Zoltan Arpadffy) + +For the '%' item in 'viminfo', allow a number to set a maximum for the number +of buffers. + +For recognizing the file type: When a file looks like a shell script, check +for an "exec" command that starts the tcl interpreter. (suggested by Alexios +Zavras) + +Support conversion between utf-8 and latin9 (iso-8859-15) internally, so that +digraphs still work when iconv is not available. + +When a session file is loaded while editing an unnamed, empty buffer that +buffer is wiped out. Avoids that there is an unused buffer in the buffer +list. + +Win32: When libintl.dll supports bind_textdomain_codeset(), use it. +(NAKADAIRA Yukihiro) + +Win32: Vim was not aware of hard links on NTFS file systems. These are +detected now for when 'backupcopy' is "auto". Also fixed a bogus "file has +been changed since reading it" error for links. + +When foldtext() finds no text after removing the comment leader, use the +second line of the fold. Helps for C-style /* */ comments where the first +line is just "/*". + +When editing the same file from two systems (e.g., Unix and MS-Windows) there +mostly was no warning for an existing swap file, because the name of the +edited file differs (e.g., y:\dir\file vs /home/me/dir/file). Added a flag to +the swap file to indicate it is in the same directory as the edited file. The +used path then doesn't matter and the check for editing the same file is much +more reliable. + +Unix: When editing a file through a symlink the swap file would use the name +of the symlink. Now use the name of the actual file, so that editing the same +file twice is detected. (suggestions by Stefano Zacchiroli and James Vega) + +Client-server communication now supports 'encoding'. When setting 'encoding' +in a Vim server to "utf-8", and using "vim --remote fname" in a console, +"fname" is converted from the console encoding to utf-8. Also allows Vims +with different 'encoding' settings to exchange messages. + +Internal: Changed ga_room into ga_maxlen, so that it doesn't need to be +incremented/decremented each time. + +When a register is empty it is not stored in the viminfo file. + +Removed the tcltags script, it's obsolete. + +":redir @*>>" and ":redir @+>>" append to the clipboard. Better check for +invalid characters after the register name. |:redir| + +":redir => variable" and ":redir =>> variable" write or append to a variable. +(Yegappan Lakshmanan) |:redir| + +":redir @{a-z}>>" appends to register a to z. (Yegappan Lakshmanan) + +The 'verbosefile' option can be used to log messages in a file. Verbose +messages are not displayed then. The "-V{filename}" argument can be used to +log startup messages. + +":let g:" lists global variables. +":let b:" lists buffer-local variables. +":let w:" lists window-local variables. +":let v:" lists Vim variables. + +The stridx() and strridx() functions take a third argument, where to start +searching. (Yegappan Lakshmanan) + +The getreg() function takes an extra argument to be able to get the expression +for the '=' register instead of the result of evaluating it. + +The setline() function can take a List argument to set multiple lines. When +the line number is just below the last line the line is appended. + +g CTRL-G also shows the number of characters if it differs from the number of +bytes. + +Completion for ":debug" and entering an expression for the '=' register. Skip +":" between range and command name. (Peter winters) + +CTRL-Q in Insert mode now works like CTRL-V by default. Previously it was +ignored. + +When "beep" is included in 'debug' a function or script that causes a beep +will result in a message with the source of the error. + +When completing buffer names, match with "\(^\|[\/]\)" instead of "^", so that +":buf stor<Tab>" finds both "include/storage.h" and "storage/main.c". + +To count items (pattern matches) without changing the buffer the 'n' flag has +been added to |:substitute|. See |count-items|. + +In a |:substitute| command the \u, \U, \l and \L items now also work for +multi-byte characters. + +The "screen.linux" $TERM name is recognized to set the default for +'background' to "dark". (Ciaran McCreesh) Also for "cygwin" and "putty". + +The |FileChangedShell| autocommand event can now use the |v:fcs_reason| +variable that specifies what triggered the event. |v:fcs_choice| can be used +to reload the buffer or ask the user what to do. + +Not all modifiers were recognized for xterm function keys. Added the +possibility in term codes to end in ";*X" or "O*X", where X is any character +and the * stands for the modifier code. +Added the <xUp>, <xDown>, <xLeft> and <xRight> keys, to be able to recognize +the two forms that xterm can send their codes in and still handle all possible +modifiers. + +getwinvar() now also works to obtain a buffer-local option from the specified +window. + +Added the "%s" item to 'errorformat'. (Yegappan Lakshmanan) +Added the "%>" item to 'errorformat'. + +For 'errorformat' it was not possible to have a file name that contains the +character that follows after "%f". For example, in "%f:%l:%m" the file name +could not contain ":". Now include the first ":" where the rest of the +pattern matches. In the example a ":" not followed by a line number is +included in the file name. (suggested by Emanuele Giaquinta) + +GTK GUI: use the GTK file dialog when it's available. Mix from patches by +Grahame Bowland and Evan Webb. + +Added ":scriptnames" to bugreport.vim, so that we can see what plugins were +used. + +Win32: If the user changes the setting for the number of lines a scroll wheel +click scrolls it is now used immediately. Previously Vim would need to be +restarted. + +When using @= in an expression the value is expression @= contains. ":let @= += value" can be used to set the register contents. + +A ! can be added to ":popup" to have the popup menu appear at the mouse +pointer position instead of the text cursor. + +The table with encodings has been expanded with many MS-Windows codepages, +such as cp1250 and cp737, so that these can also be used on Unix without +prepending "8bit-". +When an encoding name starts with "microsoft-cp" ignore the "microsoft-" part. + +Added the "customlist" completion argument to a user-defined command. The +user-defined completion function should return the completion candidates as a +Vim List and the returned results are not filtered by Vim. (Yegappan +Lakshmanan) + +Win32: Balloons can have multiple lines if common controls supports it. +(Sergey Khorev) + +For command-line completion the matches for various types of arguments are now +sorted: user commands, variables, syntax names, etc. + +When no locale is set, thus using the "C" locale, Vim will work with latin1 +characters, using its own isupper()/toupper()/etc. functions. + +When using an rxvt terminal emulator guess the value of 'background' using the +COLORFGBG environment variable. (Ciaran McCreesh) + +Also support t_SI and t_EI on Unix with normal features. (Ciaran McCreesh) + +When 'foldcolumn' is one then put as much info in it as possible. This allows +closing a fold with the mouse by clicking on the '-'. + +input() takes an optional completion argument to specify the type of +completion supported for the input. (Yegappan Lakshmanan) + +"dp" works with more than two buffers in diff mode if there is only one where +'modifiable' is set. + +The 'diffopt' option has three new values: "horizontal", "vertical" and +"foldcolumn". + +When the 'include' option contains \zs the file name found is what is being +matched from \zs to the end or \ze. Useful to pass more to 'includeexpr'. + +Loading plugins on startup now supports subdirectories in the plugin +directory. |load-plugins| + +In the foldcolumn always show the '+' for a closed fold, so that it can be +opened easily. It may overwrite another character, esp. if 'foldcolumn' is 1. + +It is now possible to get the W10 message again by setting 'readonly'. Useful +in the FileChangedRO autocommand when checking out the file fails. + +Unix: When open() returns EFBIG give an appropriate message. + +":mksession" sets the SessionLoad variable to notify plugins. A modeline is +added to the session file to set 'filetype' to "vim". + +In the ATTENTION prompt put the "Delete it" choice before "Quit" to make it +more logical. (Robert Webb) + +When appending to a file while the buffer has no name the name of the appended +file would be used for the current buffer. But the buffer contents is +actually different from the file content. Don't set the file name, unless the +'P' flag is present in 'cpoptions'. + +When starting to edit a new file and the directory for the file doesn't exist +then Vim will report "[New DIRECTORY]" instead of "[New File] to give the user +a hint that something might be wrong. + +Win32: Preserve the hidden attribute of the viminfo file. + +In Insert mode CTRL-A didn't keep the last inserted text when using CTRL-O and +then a cursor key. Now keep the previously inserted text if nothing is +inserted after the CTRL-O. Allows using CTRL-O commands to move the cursor +without losing the last inserted text. + +The exists() function now supports checking for autocmd group definition +and for supported autocommand events. (Yegappan Lakshmanan) + +Allow using ":global" in the sandbox, it doesn't do anything harmful by +itself. + +":saveas asdf.c" will set 'filetype' to c when it's empty. Also for ":w +asdf.c" when it sets the filename for the buffer. + +Insert mode completion for whole lines now also searches unloaded buffers. + +The colortest.vim script can now be invoked directly with ":source" or +":runtime syntax/colortest.vim". + +The 'statusline' option can be local to the window, so that each window can +have a different value. (partly by Yegappan Lakshmanan) + +The 'statusline' option and other options that support the same format can now +use these new features: +- When it starts with "%!" the value is first evaluated as an expression + before parsing the value. +- "%#HLname#" can be used to start highlighting with HLname. + +When 'statusline' is set to something that causes an error message then it is +made empty to avoid an endless redraw loop. Also for other options, such at +'tabline' and 'titlestring'. ":verbose set statusline" will mention that it +was set in an error handler. + +When there are several matching tags, the ":tag <name>" and CTRL-] commands +jump to the [count] matching tag. (Yegappan Lakshmanan) + +Win32: In the batch files generated by the install program, use $VIMRUNTIME or +$VIM if it's set. Example provided by Mathias Michaelis. +Also create a vimtutor.bat batch file. + +The 'balloonexpr' option is now |global-local|. + +The system() function now runs in cooked mode, thus can be interrupted by +CTRL-C. + +============================================================================== +COMPILE TIME CHANGES *compile-changes-7* + +Dropped the support for the BeOS and Amiga GUI. They were not maintained and +probably didn't work. If you want to work on this: get the Vim 6.x version +and merge it back in. + +When running the tests and one of them fails to produce "test.out" the +following tests are still executed. This helps when running out of memory. + +When compiling with EXITFREE defined and the ccmalloc library it is possible +to detect memory leaks. Some memory will always reported as leaked, such as +allocated by X11 library functions and the memory allocated in alloc_cmdbuff() +to store the ":quit" command. + +Moved the code for printing to src/hardcopy.c. + +Moved some code from main() to separate functions to make it easier to see +what is being done. Using a structure to avoid a lot of arguments to the +functions. + +Moved unix_expandpath() to misc1.c, so that it can also be used by os_mac.c +without copying the code. + +--- Mac --- + +"make" now creates the Vim.app directory and "make install" copies it to its +final destination. (Raf) + +Put the runtime directory not directly in Vim.app but in +Vim.app/Contents/Resources/vim, so that it's according to Mac specs. + +Made it possible to compile with Motif, Athena or GTK without tricks and still +being able to use the MacRoman conversion. Added the os_mac_conv.c file. + +When running "make install" the runtime files are installed as for Unix. +Avoids that too many files are copied. When running "make" a link to the +runtime files is created to avoid a recursive copy that takes much time. + +Configure will attempt to build Vim for both Intel and PowerPC. The +--with-mac-arch configure argument can change it. + +--- Win32 --- + +The Make_mvc.mak file was adjusted to work with the latest MS compilers, +including the free version of Visual Studio 2005. (George Reilly) + +INSTALLpc.txt was updated for the recent changes. (George Reilly) + +The distributed executable is now produced with the free Visual C++ Toolkit +2003 and other free SDK chunks. msvcsetup.bat was added to support this. + +Also generate the .pdb file that can be used to generate a useful crash report +on MS-Windows. (George Reilly) + +============================================================================== +BUG FIXES *bug-fixes-7* + +When using PostScript printing on MS-DOS the default 'printexpr' used "lpr" +instead of "copy". When 'printdevice' was empty the copy command did not +work. Use "LPT1" then. + +The GTK font dialog uses a font size zero when the font name doesn't include a +size. Use a default size of 10. + +This example in the documentation didn't work: + :e `=foo . ".c" ` +Skip over the expression in `=expr` when looking for comments, |, % and #. + +When ":helpgrep" doesn't find anything there is no error message. + +"L" and "H" did not take closed folds into account. + +Win32: The "-P title" argument stopped at the first title that matched, even +when it doesn't support MDI. + +Mac GUI: CTRL-^ and CTRL-@ did not work. + +"2daw" on "word." at the end of a line didn't include the preceding white +space. + +Win32: Using FindExecutable() doesn't work to find a program. Use +SearchPath() instead. For executable() use $PATHEXT when the program searched +for doesn't have an extension. + +When 'virtualedit' is set, moving the cursor up after appending a character +may move it to a different column. Was caused by auto-formatting moving the +cursor and not putting it back where it was. + +When indent was added automatically and then moving the cursor, the indent was +not deleted (like when pressing ESC). The "I" flag in 'cpoptions' can be used +to make it work the old way. + +When opening a command-line window, 'textwidth' gets set to 78 by the Vim +filetype plugin. Reset 'textwidth' to 0 to avoid lines are broken. + +After using cursor(line, col) moving up/down doesn't keep the same column. + +Win32: Borland C before 5.5 requires using ".u." for LowPart and HighPart +fields. (Walter Briscoe) + +On Sinix SYS_NMLN isn't always defined. Define it ourselves. (Cristiano De +Michele) + +Printing with PostScript may keep the printer waiting for more. Append a +CTRL-D to the printer output. (Mike Williams) + +When converting a string with a hex or octal number the leading '-' was +ignored. ":echo '-05' + 0" resulted in 5 instead of -5. + +Using "@:" to repeat a command line didn't work when it contains control +characters. Also remove "'<,'>" when in Visual mode to avoid that it appears +twice. + +When using file completion for a user command, it would not expand environment +variables like for a regular command with a file argument. + +'cindent': When the argument of a #define looks like a C++ class the next line +is indented too much. + +When 'comments' includes multi-byte characters inserting the middle part and +alignment may go wrong. 'cindent' also suffers from this for right-aligned +items. + +Win32: when 'encoding' is set to "utf-8" getenv() still returns strings in the +active codepage. Convert to utf-8. Also for $HOME. + +The default for 'helplang' was "zh" for both "zh_cn" and "zh_tw". Now use +"cn" or "tw" as intended. + +When 'bin' is set and 'eol' is not set then line2byte() added the line break +after the last line while it's not there. + +Using foldlevel() in a WinEnter autocommand may not work. Noticed when +resizing the GUI shell upon startup. + +Python: Using buffer.append(f.readlines()) didn't work. Allow appending a +string with a trailing newline. The newline is ignored. + +When using the ":saveas f2" command for buffer "f1", the Buffers menu would +contain "f2" twice, one of them leading to "f1". Also trigger the BufFilePre +and BufFilePost events for the alternate buffer that gets the old name. + +strridx() did not work well when the needle is empty. (Ciaran McCreesh) + +GTK: Avoid a potential hang in gui_mch_wait_for_chars() when input arrives +just before it is invoked + +VMS: Occasionally CR characters were inserted in the file. Expansion of +environment variables was not correct. (Zoltan Arpadffy) + +UTF-8: When 'delcombine' is set "dw" only deleted the last combining character +from the first character of the word. + +When using ":sball" in an autocommand only the filetype in one buffer was +detected. Reset did_filetype in enter_buffer(). + +When using ":argdo" and the window already was at the first argument index, +but not actually editing it, the current buffer would be used instead. + +When ":next dir/*" includes many matches, adding the names to the argument +list may take an awful lot of time and can't be interrupted. Allow +interrupting this. + +When editing a file that was already loaded in a buffer, modelines were not +used. Now window-local options in the modeline are set. Buffer-local options +and global options remain unmodified. + +Win32: When 'encoding' is set to "utf-8" in the vimrc file, files from the +command line with non-ASCII characters are not used correctly. Recode the +file names when 'encoding' is set, using the Unicode command line. + +Win32 console: When the default for 'encoding' ends up to be "latin1", the +default value of 'isprint' was wrong. + +When an error message is given while waiting for a character (e.g., when an +xterm reports the number of colors), the hit-enter prompt overwrote the last +line. Don't reset msg_didout in normal_cmd() for K_IGNORE. + +Mac GUI: Shift-Tab didn't work. + +When defining tooltip text, don't translate terminal codes, since it's not +going to be used like a command. + +GTK 2: Check the tooltip text for valid utf-8 characters to avoid getting a +GTK error. Invalid characters may appear when 'encoding' is changed. + +GTK 2: Add a safety check for invalid utf-8 sequences, they can crash pango. + +Win32: When 'encoding' is changed while starting up, use the Unicode command +line to convert the file arguments to 'encoding'. Both for the GUI and the +console version. + +Win32 GUI: latin9 text (iso-8859-15) was not displayed correctly, because +there is no codepage for latin9. Do our own conversion from latin9 to UCS2. + +When two versions of GTK+ 2 are installed it was possible to use the header +files from one and the library from the other. Use GTK_LIBDIR to put the +directory for the library early in the link flags. + +With the GUI find/replace dialog a replace only worked if the pattern was +literal text. Now it works for any pattern. + +When 'equalalways' is set and 'eadirection' is "hor", ":quit" would still +cause equalizing window heights in the vertical direction. + +When ":emenu" is used in a startup script the command was put in the typeahead +buffer, causing a prompt for the crypt key to be messed up. + +Mac OS/X: The default for 'isprint' included characters 128-160, causes +problems for Terminal.app. + +When a syntax item with "containedin" is used, it may match in the start or +end of a region with a matchgroup, while this doesn't happen for a "contains" +argument. + +When a transparent syntax items matches in another item where the highlighting +has already stopped (because of a he= argument), the highlighting would come +back. + +When cscope is used to set the quickfix error list, it didn't get set if there +was only one match. (Sergey Khorev) + +When 'confirm' is set and using ":bdel" in a modified buffer, then selecting +"cancel", would still give an error message. + +The PopUp menu items that started Visual mode didn't work when not in Normal +mode. Switching between selecting a word and a line was not possible. + +Win32: The keypad decimal point always resulted in a '.', while on some +keyboards it's a ','. Use MapVirtualKey(VK_DECIMAL, 2). + +Removed unused function DisplayCompStringOpaque() from gui_w32.c + +In Visual mode there is not always an indication whether the line break is +selected or not. Highlight the character after the line when the line break +is included, e.g., after "v$o". + +GTK: The <F10> key can't be mapped, it selects the menu. Disable that with a +GTK setting and do select the menu when <F10> isn't mapped. (David Necas) + +After "Y" '[ and '] were not at start/end of the yanked text. + +When a telnet connection is dropped Vim preserves files and exits. While +doing that a SIGHUP may arrive and disturb us, thus ignore it. (Scott +Anderson) Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to +handle. Added handle_signal(). + +When completing a file name on the command line backslashes are required for +white space. Was only done for a space, not for a Tab. + +When configure could not find a terminal library, compiling continued for a +long time before reporting the problem. Added a configure check for tgetent() +being found in a library. + +When the cursor is on the first char of the last line a ":g/pat/s///" command +may cause the cursor to be displayed below the text. + +Win32: Editing a file with non-ASCII characters doesn't work when 'encoding' +is "utf-8". use _wfullpath() instead of _fullpath(). (Yu-sung Moon) + +When recovering the 'fileformat' and 'fileencoding' were taken from the +original file instead of from the swapfile. When the file didn't exist, was +empty or the option was changed (e.g., with ":e ++fenc=cp123 file") it could +be wrong. Now store 'fileformat' and 'fileencoding' in the swapfile and use +the values when recovering. + +":bufdo g/something/p" overwrites each last printed text line with the file +message for the next buffer. Temporarily clear 'shortmess' to avoid that. + +Win32: Cannot edit a file starting with # with --remote. Do escape % and # +when building the ":drop" command. + +A comment or | just after a expression-backtick argument was not recognized. +E.g. in :e `="foo"`"comment. + +"(" does not stop at an empty sentence (single dot and white space) while ")" +does. Also breaks "das" on that dot. + +When doing "yy" with the cursor on a TAB the ruler could be wrong and "k" +moved the cursor to another column. + +When 'commentstring' is '"%s' and there is a double quote in the line a double +quote before the fold marker isn't removed in the text displayed for a closed +fold. + +In Visual mode, when 'bin' and 'eol' set, g CTRL-G counted the last line +break, resulting in "selected 202 of 201 bytes". + +Motif: fonts were not used for dialog components. (Marcin Dalecki) + +Motif: After using a toolbar button the keyboard focus would be on the toolbar +(Lesstif problem). (Marcin Dalecki) + +When using "y<C-V>`x" where mark x is in the first column, the last line was +not included. + +Not all test scripts work properly on MS-Windows when checked out from CVS. +Use a Vim command to fix all fileformats to dos before executing the tests. + +When using ":new" and the file fits in the window, lines could still be above +the window. Now remove empty lines instead of keeping the relative position. + +Cmdline completion didn't work after ":let var1 var<Tab>". + +When using ":startinsert" or ":startreplace" when already in Insert mode +(possible when using CTRL-R =), pressing Esc would directly restart Insert +mode. (Peter Winters) + +"2daw" didn't work at end of file if the last word is a single character. + +Completion for ":next a'<Tab>" put a backslash before single quote, but it was +not removed when editing a file. Now halve backslashes in save_patterns(). +Also fix expanding a file name with the shell that contains "\'". + +When doing "1,6d|put" only "fewer lines" was reported. Now a following "more +lines" overwrites the message. + +Configure could not handle "-Dfoo=long\ long" in the TCL config output. + +When searching backwards, using a pattern that matches a newline and uses \zs +after that, didn't find a match. Could also get a hang or end up in the right +column in the wrong line. + +When $LANG is "sl" for slovenian, the slovak menu was used, since "slovak" +starts with "sl". + +When 'paste' is set in the GUI the Paste toolbar button doesn't work. Clear +'paste' when starting the GUI. + +A message about a wrong viminfo line included the trailing NL. + +When 'paste' is set in the GUI the toolbar button doesn't work in Insert mode. +Use ":exe" in menu.vim to avoid duplicating the commands, instead of using a +mapping. + +Treat "mlterm" as an xterm-like terminal. (Seiichi Sato) + +":z.4" and ":z=4" didn't work Vi compatible. + +When sourcing a file, editing it and sourcing it again, it could appear twice +in ":scriptnames" and get a new <SID>, because the inode has changed. + +When $SHELL is set but empty the 'shell' option would be empty. Don't use an +empty $SHELL value. + +A command "w! file" in .vimrc or $EXINIT didn't work. Now it writes an empty +file. + +When a CTRL-F command at the end of the file failed, the cursor was still +moved to the start of the line. Now it remains where it is. + +When using ":s" or "&" to repeat the last substitute and "$" was used to put +the cursor in the last column, put the cursor in the last column again. This +is Vi compatible. + +Vim is not fully POSIX compliant but sticks with traditional Vi behavior. +Added a few flags in 'cpoptions' to behave the POSIX way when wanted. The +$VIM_POSIX environment variable is checked to set the default. + +Appending to a register didn't insert a line break like Vi. Added the '>' +flag to 'cpoptions' for this. + +Using "I" in a line with only blanks appended to the line. This is not Vi +compatible. Added the 'H' flag in 'coptions' for this. + +When joining multiple lines the cursor would be at the last joint, but Vi +leaves it at the position where "J" would put it. Added the 'q' flag in +'cpoptions' for this. + +Autoindent didn't work for ":insert" and ":append". + +Using ":append" in an empty buffer kept the dummy line. Now it's deleted to +be Vi compatible. + +When reading commands from a file and stdout goes to a terminal, would still +request the xterm version. Vim can't read it, thus the output went to the +shell and caused trouble there. + +When redirecting to a register with an invalid name the redirection would +still be done (after an error message). Now reset "redir_reg". (Yegappan +Lakshmanan) + +It was not possible to use a NL after a backslash in Ex mode. This is +sometimes used to feed multiple lines to a shell command. + +When 'cmdheight' is set to 2 in .vimrc and the GUI uses the number of lines +from the terminal we actually get 3 lines for the cmdline in gvim. + +When setting $HOME allocated memory would leak. + +Win32: bold characters may sometimes write in another character cell. Use +unicodepdy[] as for UTF-8. (Taro Muraoka) + +":w fname" didn't work for files with 'buftype' set to "nofile". + +The method used to locate user commands for completion differed from when they +are executed. Abiguous command names were not completed properly. + +Incremental search may cause a crash when there is a custom statusline that +indirectly invokes ":normal". + +Diff mode failed when $DIFF_OPTIONS was set in the environment. Unset it +before invoking "diff". + +Completion didn't work after ":argdo", ":windo" and ":bufdo". Also for ":set +&l:opt" and ":set &g:opt". (Peter Winters) + +When setting 'ttymouse' to "dec" in an xterm that supports the DEC mouse +locator it doesn't work. Now switch off the mouse before selecting another +mouse model. + +When the CursorHold event is triggered and the commands peek for typed +characters the typeahead buffer may be messed up, e.g., when a mouse-up event +is received. Avoid invoking the autocommands from the function waiting for a +character, let it put K_CURSORHOLD in the input buffer. + +Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like +":1argadd *". Same for ":argdelete" and ":argedit". + +Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US". + +Added backslashes before dashes in the vim.1 manual page to make the appear as +real dashes. (Pierr Habouzit) + +Where "gq" left the cursor depended on the value of 'formatprg'. Now "gq" +always leaves the cursor at the last line of the formatted text. + +When editing a compressed file, such as "changelog.Debian.gz" file, filetype +detection may try to check the contents of the file while it's still +compressed. Skip setting 'filetype' for compressed files until they have been +decompressed. Required for patterns that end in a "*". + +Starting with an argument "+cmd" or "-S script" causes the cursor the be moved +to the first line. That breaks a BufReadPost autocommand that uses g`". +Don't move the cursor if it's somewhere past the first line. + +"gg=G" while 'modifiable' is off was uninterruptable. + +When 'encoding' is "sjis" inserting CTRL-V u d800 a few times causes a crash. +Don't insert a DBCS character with a NUL second byte. + +In Insert mode CTRL-O <Home> didn't move the cursor. Made "ins_at_eol" global +and reset it in nv_home(). + +Wildcard expansion failed: ":w /tmp/$$.`echo test`". Don't put quotes around +spaces inside backticks. + +After this sequence of commands: Y V p gv: the wrong line is selected. Now +let "gv" select the text that was put, since the original text is deleted. +This should be the most useful thing to do. + +":sleep 100u" sleeps for 100 seconds, not 100 usec as one might expect. Give +an error message when the argument isn't recognized. + +In gui_mch_draw_string() in gui_w32.c "unibuflen" wasn't static, resulting in +reallocating the buffer every time. (Alexei Alexandrov) + +When using a Python "atexit" function it was not invoked when Vim exits. Now +call Py_Finalize() for that. (Ugo Di Girolamo) +This breaks the thread stuff though, fixed by Ugo. + +GTK GUI: using a .vimrc with "set cmdheight=2 lines=43" and ":split" right +after startup, the window layout is messed up. (Michael Schaap) Added +win_new_shellsize() call in gui_init() to fix the topframe size. + +Trick to get ...MOUSE_NM not used when there are vertical splits. Now pass +column -1 for the left most window and add MOUSE_COLOFF for others. Limits +mouse column to 10000. + +searchpair() may hang when the end pattern has "\zs" at the end. Check that +we find the same position again and advance one character. + +When in diff mode and making a change that causes the "changed" highlighting +to disappear or reappear, it was still highlighted in another window. + +When a ":next" command fails because the user selects "Abort" at the ATTENTION +prompt the argument index was advanced anyway. + +When "~" is in 'iskeyword' the "gd" doesn't work, it's used for the previous +substitute pattern. Put "\V" in the pattern to avoid that. + +Use of sprintf() sometimes didn't check properly for buffer overflow. Also +when using smsg(). Included code for snprintf() to avoid having to do size +checks where invoking them + +":help \=<Tab>" didn't find "sub-replace-\=". Wild menu for help tags didn't +show backslashes. ":he :s\=" didn't work. + +When reading an errorfile "~/" in a file name was not expanded. + +GTK GUI: When adding a scrollbar (e.g. when using ":vsplit") in a script or +removing it the window size may change. GTK sends us resize events when we +change the window size ourselves, but they may come at an unexpected moment. +Peek for a character to get any window resize events and fix 'columns' and +'lines' to undo this. + +When using the GTK plug mechanism, resizing and focus was not working +properly. (Neil Bird) + +After deleting files from the argument list a session file generated with +":mksession" may contain invalid ":next" commands. + +When 'shortmess' is empty and 'keymap' set to accents, in Insert mode CTRL-N +may cause the hit-enter prompt. Typing 'a then didn't result in the accented +character. Put the character typed at the prompt back in the typeahead buffer +so that mapping is done in the right mode. + +setbufvar() and setwinvar() did not give error messages. + +It was possible to set a variable with an illegal name, e.g. with setbufvar(). +It was possible to define a function with illegal name, e.t. ":func F{-1}()" + +CTRL-W F and "gf" didn't use the same method to get the file name. + +When reporting a conversion error the line number of the last error could be +given. Now report the first encountered error. + +When using ":e ++enc=name file" and iconv() was used for conversion an error +caused a fall-back to no conversion. Now replace a character with '?' and +continue. + +When opening a new buffer the local value of 'bomb' was not initialized from +the global value. + +Win32: When using the "Edit with Vim" entry the file name was limited to about +200 characters. + +When using command line completion for ":e *foo" and the file "+foo" exists +the resulting command ":e +foo" doesn't work. Now insert a backslash: ":e +\+foo". + +When the translation of "-- More --" was not 10 characters long the following +message would be in the wrong position. + +At the more-prompt the last character in the last line wasn't drawn. + +When deleting non-existing text while 'virtualedit' is set the '[ and '] marks +were not set. + +Win32: Could not use "**/" in 'path', it had to be "**\". + +The search pattern "\n" did not match at the end of the last line. + +Searching for a pattern backwards, starting on the NUL at the end of the line +and 'encoding' is "utf-8" would match the pattern just before it incorrectly. +Affected searchpair('/\*', '', '\*/'). + +For the Find/Replace dialog it was possible that not finding the text resulted +in an error message while redrawing, which cleared the syntax highlighting +while it was being used, resulting in a crash. Now don't clear syntax +highlighting, disable it with b_syn_error. + +Win32: Combining UTF-8 characters were drawn on the previous character. +Could be noticed with a Thai font. + +Output of ":function" could leave some of the typed text behind. (Yegappan +Lakshmanan) + +When the command line history has only a few lines the command line window +would be opened with these lines above the first window line. + +When using a command line window for search strings ":qa" would result in +searching for "qa" instead of quitting all windows. + +GUI: When scrolling with the scrollbar and there is a line that doesn't fit +redrawing may fail. Make sure w_skipcol is valid before redrawing. + +Limit the values of 'columns' and 'lines' to avoid an overflow in Rows * +Columns. Fixed bad effects when running out of memory (command line would be +reversed, ":qa!" resulted in ":!aq"). + +Motif: "gvim -iconic" opened the window anyway. (David Harrison) + +There is a tiny chance that a symlink gets created between checking for an +existing file and creating a file. Use the O_NOFOLLOW for open() if it's +available. + +In an empty line "ix<CTRL-O>0" moved the cursor to after the line instead of +sticking to the first column. + +When using ":wq" and a BufWriteCmd autocmd uses inputsecret() the text was +echoed anyway. Set terminal to raw mode in getcmdline(). + +Unix: ":w a;b~c" caused an error in expanding wildcards. + +When appending to a file with ":w >>fname" in a buffer without a name, causing +the buffer to use "fname", the modified flag was reset. + +When appending to to current file the "not edited" flag would be reset. +":w" would overwrite the file accidentally. + +Unix: When filtering text with an external command Vim would still read input, +causing text typed for the command (e.g., a password) to be eaten and echoed. +Don't read input when the terminal is in cooked mode. + +The Cygwin version of xxd used CR/LF line separators. (Corinna Vinschen) + +Unix: When filtering text through a shell command some resulting text may be +dropped. Now after detecting that the child has exited try reading some more +of its output. + +When inside input(), using "CTRL-R =" and the expression throws an exception +the command line was not abandoned but it wasn't used either. Now abandon +typing the command line. + +'delcombine' was also used in Visual and Select mode and for commands like +"cl". That was illogical and has been disabled. + +When recording while a CursorHold autocommand was defined special keys would +appear in the register. Now the CursorHold event is not triggered while +recording. + +Unix: the src/configure script used ${srcdir-.}, not all shells understand +that. Use ${srcdir:-.} instead. + +When editing file "a" which is a symlink to file "b" that doesn't exist, +writing file "a" to create "b" and then ":split b" resulted in two buffers on +the same file with two different swapfile names. Now set the inode in the +buffer when creating a new file. + +When 'esckeys' is not set don't send the xterm code to request the version +string, because it may cause trouble in Insert mode. + +When evaluating an expression for CTRL-R = on the command line it was possible +to call a function that opens a new window, resulting in errors for +incremental search, and many other nasty things were possible. Now use the +|textlock| to disallow changing the buffer or jumping to another window +to protect from unexpected behavior. Same for CTRL-\ e. + +"d(" deleted the character under the cursor, while the documentation specified +an exclusive motion. Vi also doesn't delete the character under the cursor. + +Shift-Insert in Insert mode could put the cursor before the last character +when it just fits in the window. In coladvance() don't stop at the window +edge when filling with spaces and when in Insert mode. In mswin.vim avoid +getting a beep from the "l" command. + +Win32 GUI: When Alt-F4 is used to close the window and Cancel is selected in +the dialog then Vim would insert <M-F4> in the text. Now it's ignored. + +When ":silent! {cmd}" caused the swap file dialog, which isn't displayed, +there would still be a hit-enter prompt. + +Requesting the termresponse (|t_RV|) early may cause problems with "-c" +arguments that invoke an external command or even "-c quit". Postpone it +until after executing "-c" arguments. + +When typing in Insert mode so that a new line is started, using CTRL-G u to +break undo and start a new change, then joining the lines with <BS> caused +undo info to be missing. Now reset the insertion start point. + +Syntax HL: When a region start match has a matchgroup and an offset that +happens to be after the end of the line then it continued in the next line and +stopped at the region end match, making the region continue after that. +Now check for the column being past the end of the line in syn_add_end_off(). + +When changing a file, setting 'swapfile' off and then on again, making another +change and killing Vim, then some blocks may be missing from the swapfile. +When 'swapfile' is switched back on mark all blocks in the swapfile as dirty. +Added mf_set_dirty(). + +Expanding wildcards in a command like ":e aap;<>!" didn't work. Put +backslashes before characters that are special to the shell. (Adri Verhoef) + +A CursorHold autocommand would cause a message to be cleared. Don't show the +special key for the event for 'showcmd'. + +When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r +!cmd foo<Tab>" also escape characters that are special for the shell: +"!;&()<>". + +When the name of the buffer was set by a ":r fname" command |cpo-f| no +autocommands were triggered to notify about the change in the buffer list. + +In the quickfix buffer 'bufhidden' was set to "delete", which caused closing +the quickfix window to leave an unlisted "No Name" buffer behind every time. + +Win32: when using two screens of different size, setting 'lines' to a large +value didn't fill the whole screen. (SungHyun Nam) + +Win32 installer: The generated _vimrc contained an absolute path to diff.exe. +After upgrading it becomes invalid. Now use $VIMRUNTIME instead. + +The command line was cleared to often when 'showmode' was set and ":silent +normal vy" was used. Don't clear the command line unless the mode was +actually displayed. Added the "mode_displayed" variable. + +The "load session" toolbar item could not handle a space or other special +characters in v:this_session. + +":set sta ts=8 sw=4 sts=2" deleted 4 spaces halfway a line instead of 2. + +In a multi-byte file the foldmarker could be recognized in the trail byte. +(Taro Muraoka) + +Pasting with CTRL-V and menu didn't work properly when some commands are +mapped. Use ":normal!" instead of ":normal". (Tony Apuzzo) + +Crashed when expanding a file name argument in backticks. + +In some situations the menu and scrollbar didn't work, when the value contains +a CSI byte. (Yukihiro Nakadaira) + +GTK GUI: When drawing the balloon focus changes and we might get a key release +event that removed the balloon again. Ignore the key release event. + +'titleold' was included in ":mkexrc" and ":mksession" files. + +":set background&" didn't use the same logic as was used when starting up. + +When "umask" is set such that nothing is writable then the viminfo file would +be written without write permission. (Julian Bridle) + +Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the +other diff'ed window. + +When editing in an xterm with a different number of colors than expected the +screen would be cleared and redrawn, causing the message about the edited file +to be cleared. Now set "keep_msg" to redraw the last message. + +For a color terminal: When the Normal HL uses bold, possibly to make the color +lighter, and another HL group specifies a color it might become light as well. +Now reset bold if a HL group doesn't specify bold itself. + +When using 256 color xterm the color 255 would show up as color 0. Use a +short instead of a char to store the color number. + +ml_get errors when searching for "\n\zs" in an empty file. + +When selecting a block and using "$" to select until the end of every line and +not highlighting the character under the cursor the first character of the +block could be unhighlighted. + +When counting words for the Visual block area and using "$" to select until +the end of every line only up to the length of the last line was counted. + +"dip" in trailing empty lines left one empty line behind. + +The script ID was only remembered globally for each option. When a buffer- or +window-local option was set the same "last set" location was changed for all +buffers and windows. Now remember the script ID for each local option +separately. + +GUI: The "Replace All" button didn't handle backslashes in the replacement in +the same way as "Replace". Escape backslashes so that they are taken +literally. + +When using Select mode from Insert mode and typing a key, causing lines to be +deleted and a message displayed, delayed the effect of inserting the key. +Now overwrite the message without delay. + +When 'whichwrap' includes "l" then "dl" and "yl" on a single letter line +worked differently. Now recognize all operators when using "l" at the end of +a line. + +GTK GUI: when the font selector returned a font name with a comma in it then +it would be handled like two font names. Now put a backslash before the +comma. + +MS-DOS, Win32: When 'encoding' defaults to "latin1" then the value for +'iskeyword' was still for CPxxx. And when 'nocompatible' was set 'isprint' +would also be the wrong value. + +When a command was defined not to take arguments and no '|' no warning message +would be given for using a '|'. Also with ":loadkeymap". + +Motif: When using a fontset and 'encoding' is "utf-8" and sizeof(wchar_t) != +sizeof(XChar2b) then display was wrong. (Yukihiro Nakadaira) + +":all" always set the current window to the first window, even when it +contains a buffer that is not in the argument list (can't be closed because it +is modified). Now go to the window that has the first item of the argument +list. + +GUI: To avoid left-over pixels from bold text all characters after a character +with special attributes were redrawn. Now only do this for characters that +actually are bold. Speeds up displaying considerably. + +When only highlighting changes and the text is scrolled at the same time +everything is redraw instead of using a scroll and updating the changed text. +E.g., when using ":match" to highlight a paren that the cursor landed on. +Added SOME_VALID: Redraw the whole window but also try to scroll to minimize +redrawing. + +Win32: When using Korean IME making it active didn't work properly. (Moon, +Yu-sung, 2005 March 21) + +Ruby interface: when inserting/deleting lines display wasn't updated. (Ryan +Paul) + +--- fixes since Vim 7.0b --- + +Getting the GCC version in configure didn't work with Solaris sed. First +strip any "darwin." and then get the version number. + +The "autoload" directory was missing from the self-installing executable for +MS-Windows. + +The MS-Windows install program would find "vimtutor.bat" in the install +directory. After changing to "c:" also change to "\" to avoid looking in the +install directory. + +To make the 16 bit DOS version compile exclude not used highlight +initializations and build a tiny instead of small version. + +finddir() and findfile() accept a negative cound and return a List then. + +The Python indent file contained a few debugging statements, removed. + +Expanding {} for a function name, resulting in a name starting with "s:" was +not handled correctly. + +Spelling: renamed COMPOUNDMAX to COMPOUNDWORDMAX. Added several items to be +able to handle the new Hungarian dictionary. + +Mac: Default to building for the current platform only, that is much faster +than building a universal binary. Also, using Perl/Python/etc. only works for +the current platform. + +The time on undo messages disappeared for someone. Using %T for strftime() +apparently doesn't work everywhere. Use %H:%M:%S instead. + +Typing BS at the "z=" prompt removed the prompt. + +--- fixes and changes since Vim 7.0c --- + +When jumping to another tab page the Vim window size was always set, even when +nothing in the layout changed. + +Win32 GUI tab pages line wasn't always enabled. Do a proper check for the +compiler version. + +Win32: When switching between tab pages the Vim window was moved when part of +it was outside of the screen. Now only do that in the direction of a size +change. + +Win32: added menu to GUI tab pages line. (Yegappan Lakshmanan) + +Mac: Added document icons. (Benji Fisher) + +Insert mode completion: Using Enter to accept the current match causes +confusion. Use CTRL-Y instead. Also, use CTRL-E to go back to the typed +text. + +GUI: When there are left and righ scrollbars, ":tabedit" kept them instead of +using the one that isn't needed. + +Using "gP" to replace al the text could leave the cursor below the last line, +causing ml_get errors. + +When 'cursorline' is set don't use the highlighting when Visual mode is +active, otherwise it's difficult to see the selected area. + +The matchparen plugin restricts the search to 100 lines, to avoid a long delay +when there are closed folds. + +Sometimes using CTRL-X s to list spelling suggestions used text from another +line. + +Win32: Set the default for 'isprint' back to the wrong default "@,~-255", +because many people use Windows-1252 while 'encoding' is "latin1". + +GTK: Added a workaround for gvim crashing when used over an untrusted ssh +link, caused by GTK doing something nasty. (Ed Catmur) + +Win32: The font used for the tab page labels is too big. Use the system menu +font. (George Reilly) + +Win32: Adjusting the window position and size to keep it on the screen didn't +work properly when the taskbar is on the left or top of the screen. + +The installman.sh and installml.sh scripts use ${10}, that didn't work with +old shells. And use "test -f" instead of "test -e". + +Win32: When 'encoding' was set in the vimrc then a directory argument for diff +mode didn't work. + +GUI: at the inputlist() prompt the cursorshape was adjusted as if the windows +were still at their old position. + +The parenmatch plugin didn't remember the highlighting per window. + +Using ":bd" for a buffer that's the current window in another tab page caused +a crash. + +For a new tab page the 'scroll' option wasn't set to a good default. + +Using an end offset for a search "/pat/e" didn't work properly for multi-byte +text. (Yukihiro Nakadaira) + +":s/\n/,/" doubled the text when used on the last line. + +When "search" is in 'foldopen' "[s" and "]s" now open folds. + +When using a numbered function "dict" can be omitted, but "self" didn't work +then. Always add FC_DICT to the function flags when it's part of a +dictionary. + +When "--remote-tab" executes locally it left an empty tab page. + +"gvim -u NONE", ":set cursorcolumn", "C" in the second line didn't update +text. Do update further lines even though the "$" is displayed. + +VMS: Support GTK better, also enable +clientserver. (Zoltan Arpadffy) + +When highlighting of statusline or tabline is changed there was no redraw to +show the effect. + +Mac: Added "CFBundleIdentifier" to infplist.xml. + +Added tabpage-local variables t:var. + +Win32: Added double-click in tab pages line creates new tab. (Yegappan +Lakshmanan) + +Motif: Added GUI tab pages line. (Yegappan Lakshmanan) + +Fixed crash when 'lines' was set to 1000 in a modeline. + +When init_spellfile() finds a writable directory in 'runtimepath' but it +doesn't contain a "spell" directory, create one. + +Win32: executable() also finds "xxd" in the directory where Vim was started, +but "!xxd" doesn't work. Append the Vim starting directory to $PATH. + +The tab page labels are shortened, directory names are reduced to a single +letter by default. Added the pathshorten() function to allow a user to do the +same. + +":saveas" now resets 'readonly' if the file was successfully written. + +Set $MYVIMRC file to the first found .vimrc file. +Set $MYGVIMRC file to the first found .gvimrc file. +Added menu item "Startup Settings" that edits the $MYVIMRC file + +Added matcharg(). + +Error message E745 appeared twice. Renamed one to E786. + +Fixed crash when using "au BufRead * Sexplore" and doing ":help". Was wiping +out a buffer that's still in a window. + +":hardcopy" resulted in an error message when 'encoding' is "utf-8" and +'printencoding' is empty. Now it assumes latin1. (Mike Williams) + +The check for the toolbar feature for Motif, depending on certain included +files, wasn't detailed enough, causing building to fail in gui_xmebw.c. + +Using CTRL-E in Insert mode completion after CTRL-P inserted the first match +instead of the original text. + +When displaying a UTF-8 character with a zero lower byte Vim might think the +previous character is double-wide. + +The "nbsp" item of 'listchars' didn't work when 'encoding' was utf-8. + +Motif: when Xm/xpm.h is missing gui_xmebw.c would not compile. +HAVE_XM_UNHIGHLIGHTT_H was missing a T. + +Mac: Moved the .icns files into src/os_mac_rsrc, so that they can all be +copied at once. Adjusted the Info.plist file for three icons. + +When Visual mode is active while switching to another tabpage could get ml_get +errors. + +When 'list' is set, 'nowrap' the $ in the first column caused 'cursorcolumn' +to move to the right. + +When a line wraps, 'cursorcolumn' was never displayed past the end of the +line. + +'autochdir' was only available when compiled with NetBeans and GUI. Now it's +a separate feature, also available in the "big" version. + +Added CTRL-W gf: open file under cursor in new tab page. + +When using the menu in the tab pages line, "New Tab" opens the new tab before +where the click was. Beyond the labels the new tab appears at the end instead +of after the current tab page. + +Inside a mapping with an expression getchar() could not be used. + +When vgetc is used recursively vgetc_busy protects it from being used +recursively. But after a ":normal" command the protection was reset. + +":s/a/b/n" didn't work when 'modifiable' was off. + +When $VIMRUNTIME includes a multi-byte character then rgb.txt could not be +found. (Yukihiro Nakadaira) + +":mkspell" didn't work correctly for non-ASCII affix flags when conversion is +needed on the spell file. + +glob('/dir/\$ABC/*') didn't work. + +When using several tab pages and changing 'cmdheight' the display could become +messed up. Now store the value of 'cmdheight' separately for each tab page. + +The user of the Enter key while the popup menu is visible was still confusing. +Now use Enter to select the match after using a cursor key. + +Added "usetab" to 'switchbuf'. + + +--- fixes and changes since Vim 7.0d --- + +Added CTRL-W T: move a window to a new tab page. + +Using CTRL-X s in Insert mode to complete spelling suggestions and using BS +deleted characters before the bad word. + +A few small fixes for the VMS makefile. (Zoltan Arpadffy) + +With a window of 91 lines 45 cols, ":vsp" scrolled the window. Copy w_wrow +when splitting a window and skip setting the height when it's already at the +right value. + +Using <silent> in a mapping with a shell command and the GUI caused redraw +to use wrong attributes. + +Win32: Using MSVC 4.1 for install.exe resulted in the start menu items to be +created in the administrator directory instead of "All Users". Define the +CSIDL_ items if they are missing. + +Motif: The GUI tabline did not use the space above the right scrollbar. Work +around a bug in the Motif library. (Yegappan Lakshmanan) + +The extra files for XML Omni completion are now also installed. +|xml-omni-datafile| + +GTK GUI: when 'm' is missing from 'guioptions' during startup and pressing +<F10> GTK produced error messages. Now do create the menu but disable it just +after the first gui_mch_update(). + +":mkspell" doesn't work well with the Hungarian dictionary from the Hunspell +project. Back to the Myspell dictionary. + +In help files hide the | used around tags. + +Renamed pycomplete to pythoncomplete. + +Added "tabpages" to 'sessionoptions'. + +When 'guitablabel' is set the effect wasn't visible right away. + +Fixed a few 'cindent' errors. + +When completing menu names, e.g., after ":emenu", don't sort the entries but +keep them in the original order. + +Fixed a crash when editing a directory in diff mode. Don't trigger +autocommands when executing the diff command. + +Getting a keystroke could get stuck if 'encoding' is a multi-byte encoding and +typing a special key. + +When 'foldignore' is set the folds were not updated right away. + +When a list is indexed with [a : b] and b was greater than the length an error +message was given. Now silently truncate the result. + +When using BS during Insert mode completion go back to the original text, so +that CTRL-N selects the first matching entry. + +Added the 'M' flag to 'cinoptions'. + +Win32: Make the "gvim --help" window appear in the middle of the screen +instead of at an arbitrary position. (Randall W. Morris) + +Added gettabwinvar() and settabwinvar(). + +Command line completion: pressing <Tab> after ":e /usr/*" expands the whole +tree, because it becomes ":e /usr/**". Don't add a star if there already is +one. + +Added grey10 to grey90 to all GUIs, so that they can all be used for +initializing highlighting. Use grey40 for CursorColumn and CursorLine when +'background' is "dark". + +When reading a file and using iconv for conversion, an incomplete byte +sequence at the end caused problems. (Yukihiro Nakadaira) + + +--- fixes and changes since Vim 7.0e --- + +Default color for MatchParen when 'background' is "dark" is now DarkCyan. + +":syn off" had to be used twice in a file that sets 'syntax' in a modeline. +(Michael Geddes) + +When using ":vsp" or ":sp" the available space wasn't used equally between +windows. (Servatius Brandt) + +Expanding <cWORD> on a trailing blank resulted in the first word in the line +if 'encoding' is a multi-byte encoding. + +Spell checking: spellbadword() didn't see a missing capital in the first word +of a line. Popup menu now only suggest the capitalized word when appropriate. + +When using whole line completion CTRL-L moves through the matches but it +didn't work when at the original text. + +When completion finds the longest match, don't go to the first match but stick +at the original text, so that CTRL-N selects the first one. + +Recognize "zsh-beta" like "zsh" for setting the 'shellpipe' default. (James +Vega) + +When using ":map <expr>" and the expression results in something with a +special byte (NUL or CSI) then it didn't work properly. Now escape special +bytes. + +The default Visual highlighting for a color xterm with 8 colors was a magenta +background, which made magenta text disappear. Now use reverse in this +specific situation. + +After completing the longest match "." didn't insert the same text. Repeating +also didn't work correctly for multi-byte text. + +When using Insert mode completion and BS the whole word that was completed +would result in all possible matches. Now stop completion. Also fixes that +for spell completion the previous word was deleted. + +GTK: When 'encoding' is "latin1" and using non-ASCII characters in a file name +the tab page label was wrong and an error message would be given. + +The taglist() function could hang on a tags line with a non-ASCII character. + +Win32: When 'encoding' differs from the system encoding tab page labels with +non-ASCII characters looked wrong. (Yegappan Lakshmanan) + +Motif: building failed when Xm/Notebook.h doesn't exist. Added a configure +check, disable GUI tabline when it's missing. + +Mac: When compiled without multi-byte feature the clipboard didn't work. + +It was possible to switch to another tab page when the cmdline window is open. + +Completion could hang when 'lines' is 6 and a preview window was opened. + +Added CTRL-W gF: open file under cursor in new tab page and jump to the line +number following the file name. +Added 'guitabtooltip'. Implemented for Win32 (Yegappan Lakshmanan). + +Added "throw" to 'debug' option: thow an exception for error messages even +whey they would otherwise be ignored. + +When 'keymap' is set and a line contains an invalid entry could get a "No +mapping found" warning instead of a proper error message. + +Motif: default to using XpmAttributes instead of XpmAttributes_21. + +A few more changes for 64 bit MS-Windows. (George Reilly) + +Got ml_get errors when doing "o" and selecting in other window where there are +less line shorter than the cursor position in the other window. ins_mouse() +was using position in wrong window. + +Win32 GUI: Crash when giving a lot of messages during startup. Allocate twice +as much memory for the dialog template. + +Fixed a few leaks and wrong pointer use reported by coverity. + +When showing menus the mode character was sometimes wrong. + +Added feedkeys(). (Yakov Lerner) + +Made matchlist() always return all submatches. + +Moved triggering QuickFixCmdPost to before jumping to the first location. + +Mac: Added the 'macatsui' option as a temporary work around for text drawing +problems. + +Line completion on "/**" gave error messages when scanning an unloaded buffer. + +--- fixes and changes since Vim 7.0f --- + +Win32: The height of the tab page labels is now adjusted to the font height. +(Yegappan Lakshmanan) + +Win32: selecting the tab label was off by one. (Yegappan Lakshmanan) + +Added tooltips for Motif and GTK tab page labels. (Yegappan Lakshmanan) + +When 'encoding' is "utf-8" then ":help spell" would report an illegal byte and +the file was not converted from latin1 to utf-8. Now retry with latin1 if +reading the file as utf-8 results in illegal bytes. + +Escape the argument of feedkeys() before putting it in the typeahead buffer. +(Yukihiro Nakadaira) + +Added the v:char variable for evaluating 'formatexpr'. (Yukihiro Nakadaira) + +With 8 colors Search highlighting combined with Statement highlighted text +made the text disappear. + +VMS: avoid warnings for redefining MAX and MIN. (Zoltan Arpadffy) + +When 'virtualedit' includes "onemore", stopping Visual selection would still +move the cursor left. + +Prevent that using CTRL-R = in Insert mode can start Visual mode. + +Fixed a crash that occured when in Insert mode with completion active and a +mapping caused edit() to be called recursively. + +When using CTRL-O in Insert mode just after the last character while +'virtualedit' is "all", then typing CR moved the last character to the next +line. Call coladvance() before starting the new line. + +When using |:shell| ignore clicks on the tab page labels. Also when using the +command line window. + +When 'eventignore' is "all" then adding more to ignoring some events, e.g., +for ":vimgrep", would actually trigger more events. + +Win32: When a running Vim uses server name GVIM1 then "gvim --remote fname" +didn't find it. When looking for a server name that doesn't end in a digit +and it is not found then use another server with that name and a number (just +like on Unix). + +When using "double" in 'spellsuggest' when the language doesn't support sound +folding resulted in too many suggestions. + +Win32: Dropping a shortcut on the Vim icon did't edit the referred file like +editing it in another way would. Use fname_expand() in buf_set_name() instead +of simply make the file name a full path. + +Using feedkeys() could cause Vim to hang. + +When closing another tab page from the tabline menu in Insert mode the tabline +was not updated right away. + +The syntax menu didn't work in compatible mode. + +After using ":tag id" twice with the same "id", ":ts" and then ":pop" a ":ts" +reported no matching tag. Clear the cached tag name. + +In Insert mode the matchparen plugin highlighted the wrong paren when there is +a string just next to a paren. + +GTK: After opening a new tab page the text was sometimes not drawn correctly. +Flush output and catch up with events when updating the tab page labels. + +In the GUI, using CTRL-W q to close the last window of a tab page could cause +a crash. + +GTK: The tab pages line menu was not converted from 'encoding' to utf-8. + +Typing a multi-byte character or a special key at the hit-enter prompt did not +work. + +When 'virtualedit' contains "onemore" CTRL-O in Insert mode still moved the +cursor left when it was after the end of the line, even though it's allowed to +be there. + +Added test for using tab pages. + +towupper() and towlower() were not used, because of checking for +__STDC__ISO_10646__ instead of __STDC_ISO_10646__. (sertacyildiz) + +For ":map <expr>" forbid changing the text, jumping to another buffer and +using ":normal" to avoid nasty side effects. + +--- fixes and changes since Vim 7.0g --- + +Compilation error on HP-UX, use of "dlerr" must be inside a #ifdef. +(Gary Johnson) + +Report +reltime feature in ":version" output. + +The tar and zip plugins detect failure to get the contents of the archive and +edit the file as-is. + +When the result of 'guitablabel' is empty fall back to the default label. + +Fixed crash when using ":insert" in a while loop and missing "endwhile". + +"gt" and other commands could move to another window when |textlock| active +and when the command line window was open. + +Spell checking a file with syntax highlighting and a bad word at the end of +the line is ignored could make "]s" hang. + +Mac: inputdialog() didn't work when compiled with big features. + +Interrupting ":vimgrep" while it is busy loading a file left a modified and +hidden buffer behind. Use enter_cleanup() and leave_cleanup() around +wipe_buffer(). + +When making 'keymap' empty the b:keymap_name variable wasn't deleted. + +Using CTRL-N that searches a long time, pressing space to interrupt the +searching and accept the first match, the popup menu was still displayed +briefly. + +When setting the Vim window height with -geometry the 'window' option could be +at a value that makes CTRL-F behave differently. + +When opening a quickfix window in two tabs they used different buffers, +causing redrawing problems later. Now use the same buffer for all quickfix +windows. (Yegappan Lakshmanan) + +When 'mousefocus' is set moving the mouse to the text tab pages line would +move focus to the first window. Also, the mouse pointer would jump to the +active window. + +In a session file, when an empty buffer is wiped out, do this silently. + +When one window has the cursor on the last line and another window is resized +to make that window smaller, the cursor line could go below the displayed +lines. In win_new_height() subtract one from the available space. +Also avoid that using "~" lines makes the window scroll down. + +Mac: When sourcing the "macmap.vim" script and then finding a .vimrc file the +'cpo' option isn't set properly, because it was already set and restored. +Added the <special> argument to ":map", so that 'cpo' doesn't need to be +changed to be able to use <> notation. Also do this for ":menu" for +consistency. + +When using "/encoding=abc" in a spell word list, only "bc" was used. + +When 'encoding' and 'printencoding' were both "utf-8" then ":hardcopy" didn't +work. (Mike Williams) + +Mac: When building with "--disable-gui" the install directory would still be +"/Applications" and Vim.app would be installed. Now install in /usr/local as +usual for a console application. + +GUI: when doing completion and there is one match and still searching for +another, the cursor was displayed at the end of the line instead of after the +match. Now show the cursor after the match while still searching for matches. + +GUI: The mouse shape changed on the statusline even when 'mouse' was empty and +they can't be dragged.. + +GTK2: Selecting a button in the confirm() dialog with Tab or cursor keys and +hitting Enter didn't select that button. Removed GTK 1 specific code. (Neil +Bird) + +When evaluating 'balloonexpr' takes a long time it could be called +recursively, which could cause a crash. + +exists() could not be used to detect whether ":2match" is supported. Added a +check for it specifically. + +GTK1: Tab page labels didn't work. (Yegappan Lakshmanan) + +Insert mode completion: When finding matches use 'ignorecase', but when adding +matches to the list don't use it, so that all words with different case are +added, "word", "Word" and "WORD". + +When 'cursorline' and 'hlsearch' are set and the search pattern is "x\n" +the rest of the line was highlighted as a match. + +Cursor moved while evaluating 'balloonexpr' that invokes ":isearch" and +redirects the output. Don't move the cursor to the command line if msg_silent +is set. + +exists() ignored text after a function name and option name, which could +result in false positives. + +exists() ignored characters after the recognized word, which can be wrong when +using a name with non-keyword characters. Specifically, these calls no longer +allow characters after the name: exists('*funcname') exists('*funcname(...') +exists('&option') exists(':cmd') exists('g:name') exists('g:name[n]') +exists('g:name.n') + +Trigger the TabEnter autocommand only after entering the current window of the +tab page, otherwise the commands are executed with an invalid current window. + +Win32: When using two monitors and Vim is on the second monitor, changing the +width of the Vim window could make it jump to the first monitor. + +When scrolling back at the more prompt and the quitting a line of text would +be left behind when 'cmdheight' is 2 or more. + +Fixed a few things for Insert mode completion, especially when typing BS, +CTRL-N or a printable character while still searching for matches. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/vi_diff.txt b/Aufgabe5/doc.lang/vi_diff.txt new file mode 100644 index 0000000..466a049 --- /dev/null +++ b/Aufgabe5/doc.lang/vi_diff.txt @@ -0,0 +1,1006 @@ +*vi_diff.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Differences between Vim and Vi *vi-differences* + +Throughout the help files differences between Vim and Vi/Ex are given in +curly braces, like "{not in Vi}". This file only lists what has not been +mentioned in other files and gives an overview. + +Vim is mostly POSIX 1003.2-1 compliant. The only command known to be missing +is ":open". There are probably a lot of small differences (either because Vim +is missing something or because Posix is beside the mark). + +1. Simulated command |simulated-command| +2. Missing options |missing-options| +3. Limits |limits| +4. The most interesting additions |vim-additions| +5. Other vim features |other-features| +6. Command-line arguments |cmdline-arguments| +7. POSIX compliance |posix-compliance| + +============================================================================== +1. Simulated command *simulated-command* + +This command is in Vi, but Vim only simuates it: + + *:o* *:op* *:open* +:[range]o[pen] Works like |:visual|: end Ex mode. + {Vi: start editing in open mode} + +:[range]o[pen] /pattern/ As above, additionally move the cursor to the + column where "pattern" matches in the cursor + line. + +Vim does not support open mode, since it's not really useful. For those +situations where ":open" would start open mode Vim will leave Ex mode, which +allows executing the same commands, but updates the whole screen instead of +only one line. + +============================================================================== +2. Missing options *missing-options* + +These options are in the Unix Vi, but not in Vim. If you try to set one of +them you won't get an error message, but the value is not used and cannot be +printed. + +autoprint (ap) boolean (default on) *'autoprint'* *'ap'* +beautify (bf) boolean (default off) *'beautify'* *'bf'* +flash (fl) boolean (default ??) *'flash'* *'fl'* +graphic (gr) boolean (default off) *'graphic'* *'gr'* +hardtabs (ht) number (default 8) *'hardtabs'* *'ht'* + number of spaces that a <Tab> moves on the display +mesg boolean (default on) *'mesg'* +novice boolean (default off) *'novice'* +open boolean (default on) *'open'* +optimize (op) boolean (default off) *'optimize'* *'op'* +redraw boolean (default off) *'redraw'* +slowopen (slow) boolean (default off) *'slowopen'* *'slow'* +sourceany boolean (default off) *'sourceany'* +w300 number (default 23) *'w300'* +w1200 number (default 23) *'w1200'* +w9600 number (default 23) *'w9600'* + +============================================================================== +3. Limits *limits* + +Vim has only a few limits for the files that can be edited {Vi: can not handle +<Nul> characters and characters above 128, has limited line length, many other +limits}. + *E340* +Maximum line length On machines with 16-bit ints (Amiga and MS-DOS real + mode): 32767, otherwise 2147483647 characters. + Longer lines are split. +Maximum number of lines 2147483647 lines. +Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is + 32 bits. Much more for 64 bit longs. Also limited + by available disk space for the |swap-file|. + *E75* +Length of a file path Unix and Win32: 1024 characters, otherwise 256 + characters (or as much as the system supports). +Length of an expanded string option + Unix and Win32: 1024 characters, otherwise 256 + characters +Maximum display width Unix and Win32: 1024 characters, otherwise 255 + characters +Maximum lhs of a mapping 50 characters. +Number of different highlighting types: over 30000 +Range of a Number variable: -2147483648 to 2147483647 (more on 64 bit + systems) + +Information for undo and text in registers is kept in memory, thus when making +(big) changes the amount of (virtual) memory available limits the number of +undo levels and the text that can be kept in registers. Other things are also +kept in memory: Command-line history, error messages for Quickfix mode, etc. + +Memory usage limits +------------------- + +The option 'maxmem' ('mm') is used to set the maximum memory used for one +buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for +all buffers (in kilobytes). The defaults depend on the system used. For the +Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory +available. +These are not hard limits, but tell Vim when to move text into a swap file. +If you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a +very large value. The swap file will then only be used for recovery. If you +don't want a swap file at all, set 'updatecount' to 0, or use the "-n" +argument when starting Vim. + +============================================================================== +4. The most interesting additions *vim-additions* + +Vi compatibility. |'compatible'| + Although Vim is 99% Vi compatible, some things in Vi can be + considered to be a bug, or at least need improvement. But still, Vim + starts in a mode which behaves like the "real" Vi as much as possible. + To make Vim behave a little bit better, try resetting the 'compatible' + option: + :set nocompatible + Or start Vim with the "-N" argument: + vim -N + Vim starts with 'nocompatible' automatically if you have a .vimrc + file. See |startup|. + The 'cpoptions' option can be used to set Vi compatibility on/off for + a number of specific items. + +Support for different systems. + Vim can be used on: + - All Unix systems (it works on all systems it was tested on, although + the GUI and Perl interface may not work everywhere). + - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...). + - MS-DOS in real-mode (no additional drivers required). + - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required). + - Windows 95 and Windows NT, with support for long file names. + - OS/2 (needs emx.dll) + - Atari MiNT + - VMS + - BeOS + - Macintosh + - Risc OS + - IBM OS/390 + Note that on some systems features need to be disabled to reduce + resource usage, esp. on MS-DOS. For some outdated systems you need to + use an older Vim version. + +Multi level undo. |undo| + 'u' goes backward in time, 'CTRL-R' goes forward again. Set option + 'undolevels' to the number of changes to be remembered (default 1000). + Set 'undolevels' to 0 for a vi-compatible one level undo. Set it to + -1 for no undo at all. + When all changes in a buffer have been undone, the buffer is not + considered changed anymore. You can exit it with :q, without <!>. + When undoing a few changes and then making a new change Vim will + create a branch in the undo tree. This means you can go back to any + state of the text, there is no risc of a change causing text to be + lost forever. |undo-tree| + +Graphical User Interface (GUI). |gui| + Included support for GUI: menu's, mouse, scrollbars, etc. You can + define your own menus. Better support for CTRL/SHIFT/ALT keys in + combination with special keys and mouse. Supported for various + platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32 + (Windows 95 and later), BeOS, Amiga and Macintosh. + +Multiple windows and buffers. |windows.txt| + Vim can split the screen into several windows, each editing a + different buffer or the same buffer at a different location. Buffers + can still be loaded (and changed) but not displayed in a window. This + is called a hidden buffer. Many commands and options have been added + for this facility. + Vim can also use multiple tab pages, each with one or more windows. A + line with tab labels can be used to quickly switch between these pages. + |tab-page| + +Syntax highlighting. |:syntax| + Vim can highlight keywords, patterns and other things. This is + defined by a number of |:syntax| commands, and can be made to + highlight most languages and file types. A number of files are + included for highlighting the most common languages, like C, C++, + Java, Pascal, Makefiles, shell scripts, etc. The colors used for + highlighting can be defined for ordinary terminals, color terminals + and the GUI with the |:highlight| command. A convenient way to do + this is using a |:colorscheme| command. + The highlighted text can be exported as HTML. |convert-to-HTML| + Other items that can be highlighted are matches with the search string + |'hlsearch'|, matching parens |matchparen| and the cursor line and + column |'cursorline'| |'cursorcolumn'|. + +Spell checking. |spell| + When the 'spell' option is set Vim will highlight spelling mistakes. + About 40 languages are currently supported, selected with the + 'spellang' option. In source code only comments and strings are + checked for spelling. + +Folding. |folding| + A range of lines can be shown as one "folded" line. This allows + overviewing a file and moving blocks of text around quickly. + Folds can be created manually, from the syntax of the file, by indent, + etc. + +Diff mode. |diff| + Vim can show two versions of a file with the differences highlighted. + Parts of the text that are equal are folded away. Commands can be + used to move text from one version to the other. + +Plugins. |add-plugin| + The functionality can be extended by dropping a plugin file in the + right directory. That's an easy way to start using Vim scripts + written by others. Plugins can be for all kind of files, or + specifically for a filetype. + +Repeat a series of commands. |q| + "q{c}" starts recording typed characters into named register {c}. + A subsequent "q" stops recording. The register can then be executed + with the "@{c}" command. This is very useful to repeat a complex + action. + +Flexible insert mode. |ins-special-special| + The arrow keys can be used in insert mode to move around in the file. + This breaks the insert in two parts as far as undo and redo is + concerned. + + CTRL-O can be used to execute a single Normal mode command. This is + almost the same as hitting <Esc>, typing the command and doing |a|. + +Visual mode. |Visual-mode| + Visual mode can be used to first highlight a piece of text and then + give a command to do something with it. This is an (easy to use) + alternative to first giving the operator and then moving to the end of + the text to be operated upon. + |v| and |V| are used to start Visual mode. |v| works on characters + and |V| on lines. Move the cursor to extend the Visual area. It is + shown highlighted on the screen. By typing "o" the other end of the + Visual area can be moved. The Visual area can be affected by an + operator: + d delete + c change + y yank + > or < insert or delete indent + ! filter through external program + = filter through indent + : start |:| command for the Visual lines. + gq format text to 'textwidth' columns + J join lines + ~ swap case + u make lowercase + U make uppercase + +Block operators. |visual-block| + With Visual mode a rectangular block of text can be selected. Start + Visual mode with CTRL-V. The block can be deleted ("d"), yanked ("y") + or its case can be changed ("~", "u" and "U"). A deleted or yanked + block can be put into the text with the "p" and "P" commands. + +Help system. |:help| + Help is displayed in a window. The usual commands can be used to + move around, search for a string, etc. Tags can be used to jump + around in the help files, just like hypertext links. The |:help| + command takes an argument to quickly jump to the info on a subject. + <F1> is the quick access to the help system. The name of the help + index file can be set with the 'helpfile' option. + +Command-line editing and history. |cmdline-editing| + You can insert or delete at any place in the command-line using the + cursor keys. The right/left cursor keys can be used to move + forward/backward one character. The shifted right/left cursor keys + can be used to move forward/backward one word. CTRL-B/CTRL-E can be + used to go to the begin/end of the command-line. + |cmdline-history| + The command-lines are remembered. The up/down cursor keys can be used + to recall previous command-lines. The 'history' option can be set to + the number of lines that will be remembered. There is a separate + history for commands and for search patterns. + +Command-line completion. |cmdline-completion| + While entering a command-line (on the bottom line of the screen) + <Tab> can be typed to complete + what example ~ + - command :e<Tab> + - tag :ta scr<Tab> + - option :set sc<Tab> + - option value :set hf=<Tab> + - file name :e ve<Tab> + - etc. + + If there are multiple matches, CTRL-N (next) and CTRL-P (previous) + will walk through the matches. <Tab> works like CTRL-N, but wraps + around to the first match. + + The 'wildchar' option can be set to the character for command-line + completion, <Tab> is the default. CTRL-D can be typed after an + (incomplete) wildcard; all matches will be listed. CTRL-A will insert + all matches. CTRL-L will insert the longest common part of the + matches. + +Insert-mode completion. |ins-completion| + In Insert mode the CTRL-N and CTRL-P keys can be used to complete a + word that appears elsewhere. |i_CTRL-N| + With CTRL-X another mode is entered, through which completion can be + done for: + |i_CTRL-X_CTRL-F| file names + |i_CTRL-X_CTRL-K| words from 'dictionary' files + |i_CTRL-X_CTRL-T| words from 'thesaurus' files + |i_CTRL-X_CTRL-I| words from included files + |i_CTRL-X_CTRL-L| whole lines + |i_CTRL-X_CTRL-]| words from the tags file + |i_CTRL-X_CTRL-D| definitions or macros + |i_CTRL-X_CTRL-O| Omni completion: clever completion + specifically for a file type + etc. + +Long line support. |'wrap'| |'linebreak'| + If the 'wrap' option is off, long lines will not wrap and only part + of them will be shown. When the cursor is moved to a part that is not + shown, the screen will scroll horizontally. The minimum number of + columns to scroll can be set with the 'sidescroll' option. The |zh| + and |zl| commands can be used to scroll sideways. + Alternatively, long lines are broken in between words when the + 'linebreak' option is set. This allows editing a single-line + paragraph conveniently (e.g. when the text is later read into a DTP + program). Move the cursor up/down with the |gk| and |gj| commands. + +Text formatting. |formatting| + The 'textwidth' option can be used to automatically limit the line + length. This supplements the 'wrapmargin' option of Vi, which was not + very useful. The |gq| operator can be used to format a piece of text + (for example, |gqap| formats the current paragraph). Commands for + text alignment: |:center|, |:left| and |:right|. + +Extended search patterns. |pattern| + There are many extra items to match various text items. Examples: + A "\n" can be used in a search pattern to match a line break. + "x\{2,4}" matches "x" 2 to 4 times. + "\s" matches a white space character. + +Directory, remote and archive browsing. |netrw| + Vim can browse the file system. Simply edit a directory. Move around + in the list with the usual commands and press <Enter> to go to the + directory or file under the cursor. + This also works for remote files over ftp, http, ssh, etc. + Zip and tar archives can also be browsed. |tar| |zip| + +Edit-compile-edit speedup. |quickfix| + The |:make| command can be used to run the compilation and jump to the + first error. A file with compiler error messages is interpreted. Vim + jumps to the first error. + + Each line in the error file is scanned for the name of a file, line + number and error message. The 'errorformat' option can be set to a + list of scanf-like strings to handle output from many compilers. + + The |:cn| command can be used to jump to the next error. + |:cl| lists all the error messages. Other commands are available. + The 'makeef' option has the name of the file with error messages. + The 'makeprg' option contains the name of the program to be executed + with the |:make| command. + The 'shellpipe' option contains the string to be used to put the + output of the compiler into the errorfile. + +Finding matches in files. |:vimgrep| + Vim can search for a pattern in multiple files. This uses the + advanced Vim regexp pattern, works on all systems and also works to + search in compressed files. + +Improved indenting for programs. |'cindent'| + When the 'cindent' option is on the indent of each line is + automatically adjusted. C syntax is mostly recognized. The indent + for various styles can be set with 'cinoptions'. The keys to trigger + indenting can be set with 'cinkeys'. + + Comments can be automatically formatted. The 'comments' option can be + set to the characters that start and end a comment. This works best + for C code, but also works for e-mail (">" at start of the line) and + other types of text. The |=| operator can be used to re-indent + lines. + + For many other languages an indent plugin is present to support + automatic indenting. |30.3| + +Searching for words in included files. |include-search| + The |[i| command can be used to search for a match of the word under + the cursor in the current and included files. The 'include' option + can be set the a pattern that describes a command to include a file + (the default is for C programs). + The |[I| command lists all matches, the |[_CTRL-I| command jumps to + a match. + The |[d|, |[D| and |[_CTRL-D| commands do the same, but only for + lines where the pattern given with the 'define' option matches. + +Automatic commands. |autocommand| + Commands can be automatically executed when reading a file, writing a + file, jumping to another buffer, etc., depending on the file name. + This is useful to set options and mappings for C programs, + documentation, plain text, e-mail, etc. This also makes it possible + to edit compressed files. + +Scripts and Expressions. |expression| + Commands have been added to form up a powerful script language. + |:if| Conditional execution, which can be used for example + to set options depending on the value of $TERM. + |:while| Repeat a number of commands. + |:for| Loop over a list. + |:echo| Print the result of an expression. + |:let| Assign a value to an internal variable, option, etc. + Variable types are Number, String, List and Dictionary. + |:execute| Execute a command formed by an expression. + |:try| Catch exceptions. + etc., etc. See |eval|. + Debugging and profiling are supported. |debug-scripts| |profile| + If this is not enough, an interface is provided to |Python|, |Ruby|, + |Tcl|, |Perl| and |MzScheme|. + +Viminfo. |viminfo-file| + The command-line history, marks and registers can be stored in a file + that is read on startup. This can be used to repeat a search command + or command-line command after exiting and restarting Vim. It is also + possible to jump right back to where the last edit stopped with |'0|. + The 'viminfo' option can be set to select which items to store in the + .viminfo file. This is off by default. + +Printing. |printing| + The |:hardcopy| command sends text to the printer. This can include + syntax highlighting. + +Mouse support. |mouse-using| + The mouse is supported in the GUI version, in an xterm for Unix, for + Linux with gpm, for MS-DOS, and Win32. It can be used to position the + cursor, select the visual area, paste a register, etc. + +Usage of key names. |<>| |key-notation| + Special keys now all have a name like <Up>, <End>, etc. + This name can be used in mappings, to make it easy to edit them. + +Editing binary files. |edit-binary| + Vim can edit binary files. You can change a few characters in an + executable file, without corrupting it. Vim doesn't remove NUL + characters (they are represented as <NL> internally). + |-b| command-line argument to start editing a binary file + |'binary'| Option set by |-b|. Prevents adding an <EOL> for the + last line in the file. + +Multi-language support. |multi-lang| + Files in double-byte or multi-byte encodings can be edited. There is + UTF-8 support to be able to edit various languages at the same time, + without switching fonts. |UTF-8| + Messages and menus are available in different languages. + +Move cursor beyond lines. + When the 'virtualedit' option is set the cursor can move all over the + screen, also where there is no text. This is useful to edit tables + and figures easily. + +============================================================================== +5. Other vim features *other-features* + +A random collection of nice extra features. + + +When Vim is started with "-s scriptfile", the characters read from +"scriptfile" are treated as if you typed them. If end of file is reached +before the editor exits, further characters are read from the console. + +The "-w" option can be used to record all typed characters in a script file. +This file can then be used to redo the editing, possibly on another file or +after changing some commands in the script file. + +The "-o" option opens a window for each argument. "-o4" opens four windows. + +Vi requires several termcap entries to be able to work full-screen. Vim only +requires the "cm" entry (cursor motion). + + +In command mode: + +When the 'showcmd' option is set, the command characters are shown in the last +line of the screen. They are removed when the command is finished. + +If the 'ruler' option is set, the current cursor position is shown in the +last line of the screen. + +"U" still works after having moved off the last changed line and after "u". + +Characters with the 8th bit set are displayed. The characters between '~' and +0xa0 are displayed as "~?", "~@", "~A", etc., unless they are included in the +'isprint' option. + +"][" goes to the next ending of a C function ('}' in column 1). +"[]" goes to the previous ending of a C function ('}' in column 1). + +"]f", "[f" and "gf" start editing the file whose name is under the cursor. +CTRL-W f splits the window and starts editing the file whose name is under +the cursor. + +"*" searches forward for the identifier under the cursor, "#" backward. +"K" runs the program defined by the 'keywordprg' option, with the identifier +under the cursor as argument. + +"%" can be preceded with a count. The cursor jumps to the line that +percentage down in the file. The normal "%" function to jump to the matching +brace skips braces inside quotes. + +With the CTRL-] command, the cursor may be in the middle of the identifier. + +The used tags are remembered. Commands that can be used with the tag stack +are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack. + +The 'tags' option can be set to a list of tag file names. Thus multiple +tag files can be used. For file names that start with "./", the "./" is +replaced with the path of the current file. This makes it possible to use a +tags file in the same directory as the file being edited. + +Previously used file names are remembered in the alternate file name list. +CTRL-^ accepts a count, which is an index in this list. +":files" command shows the list of alternate file names. +"#<N>" is replaced with the <N>th alternate file name in the list. +"#<" is replaced with the current file name without extension. + +Search patterns have more features. The <NL> character is seen as part of the +search pattern and the substitute string of ":s". Vi sees it as the end of +the command. + +Searches can put the cursor on the end of a match and may include a character +offset. + +Count added to "~", ":next", ":Next", "n" and "N". + +The command ":next!" with 'autowrite' set does not write the file. In vi the +file was written, but this is considered to be a bug, because one does not +expect it and the file is not written with ":rewind!". + +In Vi when entering a <CR> in replace mode deletes a character only when 'ai' +is set (but does not show it until you hit <Esc>). Vim always deletes a +character (and shows it immediately). + +Added :wnext command. Same as ":write" followed by ":next". + +The ":w!" command always writes, also when the file is write protected. In Vi +you would have to do ":!chmod +w %" and ":set noro". + +When 'tildeop' has been set, "~" is an operator (must be followed by a +movement command). + +With the "J" (join) command you can reset the 'joinspaces' option to have only +one space after a period (Vi inserts two spaces). + +"cw" can be used to change white space formed by several characters (Vi is +confusing: "cw" only changes one space, while "dw" deletes all white space). + +"o" and "O" accept a count for repeating the insert (Vi clears a part of +display). + +Flags after Ex commands not supported (no plans to include it). + +On non-UNIX systems ":cd" command shows current directory instead of going to +the home directory (there isn't one). ":pwd" prints the current directory on +all systems. + +After a ":cd" command the file names (in the argument list, opened files) +still point to the same files. In Vi ":cd" is not allowed in a changed file; +otherwise the meaning of file names change. + +":source!" command reads Vi commands from a file. + +":mkexrc" command writes current modified options and mappings to a ".exrc" +file. ":mkvimrc" writes to a ".vimrc" file. + +No check for "tail recursion" with mappings. This allows things like +":map! foo ^]foo". + +When a mapping starts with number, vi loses the count typed before it (e.g. +when using the mapping ":map g 4G" the command "7g" goes to line 4). This is +considered a vi bug. Vim concatenates the counts (in the example it becomes +"74G"), as most people would expect. + +The :put! command inserts the contents of a register above the current line. + +The "p" and "P" commands of vi cannot be repeated with "." when the putted +text is less than a line. In Vim they can always be repeated. + +":noremap" command can be used to enter a mapping that will not be remapped. +This is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and +":cnoremap" can be used for mapping in command-line editing only. ":imap", +":iunmap" and ":inoremap" can be used for mapping in insert mode only. +Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev" +":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev". + +In Vi the command ":map foo bar" would remove a previous mapping +":map bug foo". This is considered a bug, so it is not included in Vim. +":unmap! foo" does remove ":map! bug foo", because unmapping would be very +difficult otherwise (this is vi compatible). + +The ':' register contains the last command-line. +The '%' register contains the current file name. +The '.' register contains the last inserted text. + +":dis" command shows the contents of the yank registers. + +CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the +same positions as used with the '' command, but may be in another file. The +":jumps" command lists the older positions. + +If the 'shiftround' option is set, an indent is rounded to a multiple of +'shiftwidth' with ">" and "<" commands. + +The 'scrolljump' option can be set to the minimum number of lines to scroll +when the cursor gets off the screen. Use this when scrolling is slow. + +The 'scrolloff' option can be set to the minimum number of lines to keep +above and below the cursor. This gives some context to where you are +editing. When set to a large number the cursor line is always in the middle +of the window. + +Uppercase marks can be used to jump between files. The ":marks" command lists +all currently set marks. The commands "']" and "`]" jump to the end of the +previous operator or end of the text inserted with the put command. "'[" and +"`[" do jump to the start. + +The 'shelltype' option can be set to reflect the type of shell used on the +Amiga. + +The 'highlight' option can be set for the highlight mode to be used for +several commands. + +The CTRL-A (add) and CTRL-X (subtract) commands are new. The count to the +command (default 1) is added to/subtracted from the number at or after the +cursor. That number may be decimal, octal (starts with a '0') or hexadecimal +(starts with '0x'). Very useful in macros. + +With the :set command the prefix "inv" can be used to invert boolean options. + +In both Vi and Vim you can create a line break with the ":substitute" command +by using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the +text. With Vim you can put a real CTRL-M in the text by preceding it with a +CTRL-V. + + +In Insert mode: + +If the 'revins' option is set, insert happens backwards. This is for typing +Hebrew. When inserting normal characters the cursor will not be shifted and +the text moves rightwards. Backspace, CTRL-W and CTRL-U will also work in +the opposite direction. CTRL-B toggles the 'revins' option. In replace mode +'revins' has no effect. Only when enabled at compile time. + +The backspace key can be used just like CTRL-D to remove auto-indents. + +You can backspace, CTRL-U and CTRL-W over line breaks if the 'backspace' (bs) +option includes "eol". You can backspace over the start of insert if the +'backspace' option includes "start". + +When the 'paste' option is set, a few option are reset and mapping in insert +mode and abbreviation are disabled. This allows for pasting text in windowing +systems without unexpected results. When the 'paste' option is reset, the old +option values are restored. + +CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter +what column the cursor is in. + +CTRL-@ (insert previously inserted text) works always (Vi: only when typed as +first character). + +CTRL-A works like CTRL-@ but does not leave insert mode. + +CTRL-R {0-9a-z..} can be used to insert the contents of a register. + +When the 'smartindent' option is set, C programs will be better auto-indented. +With 'cindent' even more. + +CTRL-Y and CTRL-E can be used to copy a character from above/below the +current cursor position. + +After CTRL-V you can enter a three digit decimal number. This byte value is +inserted in the text as a single character. Useful for international +characters that are not on your keyboard. + +When the 'expandtab' (et) option is set, a <Tab> is expanded to the +appropriate number of spaces. + +The window always reflects the contents of the buffer (Vi does not do this +when changing text and in some other cases). + +If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of +normal digraphs is included. They are shown with the ":digraph" command. +More can be added with ":digraph {char1}{char2} {number}". A digraph is +entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when +'digraph' option is set). + +When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin +for the first insert. Vim does it for all. + +A count to the "i" or "a" command is used for all the text. Vi uses the count +only for one line. "3iabc<NL>def<Esc>" would insert "abcabcabc<NL>def" in Vi +but "abc<NL>defabc<NL>defabc<NL>def" in Vim. + + +In Command-line mode: + +<Esc> terminates the command-line without executing it. In vi the command +line would be executed, which is not what most people expect (hitting <Esc> +should always get you back to command mode). To avoid problems with some +obscure macros, an <Esc> in a macro will execute the command. If you want a +typed <Esc> to execute the command like vi does you can fix this with + ":cmap ^V<Esc> ^V<CR>" + +General: + +The 'ttimeout' option is like 'timeout', but only works for cursor and +function keys, not for ordinary mapped characters. The 'timeoutlen' option +gives the number of milliseconds that is waited for. If the 'esckeys' option +is not set, cursor and function keys that start with <Esc> are not recognized +in insert mode. + +There is an option for each terminal string. Can be used when termcap is not +supported or to change individual strings. + +The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix" +<NL> or "mac" <CR>. +When the 'fileformats' option is not empty, Vim tries to detect the type of +<EOL> automatically. The 'fileformat' option is set accordingly. + +On systems that have no job control (older Unix systems and non-Unix systems) +the CTRL-Z, ":stop" or ":suspend" command starts a new shell. + +If Vim is started on the Amiga without an interactive window for output, a +window is opened (and :sh still works). You can give a device to use for +editing with the |-d| argument, e.g. "-d con:20/20/600/150". + +The 'columns' and 'lines' options are used to set or get the width and height +of the display. + +Option settings are read from the first and last few lines of the file. +Option 'modelines' determines how many lines are tried (default is 5). Note +that this is different from the Vi versions that can execute any Ex command +in a modeline (a major security problem). |trojan-horse| + +If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode. +And it comes back there, when pressing <Esc>. + +Undo information is kept in memory. Available memory limits the number and +size of change that can be undone. This may be a problem with MS-DOS, is +hardly a problem on the Amiga and almost never with Unix and Win32. + +If the 'backup' or 'writebackup' option is set: Before a file is overwritten, +a backup file (.bak) is made. If the "backup" option is set it is left +behind. + +Vim creates a file ending in ".swp" to store parts of the file that have been +changed or that do not fit in memory. This file can be used to recover from +an aborted editing session with "vim -r file". Using the swap file can be +switched off by setting the 'updatecount' option to 0 or starting Vim with +the "-n" option. Use the 'directory' option for placing the .swp file +somewhere else. + +Vim is able to work correctly on filesystems with 8.3 file names, also when +using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted +filesystem under Unix. See |'shortname'|. + +Error messages are shown at least one second (Vi overwrites error messages). + +If Vim gives the |hit-enter| prompt, you can hit any key. Characters other +than <CR>, <NL> and <Space> are interpreted as the (start of) a command. (Vi +only accepts a command starting with ':'). + +The contents of the numbered and unnamed registers is remembered when +changing files. + +The "No lines in buffer" message is a normal message instead of an error +message, since that may cause a mapping to be aborted. + +The AUX: device of the Amiga is supported. + +============================================================================== +6. Command-line arguments *cmdline-arguments* + +Different versions of Vi have different command-line arguments. This can be +confusing. To help you, this section gives an overview of the differences. + +Five variants of Vi will be considered here: + Elvis Elvis version 2.1b + Nvi Nvi version 1.79 + Posix Posix 1003.2 + Vi Vi version 3.7 (for Sun 4.1.x) + Vile Vile version 7.4 (incomplete) + Vim Vim version 5.2 + +Only Vim is able to accept options in between and after the file names. + ++{command} Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}". + +- Nvi, Posix, Vi: Run Ex in batch mode. + Vim: Read file from stdin (use -s for batch mode). + +-- Vim: End of options, only file names are following. + +--cmd {command} Vim: execute {command} before sourcing vimrc files. + +--echo-wid Vim: GTK+ echoes the Window ID on stdout + +--help Vim: show help message and exit. + +--literal Vim: take file names literally, don't expand wildcards. + +--nofork Vim: same as |-f| + +--noplugin[s] Vim: Skip loading plugins. + +--remote Vim: edit the files in another Vim server + +--remote-expr {expr} Vim: evaluate {expr} in another Vim server + +--remote-send {keys} Vim: send {keys} to a Vim server and exit + +--remote-silent {file} Vim: edit the files in another Vim server if possible + +--remote-wait Vim: edit the files in another Vim server and wait for it + +--remote-wait-silent Vim: like --remote-wait, no complaints if not possible + +--role {role} Vim: GTK+ 2: set role of main window + +--serverlist Vim: Output a list of Vim servers and exit + +--servername {name} Vim: Specify Vim server name + +--socketid {id} Vim: GTK window socket to run Vim in + +--version Vim: show version message and exit. + +-? Vile: print usage summary and exit. + +-a Elvis: Load all specified file names into a window (use -o for + Vim). + +-A Vim: Start in Arabic mode (when compiled with Arabic). + +-b {blksize} Elvis: Use {blksize} blocksize for the session file. +-b Vim: set 'binary' mode. + +-C Vim: Compatible mode. + +-c {command} Elvis, Nvi, Posix, Vim: run {command} as an Ex command after + loading the edit buffer. + Vim: allow up to 10 "-c" arguments + +-d {device} Vim: Use {device} for I/O (Amiga only). {only when compiled + without the |+diff| feature} +-d Vim: start with 'diff' set. |vimdiff| + +-dev {device} Vim: Use {device} for I/O (Amiga only). + +-D Vim: debug mode. + +-e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is + called "ex". + +-E Vim: Start in improved Ex mode |gQ|, like "exim". + +-f Vim: Run GUI in foreground (Amiga: don't open new window). +-f {session} Elvis: Use {session} as the session file. + +-F Vim: Start in Farsi mode (when compiled with Farsi). + Nvi: Fast start, don't read the entire file when editing + starts. + +-G {gui} Elvis: Use the {gui} as user interface. + +-g Vim: Start GUI. +-g N Vile: start editing at line N + +-h Vim: Give help message. + Vile: edit the help file + +-H Vim: start Hebrew mode (when compiled with it). + +-i Elvis: Start each window in Insert mode. +-i {viminfo} Vim: Use {viminfo} for viminfo file. + +-L Vim: Same as "-r" (also in some versions of Vi). + +-l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options. + +-m Vim: Modifications not allowed to be written, resets 'write' + option. + +-M Vim: Modifications not allowed, resets 'modifiable' and the + 'write' option. + +-N Vim: No-compatible mode. + +-n Vim: No swap file used. + +-nb[args] Vim: open a NetBeans interface connection + +-O[N] Vim: Like -o, but use vertically split windows. + +-o[N] Vim: Open [N] windows, or one for each file. + +-p[N] Vim: Open [N] tab pages, or one for each file. + +-P {parent-title} Win32 Vim: open Vim inside a parent application window + +-q {name} Vim: Use {name} for quickfix error file. +-q{name} Vim: Idem. + +-R Elvis, Nvi, Posix, Vile, Vim: Set the 'readonly' option. + +-r Elvis, Nvi, Posix, Vi, Vim: Recovery mode. + +-S Nvi: Set 'secure' option. +-S {script} Vim: source script after starting up. + +-s Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode. + Elvis: Sets the 'safer' option. +-s {scriptin} Vim: Read from script file {scriptin}; only when not in Ex + mode. +-s {pattern} Vile: search for {pattern} + +-t {tag} Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}. +-t{tag} Vim: Idem. + +-T {term} Vim: Set terminal name to {term}. + +-u {vimrc} Vim: Read initializations from {vimrc} file. + +-U {gvimrc} Vim: Read GUI initializations from {gvimrc} file. + +-v Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi + terms). + Vile: View mode, no changes possible. + +-V Elvis, Vim: Verbose mode. +-V{nr} Vim: Verbose mode with specified level. + +-w {size} Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}. +-w{size} Nvi, Vi: Same as "-w {size}". +-w {name} Vim: Write to script file {name} (must start with non-digit). + +-W {name} Vim: Append to script file {name}. + +-x Vi, Vim: Ask for encryption key. See |encryption|. + +-X Vim: Don't connect to the X server. + +-y Vim: Start in easy mode, like |evim|. + +-Z Vim: restricted mode + +@{cmdfile} Vile: use {cmdfile} as startup file. + +============================================================================== +7. POSIX compliance *posix* *posix-compliance* + +In 2005 the POSIX test suite was run to check the compatiblity of Vim. Most +of the test was executed properly. There are the few things where Vim +is not POSIX compliant, even when run in Vi compatibility mode. + +Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX +flags when Vim starts up. This makes Vim run as POSIX as it can. That's +a bit different from being Vi compatible. + +This is where Vim does not behave as POSIX specifies and why: + + *posix-screen-size* + The $COLUMNS and $LINES environment variables are ignored by Vim if + the size can be obtained from the terminal in a more reliable way. + Add the '|' flag to 'cpoptions' to have $COLUMNS and $LINES overrule + sizes obtained in another way. + + The "{" and "}" commands don't stop at a "{" in the original Vi, but + POSIX specifies it does. Add the '{' flag to 'cpoptions' if you want + it the POSIX way. + + The "D", "o" and "O" commands accept a count. Also when repeated. + Add the '#' flag to 'cpoptions' if you want to ignore the count. + + The ":cd" command fails if the current buffer is modified when the '.' + flag is present in 'cpoptions'. + + There is no ATTENTION message, the "A" flag is added to 'shortmess'. + +These are remarks about running the POSIX test suite: +- vi test 33 sometimes fails for unknown reasons +- vi test 250 fails; behavior will be changed in a new revision + http://www.opengroup.org/austin/mailarchives/ag-review/msg01710.html +- vi test 310 fails; exit code non-zero when any error occurred? +- ex test 24 fails because test is wrong. Changed between SUSv2 and SUSv3. +- ex tests 47, 48, 49, 72, 73 fail because .exrc file isn't read in silent + mode and $EXINIT isn't used. +- ex tests 76, 78 fail because echo is used instead of printf. (fixed) + Also: problem with \s not changed to space. +- ex test 355 fails because 'window' isn't used for "30z". +- ex test 368 fails because shell command isn't echoed in silent mode. +- ex test 394 fails because "=" command output isn't visible in silent mode. +- ex test 411 fails because test file is wrong, contains stray ':'. +- ex test 475 and 476 fail because reprint output isn't visible in silent mode. +- ex test 480 and 481 fail because the tags file has spaces instead of a tab. +- ex test 502 fails because .exrc isn't read in silent mode. +- ex test 509 fails because .exrc isn't read in silent mode. and exit code is + 1 instead of 2. +- ex test 534 fails because .exrc isn't read in silent mode. + + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/visual.txt b/Aufgabe5/doc.lang/visual.txt new file mode 100644 index 0000000..e588d95 --- /dev/null +++ b/Aufgabe5/doc.lang/visual.txt @@ -0,0 +1,499 @@ +*visual.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Visual mode *Visual* *Visual-mode* *visual-mode* + +Visual mode is a flexible and easy way to select a piece of text for an +operator. It is the only way to select a block of text. + +This is introduced in section |04.4| of the user manual. + +1. Using Visual mode |visual-use| +2. Starting and stopping Visual mode |visual-start| +3. Changing the Visual area |visual-change| +4. Operating on the Visual area |visual-operators| +5. Blockwise operators |blockwise-operators| +6. Repeating |visual-repeat| +7. Examples |visual-examples| +8. Select mode |Select-mode| + +{Vi has no Visual mode, the name "visual" is used for Normal mode, to +distinguish it from Ex mode} +{not available when the |+visual| feature was disabled when compiling} + +============================================================================== +1. Using Visual mode *visual-use* + +Using Visual mode consists of three parts: +1. Mark the start of the text with "v", "V" or CTRL-V. + The character under the cursor will be used as the start. +2. Move to the end of the text. + The text from the start of the Visual mode up to and including the + character under the cursor is highlighted. +3. Type an operator command. + The highlighted characters will be operated upon. + +The 'highlight' option can be used to set the display mode to use for +highlighting in Visual mode. +The 'virtualedit' option can be used to allow positioning the cursor to +positions where there is no actual character. + +The highlighted text normally includes the character under the cursor. +However, when the 'selection' option is set to "exclusive" and the cursor is +after the Visual area, the character under the cursor is not included. + +With "v" the text before the start position and after the end position will +not be highlighted. However, all uppercase and non-alpha operators, except +"~" and "U", will work on whole lines anyway. See the list of operators +below. + + *visual-block* +With CTRL-V (blockwise Visual mode) the highlighted text will be a rectangle +between start position and the cursor. However, some operators work on whole +lines anyway (see the list below). The change and substitute operators will +delete the highlighted text and then start insertion at the top left +position. + +============================================================================== +2. Starting and stopping Visual mode *visual-start* + + *v* *characterwise-visual* +v start Visual mode per character. + + *V* *linewise-visual* +V start Visual mode linewise. + + *CTRL-V* *blockwise-visual* +CTRL-V start Visual mode blockwise. Note: Under Windows + CTRL-V could be mapped to paste text, it doesn't work + to start Visual mode then, see |CTRL-V-alternative|. + +If you use <Esc>, click the left mouse button or use any command that +does a jump to another buffer while in Visual mode, the highlighting stops +and no text is affected. Also when you hit "v" in characterwise Visual mode, +"CTRL-V" in blockwise Visual mode or "V" in linewise Visual mode. If you hit +CTRL-Z the highlighting stops and the editor is suspended or a new shell is +started |CTRL-Z|. + + new mode after typing: *v_v* *v_CTRL-V* *v_V* +old mode "v" "CTRL-V" "V" ~ + +Normal Visual blockwise Visual linewise Visual +Visual Normal blockwise Visual linewise Visual +blockwise Visual Visual Normal linewise Visual +linewise Visual Visual blockwise Visual Normal + + *gv* *v_gv* *reselect-Visual* +gv Start Visual mode with the same area as the previous + area and the same mode. + In Visual mode the current and the previous Visual + area are exchanged. + After using "p" or "P" in Visual mode the text that + was put will be selected. + + *<LeftMouse>* +<LeftMouse> Set the current cursor position. If Visual mode is + active it is stopped. Only when 'mouse' option is + contains 'n' or 'a'. If the position is within 'so' + lines from the last line on the screen the text is + scrolled up. If the position is within 'so' lines from + the first line on the screen the text is scrolled + down. + + *<RightMouse>* +<RightMouse> Start Visual mode if it is not active. The text from + the cursor position to the position of the click is + highlighted. If Visual mode was already active move + the start or end of the highlighted text, which ever + is closest, to the position of the click. Only when + 'mouse' option contains 'n' or 'a'. + + Note: when 'mousemodel' is set to "popup", + <S-LeftMouse> has to be used instead of <RightMouse>. + + *<LeftRelease>* +<LeftRelease> This works like a <LeftMouse>, if it is not at + the same position as <LeftMouse>. In an older version + of xterm you won't see the selected area until the + button is released, unless there is access to the + display where the xterm is running (via the DISPLAY + environment variable or the -display argument). Only + when 'mouse' option contains 'n' or 'a'. + +If Visual mode is not active and the "v", "V" or CTRL-V is preceded with a +count, the size of the previously highlighted area is used for a start. You +can then move the end of the highlighted area and give an operator. The type +of the old area is used (character, line or blockwise). +- Linewise Visual mode: The number of lines is multiplied with the count. +- Blockwise Visual mode: The number of lines and columns is multiplied with + the count. +- Normal Visual mode within one line: The number of characters is multiplied + with the count. +- Normal Visual mode with several lines: The number of lines is multiplied + with the count, in the last line the same number of characters is used as + in the last line in the previously highlighted area. +The start of the text is the Cursor position. If the "$" command was used as +one of the last commands to extend the highlighted text, the area will be +extended to the rightmost column of the longest line. + +If you want to highlight exactly the same area as the last time, you can use +"gv" |gv| |v_gv|. + + *v_<Esc>* +<Esc> In Visual mode: Stop Visual mode. + + *v_CTRL-C* +CTRL-C In Visual mode: Stop Visual mode. When insert mode is + pending (the mode message shows + "-- (insert) VISUAL --"), it is also stopped. + +============================================================================== +3. Changing the Visual area *visual-change* + + *v_o* +o Go to Other end of highlighted text: The current + cursor position becomes the start of the highlighted + text and the cursor is moved to the other end of the + highlighted text. The highlighted area remains the + same. + + *v_O* +O Go to Other end of highlighted text. This is like + "o", but in Visual block mode the cursor moves to the + other corner in the same line. When the corner is at + a character that occupies more than one position on + the screen (e.g., a <Tab>), the highlighted text may + change. + + *v_$* +When the "$" command is used with blockwise Visual mode, the right end of the +highlighted text will be determined by the longest highlighted line. This +stops when a motion command is used that does not move straight up or down. + +For moving the end of the block many commands can be used, but you cannot +use Ex commands, commands that make changes or abandon the file. Commands +(starting with) ".pPiIaAO&", CTRL-^, "Z", CTRL-], CTRL-T, CTRL-R, CTRL-I +and CTRL-O cause a beep and Visual mode continues. + +When switching to another window on the same buffer, the cursor position in +that window is adjusted, so that the same Visual area is still selected. This +is especially useful to view the start of the Visual area in one window, and +the end in another. You can then use <RightMouse> (or <S-LeftMouse> when +'mousemodel' is "popup") to drag either end of the Visual area. + +============================================================================== +4. Operating on the Visual area *visual-operators* + +The operators that can be used are: + ~ switch case |v_~| + d delete |v_d| + c change (4) |v_c| + y yank |v_y| + > shift right (4) |v_>| + < shift left (4) |v_<| + ! filter through external command (1) |v_!| + = filter through 'equalprg' option command (1) |v_=| + gq format lines to 'textwidth' length (1) |v_gq| + +The objects that can be used are: + aw a word (with white space) |v_aw| + iw inner word |v_iw| + aW a WORD (with white space) |v_aW| + iW inner WORD |v_iW| + as a sentence (with white space) |v_as| + is inner sentence |v_is| + ap a paragraph (with white space) |v_ap| + ip inner paragraph |v_ip| + ab a () block (with parenthesis) |v_ab| + ib inner () block |v_ib| + aB a {} block (with braces) |v_aB| + iB inner {} block |v_iB| + a< a <> block (with <>) |v_a<| + i< inner <> block |v_i<| + a[ a [] block (with []) |v_a[| + i[ inner [] block |v_i[| + +Additionally the following commands can be used: + : start ex command for highlighted lines (1) |v_:| + r change (4) |v_r| + s change |v_s| + C change (2)(4) |v_C| + S change (2) |v_S| + R change (2) |v_R| + x delete |v_x| + D delete (3) |v_D| + X delete (2) |v_X| + Y yank (2) |v_Y| + p put |v_p| + J join (1) |v_J| + U make uppercase |v_U| + u make lowercase |v_u| + ^] find tag |v_CTRL-]| + I block insert |v_b_I| + A block append |v_b_A| + +(1): Always whole lines, see |:visual_example|. +(2): Whole lines when not using CTRL-V. +(3): Whole lines when not using CTRL-V, delete until the end of the line when + using CTRL-V. +(4): When using CTRL-V operates on the block only. + +Note that the ":vmap" command can be used to specifically map keys in Visual +mode. For example, if you would like the "/" command not to extend the Visual +area, but instead take the highlighted text and search for that: > + :vmap / y/<C-R>"<CR> +(In the <> notation |<>|, when typing it you should type it literally; you +need to remove the 'B' and '<' flags from 'cpoptions'.) + +If you want to give a register name using the """ command, do this just before +typing the operator character: "v{move-around}"xd". + +If you want to give a count to the command, do this just before typing the +operator character: "v{move-around}3>" (move lines 3 indents to the right). + + *{move-around}* +The {move-around} is any sequence of movement commands. Note the difference +with {motion}, which is only ONE movement command. + +Another way to operate on the Visual area is using the |/\%V| item in a +pattern. For example, to replace all '(' in the Visual area with '#': > + + :%s/\%V(/X/g + +============================================================================== +5. Blockwise operators *blockwise-operators* + +{not available when compiled without the |+visualextra| feature} + +Reminder: Use 'virtualedit' to be able to select blocks that start or end +after the end of a line or halfway a tab. + +Visual-block Insert *v_b_I* +With a blockwise selection, I{string}<ESC> will insert {string} at the start +of block on every line of the block, provided that the line extends into the +block. Thus lines that are short will remain unmodified. TABs are split to +retain visual columns. +See |v_b_I_example|. + +Visual-block Append *v_b_A* +With a blockwise selection, A{string}<ESC> will append {string} to the end of +block on every line of the block. There is some differing behavior where the +block RHS is not straight, due to different line lengths: + +1. Block was created with <C-v>$ + In this case the string is appended to the end of each line. +2. Block was created with <C-v>{move-around} + In this case the string is appended to the end of the block on each line, + and whitespace is inserted to pad to the end-of-block column. +See |v_b_A_example|. +Note: "I" and "A" behave differently for lines that don't extend into the +selected block. This was done intentionally, so that you can do it the way +you want. + +Visual-block change *v_b_c* +All selected text in the block will be replaced by the same text string. When +using "c" the selected text is deleted and Insert mode started. You can then +enter text (without a line break). When you hit <Esc>, the same string is +inserted in all previously selected lines. + +Visual-block Change *v_b_C* +Like using "c", but the selection is extended until the end of the line for +all lines. + + *v_b_<* +Visual-block Shift *v_b_>* +The block is shifted by 'shiftwidth'. The RHS of the block is irrelevant. The +LHS of the block determines the point from which to apply a right shift, and +padding includes TABs optimally according to 'ts' and 'et'. The LHS of the +block determines the point upto which to shift left. + Note: v_< padding is buggy if the Visual Block starts and ends in the same + TAB. (Vim 5.4c) +See |v_b_>_example|. +See |v_b_<_example|. + +Visual-block Replace *v_b_r* +Every screen char in the highlighted region is replaced with the same char, ie +TABs are split and the virtual whitespace is replaced, maintaining screen +layout. +See |v_b_r_example|. + + +============================================================================== +6. Repeating *visual-repeat* + +When repeating a Visual mode operator, the operator will be applied to the +same amount of text as the last time: +- Linewise Visual mode: The same number of lines. +- Blockwise Visual mode: The same number of lines and columns. +- Normal Visual mode within one line: The same number of characters. +- Normal Visual mode with several lines: The same number of lines, in the + last line the same number of characters as in the last line the last time. +The start of the text is the Cursor position. If the "$" command was used as +one of the last commands to extend the highlighted text, the repeating will +be applied up to the rightmost column of the longest line. + + +============================================================================== +7. Examples *visual-examples* + + *:visual_example* +Currently the ":" command works on whole lines only. When you select part of +a line, doing something like ":!date" will replace the whole line. If you +want only part of the line to be replaced you will have to make a mapping for +it. In a future release ":" may work on partial lines. + +Here is an example, to replace the selected text with the output of "date": > + :vmap _a <Esc>`>a<CR><Esc>`<i<CR><Esc>!!date<CR>kJJ + +(In the <> notation |<>|, when typing it you should type it literally; you +need to remove the 'B' and '<' flags from 'cpoptions') + +What this does is: +<Esc> stop Visual mode +`> go to the end of the Visual area +a<CR><Esc> break the line after the Visual area +`< jump to the start of the Visual area +i<CR><Esc> break the line before the Visual area +!!date<CR> filter the Visual text through date +kJJ Join the lines back together + + *visual-search* +Here is an idea for a mapping that makes it possible to do a search for the +selected text: > + :vmap X y/<C-R>"<CR> + +(In the <> notation |<>|, when typing it you should type it literally; you +need to remove the 'B' and '<' flags from 'cpoptions') + +Note that special characters (like '.' and '*') will cause problems. + +Visual-block Examples *blockwise-examples* +With the following text, I will indicate the commands to produce the block and +the results below. In all cases, the cursor begins on the 'a' in the first +line of the test text. +The following modeline settings are assumed ":ts=8:sw=4:". + +It will be helpful to +:set hls +/<TAB> +where <TAB> is a real TAB. This helps visualise the operations. + +The test text is: + +abcdefghijklmnopqrstuvwxyz +abc defghijklmnopqrstuvwxyz +abcdef ghi jklmnopqrstuvwxyz +abcdefghijklmnopqrstuvwxyz + +1. fo<C-v>3jISTRING<ESC> *v_b_I_example* + +abcdefghijklmnSTRINGopqrstuvwxyz +abc STRING defghijklmnopqrstuvwxyz +abcdef ghi STRING jklmnopqrstuvwxyz +abcdefghijklmnSTRINGopqrstuvwxyz + +2. fo<C-v>3j$ASTRING<ESC> *v_b_A_example* + +abcdefghijklmnopqrstuvwxyzSTRING +abc defghijklmnopqrstuvwxyzSTRING +abcdef ghi jklmnopqrstuvwxyzSTRING +abcdefghijklmnopqrstuvwxyzSTRING + +3. fo<C-v>3j3l<.. *v_b_<_example* + +abcdefghijklmnopqrstuvwxyz +abc defghijklmnopqrstuvwxyz +abcdef ghi jklmnopqrstuvwxyz +abcdefghijklmnopqrstuvwxyz + +4. fo<C-v>3j>.. *v_b_>_example* + +abcdefghijklmn opqrstuvwxyz +abc defghijklmnopqrstuvwxyz +abcdef ghi jklmnopqrstuvwxyz +abcdefghijklmn opqrstuvwxyz + +5. fo<C-v>5l3jrX *v_b_r_example* + +abcdefghijklmnXXXXXXuvwxyz +abc XXXXXXhijklmnopqrstuvwxyz +abcdef ghi XXXXXX jklmnopqrstuvwxyz +abcdefghijklmnXXXXXXuvwxyz + +============================================================================== +8. Select mode *Select* *Select-mode* + +Select mode looks like Visual mode, but the commands accepted are quite +different. This resembles the selection mode in Microsoft Windows. +When the 'showmode' option is set, "-- SELECT --" is shown in the last line. + +Entering Select mode: +- Using the mouse to select an area, and 'selectmode' contains "mouse". + 'mouse' must also contain a flag for the current mode. +- Using a non-printable movement command, with the Shift key pressed, and + 'selectmode' contains "key". For example: <S-Left> and <S-End>. 'keymodel' + must also contain "startsel". +- Using "v", "V" or CTRL-V command, and 'selectmode' contains "cmd". +- Using "gh", "gH" or "g_CTRL-H" command in Normal mode. +- From Visual mode, press CTRL-G. *v_CTRL-G* + +Commands in Select mode: +- Printable characters, <NL> and <CR> cause the selection to be deleted, and + Vim enters Insert mode. The typed character is inserted. +- Non-printable movement commands, with the Shift key pressed, extend the + selection. 'keymodel' must include "startsel". +- Non-printable movement commands, with the Shift key NOT pressed, stop Select + mode. 'keymodel' must include "stopsel". +- ESC stops Select mode. +- CTRL-O switches to Visual mode for the duration of one command. *v_CTRL-O* +- CTRL-G switches to Visual mode. + +Otherwise, typed characters are handled as in Visual mode. + +When using an operator in Select mode, and the selection is linewise, the +selected lines are operated upon, but like in characterwise selection. For +example, when a whole line is deleted, it can later be pasted halfway a line. + + +Mappings and menus in Select mode. *Select-mode-mapping* + +When mappings and menus are defined with the |:vmap| or |:vmenu| command they +work both in Visual mode and in Select mode. When these are used in Select +mode Vim automatically switches to Visual mode, so that the same behavior as +in Visual mode is effective. If you don't want this use |:xmap| or |:smap|. + +After the mapping or menu finishes, the selection is enabled again and Select +mode entered, unless the selected area was deleted, another buffer became +the current one or the window layout was changed. + +When a character was typed that causes the selection to be deleted and Insert +mode started, Insert mode mappings are applied to this character. This may +cause some confusion, because it means Insert mode mappings apply to a +character typed in Select mode. Language mappings apply as well. + + *gV* *v_gV* +gV Avoid the automatic reselection of the Visual area + after a Select mode mapping or menu has finished. + Put this just before the end of the mapping or menu. + At least it should be after any operations on the + selection. + + *gh* +gh Start Select mode, characterwise. This is like "v", + but starts Select mode instead of Visual mode. + Mnemonic: "get highlighted". + + *gH* +gH Start Select mode, linewise. This is like "V", + but starts Select mode instead of Visual mode. + Mnemonic: "get Highlighted". + + *g_CTRL-H* +g CTRL-H Start Select mode, blockwise. This is like CTRL-V, + but starts Select mode instead of Visual mode. + Mnemonic: "get Highlighted". + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/windows.txt b/Aufgabe5/doc.lang/windows.txt new file mode 100644 index 0000000..fb4a3b4 --- /dev/null +++ b/Aufgabe5/doc.lang/windows.txt @@ -0,0 +1,1175 @@ +*windows.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Editing with multiple windows and buffers. *windows* *buffers* + +The commands which have been added to use multiple windows and buffers are +explained here. Additionally, there are explanations for commands that work +differently when used in combination with more than one window. + +The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt| +|usr_08.txt|. + +1. Introduction |windows-intro| +2. Starting Vim |windows-starting| +3. Opening and closing a window |opening-window| +4. Moving cursor to other windows |window-move-cursor| +5. Moving windows around |window-moving| +6. Window resizing |window-resize| +7. Argument and buffer list commands |buffer-list| +8. Do a command in all buffers or windows |list-repeat| +9. Tag or file name under the cursor |window-tag| +10. The preview window |preview-window| +11. Using hidden buffers |buffer-hidden| +12. Special kinds of buffers |special-buffers| + +{Vi does not have any of these commands} +{not able to use multiple windows when the |+windows| feature was disabled at +compile time} +{not able to use vertically split windows when the |+vertsplit| feature was +disabled at compile time} + +============================================================================== +1. Introduction *windows-intro* *window* + +A window is a viewport onto a buffer. You can use multiple windows on one +buffer, or several windows on different buffers. + +A buffer is a file loaded into memory for editing. The original file remains +unchanged until you write the buffer to the file. + +A buffer can be in one of three states: + + *active-buffer* +active: The buffer is displayed in a window. If there is a file for this + buffer, it has been read into the buffer. The buffer may have been + modified since then and thus be different from the file. + *hidden-buffer* +hidden: The buffer is not displayed. If there is a file for this buffer, it + has been read into the buffer. Otherwise it's the same as an active + buffer, you just can't see it. + *inactive-buffer* +inactive: The buffer is not displayed and does not contain anything. Options + for the buffer are remembered if the file was once loaded. It can + contain marks from the |viminfo| file. But the buffer doesn't + contain text. + +In a table: + +state displayed loaded ":buffers" ~ + in window shows ~ +active yes yes 'a' +hidden no yes 'h' +inactive no no ' ' + +Note: All CTRL-W commands can also be executed with |:wincmd|, for those +places where a Normal mode command can't be used or is inconvenient. + +The main Vim window can hold several split windows. There are also tab pages +|tab-page|, each of which can hold multiple windows. + +============================================================================== +2. Starting Vim *windows-starting* + +By default, Vim starts with one window, just like Vi. + +The "-o" and "-O" arguments to Vim can be used to open a window for each file +in the argument list. The "-o" argument will split the windows horizontally; +the "-O" argument will split the windows vertically. If both "-o" and "-O" +are given, the last one encountered will be used to determine the split +orientation. For example, this will open three windows, split horizontally: > + vim -o file1 file2 file3 + +"-oN", where N is a decimal number, opens N windows split horizontally. If +there are more file names than windows, only N windows are opened and some +files do not get a window. If there are more windows than file names, the +last few windows will be editing empty buffers. Similarly, "-ON" opens N +windows split vertically, with the same restrictions. + +If there are many file names, the windows will become very small. You might +want to set the 'winheight' and/or 'winwidth' options to create a workable +situation. + +Buf/Win Enter/Leave |autocommand|s are not executed when opening the new +windows and reading the files, that's only done when they are really entered. + + *status-line* +A status line will be used to separate windows. The 'laststatus' option tells +when the last window also has a status line: + 'laststatus' = 0 never a status line + 'laststatus' = 1 status line if there is more than one window + 'laststatus' = 2 always a status line + +You can change the contents of the status line with the 'statusline' option. +This option can be local to the window, so that you can have a different +status line in each window. + +Normally, inversion is used to display the status line. This can be changed +with the 's' character in the 'highlight' option. For example, "sb" sets it to +bold characters. If no highlighting is used for the status line ("sn"), the +'^' character is used for the current window, and '=' for other windows. If +the mouse is supported and enabled with the 'mouse' option, a status line can +be dragged to resize windows. + +Note: If you expect your status line to be in reverse video and it isn't, +check if the 'highlight' option contains "si". In version 3.0, this meant to +invert the status line. Now it should be "sr", reverse the status line, as +"si" now stands for italic! If italic is not available on your terminal, the +status line is inverted anyway; you will only see this problem on terminals +that have termcap codes for italics. + +============================================================================== +3. Opening and closing a window *opening-window* *E36* + +CTRL-W s *CTRL-W_s* +CTRL-W S *CTRL-W_S* +CTRL-W CTRL-S *CTRL-W_CTRL-S* +:[N]sp[lit] [++opt] [+cmd] *:sp* *:split* + Split current window in two. The result is two viewports on + the same file. Make new window N high (default is to use half + the height of the current window). Reduces the current window + height to create room (and others, if the 'equalalways' option + is set and 'eadirection' isn't "hor"). + Note: CTRL-S does not work on all terminals and might block + further input, use CTRL-Q to get going again. + Also see |++opt| and |+cmd|. + +CTRL-W CTRL-V *CTRL-W_CTRL-V* +CTRL-W v *CTRL-W_v* +:[N]vs[plit] [++opt] [+cmd] [file] *:vs* *:vsplit* + Like |:split|, but split vertically. If 'equalalways' is set + and 'eadirection' isn't "ver" the windows will be spread out + horizontally, unless a width was specified. + Note: In other places CTRL-Q does the same as CTRL-V, but here + it doesn't! + +CTRL-W n *CTRL-W_n* +CTRL-W CTRL_N *CTRL-W_CTRL-N* +:[N]new [++opt] [+cmd] *:new* + Create a new window and start editing an empty file in it. + Make new window N high (default is to use half the existing + height). Reduces the current window height to create room (and + others, if the 'equalalways' option is set and 'eadirection' + isn't "hor"). + Also see |++opt| and |+cmd|. + If 'fileformats' is not empty, the first format given will be + used for the new buffer. If 'fileformats' is empty, the + 'fileformat' of the current buffer is used. This can be + overridden with the |++opt| argument. + Autocommands are executed in this order: + 1. WinLeave for the current window + 2. WinEnter for the new window + 3. BufLeave for the current buffer + 4. BufEnter for the new buffer + This behaves like a ":split" first, and then a ":e" command. + +:[N]vne[w] [++opt] [+cmd] [file] *:vne* *:vnew* + Like |:new|, but split vertically. If 'equalalways' is set + and 'eadirection' isn't "ver" the windows will be spread out + horizontally, unless a width was specified. + +:[N]new [++opt] [+cmd] {file} +:[N]sp[lit] [++opt] [+cmd] {file} *:split_f* + Create a new window and start editing file {file} in it. + If [+cmd] is given, execute the command when the file has been + loaded |+cmd|. + Also see |++opt|. + Make new window N high (default is to use half the existing + height). Reduces the current window height to create room + (and others, if the 'equalalways' option is set). + +:[N]sv[iew] [++opt] [+cmd] {file} *:sv* *:sview* *splitview* + Same as ":split", but set 'readonly' option for this buffer. + +:[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfind* *splitfind* + Same as ":split", but search for {file} in 'path'. Doesn't + split if {file} is not found. + +CTRL-W CTRL-^ *CTRL-W_CTRL-^* *CTRL-W_^* +CTRL-W ^ Does ":split #", split window in two and edit alternate file. + When a count is given, it becomes ":split #N", split window + and edit buffer N. + +Note that the 'splitbelow' and 'splitright' options influence where a new +window will appear. + + *:vert* *:vertical* +:vert[ical] {cmd} + Execute {cmd}. If it contains a command that splits a window, + it will be split vertically. + +:lefta[bove] {cmd} *:lefta* *:leftabove* +:abo[veleft] {cmd} *:abo* *:aboveleft* + Execute {cmd}. If it contains a command that splits a window, + it will be opened left (vertical split) or above (horizontal + split) the current window. Overrules 'splitbelow' and + 'splitright'. + +:rightb[elow] {cmd} *:rightb* *:rightbelow* +:bel[owright] {cmd} *:bel* *:belowright* + Execute {cmd}. If it contains a command that splits a window, + it will be opened right (vertical split) or below (horizontal + split) the current window. Overrules 'splitbelow' and + 'splitright'. + + *:topleft* *E442* +:to[pleft] {cmd} + Execute {cmd}. If it contains a command that splits a window, + it will appear at the top and occupy the full width of the Vim + window. When the split is vertical the window appears at the + far left and occupies the full height of the Vim window. + + *:botright* +:bo[tright] {cmd} + Execute {cmd}. If it contains a command that splits a window, + it will appear at the bottom and occupy the full width of the + Vim window. When the split is vertical the window appears at + the far right and occupies the full height of the Vim window. + +These command modifiers can be combined to make a vertically split window +occupy the full height. Example: > + :vertical topleft edit tags +Opens a vertically split, full-height window on the "tags" file at the far +left of the Vim window. + + +Closing a window +---------------- + +CTRL-W q *CTRL-W_q* +CTRL-W CTRL-Q *CTRL-W_CTRL-Q* +:q[uit] Quit current window. When quitting the last window (not + counting a help window), exit Vim. + When 'hidden' is set, and there is only one window for the + current buffer, it becomes hidden. + When 'hidden' is not set, and there is only one window for the + current buffer, and the buffer was changed, the command fails. + (Note: CTRL-Q does not work on all terminals) + +:q[uit]! Quit current window. If this was the last window for a buffer, + any changes to that buffer are lost. When quitting the last + window (not counting help windows), exit Vim. The contents of + the buffer are lost, even when 'hidden' is set. + +CTRL-W c *CTRL-W_c* *:clo* *:close* +:clo[se][!] Close current window. When the 'hidden' option is set, or + when the buffer was changed and the [!] is used, the buffer + becomes hidden (unless there is another window editing it). + When there is only one window in the current tab page and + there is another tab page, this closes the current tab page. + |tab-page|. + This command fails when: *E444* + - There is only one window on the screen. + - When 'hidden' is not set, [!] is not used, the buffer has + changes, and there is no other window on this buffer. + Changes to the buffer are not written and won't get lost, so + this is a "safe" command. + +CTRL-W CTRL-C *CTRL-W_CTRL-C* + You might have expected that CTRL-W CTRL-C closes the current + window, but that does not work, because the CTRL-C cancels the + command. + + *:hide* +:hid[e] Quit current window, unless it is the last window on the + screen. The buffer becomes hidden (unless there is another + window editing it or 'bufhidden' is "unload" or "delete"). + If the window is the last one in the current tab page the tab + page is closed. |tab-page| + The value of 'hidden' is irrelevant for this command. + Changes to the buffer are not written and won't get lost, so + this is a "safe" command. + +:hid[e] {cmd} Execute {cmd} with 'hidden' is set. The previous value of + 'hidden' is restored after {cmd} has been executed. + Example: > + :hide edit Makefile +< This will edit "Makefile", and hide the current buffer if it + has any changes. + +CTRL-W o *CTRL-W_o* *E445* +CTRL-W CTRL-O *CTRL-W_CTRL-O* *:on* *:only* +:on[ly][!] Make the current window the only one on the screen. All other + windows are closed. + When the 'hidden' option is set, all buffers in closed windows + become hidden. + When 'hidden' is not set, and the 'autowrite' option is set, + modified buffers are written. Otherwise, windows that have + buffers that are modified are not removed, unless the [!] is + given, then they become hidden. But modified buffers are + never abandoned, so changes cannot get lost. + +============================================================================== +4. Moving cursor to other windows *window-move-cursor* + +CTRL-W <Down> *CTRL-W_<Down>* +CTRL-W CTRL-J *CTRL-W_CTRL-J* *CTRL-W_j* +CTRL-W j Move cursor to Nth window below current one. Uses the cursor + position to select between alternatives. + +CTRL-W <Up> *CTRL-W_<Up>* +CTRL-W CTRL-K *CTRL-W_CTRL-K* *CTRL-W_k* +CTRL-W k Move cursor to Nth window above current one. Uses the cursor + position to select between alternatives. + +CTRL-W <Left> *CTRL-W_<Left>* +CTRL-W CTRL-H *CTRL-W_CTRL-H* +CTRL-W <BS> *CTRL-W_<BS>* *CTRL-W_h* +CTRL-W h Move cursor to Nth window left of current one. Uses the + cursor position to select between alternatives. + +CTRL-W <Right> *CTRL-W_<Right>* +CTRL-W CTRL-L *CTRL-W_CTRL-L* *CTRL-W_l* +CTRL-W l Move cursor to Nth window right of current one. Uses the + cursor position to select between alternatives. + +CTRL-W w *CTRL-W_w* *CTRL-W_CTRL-W* +CTRL-W CTRL-W Without count: move cursor to window below/right of the + current one. If there is no window below or right, go to + top-left window. + With count: go to Nth window (windows are numbered from + top-left to bottom-right). To obtain the window number see + |bufwinnr()| and |winnr()|. + + *CTRL-W_W* +CTRL-W W Without count: move cursor to window above/left of current + one. If there is no window above or left, go to bottom-right + window. With count: go to Nth window (windows are numbered + from top-left to bottom-right). + +CTRL-W t *CTRL-W_t* *CTRL-W_CTRL-T* +CTRL-W CTRL-T Move cursor to top-left window. + +CTRL-W b *CTRL-W_b* *CTRL-W_CTRL-B* +CTRL-W CTRL-B Move cursor to bottom-right window. + +CTRL-W p *CTRL-W_p* *CTRL-W_CTRL-P* +CTRL-W CTRL-P Go to previous (last accessed) window. + + *CTRL-W_P* *E441* +CTRL-W P Go to preview window. When there is no preview window this is + an error. + {not available when compiled without the |+quickfix| feature} + +If Visual mode is active and the new window is not for the same buffer, the +Visual mode is ended. If the window is on the same buffer, the cursor +position is set to keep the same Visual area selected. + + *:winc* *:wincmd* +These commands can also be executed with ":wincmd": + +:[count]winc[md] {arg} + Like executing CTRL-W [count] {arg}. Example: > + :wincmd j +< Moves to the window below the current one. + This command is useful when a Normal mode cannot be used (for + the |CursorHold| autocommand event). Or when a Normal mode + command is inconvenient. + The count can also be a window number. Example: > + :exe nr . "wincmd w" +< This goes to window "nr". + +============================================================================== +5. Moving windows around *window-moving* + +CTRL-W r *CTRL-W_r* *CTRL-W_CTRL-R* *E443* +CTRL-W CTRL-R Rotate windows downwards/rightwards. The first window becomes + the second one, the second one becomes the third one, etc. + The last window becomes the first window. The cursor remains + in the same window. + This only works within the row or column of windows that the + current window is in. + + *CTRL-W_R* +CTRL-W R Rotate windows upwards/leftwards. The second window becomes + the first one, the third one becomes the second one, etc. The + first window becomes the last window. The cursor remains in + the same window. + This only works within the row or column of windows that the + current window is in. + +CTRL-W x *CTRL-W_x* *CTRL-W_CTRL-X* +CTRL-W CTRL-X Without count: Exchange current window with next one. If there + is no next window, exchange with previous window. + With count: Exchange current window with Nth window (first + window is 1). The cursor is put in the other window. + When vertical and horizontal window splits are mixed, the + exchange is only done in the row or column of windows that the + current window is in. + +The following commands can be used to change the window layout. For example, +when there are two vertically split windows, CTRL-W K will change that in +horizontally split windows. CTRL-W H does it the other way around. + + *CTRL-W_K* +CTRL-W K Move the current window to be at the very top, using the full + width of the screen. This works like closing the current + window and then creating another one with ":topleft split", + except that the current window contents is used for the new + window. + + *CTRL-W_J* +CTRL-W J Move the current window to be at the very bottom, using the + full width of the screen. This works like closing the current + window and then creating another one with ":botright split", + except that the current window contents is used for the new + window. + + *CTRL-W_H* +CTRL-W H Move the current window to be at the far left, using the + full height of the screen. This works like closing the + current window and then creating another one with + ":vert topleft split", except that the current window contents + is used for the new window. + {not available when compiled without the +vertsplit feature} + + *CTRL-W_L* +CTRL-W L Move the current window to be at the far right, using the full + height of the screen. This works like closing the + current window and then creating another one with + ":vert botright split", except that the current window + contents is used for the new window. + {not available when compiled without the +vertsplit feature} + + *CTRL-W_T* +CTRL-W T Move the current window to a new tab page. This fails if + there is only one window in the current tab page. + When a count is specified the new tab page will be opened + before the tab page with this index. Otherwise it comes after + the current tab page. + +============================================================================== +6. Window resizing *window-resize* + + *CTRL-W_=* +CTRL-W = Make all windows (almost) equally high and wide, but use + 'winheight' and 'winwidth' for the current window. + +:res[ize] -N *:res* *:resize* *CTRL-W_-* +CTRL-W - Decrease current window height by N (default 1). + If used after 'vertical': decrease width by N. + +:res[ize] +N *CTRL-W_+* +CTRL-W + Increase current window height by N (default 1). + If used after 'vertical': increase width by N. + +:res[ize] [N] +CTRL-W CTRL-_ *CTRL-W_CTRL-_* *CTRL-W__* +CTRL-W _ Set current window height to N (default: highest possible). + +z{nr}<CR> Set current window height to {nr}. + + *CTRL-W_<* +CTRL-W < Decrease current window width by N (default 1). + + *CTRL-W_>* +CTRL-W > Increase current window width by N (default 1). + +:vertical res[ize] [N] *:vertical-resize* *CTRL-W_bar* +CTRL-W | Set current window width to N (default: widest possible). + +You can also resize a window by dragging a status line up or down with the +mouse. Or by dragging a vertical separator line left or right. This only +works if the version of Vim that is being used supports the mouse and the +'mouse' option has been set to enable it. + +The option 'winheight' ('wh') is used to set the minimal window height of the +current window. This option is used each time another window becomes the +current window. If the option is '0', it is disabled. Set 'winheight' to a +very large value, e.g., '9999', to make the current window always fill all +available space. Set it to a reasonable value, e.g., '10', to make editing in +the current window comfortable. + +The equivalent 'winwidth' ('wiw') option is used to set the minimal width of +the current window. + +When the option 'equalalways' ('ea') is set, all the windows are automatically +made the same size after splitting or closing a window. If you don't set this +option, splitting a window will reduce the size of the current window and +leave the other windows the same. When closing a window, the extra lines are +given to the window above it. + +The 'eadirection' option limits the direction in which the 'equalalways' +option is applied. The default "both" resizes in both directions. When the +value is "ver" only the heights of windows are equalized. Use this when you +have manually resized a vertically split window and want to keep this width. +Likewise, "hor" causes only the widths of windows to be equalized. + +The option 'cmdheight' ('ch') is used to set the height of the command-line. +If you are annoyed by the |hit-enter| prompt for long messages, set this +option to 2 or 3. + +If there is only one window, resizing that window will also change the command +line height. If there are several windows, resizing the current window will +also change the height of the window below it (and sometimes the window above +it). + +The minimal height and width of a window is set with 'winminheight' and +'winminwidth'. These are hard values, a window will never become smaller. + +============================================================================== +7. Argument and buffer list commands *buffer-list* + + args list buffer list meaning ~ +1. :[N]argument [N] 11. :[N]buffer [N] to arg/buf N +2. :[N]next [file ..] 12. :[N]bnext [N] to Nth next arg/buf +3. :[N]Next [N] 13. :[N]bNext [N] to Nth previous arg/buf +4. :[N]previous [N] 14. :[N]bprevious [N] to Nth previous arg/buf +5. :rewind / :first 15. :brewind / :bfirst to first arg/buf +6. :last 16. :blast to last arg/buf +7. :all 17. :ball edit all args/buffers + 18. :unhide edit all loaded buffers + 19. :[N]bmod [N] to Nth modified buf + + split & args list split & buffer list meaning ~ +21. :[N]sargument [N] 31. :[N]sbuffer [N] split + to arg/buf N +22. :[N]snext [file ..] 32. :[N]sbnext [N] split + to Nth next arg/buf +23. :[N]sNext [N] 33. :[N]sbNext [N] split + to Nth previous arg/buf +24. :[N]sprevious [N] 34. :[N]sbprevious [N] split + to Nth previous arg/buf +25. :srewind / :sfirst 35. :sbrewind / :sbfirst split + to first arg/buf +26. :slast 36. :sblast split + to last arg/buf +27. :sall 37. :sball edit all args/buffers + 38. :sunhide edit all loaded buffers + 39. :[N]sbmod [N] split + to Nth modified buf + +40. :args list of arguments +41. :buffers list of buffers + +The meaning of [N] depends on the command: + [N] is number of buffers to go forward/backward on ?2, ?3, and ?4 + [N] is an argument number, defaulting to current argument, for 1 and 21 + [N] is a buffer number, defaulting to current buffer, for 11 and 31 + [N] is a count for 19 and 39 + +Note: ":next" is an exception, because it must accept a list of file names +for compatibility with Vi. + + +The argument list and multiple windows +-------------------------------------- + +The current position in the argument list can be different for each window. +Remember that when doing ":e file", the position in the argument list stays +the same, but you are not editing the file at that position. To indicate +this, the file message (and the title, if you have one) shows +"(file (N) of M)", where "(N)" is the current position in the file list, and +"M" the number of files in the file list. + +All the entries in the argument list are added to the buffer list. Thus, you +can also get to them with the buffer list commands, like ":bnext". + +:[N]al[l][!] [N] *:al* *:all* *:sal* *:sall* +:[N]sal[l][!] [N] + Rearrange the screen to open one window for each argument. + All other windows are closed. When a count is given, this is + the maximum number of windows to open. + With the |:tab| modifier open a tab page for each argument. + When there are more arguments than 'tabpagemax' further ones + become split windows in the last tab page. + When the 'hidden' option is set, all buffers in closed windows + become hidden. + When 'hidden' is not set, and the 'autowrite' option is set, + modified buffers are written. Otherwise, windows that have + buffers that are modified are not removed, unless the [!] is + given, then they become hidden. But modified buffers are + never abandoned, so changes cannot get lost. + [N] is the maximum number of windows to open. 'winheight' + also limits the number of windows opened ('winwidth' if + |:vertical| was prepended). + Buf/Win Enter/Leave autocommands are not executed for the new + windows here, that's only done when they are really entered. + +:[N]sa[rgument][!] [++opt] [+cmd] [N] *:sa* *:sargument* + Short for ":split | argument [N]": split window and go to Nth + argument. But when there is no such argument, the window is + not split. Also see |++opt| and |+cmd|. + +:[N]sn[ext][!] [++opt] [+cmd] [file ..] *:sn* *:snext* + Short for ":split | [N]next": split window and go to Nth next + argument. But when there is no next file, the window is not + split. Also see |++opt| and |+cmd|. + +:[N]spr[evious][!] [++opt] [+cmd] [N] *:spr* *:sprevious* +:[N]sN[ext][!] [++opt] [+cmd] [N] *:sN* *:sNext* + Short for ":split | [N]Next": split window and go to Nth + previous argument. But when there is no previous file, the + window is not split. Also see |++opt| and |+cmd|. + + *:sre* *:srewind* +:sre[wind][!] [++opt] [+cmd] + Short for ":split | rewind": split window and go to first + argument. But when there is no argument list, the window is + not split. Also see |++opt| and |+cmd|. + + *:sfir* *:sfirst* +:sfir[st] [++opt] [+cmd] + Same as ":srewind". + + *:sla* *:slast* +:sla[st][!] [++opt] [+cmd] + Short for ":split | last": split window and go to last + argument. But when there is no argument list, the window is + not split. Also see |++opt| and |+cmd|. + + *:dr* *:drop* +:dr[op] {file} .. + Edit the first {file} in a window. + - If the file is already open in a window change to that + window. + - If the file is not open in a window edit the file in the + current window. If the current buffer can't be |abandon|ed, + the window is split first. + The |argument-list| is set, like with the |:next| command. + The purpose of this command is that it can be used from a + program that wants Vim to edit another file, e.g., a debugger. + When using the |:tab| modifier each argument is opened in a + tab page. The last window is used if it's empty. + {only available when compiled with the +gui feature} + +============================================================================== +8. Do a command in all buffers or windows *list-repeat* + + *:windo* +:windo {cmd} Execute {cmd} in each window. + It works like doing this: > + CTRL-W t + :{cmd} + CTRL-W w + :{cmd} + etc. +< This only operates in the current tab page. + When an error is detected on one window, further + windows will not be visited. + The last window (or where an error occurred) becomes + the current window. + {cmd} can contain '|' to concatenate several commands. + {cmd} must not open or close windows or reorder them. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Also see |:tabdo|, |:argdo| and |:bufdo|. + + *:bufdo* +:bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list. + It works like doing this: > + :bfirst + :{cmd} + :bnext + :{cmd} + etc. +< When the current file can't be |abandon|ed and the [!] + is not present, the command fails. + When an error is detected on one buffer, further + buffers will not be visited. + Unlisted buffers are skipped. + The last buffer (or where an error occurred) becomes + the current buffer. + {cmd} can contain '|' to concatenate several commands. + {cmd} must not delete buffers or add buffers to the + buffer list. + Note: While this command is executing, the Syntax + autocommand event is disabled by adding it to + 'eventignore'. This considerably speeds up editing + each buffer. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Also see |:tabdo|, |:argdo| and |:windo|. + +Examples: > + + :windo set nolist nofoldcolumn | normal zn + +This resets the 'list' option and disables folding in all windows. > + + :bufdo set fileencoding= | update + +This resets the 'fileencoding' in each buffer and writes it if this changed +the buffer. The result is that all buffers will use the 'encoding' encoding +(if conversion works properly). + +============================================================================== +9. Tag or file name under the cursor *window-tag* + + *:sta* *:stag* +:sta[g][!] [tagname] + Does ":tag[!] [tagname]" and splits the window for the found + tag. See also |:tag|. + +CTRL-W ] *CTRL-W_]* *CTRL-W_CTRL-]* +CTRL-W CTRL-] Split current window in two. Use identifier under cursor as a + tag and jump to it in the new upper window. Make new window N + high. + + *CTRL-W_g]* +CTRL-W g ] Split current window in two. Use identifier under cursor as a + tag and perform ":tselect" on it in the new upper window. + Make new window N high. + + *CTRL-W_g_CTRL-]* +CTRL-W g CTRL-] Split current window in two. Use identifier under cursor as a + tag and perform ":tjump" on it in the new upper window. Make + new window N high. + +CTRL-W f *CTRL-W_f* *CTRL-W_CTRL-F* +CTRL-W CTRL-F Split current window in two. Edit file name under cursor. + Like ":split gf", but window isn't split if the file does not + exist. + Uses the 'path' variable as a list of directory names where to + look for the file. Also the path for current file is + used to search for the file name. + If the name is a hypertext link that looks like + "type://machine/path", only "/path" is used. + If a count is given, the count'th matching file is edited. + {not available when the |+file_in_path| feature was disabled + at compile time} + +CTRL-W F *CTRL-W_F* + Split current window in two. Edit file name under cursor and + jump to the line number following the file name. See |gF| for + details on how the line number is obtained. + {not available when the |+file_in_path| feature was disabled + at compile time} + +CTRL-W gf *CTRL-W_gf* + Open a new tab page and edit the file name under the cursor. + Like "tab split" and "gf", but the new tab page isn't created + if the file does not exist. + {not available when the |+file_in_path| feature was disabled + at compile time} + +CTRL-W gF *CTRL-W_gF* + Open a new tab page and edit the file name under the cursor + and jump to the line number following the file name. Like + "tab split" and "gF", but the new tab page isn't created if + the file does not exist. + {not available when the |+file_in_path| feature was disabled + at compile time} + +Also see |CTRL-W_CTRL-I|: open window for an included file that includes +the keyword under the cursor. + +============================================================================== +10. The preview window *preview-window* + +The preview window is a special window to show (preview) another file. It is +normally a small window used to show an include file or definition of a +function. +{not available when compiled without the |+quickfix| feature} + +There can be only one preview window (per tab page). It is created with one +of the commands below. The 'previewheight' option can be set to specify the +height of the preview window when it's opened. The 'previewwindow' option is +set in the preview window to be able to recognize it. The 'winfixheight' +option is set to have it keep the same height when opening/closing other +windows. + + *:pta* *:ptag* +:pta[g][!] [tagname] + Does ":tag[!] [tagname]" and shows the found tag in a + "Preview" window without changing the current buffer or cursor + position. If a "Preview" window already exists, it is re-used + (like a help window is). If a new one is opened, + 'previewheight' is used for the height of the window. See + also |:tag|. + See below for an example. |CursorHold-example| + Small difference from |:tag|: When [tagname] is equal to the + already displayed tag, the position in the matching tag list + is not reset. This makes the CursorHold example work after a + |:ptnext|. + +CTRL-W z *CTRL-W_z* +CTRL-W CTRL-Z *CTRL-W_CTRL-Z* *:pc* *:pclose* +:pc[lose][!] Close any "Preview" window currently open. When the 'hidden' + option is set, or when the buffer was changed and the [!] is + used, the buffer becomes hidden (unless there is another + window editing it). The command fails if any "Preview" buffer + cannot be closed. See also |:close|. + + *:pp* *:ppop* +:[count]pp[op][!] + Does ":[count]pop[!]" in the preview window. See |:pop| and + |:ptag|. {not in Vi} + +CTRL-W } *CTRL-W_}* + Use identifier under cursor as a tag and perform a :ptag on + it. Make the new Preview window (if required) N high. If N is + not given, 'previewheight' is used. + +CTRL-W g } *CTRL-W_g}* + Use identifier under cursor as a tag and perform a :ptjump on + it. Make the new Preview window (if required) N high. If N is + not given, 'previewheight' is used. + + *:ped* *:pedit* +:ped[it][!] [++opt] [+cmd] {file} + Edit {file} in the preview window. The preview window is + opened like with |:ptag|. The current window and cursor + position isn't changed. Useful example: > + :pedit +/fputc /usr/include/stdio.h +< + *:ps* *:psearch* +:[range]ps[earch][!] [count] [/]pattern[/] + Works like |:ijump| but shows the found match in the preview + window. The preview window is opened like with |:ptag|. The + current window and cursor position isn't changed. Useful + example: > + :psearch popen +< Like with the |:ptag| command, you can use this to + automatically show information about the word under the + cursor. This is less clever than using |:ptag|, but you don't + need a tags file and it will also find matches in system + include files. Example: > + :au! CursorHold *.[ch] nested exe "silent! psearch " . expand("<cword>") +< Warning: This can be slow. + +Example *CursorHold-example* > + + :au! CursorHold *.[ch] nested exe "silent! ptag " . expand("<cword>") + +This will cause a ":ptag" to be executed for the keyword under the cursor, +when the cursor hasn't moved for the time set with 'updatetime'. The "nested" +makes other autocommands be executed, so that syntax highlighting works in the +preview window. The "silent!" avoids an error message when the tag could not +be found. Also see |CursorHold|. To disable this again: > + + :au! CursorHold + +A nice addition is to highlight the found tag, avoid the ":ptag" when there +is no word under the cursor, and a few other things: > + + :au! CursorHold *.[ch] nested call PreviewWord() + :func PreviewWord() + : if &previewwindow " don't do this in the preview window + : return + : endif + : let w = expand("<cword>") " get the word under cursor + : if w =~ '\a' " if the word contains a letter + : + : " Delete any existing highlight before showing another tag + : silent! wincmd P " jump to preview window + : if &previewwindow " if we really get there... + : match none " delete existing highlight + : wincmd p " back to old window + : endif + : + : " Try displaying a matching tag for the word under the cursor + : try + : exe "ptag " . w + : catch + : return + : endtry + : + : silent! wincmd P " jump to preview window + : if &previewwindow " if we really get there... + : if has("folding") + : silent! .foldopen " don't want a closed fold + : endif + : call search("$", "b") " to end of previous line + : let w = substitute(w, '\\', '\\\\', "") + : call search('\<\V' . w . '\>') " position cursor on match + : " Add a match highlight to the word at this position + : hi previewWord term=bold ctermbg=green guibg=green + : exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"' + : wincmd p " back to old window + : endif + : endif + :endfun + +============================================================================== +11. Using hidden buffers *buffer-hidden* + +A hidden buffer is not displayed in a window, but is still loaded into memory. +This makes it possible to jump from file to file, without the need to read or +write the file every time you get another buffer in a window. +{not available when compiled without the |+listcmds| feature} + + *:buffer-!* +If the option 'hidden' ('hid') is set, abandoned buffers are kept for all +commands that start editing another file: ":edit", ":next", ":tag", etc. The +commands that move through the buffer list sometimes make the current buffer +hidden although the 'hidden' option is not set. This happens when a buffer is +modified, but is forced (with '!') to be removed from a window, and +'autowrite' is off or the buffer can't be written. + +You can make a hidden buffer not hidden by starting to edit it with any +command. Or by deleting it with the ":bdelete" command. + +The 'hidden' is global, it is used for all buffers. The 'bufhidden' option +can be used to make an exception for a specific buffer. It can take these +values: + <empty> Use the value of 'hidden'. + hide Hide this buffer, also when 'hidden' is not set. + unload Don't hide but unload this buffer, also when 'hidden' + is set. + delete Delete the buffer. + + *hidden-quit* +When you try to quit Vim while there is a hidden, modified buffer, you will +get an error message and Vim will make that buffer the current buffer. You +can then decide to write this buffer (":wq") or quit without writing (":q!"). +Be careful: there may be more hidden, modified buffers! + +A buffer can also be unlisted. This means it exists, but it is not in the +list of buffers. |unlisted-buffer| + + +:files[!] *:files* +:buffers[!] *:buffers* *:ls* +:ls[!] Show all buffers. Example: + + 1 #h "/test/text" line 1 ~ + 2u "asdf" line 0 ~ + 3 %a+ "version.c" line 1 ~ + + When the [!] is included the list will show unlisted buffers + (the term "unlisted" is a bit confusing then...). + + Each buffer has a unique number. That number will not change, + so you can always go to a specific buffer with ":buffer N" or + "N CTRL-^", where N is the buffer number. + + Indicators (chars in the same column are mutually exclusive): + u an unlisted buffer (only displayed when [!] is used) + |unlisted-buffer| + % the buffer in the current window + # the alternate buffer for ":e #" and CTRL-^ + a an active buffer: it is loaded and visible + h a hidden buffer: It is loaded, but currently not + displayed in a window |hidden-buffer| + - a buffer with 'modifiable' off + = a readonly buffer + + a modified buffer + x a buffer with read errors + + *:bad* *:badd* +:bad[d] [+lnum] {fname} + Add file name {fname} to the buffer list, without loading it. + If "lnum" is specified, the cursor will be positioned at that + line when the buffer is first entered. Note that other + commands after the + will be ignored. + +:[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516* +:bd[elete][!] [N] + Unload buffer [N] (default: current buffer) and delete it from + the buffer list. If the buffer was changed, this fails, + unless when [!] is specified, in which case changes are lost. + The file remains unaffected. Any windows for this buffer are + closed. If buffer [N] is the current buffer, another buffer + will be displayed instead. This is the most recent entry in + the jump list that points into a loaded buffer. + Actually, the buffer isn't completely deleted, it is removed + from the buffer list |unlisted-buffer| and option values, + variables and mappings/abbreviations for the buffer are + cleared. + +:bdelete[!] {bufname} *E93* *E94* + Like ":bdelete[!] [N]", but buffer given by name. Note that a + buffer whose name is a number cannot be referenced by that + name; use the buffer number instead. Insert a backslash + before a space in a buffer name. + +:bdelete[!] N1 N2 ... + Do ":bdelete[!]" for buffer N1, N2, etc. The arguments can be + buffer numbers or buffer names (but not buffer names that are + a number). Insert a backslash before a space in a buffer + name. + +:N,Mbdelete[!] Do ":bdelete[!]" for all buffers in the range N to M + |inclusive|. + +:[N]bw[ipeout][!] *:bw* *:bwipe* *:bwipeout* *E517* +:bw[ipeout][!] {bufname} +:N,Mbw[ipeout][!] +:bw[ipeout][!] N1 N2 ... + Like |:bdelete|, but really delete the buffer. Everything + related to the buffer is lost. All marks in this buffer + become invalid, option settings are lost, etc. Don't use this + unless you know what you are doing. + +:[N]bun[load][!] *:bun* *:bunload* *E515* +:bun[load][!] [N] + Unload buffer [N] (default: current buffer). The memory + allocated for this buffer will be freed. The buffer remains + in the buffer list. + If the buffer was changed, this fails, unless when [!] is + specified, in which case the changes are lost. + Any windows for this buffer are closed. If buffer [N] is the + current buffer, another buffer will be displayed instead. + This is the most recent entry in the jump list that points + into a loaded buffer. + +:bunload[!] {bufname} + Like ":bunload[!] [N]", but buffer given by name. Note that a + buffer whose name is a number cannot be referenced by that + name; use the buffer number instead. Insert a backslash + before a space in a buffer name. + +:N,Mbunload[!] Do ":bunload[!]" for all buffers in the range N to M + |inclusive|. + +:bunload[!] N1 N2 ... + Do ":bunload[!]" for buffer N1, N2, etc. The arguments can be + buffer numbers or buffer names (but not buffer names that are + a number). Insert a backslash before a space in a buffer + name. + +:[N]b[uffer][!] [N] *:b* *:bu* *:buf* *:buffer* *E86* + Edit buffer [N] from the buffer list. If [N] is not given, + the current buffer remains being edited. See |:buffer-!| for + [!]. This will also edit a buffer that is not in the buffer + list, without setting the 'buflisted' flag. + +:[N]b[uffer][!] {filename} + Edit buffer for {filename} from the buffer list. See + |:buffer-!| for [!]. This will also edit a buffer that is not + in the buffer list, without setting the 'buflisted' flag. + +:[N]sb[uffer] [N] *:sb* *:sbuffer* + Split window and edit buffer [N] from the buffer list. If [N] + is not given, the current buffer is edited. Respects the + "useopen" setting of 'switchbuf' when splitting. This will + also edit a buffer that is not in the buffer list, without + setting the 'buflisted' flag. + +:[N]sb[uffer] {filename} + Split window and edit buffer for {filename} from the buffer + list. This will also edit a buffer that is not in the buffer + list, without setting the 'buflisted' flag. + Note: If what you want to do is split the buffer, make a copy + under another name, you can do it this way: > + :w foobar | sp # + +:[N]bn[ext][!] [N] *:bn* *:bnext* *E87* + Go to [N]th next buffer in buffer list. [N] defaults to one. + Wraps around the end of the buffer list. + See |:buffer-!| for [!]. + If you are in a help buffer, this takes you to the next help + buffer (if there is one). Similarly, if you are in a normal + (non-help) buffer, this takes you to the next normal buffer. + This is so that if you have invoked help, it doesn't get in + the way when you're browsing code/text buffers. The next three + commands also work like this. + + *:sbn* *:sbnext* +:[N]sbn[ext] [N] + Split window and go to [N]th next buffer in buffer list. + Wraps around the end of the buffer list. Uses 'switchbuf' + +:[N]bN[ext][!] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88* +:[N]bp[revious][!] [N] + Go to [N]th previous buffer in buffer list. [N] defaults to + one. Wraps around the start of the buffer list. + See |:buffer-!| for [!] and 'switchbuf'. + +:[N]sbN[ext] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious* +:[N]sbp[revious] [N] + Split window and go to [N]th previous buffer in buffer list. + Wraps around the start of the buffer list. + Uses 'switchbuf'. + + *:br* *:brewind* +:br[ewind][!] Go to first buffer in buffer list. If the buffer list is + empty, go to the first unlisted buffer. + See |:buffer-!| for [!]. + + *:bf* *:bfirst* +:bf[irst] Same as ":brewind". + + *:sbr* *:sbrewind* +:sbr[ewind] Split window and go to first buffer in buffer list. If the + buffer list is empty, go to the first unlisted buffer. + Respects the 'switchbuf' option. + + *:sbf* *:sbfirst* +:sbf[irst] Same as ":sbrewind". + + *:bl* *:blast* +:bl[ast][!] Go to last buffer in buffer list. If the buffer list is + empty, go to the last unlisted buffer. + See |:buffer-!| for [!]. + + *:sbl* *:sblast* +:sbl[ast] Split window and go to last buffer in buffer list. If the + buffer list is empty, go to the last unlisted buffer. + Respects 'switchbuf' option. + +:[N]bm[odified][!] [N] *:bm* *:bmodified* *E84* + Go to [N]th next modified buffer. Note: this command also + finds unlisted buffers. If there is no modified buffer the + command fails. + +:[N]sbm[odified] [N] *:sbm* *:sbmodified* + Split window and go to [N]th next modified buffer. + Respects 'switchbuf' option. + Note: this command also finds buffers not in the buffer list. + +:[N]unh[ide] [N] *:unh* *:unhide* *:sun* *:sunhide* +:[N]sun[hide] [N] + Rearrange the screen to open one window for each loaded buffer + in the buffer list. When a count is given, this is the + maximum number of windows to open. + +:[N]ba[ll] [N] *:ba* *:ball* *:sba* *:sball* +:[N]sba[ll] [N] Rearrange the screen to open one window for each buffer in + the buffer list. When a count is given, this is the maximum + number of windows to open. 'winheight' also limits the number + of windows opened ('winwidth' if |:vertical| was prepended). + Buf/Win Enter/Leave autocommands are not executed for the new + windows here, that's only done when they are really entered. + When the |:tab| modifier is used new windows are opended in a + new tab, up to 'tabpagemax'. + +Note: All the commands above that start editing another buffer, keep the +'readonly' flag as it was. This differs from the ":edit" command, which sets +the 'readonly' flag each time the file is read. + +============================================================================== +12. Special kinds of buffers *special-buffers* + +Instead of containing the text of a file, buffers can also be used for other +purposes. A few options can be set to change the behavior of a buffer: + 'bufhidden' what happens when the buffer is no longer displayed + in a window. + 'buftype' what kind of a buffer this is + 'swapfile' whether the buffer will have a swap file + 'buflisted' buffer shows up in the buffer list + +A few useful kinds of a buffer: + +quickfix Used to contain the error list or the location list. See + |:cwindow| and |:lwindow|. This command sets the 'buftype' + option to "quickfix". You are not supposed to change this! + 'swapfile' is off. + +help Contains a help file. Will only be created with the |:help| + command. The flag that indicates a help buffer is internal + and can't be changed. The 'buflisted' option will be reset + for a help buffer. + +directory Displays directory contents. Can be used by a file explorer + plugin. The buffer is created with these settings: > + :setlocal buftype=nowrite + :setlocal bufhidden=delete + :setlocal noswapfile +< The buffer name is the name of the directory and is adjusted + when using the |:cd| command. + +scratch Contains text that can be discarded at any time. It is kept + when closing the window, it must be deleted explicitly. + Settings: > + :setlocal buftype=nofile + :setlocal bufhidden=hide + :setlocal noswapfile +< The buffer name can be used to identify the buffer. + + *unlisted-buffer* +unlisted The buffer is not in the buffer list. It is not used for + normal editing, but to show a help file, remember a file name + or marks. The ":bdelete" command will also set this option, + thus it doesn't completely delete the buffer. Settings: > + :setlocal nobuflisted +< + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/doc.lang/workshop.txt b/Aufgabe5/doc.lang/workshop.txt new file mode 100644 index 0000000..21b80ce --- /dev/null +++ b/Aufgabe5/doc.lang/workshop.txt @@ -0,0 +1,98 @@ +*workshop.txt* For Vim version 7.0. Last change: 2006 Apr 24 + + + VIM REFERENCE MANUAL by Gordon Prieur + + +Sun Visual WorkShop Features *workshop* *workshop-support* + +1. Introduction |workshop-intro| +2. Commands |workshop-commands| +3. Compiling vim/gvim for WorkShop |workshop-compiling| +4. Configuring gvim for a WorkShop release tree |workshop-configure| +5. Obtaining the latest version of the XPM library |workshop-xpm| + +{Vi does not have any of these features} +{only available when compiled with the |+sun_workshop| feature} + +============================================================================== +1. Introduction *workshop-intro* + +Sun Visual WorkShop has an "Editor of Choice" feature designed to let users +debug using their favorite editors. For the 6.0 release we have added support +for gvim. A workshop debug session will have a debugging window and an editor +window (possibly others as well). The user can do many debugging operations +from the editor window, minimizing the need to switch from window to window. + +The version of vim shipped with Sun Visual WorkShop 6 (also called Forte +Developer 6) is vim 5.3. The features in this release are much more reliable +than the vim/gvim shipped with Visual WorkShop. VWS users wishing to use vim +as their editor should compile these sources and install them in their +workshop release tree. + +============================================================================== +2. Commands *workshop-commands* + + *:ws* *:wsverb* +:ws[verb] verb Pass the verb to the verb executor + +Pass the verb to a workshop function which gathers some arguments and +sends the verb and data to workshop over an IPC connection. + +============================================================================== +3. Compiling vim/gvim for WorkShop *workshop-compiling* + +Compiling vim with FEAT_SUN_WORKSHOP turns on all compile time flags necessary +for building a vim to work with Visual WorkShop. The features required for VWS +have been built and tested using the Sun compilers from the VWS release. They +have not been built or tested using Gnu compilers. This does not mean the +features won't build and run if compiled with gcc, just that nothing is +guaranteed with gcc! + +============================================================================== +4. Configuring gvim for a WorkShop release tree *workshop-configure* + +There are several assumptions which must be met in order to compile a gvim for +use with Sun Visual WorkShop 6. + + o You should use the compiler in VWS rather than gcc. We have neither + built nor tested with gcc and cannot guarantee it will build properly. + + o You must supply your own XPM library. See |workshop-xpm| below for + details on obtaining the latest version of XPM. + + o Edit the Makefile in the src directory and uncomment the lines for Sun + Visual WorkShop. You can easily find these by searching for the string + FEAT_SUN_WORKSHOP + + o We also suggest you use Motif for your gui. This will provide gvim with + the same look-and-feel as the rest of Sun Visual WorkShop. + +The following configuration line can be used to configure vim to build for use +with Sun Visual WorkShop: + + $ CC=cc configure --enable-workshop --enable-gui=motif \ + -prefix=<VWS-install-dir>/contrib/contrib6/<vim-version> + +The VWS-install-dir should be the base directory where your Sun Visual WorkShop +was installed. By default this is /opt/SUNWspro. It will normally require +root permissions to install the vim release. You will also need to change the +symlink <VWS-install-dir>/bin/gvim to point to the vim in your newly installed +directory. The <vim-version> should be a unique version string. I use "vim" +concatenated with the equivalent of version.h's VIM_VERSION_SHORT. + +============================================================================== +5. Obtaining the latest version of the XPM library *workshop-xpm* + +The XPM library is required to show images within Vim with Motif or Athena. +Without it the toolbar and signs will be disabled. + +The XPM library is provide by Arnaud Le Hors of the French National Institute +for Research in Computer Science and Control. It can be downloaded from +http://koala.ilog.fr/ftp/pub/xpm. The current release, as of this writing, is +xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create the directory +/usr/local/xpm and untar the file there you can use the uncommented lines in +the Makefile without changing them. If you use another xpm directory you will +need to change the XPM_DIR in src/Makefile. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/Aufgabe5/stoplist.engl.txt b/Aufgabe5/stoplist.engl.txt new file mode 100644 index 0000000..f9bf98b --- /dev/null +++ b/Aufgabe5/stoplist.engl.txt @@ -0,0 +1,583 @@ +i'm +web +don't +i've +we've +they've +she's +he's +it's +great +old +can't +tell +tells +busy +doesn't +you're +your's +didn't +they're +night +nights +anyone +isn't +i'll +actual +actually +presents +presenting +presenter +present +presented +presentation +we're +wouldn't +example +examples +i'd +haven't +etc +won't +myself +we've +they've +aren't +we'd +it'd +ain't +i'll +who've +-year-old +kind +kinds +builds +build +built +com +make +makes +making +made +you'll +couldn't +use +uses +used +using +take +takes +taking +taken +exactly +we'll +it'll +certainly +he'd +shown +they'd +wasn't +yeah +to-day +lya +a +ability +able +aboard +about +above +absolute +absolutely +across +act +acts +add +additional +additionally +after +afterwards +again +against +ago +ahead +aimless +aimlessly +al +albeit +align +all +allow +almost +along +alongside +already +also +alternate +alternately +although +always +am +amid +amidst +among +amongst +an +and +announce +announced +announcement +announces +another +anti +any +anything +appaling +appalingly +appear +appeared +appears +are +around +as +ask +asked +asking +asks +at +await +awaited +awaits +awaken +awakened +awakens +aware +away +b +back +backed +backing +backs +be +became +because +become +becomes +becoming +been +before +began +begin +begins +behind +being +believe +believed +between +both +brang +bring +brings +brought +but +by +c +call +called +calling +calls +can +cannot +carried +carries +carry +carrying +change +changed +changes +choose +chooses +chose +clearly +close +closed +closes +closing +come +comes +coming +consider +considerable +considering +could +couldn +d +dare +daren +day +days +despite +did +didn +do +does +doesn +doing +done +down +downward +downwards +e +each +eight +either +else +elsewhere +especially +even +eventually +ever +every +everybody +everyone +f +far +feel +felt +few +final +finally +find +five +for +found +four +fourth +from +get +gets +getting +gave +give +gives +go +goes +going +gone +good +got +h +had +has +have +he +held +her +here +heretofore +hereby +herewith +hers +herself +high +him +himself +his +hitherto +happen +happened +happens +hour +hours +how +however +i +ii +iii +iv +if +in +include +included +includes +including +inside +into +is +isn +it +its +itself +j +just +k +l +la +larger +largest +last +later +latest +le +least +leave +leaves +leaving +les +let +less +like +ll +m +made +main +mainly +make +makes +man +many +may +me +means +meant +meanwhile +men +might +missed +more +moreover +most +mostly +move +moved +moving +mr +mrs +much +must +mustn +my +need +needs +neither +never +new +newer +news +nine +no +non +none +nor +not +now +o +of +off +often +on +once +one +only +or +other +our +out +over +own +owns +p +particularly +per +percent +primarily +put +q +quickly +r +remain +remaining +respond +responded +responding +responds +return +ran +rather +run +running +runs +s +said +say +says +same +see +seek +seeking +seeks +seen +send +sent +set +sets +seven +several +she +should +shouldn +side +since +six +sixes +slow +slowed +slows +small +smaller +so +some +someone +something +somewhat +somewhere +soon +sought +spread +stay +stayed +still +substantially +such +suppose +t +take +takes +taken +th +than +that +the +their +them +themselves +then +there +thereby +therefore +these +they +thing +things +thi +this +those +though +thus +three +through +throughout +to +together +too +took +toward +towards +tried +tries +try +trying +two +u +unable +under +underneath +undid +undo +undoes +undone +undue +undoubtedly +unfortunately +unless +unnecessarily +unofficially +until +unusually +unsure +up +upon +upward +us +use +used +uses +using +usual +usually +v +ve +very +via +view +viewed +w +wait +waited +waits +want +wanted +wants +was +wasn +watched +watching +way +ways +we +went +were +what +whatever +when +whenever +where +whereever +whether +which +whichever +while +who +whoever +whom +whomsoever +whose +whosever +why +wide +wider +will +with +without +won +would +wouldn +wow +wows +www +x +xii +xiii +xiv +xv +xvi +xvii +xviii +xix +xx +y +year +you +your +yours +yourself +yourselves -- cgit v1.2.3-70-g09d2