diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-01-06 20:52:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-01-06 20:52:26 +0100 |
commit | 8f3f58f2c361f1b7241128d9821f88d8a30aa066 (patch) | |
tree | bd5827eec39ddf8e6a94919a6a541765882f00d4 /runtime/doc | |
parent | 28c37959871b83fd5d1d621f70bce29dc3f21ba4 (diff) |
Update documentation files.
Diffstat (limited to 'runtime/doc')
90 files changed, 2371 insertions, 1036 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 14d64ed9b5..20b5e6a485 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.2. Last change: 2008 Jun 27 +*autocmd.txt* For Vim version 7.2. Last change: 2009 Nov 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -59,10 +59,10 @@ Note: The ":autocmd" command cannot be followed by another command, since any :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]. + {pat} |autocmd-patterns|. + 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 <buffer> or <buffer=N> defines a buffer-local autocommand. See |autocmd-buflocal|. @@ -551,7 +551,7 @@ FileChangedShell When Vim notices that the modification time of buffer that was changed "<afile>". NOTE: The commands must not change the current buffer, jump to another buffer or delete a - buffer. *E246* + buffer. *E246* *E811* NOTE: This event never nests, to avoid an endless loop. This means that while executing commands for the FileChangedShell event no @@ -835,9 +835,9 @@ 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). +2. When there is a '/' in the pattern, Vim checks for a match against both the + 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 <buffer> or <buffer=N> is used for buffer-local autocommands |autocmd-buflocal|. This pattern is not matched against the name @@ -1052,7 +1052,7 @@ option will not cause any commands to be executed. *:doautoa* *:doautoall* :doautoa[ll] [group] {event} [fname] Like ":doautocmd", but apply the autocommands to each - loaded buffer. Note that {fname} is used to select + 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 diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 440e6b5456..f493e10e84 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.2. Last change: 2008 Jul 24 +*change.txt* For Vim version 7.2. Last change: 2009 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -506,9 +506,9 @@ comment (starting with '"') after the ":!" command. {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. + temporary file and then reads the file into the buffer + |tempfile|. 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 @@ -524,7 +524,9 @@ comment (starting with '"') after the ":!" command. 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|. + |indent-expression|. When Vim was compiled without + internal formatting then the "indent" program is used + as a last resort. *==* == Filter [count] lines like with ={motion}. @@ -534,6 +536,22 @@ comment (starting with '"') after the ":!" command. {not in Vi} + *tempfile* *setuid* +Vim uses temporary files for filtering, generating diffs and also for +tempname(). 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. When Vim has the setuid bit set this may cause +problems, the temp file is owned by the setuid user but the filter command +probably runs as the original user. +On MS-DOS and OS/2 the first of these directories that works is used: $TMP, +$TEMP, c:\TMP, c:\TEMP. +For Unix the list of directories is: $TMPDIR, /tmp, current-dir, $HOME. +For MS-Windows the GetTempFileName() system function is used. +For other systems the tmpnam() library function is used. + + + 4.2 Substitute *:substitute* *:s* *:su* :[range]s[ubstitute]/{pattern}/{string}/[flags] [count] @@ -861,7 +879,10 @@ inside of strings can change! Also see 'softtabstop' option. > *:reg* *:registers* :reg[isters] Display the contents of all numbered and named - registers. {not in Vi} + registers. If a register is written to for |:redir| + it will not be listed. + {not in Vi} + :reg[isters] {arg} Display the contents of the numbered and named registers that are mentioned in {arg}. For example: > @@ -994,6 +1015,11 @@ 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.) +The previously selected text is put in the unnamed register. If you want to +put the same text into a Visual selection several times you need to use +another register. E.g., yank the text to copy, Visually select the text to +replace and use "0p . You can repeat this as many times as you like, the +unnamed register will be changed each time. *blockwise-register* If you use a blockwise Visual mode command to get the text into the register, @@ -1031,8 +1057,10 @@ There are nine types of registers: *registers* *E354* 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. +to the last used register. Thus when appending using an uppercase register +name, the unnamed register contains the same text as the named 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 "" @@ -1098,11 +1126,16 @@ normal command-line editing commands are available, including a special history for expressions. When you end the command-line by typing <CR>, Vim computes the result of the expression. If you end it with <Esc>, 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 <NL> -characters. If the string ends in a <NL>, it is regarded as a linewise +expression (like with the "/" command). + +The expression must evaluate to a String. A Number is always automatically +converted to a String. For the "p" and ":put" command, if the result is a +Float it's converted into a String. If the result is a List each element is +turned into a String and used as a line. A 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 <NL> +characters. If the String ends in a <NL>, it is regarded as a linewise register. {not in Vi} 7. Selection and drop registers "*, "+ and "~ diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index c87e61c089..b98ded1662 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.2. Last change: 2008 Sep 18 +*cmdline.txt* For Vim version 7.2. Last change: 2009 Oct 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -118,8 +118,6 @@ CTRL-U Remove all characters between the cursor position and preferred behavior, add the following to your .vimrc: > :cnoremap <C-U> <C-E><C-U> < - Note: if the command-line becomes empty with one of the - delete commands, Command-line mode is quit. *c_<Insert>* <Insert> Toggle between insert and overstrike. {not in Vi} @@ -485,14 +483,14 @@ And this in your .vimrc: > The Ex commands have a few specialties: - *:quote* + *:quote* *:comment* '"' 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. +":map" command and a few others, because they see the '"' as part of their +argument. This is mentioned where the command is explained. *:bar* *:\bar* '|' can be used to separate commands, so you can give multiple commands in one @@ -744,8 +742,8 @@ characters have a special meaning. These can also be used in the expression function expand() |expand()|. % Is replaced with the current file name. *:_%* *c_%* # Is replaced with the alternate file name. *:_#* *c_#* - #n (where n is a number) is replaced with the file name of - buffer n. "#0" is the same as "#". + #n (where n is a number) is replaced with *:_#0* *:_#n* + the file name of buffer n. "#0" is the same as "#". *c_#n* ## Is replaced with all names in the argument list *:_##* *c_##* concatenated, separated by spaces. Each space in a name is preceded with a backslash. @@ -949,7 +947,7 @@ for the file "$home" in the root directory. A few examples: ============================================================================== 6. Command-line window *cmdline-window* *cmdwin* - + *command-line-window* 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. @@ -957,12 +955,12 @@ it in a normal way. feature} -OPEN +OPEN *c_CTRL-F* *q:* *q/* *q?* 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?* +2. From Normal mode, use the "q:", "q/" or "q?" command. 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). @@ -992,7 +990,8 @@ nesting. 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. +any command that you entered in the command-line window. Other text edits are +discarded when closing the window. CLOSE *E199* @@ -1027,7 +1026,7 @@ 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() +- for entering an 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: diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index 44c9f9f1a7..654d89b581 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -1,4 +1,4 @@ -*debug.txt* For Vim version 7.2. Last change: 2006 May 01 +*debug.txt* For Vim version 7.2. Last change: 2009 Jul 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -10,7 +10,8 @@ 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| +2. Locating memory leaks |debug-leaks| +3. Windows Bug Reporting |debug-win32| ============================================================================== @@ -38,7 +39,25 @@ This also applies when using the MingW tools. ============================================================================== -2. Windows Bug Reporting *debug-win32* +2. Locating memory leaks *debug-leaks* + +If you suspect Vim is leaking memory and you are using Linux, the valgrind +tool is very useful to pinpoint memory leaks. + +First of all, build Vim with EXITFREE defined. Search for this in MAKEFILE +and uncomment the line. + +Use this command to start Vim: *valgrind* +> + valgrind --log-file=valgrind.log ./vim + +Note: Vim will run much slower. If your .vimrc is big or you have several +plugins you need to be patient for startup, or run with the "-u NONE" +argument. + +============================================================================== + +3. 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. diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 89cb455e0c..dd8031c376 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 7.2. Last change: 2007 May 11 +*develop.txt* For Vim version 7.2. Last change: 2008 Dec 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -64,7 +64,7 @@ completely different editor. Extensions are done with a "Vi spirit". 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. + obscure features, or at least add hints in documentation that they exist. - 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. @@ -323,7 +323,7 @@ Wrong: var=a*5; OK: var = a * 5; |