diff options
Diffstat (limited to 'runtime/doc')
66 files changed, 1997 insertions, 1735 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt new file mode 100644 index 0000000000..ca79465e0d --- /dev/null +++ b/runtime/doc/api.txt @@ -0,0 +1,99 @@ +*api.txt* For Nvim. {Nvim} + + + NVIM REFERENCE MANUAL by Thiago de Arruda + +The C API of Nvim *nvim-api* + +1. Introduction |nvim-api-intro| +2. API Types |nvim-api-types| +3. API metadata |nvim-api-metadata| +4. Buffer highlighting |nvim-api-highlights| + +============================================================================== +1. Introduction *nvim-api-intro* + +Nvim defines a C API as the primary way for external code to interact with +the NVim core. In the present version of Nvim the API is primarily used by +external processes to interact with Nvim using the msgpack-rpc protocol, see +|msgpack-rpc|. The API will also be used from vimscript to access new Nvim core +features, but this is not implemented yet. Later on, Nvim might be embeddable +in C applications as libnvim, and the application will then control the +embedded instance by calling the C API directly. + +============================================================================== +2. API Types *nvim-api-types* + +Nvim's C API uses custom types for all functions. Some are just typedefs +around C99 standard types, and some are Nvim defined data structures. + +Boolean -> bool +Integer (signed 64-bit integer) -> int64_t +Float (IEEE 754 double precision) -> double +String -> {char* data, size_t size} struct + +Additionally, the following data structures are defined: + +Array +Dictionary +Object + +The following handle types are defined as integer typedefs, but are +discriminated as separate types in an Object: + +Buffer -> enum value kObjectTypeBuffer +Window -> enum value kObjectTypeWindow +Tabpage -> enum value kObjectTypeTabpage + +============================================================================== +3. API metadata *nvim-api-metadata* + +Nvim exposes metadata about the API as a Dictionary with the following keys: + +functions calling signature of the API functions +types The custom handle types defined by Nvim +error_types The possible kinds of errors an API function can exit with. + +This metadata is mostly useful for external programs accessing the api over +msgpack-api, see |msgpack-rpc-api|. + +============================================================================== +4. Buffer highlighting *nvim-api-highlights* + +Nvim allows plugins to add position-based highlights to buffers. This is +similar to |matchaddpos()| but with some key differences. The added highlights +are associated with a buffer and adapts to line insertions and deletions, +similar to signs. It is also possible to manage a set of highlights as a group +and delete or replace all at once. + +The intended use case are linter or semantic highlighter plugins that monitor +a buffer for changes, and in the background compute highlights to the buffer. +Another use case are plugins that show output in an append-only buffer, and +want to add highlights to the outputs. Highlight data cannot be preserved +on writing and loading a buffer to file, nor in undo/redo cycles. + +Highlights are registered using the |buffer_add_highlight| function, see the +generated API documentation for details. If an external highlighter plugin is +adding a large number of highlights in a batch, performance can be improved by +calling |buffer_add_highlight| as an asynchronous notification, after first +(synchronously) reqesting a source id. Here is an example using wrapper +functions in the python client: +> + src = vim.new_highlight_source() + + buf = vim.current.buffer + for i in range(5): + buf.add_highlight("String",i,0,-1,src_id=src) + + # some time later + + buf.clear_highlight(src) +< +If the highlights don't need to be deleted or updated, just pass -1 as +src_id (this is the default in python). |buffer_clear_highlight| can be used +to clear highligts from a specific source, in a specific line range or the +entire buffer by passing in the line range 0, -1 (the later is the default +in python as used above). + +============================================================================== + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 38d53249d1..25ae94f784 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.4. Last change: 2014 Sep 23 +*autocmd.txt* For Vim version 7.4. Last change: 2015 Dec 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -308,6 +308,8 @@ Name triggered by ~ |InsertCharPre| when a character was typed in Insert mode, before inserting it +|TextYankPost| when some text is yanked or deleted + |TextChanged| after a change was made to the text in Normal mode |TextChangedI| after a change was made to the text in Insert mode @@ -722,6 +724,18 @@ InsertCharPre When a character is typed in Insert mode, It is not allowed to change the text |textlock|. The event is not triggered when 'paste' is set. + *TextYankPost* +TextYankPost Just after a |yank| or |deleting| command, but not + if the black hole register |quote_| is used nor + for |setreg()|. Pattern must be * because its + meaning may change in the future. + Sets these |v:event| keys: + operator + regcontents + regname + regtype + Recursion is ignored. + It is not allowed to change the text |textlock|. *InsertEnter* InsertEnter Just before starting Insert mode. Also for Replace mode and Virtual Replace mode. The @@ -756,13 +770,15 @@ OptionSet After setting an option. The pattern is it's global or local scoped and |<amatch>| indicates what option has been set. - Note: It's a bad idea, to reset an option - during this autocommand, since this will - probably break plugins. You can always use - |noa| to prevent triggering this autocommand. - Could be used, to check for existence of the - 'backupdir' and 'undodir' options and create - directories, if they don't exist yet. + Usage example: Check for the existence of the + directory in the 'backupdir' and 'undodir' + options, create the directory if it doesn't + exist yet. + + Note: It's a bad idea to reset an option + during this autocommand, this may break a + plugin. You can always use `:noa` to prevent + triggering this autocommand. *QuickFixCmdPre* QuickFixCmdPre Before a quickfix command is run (|:make|, @@ -973,6 +989,13 @@ WinLeave Before leaving a window. If the window to be ============================================================================== 6. Patterns *autocmd-patterns* *{pat}* +The {pat} argument can be a comma separated list. This works as if the +command was given with each pattern separately. Thus this command: > + :autocmd BufRead *.txt,*.info set et +Is equivalent to: > + :autocmd BufRead *.txt set et + :autocmd BufRead *.info set et + 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 @@ -1041,7 +1064,7 @@ The pattern is interpreted like mostly used in file names: [^ch] match any character but 'c' and 'h' Note that for all systems the '/' character is used for path separator (even -MS-DOS). This was done because the backslash is difficult to use in a pattern +Windows). This was done because the backslash is difficult to use in a pattern and to make the autocommands portable across different systems. *autocmd-changes* @@ -1079,7 +1102,7 @@ Instead of a pattern buffer-local autocommands use one of these forms: Examples: > :au CursorHold <buffer> echo 'hold' :au CursorHold <buffer=33> echo 'hold' - :au CursorHold <buffer=abuf> echo 'hold' + :au BufNewFile * au CursorHold <buffer=abuf> echo 'hold' All the commands for autocommands also work with buffer-local autocommands, simply use the special string instead of the pattern. Examples: > @@ -1138,6 +1161,9 @@ name! :aug[roup] {name} Define the autocmd group name for the following ":autocmd" commands. The name "end" or "END" selects the default group. + To avoid confusion, the name should be + different from existing {event} names, as this + most likely will not do what you intended. *:augroup-delete* *E367* :aug[roup]! {name} Delete the autocmd group {name}. Don't use diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 075e581bf2..c8eb0705f6 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.4. Last change: 2014 Jun 26 +*change.txt* For Vim version 7.4. Last change: 2016 Jan 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -366,13 +366,49 @@ Adding and subtracting ~ CTRL-A Add [count] to the number or alphabetic character at or after the cursor. + *v_CTRL-A* +{Visual}CTRL-A Add [count] to the number or alphabetic character in + the highlighted text. {not in Vi} + + *v_g_CTRL-A* +{Visual}g CTRL-A Add [count] to the number or alphabetic character in + the highlighted text. If several lines are + highlighted, each one will be incremented by an + additional [count] (so effectively creating a + [count] incrementing sequence). {not in Vi} + For Example, if you have this list of numbers: + 1. ~ + 1. ~ + 1. ~ + 1. ~ + Move to the second "1." and Visually select three + lines, pressing g CTRL-A results in: + 1. ~ + 2. ~ + 3. ~ + 4. ~ + *CTRL-X* CTRL-X Subtract [count] from the number or alphabetic character at or after the cursor. + *v_CTRL-X* +{Visual}CTRL-X Subtract [count] from the number or alphabetic + character in the highlighted text. {not in Vi} + + *v_g_CTRL-X* +{Visual}g CTRL-X Subtract [count] from the number or alphabetic + character in the highlighted text. If several lines + are highlighted, each value will be decremented by an + additional [count] (so effectively creating a [count] + decrementing sequence). {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. +binary/octal/hexadecimal numbers and alphabetic characters. + +This depends on the 'nrformats' option: +- When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or + '0B' are binary. - 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. @@ -386,6 +422,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the under or after the cursor. This is useful to make lists with an alphabetic index. +For decimals a leading negative sign is considered for incrementing or +decrementing, for binary, octal and hex values, it won't be considered. To +ignore the sign Visually select the number before using CTRL-A or CTRL-X. + 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". @@ -397,6 +437,10 @@ octal number. Note that when 'nrformats' includes "octal", decimal numbers with leading zeros cause mistakes, because they can be confused with octal numbers. +Note similarly, when 'nrformats' includes "bin", binary numbers with a leading +'0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b' +are valid hexadecimal digits. + The CTRL-A command is very useful in a macro. Example: Use the following steps to make a numbered list. @@ -578,9 +622,9 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir. 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. + The space between `:substitute` and the 'c', 'g', + 'i', 'I' 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 @@ -789,6 +833,36 @@ either the first or second pattern in parentheses did not match, so either :s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x" < + *:sc* *:sce* *:scg* *:sci* *:scI* *:scl* *:scp* *:sg* *:sgc* + *:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si* + *:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp* + *:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl* + *:srn* *:srp* +2-letter and 3-letter :substitute commands ~ + + List of :substitute commands + | c e g i I n p l r + | c :sc :sce :scg :sci :scI :scn :scp :scl --- + | e + | g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr + | i :sic :sie --- :si :siI :sin :sip --- :sir + | I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr + | n + | p + | l + | r :src --- :srg :sri :srI :srn :srp :srl :sr + +Exceptions: + :scr is `:scriptnames` + :se is `:set` + :sig is `:sign` + :sil is `:silent` + :sn is `:snext` + :sp is `:split` + :sl is `:sleep` + :sre is `:srewind` + + Substitute with an expression *sub-replace-expression* *sub-replace-\=* *s/\=* When the substitute string starts with "\=" the remainder is interpreted as an @@ -832,13 +906,13 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|. :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} + {only for Win32 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} + {only for Win32 GUI} 4.4 Changing tabs *change-tabs* @@ -892,7 +966,7 @@ inside of strings can change! Also see 'softtabstop' option. > :reg[isters] {arg} Display the contents of the numbered and named registers that are mentioned in {arg}. For example: > - :dis 1a + :reg 1a < to display registers '1' and 'a'. Spaces are allowed in {arg}. @@ -1058,16 +1132,17 @@ Rationale: In Vi the "y" command followed by a backwards motion would 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* +There are ten 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 "/ +5. three read-only registers ":, "., "% +6. alternate buffer register "# +7. the expression register "= +8. The selection and drop registers "*, "+ and "~ +9. The black hole register "_ +10. Last search pattern register "/ 1. Unnamed register "" *quote_quote* *quotequote* Vim fills this register with text deleted with the "d", "c", "s", "x" commands @@ -1109,7 +1184,7 @@ 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 "# +5. Read-only registers ":, ". and "% These are '%', '#', ':' and '.'. You can use them only with the "p", "P", and ":put" commands and with CTRL-R. *quote_.* *quote.* *E29* @@ -1120,8 +1195,6 @@ and ":put" commands and with CTRL-R. ('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. @@ -1129,15 +1202,33 @@ and ":put" commands and with CTRL-R. one character of it was typed. Thus it remains unchanged if the command was completely from a mapping. -6. Expression register "= *quote_=* *quote=* *@=* + *quote_#* *quote#* +6. Alternate file register "# +Contains the name of the alternate file for the current window. It will +change how the |CTRL-^| command works. +This register is writable, mainly to allow for restoring it after a plugin has +changed it. It accepts buffer number: > + let altbuf = bufnr(@#) + ... + let @# = altbuf +It will give error |E86| if you pass buffer number and this buffer does not +exist. +It can also accept a match with an existing buffer name: > + let @# = 'buffer_name' +Error |E93| if there is more than one buffer matching the given name or |E94| +if none of buffers matches the given name. + +7. 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 <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 +read-write. + +When typing the '=' after " or CTRL-R 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 <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. A Number is always automatically @@ -1150,35 +1241,23 @@ 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. -7. Selection and drop registers "*, "+ and "~ +8. Selection and drop registers "*, "+ and "~ Use these registers 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 and Mac OS X, see |nvim-clipboard|. - *quote_~* *quote~* *<Drop>* -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 <Drop> 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. -{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_* +9. 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. -9. Last search pattern register "/ *quote_/* *quote/* +10. 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. The search direction is available in |v:searchforward|. -Note that the valued is restored when returning from a function +Note that the value is restored when returning from a function |function-search-undo|. *@/* @@ -1390,10 +1469,10 @@ When you hit Return in a C-comment, Vim will insert the middle comment leader for the new line: " * ". 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 and apply any specified -alignment, leaving just " */". There is no need to hit BackSpace first. +alignment, leaving just " */". There is no need to hit Backspace first. -When there is a match with a middle part, but there also is a maching end part -which is longer, the end part is used. This makes a C style comment work +When there is a match with a middle part, but there also is a matching end +part which is longer, the end part is used. This makes a C style comment work without requiring the middle part to end with a space. Here is an example of alignment flags at work to make a comment stand out @@ -1597,7 +1676,7 @@ Vim has a sorting function and a sorting command. The sorting function can be found here: |sort()|, |uniq()|. *:sor* *:sort* -:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/] +:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/] Sort lines in [range]. When no range is given all lines are sorted. @@ -1605,10 +1684,18 @@ found here: |sort()|, |uniq()|. With [i] case is ignored. + Options [n][f][x][o][b] are mutually exclusive. + With [n] sorting is done on the first decimal number in the line (after or inside a {pattern} match). One leading '-' is included in the number. + With [f] sorting is done on the Float in the line. + The value of Float is determined similar to passing + the text (after or inside a {pattern} match) to + str2float() function. This option is available only + if Vim was compiled with Floating point support. + 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. @@ -1617,10 +1704,13 @@ found here: |sort()|, |uniq()|. 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. + With [b] sorting is done on the first binary number in + the line (after or inside a {pattern} match). + + With [u] (u stands for unique) 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. diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index d85d41a295..a123ea711b 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06 +*cmdline.txt* For Vim version 7.4. Last change: 2015 Dec 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -97,6 +97,11 @@ CTRL-E or <End> *c_CTRL-E* *c_<End>* *c_End* *c_<LeftMouse>* <LeftMouse> Move the cursor to the position of the mouse click. + *c_<MiddleMouse>* +<MiddleMouse> Paste the contents of the clipboard (for X11 the primary + selection). This is similar to using CTRL-R *, but no CR + characters are inserted between lines. + CTRL-H *c_<BS>* *c_CTRL-H* *c_BS* <BS> Delete the character in front of the cursor. *c_<Del>* *c_Del* @@ -379,7 +384,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next <S-Tab> *c_CTRL-P* *c_<S-Tab>* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from - history. <S-Tab> only works with the GUI and with MS-DOS. + history. <S-Tab> only works with the GUI. *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. @@ -482,6 +487,8 @@ followed by another Vim command: :argdo :autocmd :bufdo + :cdo + :cfdo :command :cscope :debug @@ -490,8 +497,9 @@ followed by another Vim command: :function :global :help - :helpfind :lcscope + :ldo + :lfdo :make :normal :promptfind @@ -562,6 +570,7 @@ 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. +See also |`=|. *:_!* The '!' (bang) character after an Ex command makes the command behave in a @@ -711,13 +720,13 @@ 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|. -Note: If you want to avoid the special characters in a Vim script you may want -to use |fnameescape()|. +Note: If you want to avoid the effects of special characters in a Vim script +you may want to use |fnameescape()|. Also see |`=|. 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()|. +function |expand()|. % Is replaced with the current file name. *:_%* *c_%* # Is replaced with the alternate file name. *:_#* *c_#* This is remembered for every window. @@ -752,6 +761,7 @@ it, no matter how many backslashes. # alternate.file \# # \\# \# +Also see |`=|. *:<cword>* *:<cWORD>* *:<cfile>* *<cfile>* *:<sfile>* *<sfile>* *:<afile>* *<afile>* @@ -773,13 +783,13 @@ Note: these are typed literally, they are not special keys! <afile> only when the file name isn't used to match with (for FileType, Syntax and SpellFileMissing events). <sfile> When executing a ":source" command, is replaced with the - file name of the sourced file. *E498* - 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 <sfile> is used inside - a function. + file name of the sourced file. *E498* + When executing a function, is replaced with: + "function {function-name}[{lnum}]" + function call nesting is indicated like this: + "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" + Note that filename-modifiers are useless when <sfile> is + used inside a function. <slnum> When executing a ":source" command, is replaced with the line number. *E842* When executing a function it's the line number relative to @@ -816,7 +826,7 @@ These modifiers can be given, in this order: 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 and WIN32), that part is not removed. + Unix; "x:\" for Windows), 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 @@ -841,7 +851,7 @@ These modifiers can be given, in this order: :gs?pat?sub? Substitute all occurrences of "pat" with "sub". Otherwise this works like ":s". - :S Escape special characters for use with a shell command (see + :S Escape special characters for use with a shell command (see |shellescape()|). Must be the last one. Examples: > :!dir <cfile>:S :call system('chmod +w -- ' . expand('%:S')) @@ -894,9 +904,8 @@ name). This is included for backwards compatibility with version 3.0, the 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 > +Unless in |restricted-mode|, backticks work also, 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 <cfile>, add a wildcard character to it. @@ -907,6 +916,7 @@ Examples: (alternate file name is "?readme?") :e #.* :e {files matching "?readme?.*"} :cd <cfile> :cd {file name under cursor} :cd <cfile>* :cd {file name under cursor plus "*" and then expanded} +Also see |`=|. When the expanded argument contains a "!" and it is used for a shell command (":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to @@ -915,8 +925,8 @@ 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 and -Windows), it's a bit difficult to recognize a backslash that is used +For filesystems that use a backslash as directory separator (Windows +filesystems), 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 @@ -933,6 +943,8 @@ for the file "$home" in the root directory. A few examples: /\$home file "$home" in root directory \\$home file "\\", followed by expanded $home +Also see |`=|. + ============================================================================== 7. Command-line window *cmdline-window* *cmdwin* *command-line-window* diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt deleted file mode 100644 index f1eb5639bd..0000000000 --- a/runtime/doc/debugger.txt +++ /dev/null @@ -1,107 +0,0 @@ -*debugger.txt* For Vim version 7.4. Last change: 2005 Mar 29 - - - VIM REFERENCE MANUAL by Gordon Prieur - - -Debugger Support Features *debugger-support* - -1. Debugger Features |debugger-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. - -============================================================================== - vim:tw=78:sw=4:ts=8:ft=help:norl: diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 54d47eb28a..12bc655edc 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.4. Last change: 2015 Jan 19 +*diff.txt* For Vim version 7.4. Last change: 2015 Nov 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -124,8 +124,9 @@ file for a moment and come back to the same file and be in diff mode again. if the current window does not have 'diff' set then no options in it are changed. -The ":diffoff" command resets the relevant options to the values they had when -using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode. +The `:diffoff` command resets the relevant options to the values they had when +using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode. +When using `:diffoff` twice the last saved values are restored. Otherwise they are set to their default value: 'diff' off @@ -173,8 +174,8 @@ 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. + *:dif* *:diffupdate* +:dif[fupdate][!] 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 @@ -306,6 +307,19 @@ name or a part of a buffer name. Examples: Also see |'diffopt'| and the "diff" item of |'fillchars'|. + *diff-slow* *diff_translations* +For very long lines, the diff syntax highlighting might be slow, especially +since it tries to match all different kind of localisations. To disable +localisations and speed up the syntax highlighting, set the global variable +g:diff_translations to zero: > + + let g:diff_translations = 0 +< +After setting this variable, Reload the syntax script: > + + set syntax=diff +< + FINDING THE DIFFERENCES *diff-diffexpr* diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index ffa3f1d673..c51286a350 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18 +*editing.txt* For Vim version 7.4. Last change: 2016 Jan 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -77,7 +77,8 @@ g CTRL-G Prints the current position of the cursor in five than one position on the screen (<Tab> or special character), both the "real" column and the screen column are shown, separated with a dash. - See also 'ruler' option. + Also see the 'ruler' option and the |wordcount()| + function. *v_g_CTRL-G* {Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and @@ -130,9 +131,7 @@ 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). The backup file can be placed in another +change the 'backupext' option. The backup file can be placed in another directory by setting 'backupdir'. When you started editing without giving a file name, "No File" is displayed in @@ -276,7 +275,8 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is 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. + punctuation characters ".,:;!" are ignored. Escaped + spaces "\ " are reduced to a single space. Uses the 'path' option as a list of directory names to look for the file. See the 'path' option for details about relative directories and wildcards. @@ -379,25 +379,38 @@ Finds files: /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. +On Unix and a few other systems you can also use backticks for the file name +argument, for example: > + :next `find . -name ver\\*.c -print` + :view `ls -t *.patch \| head -n1` +The backslashes before the star are required to prevent the shell from +expanding "ver*.c" prior to execution of the find program. The backslash +before the shell pipe symbol "|" prevents Vim from parsing it as command +termination. 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.: > +You can have the backticks expanded as a Vim expression, instead of as an +external command, by putting an equal sign right after the first backtick, +e.g.: > :e `=tempname()` The expression can contain just about anything, thus this can also be used to avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore' does apply like to other wildcards. + +Environment variables in the expression are expanded when evaluating the +expression, thus this works: > + :e `=$HOME . '/.vimrc'` +This does not work, $HOME is inside a string and used literally: > + :e `='$HOME' . '/.vimrc'` + If the expression returns a string then 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. +Note that such expressions are only supported in places where a filename is +expected as an argument to an Ex-command. *++opt* *[++opt]* The [++opt] argument can be used to force the value of 'fileformat', @@ -470,9 +483,9 @@ The 'fileformat' option sets the <EOL> style for a file: "mac" <CR> Mac format *Mac-format* When reading a file, the mentioned characters are interpreted as the <EOL>. -In DOS format (default for MS-DOS and Win32), <CR><NL> and <NL> are both -interpreted as the <EOL>. Note that when writing the file in DOS format, -<CR> characters will be added for each single <NL>. Also see |file-read|. +In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as +the <EOL>. Note that when writing the file in DOS format, <CR> characters will +be added for each single <NL>. Also see |file-read|. When writing a file, the mentioned characters are used for <EOL>. For DOS format <CR><NL> is used. Also see |DOS-format-write|. @@ -493,13 +506,13 @@ 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 <NL> (as used on Unix) or by a <CR><NL> pair -(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", +(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL> 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 +If the 'fileformat' option is set to "dos" on non-Windows 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 +Windows 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". @@ -795,7 +808,8 @@ USING THE ARGUMENT LIST autocommand event is disabled by adding it to 'eventignore'. This considerably speeds up editing each file. - Also see |:windo|, |:tabdo| and |:bufdo|. + Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo|. Example: > :args *.c @@ -964,10 +978,10 @@ lost the original file. *DOS-format-write* If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default -for MS-DOS and Win32. On other systems the message "[dos format]" is shown to +for Windows. On other systems the message "[dos format]" is shown to remind you that an unusual <EOL> was used. *Unix-format-write* -If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS and Win32 +If the 'fileformat' is "unix", <NL> is used for <EOL>. On Windows the message "[unix format]" is shown. *Mac-format-write* If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the @@ -997,11 +1011,11 @@ 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: > +and 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: +For Windows the device is detected by its name: CON CLOCK$ NUL @@ -1028,10 +1042,10 @@ The names can be in upper- or lowercase. the last file in the argument list has not been edited. See |:confirm| and 'confirm'. -:q[uit]! Quit without writing, also when currently visible - buffers have changes. Does not exit when this is the - last window and there is a changed hidden buffer. - In this case, the first changed hidden buffer becomes +:q[uit]! Quit without writing, also when the current buffer has + changes. If this is the last window and there is a + modified hidden buffer, the current buffer is + abandoned and the first changed hidden buffer becomes the current buffer. Use ":qall!" to exit always. @@ -1144,7 +1158,7 @@ If you want to always use ":confirm", set the 'confirm' option. |:diffsplit|, |:diffpatch|, |:pedit|, |:redir|, |:source|, |:update|, |:visual|, |:vsplit|, and |:qall| if 'confirm' is set. - {only in Win32, Athena, Motif, GTK and Mac GUI} + {only in Win32 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 @@ -1172,16 +1186,13 @@ For versions of Vim where browsing is not supported, the command is executed unmodified. *browsefilter* -For MS Windows and GTK, 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 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 example, to have only Vim files in the dialog, you could use the following command: > @@ -1206,12 +1217,18 @@ use has("browsefilter"): > ============================================================================== 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". +You can use |:cd|, |:tcd| and |:lcd| 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" or ":te ls". -Changing directory fails when the current buffer is modified, the '.' flag is -present in 'cpoptions' and "!" is not used in the command. +There are three current-directory "scopes": global, tab and window. The +window-local working directory takes precedence over the tab-local +working directory, which in turn takes precedence over the global +working directory. If a local working directory (tab or window) does not +exist, the next-higher scope in the hierarchy applies. + +Commands for changing the working directory can be suffixed with a bang "!" +(e.g. |:cd!|) which is ignored, for compatibility with Vim. *:cd* *E747* *E472* :cd[!] On non-Unix systems: Print the current directory @@ -1225,7 +1242,7 @@ present in 'cpoptions' and "!" is not used in the command. 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. + On Windows this also changes the active drive. To change to the directory of the current file: > :cd %:h < @@ -1236,29 +1253,50 @@ present in 'cpoptions' and "!" is not used in the command. *:chd* *:chdir* :chd[ir][!] [path] Same as |:cd|. + *:tc* *:tcd* *E5000* *E5001* *E5002* +:tc[d][!] {path} Like |:cd|, but set the current directory for the + current tab and window. The current directory for + other tabs and windows is not changed. + + *:tcd-* +:tcd[!] - Change to the previous current directory (before the + previous ":tcd {path}" command). + + *:tch* *:tchdir* +:tch[dir][!] Same as |:tcd|. + *: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. + windows or any tabs is not changed. *:lch* *:lchdir* :lch[dir][!] Same as |:lcd|. + *:lcd-* +:lcd[!] - Change to the previous current directory (before the + previous ":tcd {path}" command). + *:pw* *:pwd* *E187* :pw[d] Print the current directory name. 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. +So long as no |:tcd| or |: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 |:lcd| 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 or tab-local directory. When jumping to another +window the current directory will become the last specified local current +directory. If none was specified, the global or tab-local directory is used. + +When changing tabs the same behaviour applies. If the current tab has no +local working directory the global working directory is used. When a |:cd| +command is used, the current window and tab will lose their local current +directories and will use the global current directory from now on. When +a |:tcd| command is used, only the current window will lose its local working +directory. 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 @@ -1295,7 +1333,7 @@ There are a few things to remember when editing binary files: and when the file is written the <NL> will be replaced with <CR> <NL>. - <Nul> characters are shown on the screen as ^@. You can enter them with "CTRL-V CTRL-@" or "CTRL-V 000". -- To insert a <NL> character in the file split up a line. When writing the +- To insert a <NL> character in the file split a line. When writing the buffer to a file a <NL> will be written for the <EOL>. - Vim normally appends an <EOL> at the end of the file if there is none. Setting the 'binary' option prevents this. If you want to add the final @@ -1307,9 +1345,7 @@ There are a few things to remember when editing binary files: 9. Encryption *encryption* *:X* *E817* *E818* *E819* *E820* -Support for editing encrypted files has been removed, but may be added back in -the future. See the following discussions for more information: - +Support for editing encrypted files has been removed. https://github.com/neovim/neovim/issues/694 https://github.com/neovim/neovim/issues/701 diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4ff0636b61..6ae137a6ce 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2014 Nov 27 +*eval.txt* For Vim version 7.4. Last change: 2016 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -65,14 +65,16 @@ the Number. Examples: Number 0 --> String "0" ~ Number -1 --> String "-1" ~ *octal* -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: +Conversion from a String to a Number is done by converting the first digits to +a number. Hexadecimal "0xf9", Octal "017", and Binary "0b10" 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 "0b101" --> Number 5 ~ String "-8" --> Number -8 ~ String "+8" --> Number 0 ~ @@ -522,7 +524,7 @@ Funcref to a Dictionary, but the "self" variable is not available then. 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 + :function mydict.len() : return len(self.data) :endfunction :echo mydict.len() @@ -862,8 +864,8 @@ expr1'th single byte from expr8. expr8 is used as a String, expr1 as a Number. This doesn't recognize multi-byte encodings, see |byteidx()| for an alternative. -Index zero gives the first character. This is like it works in C. Careful: -text column numbers start with one! Example, to get the character under the +Index zero gives the first byte. This is like it works in C. Careful: +text column numbers start with one! Example, to get the byte under the cursor: > :let c = getline(".")[col(".") - 1] @@ -914,6 +916,11 @@ just above, except that indexes out of range cause an error. Examples: > Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an error. +Watch out for confusion between a namespace and a variable followed by a colon +for a sublist: > + mylist[n:] " uses variable n + mylist[s:] " uses namespace s:, error! + expr8.name entry in a |Dictionary| *expr-entry* @@ -953,7 +960,7 @@ Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). Floating point numbers can be written in two forms: [-+]{N}.{M} - [-+]{N}.{M}e[-+]{exp} + [-+]{N}.{M}[eE][-+]{exp} {N} and {M} are numbers. Both {N} and {M} must be present and can only contain digits. @@ -1001,7 +1008,7 @@ function. Example: > -string *string* *expr-string* *E114* +string *string* *String* *expr-string* *E114* ------ "string" string constant *expr-quote* @@ -1017,7 +1024,7 @@ A string constant accepts these special characters: \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.... +\U.... same as \u but allows up to 8 hex numbers. \b backspace <BS> \e escape <Esc> \f formfeed <FF> @@ -1375,6 +1382,31 @@ v:errmsg Last given error message. It's allowed to set this variable. : ... handle error < "errmsg" also works, for backwards compatibility. + *v:errors* *errors-variable* +v:errors Errors found by assert functions, such as |assert_true()|. + This is a list of strings. + The assert functions append an item when an assert fails. + To remove old results make it empty: > + :let v:errors = [] +< If v:errors is set to anything but a list it is made an empty + list by the assert function. + + *v:event* *event-variable* +v:event Dictionary of event data for the current |autocommand|. The + available keys differ per event type and are specified at the + documentation for each |event|. The possible keys are: + operator The operation performed. Unlike + |v:operator|, it is set also for an Ex + mode command. For instance, |:yank| is + translated to "|y|". + regcontents Text stored in the register as a + |readfile()|-style list of lines. + regname Requested register (e.g "x" for "xyy) + or the empty string for an unnamed + operation. + regtype Type of register as returned by + |getregtype()|. + *v:exception* *exception-variable* v:exception The value of the exception most recently caught and not finished. See also |v:throwpoint| and |throw-variables|. @@ -1386,6 +1418,13 @@ v:exception The value of the exception most recently caught and not :endtry < Output: "caught oops". + *v:false* *false-variable* +v:false Special value used to put "false" in JSON and msgpack. See + |json_encode()|. This value is converted to "false" when used + as a String (e.g. in |expr5| with string concatenation + operator) and to zero when used as a Number (e.g. in |expr5| + or |expr7| when used with numeric operators). + *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 @@ -1464,7 +1503,9 @@ v:hlsearch Variable that indicates whether search highlighting is on. this variable to zero acts like the |:nohlsearch| command, setting it to one acts like > let &hlsearch = &hlsearch -< +< Note that the value is restored when returning from a + function. |function-search-undo|. + *v:insertmode* *insertmode-variable* v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand events. Values: @@ -1523,6 +1564,13 @@ v:msgpack_types Dictionary containing msgpack types used by |msgpackparse()| (not editable) empty lists. To check whether some list is one of msgpack types, use |is| operator. + *v:null* *null-variable* +v:null Special value used to put "null" in JSON and NIL in msgpack. + See |json_encode()|. This value is converted to "null" when + used as a String (e.g. in |expr5| with string concatenation + operator) and to zero when used as a Number (e.g. in |expr5| + or |expr7| when used with numeric operators). + *v:oldfiles* *oldfiles-variable* v:oldfiles List of file names that is loaded from the |shada| file on startup. These are the files that Vim remembers marks for. @@ -1688,6 +1736,13 @@ v:throwpoint The point where the exception most recently caught and not :endtry < Output: "Exception from test.vim, line 2" + *v:true* *true-variable* +v:true Special value used to put "true" in JSON and msgpack. See + |json_encode()|. This value is converted to "true" when used + as a String (e.g. in |expr5| with string concatenation + operator) and to one when used as a Number (e.g. in |expr5| or + |expr7| when used with numeric operators). + *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 @@ -1708,7 +1763,8 @@ v:version Version number of Vim: Major version number times 100 plus v:warningmsg Last given warning message. It's allowed to set this variable. *v:windowid* *windowid-variable* {Nvim} -v:windowid Is a no-op at the moment; the value is always set to 0. +v:windowid Application-specific window ID ("window handle" in MS-Windows) + which may be set by any attached UI. Defaults to zero. Note: for windows inside Vim use |winnr()|. ============================================================================== @@ -1728,10 +1784,14 @@ 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 -arglistid( [{winnr}, [ {tabnr}]]) +arglistid( [{winnr} [, {tabnr}]]) Number argument list id argv( {nr}) String {nr} entry of the argument list argv( ) List the argument list +assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act} +assert_exception({error} [, {msg}]) none assert {error} is in v:exception +assert_false( {actual} [, {msg}]) none assert {actual} is false +assert_true( {actual} [, {msg}]) none assert {actual} is true asin( {expr}) Float arc sine of {expr} atan( {expr}) Float arc tangent of {expr} atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2} @@ -1742,7 +1802,7 @@ 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} +bufnr( {expr} [, {create}]) 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} @@ -1771,9 +1831,11 @@ cursor( {lnum}, {col} [, {off}]) Number move cursor to {lnum}, {col}, {off} cursor( {list}) Number move cursor to position in {list} deepcopy( {expr} [, {noref}]) any make a full copy of {expr} -delete( {fname}) Number delete file {fname} -dictwatcheradd({dict}, {pattern}, {callback}) Start watching a dictionary -dictwatcherdel({dict}, {pattern}, {callback}) Stop watching a dictionary +delete( {fname} [, {flags}]) Number delete the file or directory {fname} +dictwatcheradd( {dict}, {pattern}, {callback}) + Start watching a dictionary +dictwatcherdel( {dict}, {pattern}, {callback}) + Stop watching a dictionary 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} @@ -1793,7 +1855,7 @@ 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 + {string} is 0 finddir( {name}[, {path}[, {count}]]) String find directory {name} in {path} findfile( {name}[, {path}[, {count}]]) @@ -1819,12 +1881,13 @@ getbufvar( {expr}, {varname} [, {def}]) any variable {varname} in buffer {expr} getchar( [expr]) Number get one character from the user getcharmod( ) Number modifiers for the last typed character +getcharsearch() Dict last character search getcmdline() String return the current command-line getcmdpos() Number return cursor position in command-line getcmdtype() String return current command-line type getcmdwintype() String return current command-line window type getcurpos() List position of the cursor -getcwd() String the current working directory +getcwd( [{scope}]) String the current working directory getfontname( [{name}]) String name of font being used getfperm( {fname}) String file permissions of file {fname} getfsize( {fname}) Number size in bytes of file {fname} @@ -1848,10 +1911,10 @@ getwinposx() Number X coord in pixels of GUI Vim window getwinposy() Number Y coord in pixels of GUI Vim window getwinvar( {nr}, {varname} [, {def}]) any variable {varname} in window {nr} -glob( {expr} [, {nosuf} [, {list}]]) +glob( {expr} [, {nosuf} [, {list} [, {alllinks}]]]) any expand file wildcards in {expr} glob2regpat( {expr}) String convert a glob pat into a search pat -globpath( {path}, {expr} [, {nosuf} [, {list}]]) +globpath( {path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) 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} @@ -1875,20 +1938,25 @@ 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}] +inputsecret( {prompt} [, {text}]) + String like input() but hiding the text +insert( {list}, {item} [, {idx}]) + List insert {item} in {list} [before {idx}] invert( {expr}) Number bitwise invert 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} -jobclose({job}[, {stream}]) Number Closes a job stream(s) -jobresize({job}, {width}, {height}) +jobclose( {job}[, {stream}]) Number Closes a job stream(s) +jobpid( {job}) Number Returns pid of a job. +jobresize( {job}, {width}, {height}) Number Resize {job}'s pseudo terminal window -jobsend({job}, {data}) Number Writes {data} to {job}'s stdin -jobstart({cmd}[, {opts}]) Number Spawns {cmd} as a job -jobstop({job}) Number Stops a job -jobwait({ids}[, {timeout}]) Number Wait for a set of jobs +jobsend( {job}, {data}) Number Writes {data} to {job}'s stdin +jobstart( {cmd}[, {opts}]) Number Spawns {cmd} as a job +jobstop( {job}) Number Stops a job +jobwait( {ids}[, {timeout}]) Number Wait for a set of jobs join( {list} [, {sep}]) String join {list} items into one String +json_decode( {expr}) any Convert {expr} from JSON +json_encode( {expr}) String Convert {expr} to JSON 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} @@ -1941,6 +2009,7 @@ range( {expr} [, {max} [, {stride}]]) readfile( {fname} [, {binary} [, {max}]]) List get list of lines from file {fname} reltime( [{start} [, {end}]]) List get time value +reltimefloat( {time}) Float turn the time value into a Float reltimestr( {time}) String turn time value into a String remote_expr( {server}, {string} [, {idvar}]) String send expression @@ -1957,12 +2026,12 @@ repeat( {expr}, {count}) String repeat {expr} {count} times resolve( {filename}) String get filename a shortcut points to reverse( {list}) List reverse {list} in-place round( {expr}) Float round off {expr} -rpcnotify({channel}, {event}[, {args}...]) +rpcnotify( {channel}, {event}[, {args}...]) Sends a |msgpack-rpc| notification to {channel} -rpcrequest({channel}, {method}[, {args}...]) +rpcrequest( {channel}, {method}[, {args}...]) Sends a |msgpack-rpc| request to {channel} -rpcstart({prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel -rpcstop({channel}) Closes a |msgpack-rpc| {channel} +rpcstart( {prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel +rpcstop( {channel}) Closes a |msgpack-rpc| {channel} screenattr( {row}, {col}) Number attribute at screen position screenchar( {row}, {col}) Number character at screen position screencol() Number current cursor column @@ -1984,11 +2053,12 @@ setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} setcharsearch( {dict}) Dict set character search from {dict} setcmdpos( {pos}) Number set cursor position in command-line setline( {lnum}, {line}) Number set line {lnum} to {line} -setloclist( {nr}, {list}[, {action}]) +setloclist( {nr}, {list}[, {action}[, {title}]]) Number modify location list using {list} setmatches( {list}) Number restore a list of matches setpos( {expr}, {list}) Number set the {expr} position to {list} -setqflist( {list}[, {action}]) Number modify quickfix list using {list} +setqflist( {list}[, {action}[, {title}]] + Number modify quickfix list using {list} setreg( {n}, {v}[, {opt}]) Number set register to value and type settabvar( {nr}, {varname}, {val}) set {varname} in tab page {nr} to {val} settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window @@ -2013,7 +2083,7 @@ split( {expr} [, {pat} [, {keepempty}]]) sqrt( {expr}) Float square root of {expr} str2float( {expr}) Float convert String to Float str2nr( {expr} [, {base}]) Number convert String to Number -strchars( {expr}) Number character length of the String {expr} +strchars( {expr} [, {skipcc}]) Number character length of the String {expr} strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr} strftime( {format}[, {time}]) String time in specified format stridx( {haystack}, {needle}[, {start}]) @@ -2070,6 +2140,7 @@ 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} +wordcount() Dict get byte/char/word statistics writefile( {list}, {fname} [, {flags}]) Number write list of lines to file {fname} xor( {expr}, {expr}) Number bitwise XOR @@ -2161,6 +2232,50 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the < Without the {nr} argument a |List| with the whole |arglist| is returned. + *assert_equal()* +assert_equal({expected}, {actual}, [, {msg}]) + When {expected} and {actual} are not equal an error message is + added to |v:errors|. + There is no automatic conversion, the String "4" is different + from the Number 4. And the number 4 is different from the + Float 4.0. The value of 'ignorecase' is not used here, case + always matters. + When {msg} is omitted an error in the form "Expected + {expected} but got {actual}" is produced. + Example: > + assert_equal('foo', 'bar') +< Will result in a string to be added to |v:errors|: + test.vim line 12: Expected 'foo' but got 'bar' ~ + +assert_exception({error} [, {msg}]) *assert_exception()* + When v:exception does not contain the string {error} an error + message is added to |v:errors|. + This can be used to assert that a command throws an exception. + Using the error number, followed by a colon, avoids problems + with translations: > + try + commandthatfails + call assert_false(1, 'command should have failed') + catch + call assert_exception('E492:') + endtry + +assert_false({actual} [, {msg}]) *assert_false()* + When {actual} is not false an error message is added to + |v:errors|, like with |assert_equal()|. + A value is false when it is zero or |v:false|. When "{actual}" + is not a number or |v:false| the assert fails. + When {msg} is omitted an error in the form "Expected False but + got {actual}" is produced. + +assert_true({actual} [, {msg}]) *assert_true()* + When {actual} is not true an error message is added to + |v:errors|, like with |assert_equal()|. + A value is true when it is a non-zero number or |v:true|. + When {actual} is not a number or |v:true| the assert fails. + When {msg} is omitted an error in the form "Expected True but + got {actual}" is produced. + asin({expr}) *asin()* Return the arc sine of {expr} measured in radians, as a |Float| in the range of [-pi/2, pi/2]. @@ -2415,6 +2530,10 @@ col({expr}) The result is a Number, which is the byte index of the column number of bytes in the cursor line plus one) 'x position of mark x (if the mark is not set, 0 is returned) + v In Visual mode: the start of the Visual area (the + cursor is the end). When not in Visual mode + returns the cursor position. Differs from |'<| in + that it's updated right away. Additionally {expr} can be [lnum, col]: a |List| with the line and column number. Most useful when the column is "$", to get the last column of a specific line. When "lnum" or "col" is @@ -2516,10 +2635,10 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) {default} is omitted, 1 is used. The optional {type} argument gives the type of dialog. This - is only used for the icon of the GTK, Mac, Motif and 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. + 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 <Esc>, CTRL-C, or another valid interrupt key, confirm() returns 0. @@ -2667,13 +2786,19 @@ deepcopy({expr}[, {noref}]) *deepcopy()* *E698* {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|. - To delete a line from the buffer use |:delete|. Use |:exe| - when the line number is in a variable. +delete({fname} [, {flags}]) *delete()* + Without {flags} or with {flags} empty: Deletes the file by the + name {fname}. This also works when {fname} is a symbolic link. + A symbolic link itself is deleted, not what it points to. + + When {flags} is "d": Deletes the directory by the name + {fname}. This fails when directory {fname} is not empty. + + When {flags} is "rf": Deletes the directory by the name + {fname} and everything in it, recursively. BE CAREFUL! + + The result is a Number, which is 0 if the delete operation was + successful and -1 when the deletion failed or partly failed. dictwatcheradd({dict}, {pattern}, {callback}) *dictwatcheradd()* Adds a watcher to a dictionary. A dictionary watcher is @@ -2747,9 +2872,8 @@ diff_hlID({lnum}, {col}) *diff_hlID()* 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 than comparing the - length with zero. + items. A Number is empty when its value is zero. Special + variable is empty when it is |v:false| or |v:null|. escape({string}, {chars}) *escape()* Escape the characters in {chars} that occur in {string} with a @@ -2778,7 +2902,7 @@ executable({expr}) *executable()* 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 + On 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 @@ -2786,9 +2910,9 @@ executable({expr}) *executable()* 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 + On 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 + On 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: @@ -3232,8 +3356,7 @@ foreground() Move the Vim window to the foreground. Useful when sent from 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} + {only in the Win32 GUI and console version} function({name}) *function()* *E700* @@ -3364,7 +3487,7 @@ getchar([expr]) *getchar()* : endwhile :endfunction < - You may also receive syntetic characters, such as + You may also receive synthetic characters, such as |<CursorHold>|. Often you will want to ignore this and get another character: > :function GetKey() @@ -3458,9 +3581,18 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but MoveTheCursorAround call setpos('.', save_cursor) < - *getcwd()* -getcwd() The result is a String, which is the name of the current - working directory. +getcwd([{window}[, {tab}]]) *getcwd()* + With no arguments the result is a String, which is the name of + the current effective working directory. With {window} or + {tab} the working directory of that scope is returned. + Tabs and windows are identified by their respective numbers, + 0 means current tab or window. Missing argument implies 0. + Thus the following are equivalent: > + getcwd() + getcwd(0) + getcwd(0, 0) +< If {window} is -1 it is ignored, only the tab is resolved. + getfsize({fname}) *getfsize()* The result is a Number, which is the size in bytes of the @@ -3481,8 +3613,6 @@ getfontname([{name}]) *getfontname()* 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 @@ -3581,8 +3711,7 @@ getmatches() *getmatches()* < *getpid()* getpid() Return a Number which is the process ID of the Vim process. - On Unix and MS-Windows this is a unique number, until Vim - exits. On MS-DOS it's always zero. + This is a unique number, until Vim exits. *getpos()* getpos({expr}) Get the position for {expr}. For possible values of {expr} @@ -3708,7 +3837,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* :let list_is_on = getwinvar(2, '&list') :echo "myvar = " . getwinvar(1, 'myvar') < -glob({expr} [, {nosuf} [, {list}]]) *glob()* +glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Expand the file wildcards in {expr}. See |wildcards| for the use of special characters. @@ -3725,8 +3854,11 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()* matches, they are separated by <NL> characters. If the expansion fails, the result is an empty String or List. + A name for a non-existing file is not included. A symbolic link is only included if it points to an existing file. + However, when the {alllinks} argument is present and it is + non-zero then all symbolic links are included. For most systems backticks can be used to get files names from any external command. Example: > @@ -3745,8 +3877,11 @@ glob2regpat({expr}) *glob2regpat()* if filename =~ glob2regpat('Make*.mak') < This is equivalent to: > if filename =~ '^Make.*\.mak$' -< -globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()* +< When {expr} is an empty string the result is "^$", match an + empty string. + + *globpath()* +globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]]) Perform glob() on all directories in {path} and concatenate the results. Example: > :echo globpath(&rtp, "syntax/c.vim") @@ -3772,6 +3907,8 @@ globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()* they are separated by <NL> characters. Example: > :echo globpath(&rtp, "syntax/c.vim", 0, 1) < + {allinks} is used as with |glob()|. + 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: > @@ -3790,9 +3927,18 @@ 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. -haslocaldir() *haslocaldir()* - The result is a Number, which is 1 when the current - window has set a local path via |:lcd|, and 0 otherwise. +haslocaldir([{window}[, {tab}]]) *haslocaldir()* + The result is a Number, which is 1 when the specified tabpage + or window has a local path set via |:lcd| or |:tcd|, and + 0 otherwise. + + Tabs and windows are identified by their respective numbers, + 0 means current tab or window. Missing argument implies 0. + Thus the following are equivalent: > + haslocaldir() + haslocaldir(0) + haslocaldir(0, 0) +< If {window} is -1 it is ignored, only the tab is resolved. hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* The result is a Number, which is 1 if there is a mapping that @@ -4114,6 +4260,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()* Close {job}'s {stream}, which can be one "stdin", "stdout" or "stderr". If {stream} is omitted, all streams are closed. +jobpid({job}) {Nvim} *jobpid()* + Return the pid (process id) of {job}. + jobresize({job}, {width}, {height}) {Nvim} *jobresize()* Resize {job}'s pseudo terminal window to {width} and {height}. This function will fail if used on jobs started without the @@ -4133,9 +4282,14 @@ jobsend({job}, {data}) {Nvim} *jobsend()* jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* Spawns {cmd} as a job. If {cmd} is a |List|, it will be run - directly. If {cmd} is a |string|, it will be equivalent to > - :call jobstart([&shell, &shellcmdflag, '{cmd}']) -< If passed, {opts} must be a dictionary with any of the + directly. If {cmd} is a |string|, it will be roughly + equivalent to > + :call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}']) +< NOTE: read |shell-unquoting| before constructing any lists + with 'shell' or 'shellcmdflag' options. The above call is + only written to show the idea, one needs to perform unquoting + and do split taking quotes into account. + If passed, {opts} must be a dictionary with any of the following keys: - on_stdout: stdout event handler - on_stderr: stderr event handler @@ -4146,6 +4300,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* - width: Width of the terminal screen(only if pty is set) - height: Height of the terminal screen(only if pty is set) - TERM: $TERM environment variable(only if pty is set) + - detach: Detach the job process from the nvim process. The + process won't get killed when nvim exists. If the process + dies before nvim exits, on_exit will still be invoked. + This option is only allowed for non-pty jobs. Either funcrefs or function names can be passed as event handlers. The {opts} object is also used as the "self" argument for the callback, so the caller may pass arbitrary @@ -4196,6 +4354,46 @@ join({list} [, {sep}]) *join()* converted into a string like with |string()|. The opposite function is |split()|. +json_decode({expr}) *json_decode()* + Convert {expr} from JSON object. Accepts |readfile()|-style + list as the input, as well as regular string. May output any + Vim value. When 'encoding' is not UTF-8 string is converted + from UTF-8 to 'encoding', failing conversion fails + json_decode(). In the following cases it will output + |msgpack-special-dict|: + 1. Dictionary contains duplicate key. + 2. Dictionary contains empty key. + 3. String contains NUL byte. Two special dictionaries: for + dictionary and for string will be emitted in case string + with NUL byte was a dictionary key. + + Note: function treats its input as UTF-8 always regardless of + 'encoding' value. This is needed because JSON source is + supposed to be external (e.g. |readfile()|) and JSON standard + allows only a few encodings, of which UTF-8 is recommended and + the only one required to be supported. Non-UTF-8 characters + are an error. + +json_encode({expr}) *json_encode()* + Convert {expr} into a JSON string. Accepts + |msgpack-special-dict| as the input. Converts from 'encoding' + to UTF-8 when encoding strings. Will not convert |Funcref|s, + mappings with non-string keys (can be created as + |msgpack-special-dict|), values with self-referencing + containers, strings which contain non-UTF-8 characters, + pseudo-UTF-8 strings which contain codepoints reserved for + surrogate pairs (such strings are not valid UTF-8 strings). + When converting 'encoding' is taken into account, if it is not + "utf-8", then conversion is performed before encoding strings. + Non-printable characters are converted into "\u1234" escapes + or special escapes like "\t", other are dumped as-is. + + Note: all characters above U+0079 are considered non-printable + when 'encoding' is not UTF-8. This function always outputs + UTF-8 strings as required by the standard thus when 'encoding' + is not unicode resulting string will look incorrect if + "\u1234" notation is not used. + keys({dict}) *keys()* Return a |List| with all the keys of {dict}. The |List| is in arbitrary order. @@ -4507,7 +4705,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()* done like 'magic' is set and 'cpoptions' is empty. *matchadd()* *E798* *E799* *E801* -matchadd({group}, {pattern}[, {priority}[, {id}]]) +matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a "match"). It will be highlighted with {group}. Returns an identification number (ID), which can be used to delete the @@ -4515,6 +4713,8 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) Matching is case sensitive and magic, unless case sensitivity or magicness are explicitly overridden in {pattern}. The 'magic', 'smartcase' and 'ignorecase' options are not used. + The "Conceal" value is special, it causes the match to be + concealed. The optional {priority} argument assigns a priority to the match. A match with a high priority will have its @@ -4532,9 +4732,18 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) message will appear and the match will not be added. An ID is specified as a positive integer (zero excluded). IDs 1, 2 and 3 are reserved for |:match|, |:2match| and |:3match|, - respectively. If the {id} argument is not specified, + respectively. If the {id} argument is not specified or -1, |matchadd()| automatically chooses a free ID. + The optional {dict} argmument allows for further custom + values. Currently this is used to specify a match specifc + conceal character that will be shown for |hl-Conceal| + highlighted matches. The dict can have the following members: + + conceal Special character to show instead of the + match (only for |hl-Conceal| highlighed + matches, see |:syn-cchar|) + The number of matches is not limited, as it is the case with the |:match| commands. @@ -4548,7 +4757,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. -matchaddpos({group}, {pos}[, {priority}[, {id}]]) *matchaddpos()* +matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()* Same as |matchadd()|, but requires a list of positions {pos} instead of a pattern. This command is faster than |matchadd()| because it does not require to handle regular expressions and @@ -4712,7 +4921,7 @@ msgpackdump({list}) {Nvim} *msgpackdump()* (dictionary with zero items is represented by 0x80 byte in messagepack). - Limitations: + Limitations: *E951* *E952* *E953* 1. |Funcref|s cannot be dumped. 2. Containers that reference themselves cannot be dumped. 3. Dictionary keys are always dumped as STR strings. @@ -4747,9 +4956,13 @@ msgpackparse({list}) {Nvim} *msgpackparse()* contains name of the key from |v:msgpack_types|): Key Value ~ - nil Zero, ignored when dumping. - boolean One or zero. When dumping it is only checked that - value is a |Number|. + nil Zero, ignored when dumping. This value cannot + possibly appear in |msgpackparse()| output in Neovim + versions which have |v:null|. + boolean One or zero. When dumping it is only checked that + value is a |Number|. This value cannot possibly + appear in |msgpackparse()| output in Neovim versions + which have |v:true| and |v:false|. integer |List| with four numbers: sign (-1 or 1), highest two bits, number with bits from 62nd to 31st, lowest 31 bits. I.e. to get actual number one will need to use @@ -4863,6 +5076,9 @@ printf({fmt}, {expr1} ...) *printf()* %c single byte %d decimal number %5d decimal number padded with spaces to 5 characters + %b binary number + %08b binary number padded with zeros to at least 8 characters + %B binary number using upper case letters %x hex number %04x hex number padded with zeros to at least 4 characters %X hex number using upper case letters @@ -4949,20 +5165,19 @@ printf({fmt}, {expr1} ...) *printf()* The conversion specifiers and their meanings are: - *printf-d* *printf-o* *printf-x* *printf-X* - 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. + *printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X* + dbBoxX The Number argument is converted to signed decimal (d), + unsigned binary (b and B), 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. *printf-c* c The Number argument is converted to a byte, and the @@ -4972,6 +5187,7 @@ printf({fmt}, {expr1} ...) *printf()* s The text of the String argument is used. If a precision is specified, no more bytes than the number specified are used. + *printf-S* S The text of the String argument is used. If a precision is specified, no more display cells than the number specified are used. Without the |+multi_byte| @@ -5033,7 +5249,7 @@ py3eval({expr}) *py3eval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. Numbers and strings are returned as they are (strings are - copied though, unicode strings are additionally converted to + copied though, Unicode strings are additionally converted to 'encoding'). Lists are represented as Vim |List| type. Dictionaries are represented as Vim |Dictionary| type with @@ -5077,7 +5293,7 @@ readfile({fname} [, {binary} [, {max}]]) separated with CR will result in a single long line (unless a NL appears somewhere). All NUL characters are replaced with a NL character. - When {binary/append} contains "b" binary mode is used: + When {binary} contains "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. @@ -5105,7 +5321,8 @@ readfile({fname} [, {binary} [, {max}]]) 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. + |reltimestr()| to convert it to a string or |reltimefloat()| + to convert to a float. Without an argument it returns the current time. With one argument is returns the time passed since the time specified in the argument. @@ -5113,7 +5330,16 @@ reltime([{start} [, {end}]]) *reltime()* and {end}. The {start} and {end} arguments must be values returned by reltime(). - {only available when compiled with the |+reltime| feature} + +reltimefloat({time}) *reltimefloat()* + Return a Float that represents the time value of {time}. + Unit of time is seconds. + Example: + let start = reltime() + call MyFunction() + let seconds = reltimefloat(reltime(start)) + See the note of reltimestr() about overhead. + Also see |profiling|. reltimestr({time}) *reltimestr()* Return a String that represents the time value of {time}. @@ -5123,12 +5349,10 @@ reltimestr({time}) *reltimestr()* call MyFunction() echo reltimestr(reltime(start)) < Note that overhead for the commands will be added to the time. - The accuracy depends on the system. Leading spaces are used to make the string align nicely. You can use split() to remove it. > echo split(reltimestr(reltime(start)))[0] < Also see |profiling|. - {only available when compiled with the |+reltime| feature} *remote_expr()* *E449* remote_expr({server}, {string} [, {idvar}]) @@ -5160,8 +5384,7 @@ remote_foreground({server}) *remote_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} + {only in the Win32 GUI and the Win32 console version} remote_peek({serverid} [, {retvar}]) *remote_peek()* @@ -5349,14 +5572,15 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* move. No error message is given. {flags} is a String, which can contain these character flags: - 'b' search backward instead of forward - 'c' accept a match at the cursor position + '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 + '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 + 'z' start searching at the cursor column instead of Zero If neither 'w' or 'W' is given, the 'wrapscan' option applies. If the 's' flag is supplied, the ' mark is set, only if the @@ -5364,6 +5588,12 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* flag. 'ignorecase', 'smartcase' and 'magic' are used. + + When the 'z' flag is not given seaching always starts in + column zero and then matches before the cursor are skipped. + When the 'c' flag is present in 'cpo' the next search starts + after the match. Without the 'c' flag the next search starts + one column further. When the {stopline} argument is given then the search stops after searching this line. This is useful to restrict the @@ -5602,7 +5832,7 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()* :call setbufvar("todo", "myvar", "foobar") < This function is not available in the |sandbox|. -setcharsearch() *setcharsearch()* +setcharsearch({dict}) *setcharsearch()* Set the current character search information to {dict}, which contains one or more of the following entries: @@ -5655,11 +5885,13 @@ setline({lnum}, {text}) *setline()* :endfor < Note: The '[ and '] marks are not set. -setloclist({nr}, {list} [, {action}]) *setloclist()* +setloclist({nr}, {list} [, {action}[, {title}]]) *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. + invalid window number {nr}, -1 is returned. If {title} is + given, it will be used to set |w:quickfix_title| after opening + the location window. Otherwise, same as |setqflist()|. Also see |location-list|. @@ -5716,7 +5948,7 @@ setpos({expr}, {list}) |winrestview()|. -setqflist({list} [, {action}]) *setqflist()* +setqflist({list} [, {action}[, {title}]]) *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 @@ -5755,6 +5987,9 @@ setqflist({list} [, {action}]) *setqflist()* with the items from {list}. If {action} is not present or is set to ' ', then a new list is created. + If {title} is given, it will be used to set |w:quickfix_title| + after opening the quickfix window. + Returns zero for success, -1 for failure. This function can be used to create a quickfix list @@ -5837,12 +6072,12 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()* :call setwinvar(2, "myvar", "foobar") sha256({string}) *sha256()* - Returns a String with 64 hex charactes, which is the SHA256 + Returns a String with 64 hex characters, which is the SHA256 checksum of {string}. shellescape({string} [, {special}]) *shellescape()* Escape {string} for use as a shell command argument. - On MS-Windows and MS-DOS, when 'shellslash' is not set, it + On Windows when 'shellslash' is not set, it will enclose {string} in double quotes and double all double quotes within {string}. For other systems, it will enclose {string} in single quotes @@ -5940,6 +6175,10 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702* strtod() function to parse numbers, Strings, Lists, Dicts and Funcrefs will be considered as being 0). + When {func} is given and it is 'N' then all items will be + sorted numerical. This is like 'n' but a string containing + digits will be used as the number they represent. + 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 or @@ -6041,7 +6280,8 @@ split({expr} [, {pattern} [, {keepempty}]]) *split()* :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': > +< If you want to keep the separator you can also use '\zs' at + the end of the pattern: > :echo split('abc:def:ghi', ':\zs') < ['abc:', 'def:', 'ghi'] ~ Splitting a table where the first element can be empty: > @@ -6078,24 +6318,46 @@ str2float( {expr}) *str2float()* str2nr( {expr} [, {base}]) *str2nr()* Convert string {expr} to a number. - {base} is the conversion base, it can be 8, 10 or 16. + {base} is the conversion base, it can be 2, 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. + different base the result will be zero. Similarly, when {base} + is 8 a leading "0" is ignored, and when {base} is 2 a leading + "0b" or "0B" is ignored. Text after the number is silently ignored. -strchars({expr}) *strchars()* +strchars({expr} [, {skipcc}]) *strchars()* The result is a Number, which is the number of characters - String {expr} occupies. Composing characters are counted - separately. + in String {expr}. + When {skipcc} is omitted or zero, composing characters are + counted separately. + When {skipcc} set to 1, Composing characters are ignored. Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. + + {skipcc} is only available after 7.4.755. For backward + compatibility, you can define a wrapper function: > + if has("patch-7.4.755") + function s:strchars(str, skipcc) + return strchars(a:str, a:skipcc) + endfunction + else + function s:strchars(str, skipcc) + if a:skipcc + return strlen(substitute(a:str, ".", "x", "g")) + else + return strchars(a:str) + endif + endfunction + endif +< + strdisplaywidth({expr}[, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells - String {expr} occupies on the screen when it starts a {col}. + String {expr} occupies on the screen when it starts at {col}. When {col} is omitted zero is used. Otherwise it is the screen column where to start. This matters for Tab characters. @@ -6151,25 +6413,31 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number, {expr} type result ~ String 'string' Number 123 - Float 123.123456 or 1.123456e8 - Funcref function('name') + Float 123.123456 or 1.123456e8 or + `str2float('inf')` + Funcref `function('name')` List [item, item] Dictionary {key: value, key: value} Note that in String values the ' character is doubled. Also see |strtrans()|. + Note 2: Output format is mostly compatible with YAML, except + for infinite and NaN floating-point values representations + which use |str2float()|. Strings are also dumped literally, + only single quote is escaped, which does not allow using YAML + for parsing back binary strings (including text when + 'encoding' is not UTF-8). |eval()| should always work for + strings and floats though and this is the only official + method, use |msgpackdump()| or |json_encode()| if you need to + share data with other application. *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()|, |strchars()|, |strdisplaywidth()| and - |strwidth()|. + If you want to count the number of multi-byte characters use + |strchars()|. + Also see |len()|, |strdisplaywidth()| and |strwidth()|. strpart({src}, {start}[, {len}]) *strpart()* The result is a String, which is part of {src}, starting from @@ -6283,6 +6551,9 @@ synID({lnum}, {col}, {trans}) *synID()* {col} is 1 for the leftmost column, {lnum} is 1 for the first line. 'synmaxcol' applies, in a longer line zero is returned. + Note that when the position is after the last character, + that's where the cursor can be in Insert mode, synID() returns + zero. When {trans} is non-zero, transparent items are reduced to the item that they reveal. This is useful when wanting to know @@ -6588,12 +6859,14 @@ trunc({expr}) *trunc()* type({expr}) *type()* The result is a Number, depending on the type of {expr}: - Number: 0 - String: 1 + Number: 0 + String: 1 Funcref: 2 - List: 3 + List: 3 Dictionary: 4 - Float: 5 + Float: 5 + Boolean: 6 (|v:true| and |v:false|) + Null: 7 (|v:null|) To avoid the magic numbers it should be used this way: > :if type(myvar) == type(0) :if type(myvar) == type("") @@ -6601,6 +6874,10 @@ type({expr}) *type()* :if type(myvar) == type([]) :if type(myvar) == type({}) :if type(myvar) == type(0.0) + :if type(myvar) == type(v:true) +< In place of checking for |v:null| type it is better to check + for |v:null| directly as it is the only value of this type: > + :if myvar is v:null undofile({name}) *undofile()* Return the name of the undo file that would be used for a file @@ -6694,6 +6971,10 @@ virtcol({expr}) *virtcol()* plus one) 'x position of mark x (if the mark is not set, 0 is returned) + v In Visual mode: the start of the Visual area (the + cursor is the end). When not in Visual mode + returns the cursor position. Differs from |'<| in + that it's updated right away. Note that only marks in the current file can be used. Examples: > virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5 @@ -6842,6 +7123,28 @@ winwidth({nr}) *winwidth()* : exe "normal 50\<C-W>|" :endif < +wordcount() *wordcount()* + The result is a dictionary of byte/chars/word statistics for + the current buffer. This is the same info as provided by + |g_CTRL-G| + The return value includes: + bytes Number of bytes in the buffer + chars Number of chars in the buffer + words Number of words in the buffer + cursor_bytes Number of bytes before cursor position + (not in Visual mode) + cursor_chars Number of chars before cursor position + (not in Visual mode) + cursor_words Number of words before cursor position + (not in Visual mode) + visual_bytes Number of bytes visually selected + (only in Visual mode) + visual_chars Number of chars visually selected + (only in Visual mode) + visual_words Number of chars visually selected + (only in Visual mode) + + *writefile()* writefile({list}, {fname} [, {flags}]) Write |List| {list} to file {fname}. Each list item is @@ -6906,8 +7209,6 @@ There are four types of features: acl Compiled with |ACL| support. arabic Compiled with Arabic support |Arabic|. autocmd Compiled with autocommand support. |autocommand| -balloon_eval Compiled with |balloon-eval| support. -balloon_multiline GUI supports multiline balloons. browse Compiled with |:browse| support, and browse() will work. browsefilter Compiled with support for |browsefilter|. @@ -6925,7 +7226,6 @@ debug Compiled with "DEBUG" defined. dialog_con Compiled with console dialog support. dialog_gui Compiled with GUI dialog support. digraphs Compiled with support for digraphs. -dnd Compiled with support for the "~ register |quote_~|. eval Compiled with expression evaluation support. Always true, of course! ex_extra Compiled with extra Ex commands |+ex_extra|. @@ -6938,21 +7238,13 @@ filterpipe When 'shelltemp' is off pipes are used for shell find_in_path Compiled with support for include file searches |+find_in_path|. float Compiled with support for |Float|. -fname_case Case in file names matters (for MS-DOS and Windows - this is not present). +fname_case Case in file names matters (for Windows this is not + present). folding Compiled with |folding| support. -footer Compiled with GUI footer support. |gui-footer| gettext Compiled with message translation |multi-lang| gui Compiled with GUI enabled. -gui_athena Compiled with Athena GUI. -gui_gnome Compiled with Gnome support (gui_gtk is also defined). -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_running Vim is running in the GUI, or it will start soon. gui_win32 Compiled with MS Windows Win32 GUI. -gui_win32s idem, and Win32s system being used (Windows 3.1) iconv Can use iconv() for conversion. insert_expand Compiled with support for CTRL-X expansion commands in Insert mode. @@ -7000,6 +7292,7 @@ statusline Compiled with support for 'statusline', 'rulerformat' syntax Compiled with syntax highlighting support |syntax|. syntax_items There are active syntax highlighting items for the current buffer. +tablineat 'tabline' option accepts %@Func@ items. tag_binary Compiled with binary searching in tags files |tag-binary-search|. tag_old_static Compiled with support for old static tags @@ -7024,10 +7317,9 @@ visualextra Compiled with extra Visual mode commands. vreplace Compiled with |gR| and |gr| commands. wildignore Compiled with 'wildignore' option. wildmenu Compiled with 'wildmenu' option. -win32 Win32 version of Vim (MS-Windows 95 and later, 32 or - 64 bits) -win32unix Win32 version of Vim, using Unix files (Cygwin) -win64 Win64 version of Vim (MS-Windows 64 bit). +win32 Windows version of Vim (32 or 64 bit). +win32unix Windows version of Vim, using Unix files (Cygwin). +win64 Windows version of Vim (64 bit). winaltkeys Compiled with 'winaltkeys' option. windows Compiled with support for more than one window. writebackup Compiled with 'writebackup' default on. @@ -7596,7 +7888,7 @@ This does NOT work: > :unlet v < *E741* If you try to change a locked variable you get an - error message: "E741: Value of {name} is locked" + error message: "E741: Value is locked: {name}" [depth] is relevant when locking a |List| or |Dictionary|. It specifies how deep the locking goes: @@ -8513,7 +8805,7 @@ You can catch all Vim errors by the pattern > *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 +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 diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index d5b371ab40..b85c0a357c 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -53,60 +53,6 @@ o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9 right-to-left mode, this function is also supported only in right-to-left mode. -Farsi Fonts *farsi fonts* ------------ - -The following files are found in the subdirectories of the '$VIM/farsi/fonts' -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 ----- @@ -165,7 +111,7 @@ 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, ...). +different platforms (i.e. Unix, Windows, ...). o Keyboard @@ -215,7 +161,7 @@ o Keyboard Note: stands for Farsi PSP (break without space) - stands for Farsi PCN (for HAMZE attribute ) + stands for Farsi PCN (for HAMZE attribute) Restrictions ------------ diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index baf7550948..76aa3a50ce 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 7.4. Last change: 2013 Dec 15 +*filetype.txt* For Vim version 7.4. Last change: 2015 Dec 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -510,7 +510,7 @@ Local mappings: to the end of the file in Normal mode. This means "> " is inserted in each line. -MAN *ft-man-plugin* *:Man* +MAN *ft-man-plugin* *:Man* *man.vim* Displays a manual page in a nice way. Also see the user manual |find-manpage|. @@ -535,6 +535,13 @@ Global mapping: Local mappings: CTRL-] Jump to the manual page for the word under the cursor. CTRL-T Jump back to the previous manual page. +q Same as ":quit" + +To enable folding use this: > + let g:ft_man_folding_enable = 1 +If you do not like the default folding, use an autocommand to add your desired +folding style instead. For example: > + autocmd FileType man setlocal foldmethod=indent foldenable PDF *ft-pdf-plugin* @@ -595,7 +602,7 @@ Format description: ignored. 2. Each entry starts with line that has format "{type} with timestamp {timestamp}:". {timestamp} is |strftime()|-formatted string representing - actual UNIX timestamp value. First strftime() argument is equal to + actual Unix timestamp value. First strftime() argument is equal to `%Y-%m-%dT%H:%M:%S`. When writing this timestamp is parsed using |msgpack#strptime()|, with caching (it remembers which timestamp produced particular strftime() output and uses this value if you did not change diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 03dd6a61ba..680e3270f2 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -1,4 +1,4 @@ -*fold.txt* For Vim version 7.4. Last change: 2013 Dec 04 +*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -94,9 +94,9 @@ These are the conditions with which the expression is evaluated: lowest. "=" use fold level from the previous line "a1", "a2", .. add one, two, .. to the fold level of the previous - line + line, use the result for the current line "s1", "s2", .. subtract one, two, .. from the fold level of the - previous line + previous line, use the result for the next line "<1", "<2", .. a fold with this level ends at this line ">1", ">2", .. a fold with this level starts at this line @@ -119,6 +119,18 @@ 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. +An example of using "a1" and "s1": For a multi-line C comment, a line +containing "/*" would return "a1" to start a fold, and a line containing "*/" +would return "s1" to end the fold after that line: > + if match(thisline, '/\*') >= 0 + return 'a1' + elseif match(thisline, '\*/') >= 0 + return 's1' + else + return '=' + endif +However, this won't work for single line comments, strings, etc. + |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 @@ -570,8 +582,9 @@ 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: > +For Ex commands that work on buffer lines 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. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index c74c31d1fa..8d97678af2 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -208,18 +208,6 @@ 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* @@ -605,10 +593,6 @@ The default menus have these priorities: When no or zero priority is given, 500 is used. The priority for the PopUp menu is not used. -The Help menu will be placed on the far right side of the menu bar on systems -which support this (Motif and GTK+). For GTK+ 2, this is not done anymore -because right-aligning the Help menu is now discouraged UI design. - You can use a priority higher than 9999, to make it go after the Help menu, but that is non-standard and is discouraged. The highest possible priority is about 32000. The lowest is 1. @@ -677,10 +661,8 @@ level. Vim interprets the items in this menu as follows: toolbar button image. Note that the exact filename is OS-specific: For example, under Win32 the command > :amenu ToolBar.Hello :echo "hello"<CR> -< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With - GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for - existence, and the first one found would be used. - For MS-Windows and GTK+ 2 the bitmap is scaled to fit the button. For +< would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'. + For MS-Windows and the bitmap is scaled to fit the button. For MS-Windows a size of 18 by 18 pixels works best. For MS-Windows the bitmap should have 16 colors with the standard palette. The light grey pixels will be changed to the Window frame color and the @@ -729,8 +711,8 @@ nr Name Normal action ~ 30 WinMinWidth make current window use few columns *hidden-menus* *win32-hidden-menus* -In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu -from the main menu bar. You must then use the |:popup| command to display it. +In the Win32 GUI, starting a menu name with ']' excludes that menu from the +main menu bar. You must then use the |:popup| command to display it. *popup-menu* You can define the special menu "PopUp". This is the menu that is displayed @@ -883,9 +865,8 @@ a menu item - you don't need to do a :tunmenu as well. 5.9 Popup Menus -In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor. -This behaves similarly to the PopUp menus except that any menu tree can -be popped up. +In the Win32 GUI, you can cause a menu to popup at the cursor. This behaves +similarly to the PopUp menus except that any menu tree can be popped up. This command is for backwards compatibility, using it is discouraged, because it behaves in a strange way. @@ -894,7 +875,7 @@ it behaves in a strange way. :popu[p] {name} Popup the menu {name}. The menu named must have at least one subentry, but need not appear on the menu-bar (see |hidden-menus|). - {only available for Win32 and GTK GUI} + {only available for Win32 GUI} :popu[p]! {name} Like above, but use the position of the mouse pointer instead of the cursor. diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index eef0aaefb6..228be9eab2 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -47,10 +47,6 @@ If you want Vim to start with a maximized window, add this command to your vimrc or gvimrc file: > au GUIEnter * simalt ~x < - *gui-w32s* -There is a specific version of gvim.exe that runs under the Win32s subsystem -of Windows 3.1 or 3.11. See |win32s|. - ============================================================================== 2. Vim as default editor *vim-default-editor* @@ -88,7 +84,6 @@ when you have got a new version): You can also install Vim in the "Send To" menu: 1. Start a Windows Explorer 2. Navigate to your sendto directory: - Windows 95: %windir%\sendto (e.g. "c:\windows\sendto") Windows NT: %windir%\profiles\%user%\sendto (e.g. "c:\winnt\profiles\mattha\sendto"). 3. Right-click in the file pane and select New->Shortcut @@ -262,17 +257,6 @@ WARNING: If you close this window with the "X" button, and confirm the question if you really want to kill the application, Vim may be killed too! (This does not apply to commands run asynchronously with ":!start".) - *msdos-mode* -If you get a dialog that says "This program is set to run in MS-DOS mode..." -when you run an external program, you can solve this by changing the -properties of the associated shortcut: -- Use a Windows Explorer to find the command.com that is used. It can be - c:\command.com, c:\dos\command.com, c:\windows\command.com, etc. -- With the right mouse button, select properties of this command.com. -- In the Program tab select "Advanced". -- Unselect "MS-DOS mode". -- Click "OK" twice. - *win32-!start* Normally, Vim waits for a command to complete before continuing (this makes sense for most shell commands which produce output for Vim to use). If you @@ -281,10 +265,6 @@ syntax on W95 & NT: > :!start [/min] {command} The optional "/min" causes the window to be minimized. -On Win32s, you will have to go to another window instead. Don't forget that -you must tell Windows 3.1x to keep executing a DOS command in the background -while you switch back to Vim. - ============================================================================== 5. Special colors *win32-colors* @@ -293,7 +273,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|. Additionally the system configured colors can also be used. These are known by the names Sys_XXX, where XXX is the appropriate system color name, from the following list (see the Win32 documentation for full descriptions). Case is -ignored. Note: On Win32s not all of these colors are supported. +ignored. Sys_3DDKShadow Sys_3DFace Sys_BTNFace Sys_3DHilight Sys_3DHighlight Sys_BTNHilight @@ -405,7 +385,7 @@ detailed elsewhere: see |'mouse'|, |win32-hidden-menus|. You can drag and drop one or more files into the Vim window, where they will be opened as normal. See |drag-n-drop|. - *:simalt* *:si* + *:simalt* *:sim* :sim[alt] {key} simulate pressing {key} while holding Alt pressed. {only for Win32 versions} diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 766a440cb3..19bcb35da8 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 7.4. Last change: 2012 Dec 06 +*help.txt* For Vim version 7.4. Last change: 2015 Apr 15 VIM - main help file k @@ -23,6 +23,7 @@ Get specific help: It is possible to go directly to whatever you want help Command-line editing c_ :help c_<Del> Vim command argument - :help -r Option ' :help 'textwidth' + Regular expression / :help /[ Search for help: Type ":help word", then hit CTRL-D to see matching help entries for "word". Or use ":helpgrep word". |:helpgrep| diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index dea7dded95..f3533b8815 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -184,12 +184,6 @@ 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|} - *:helpt* *:helptags* *E154* *E150* *E151* *E152* *E153* *E670* :helpt[ags] [++t] {dir} diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 75c986efcd..e6c1ccc0cf 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.4. Last change: 2015 Jan 07 +*index.txt* For Vim version 7.4. Last change: 2016 Jan 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -700,12 +700,16 @@ tag char note action in Normal mode ~ |g'| g'{mark} 1 like |'| but without changing the jumplist |g`| g`{mark} 1 like |`| but without changing the jumplist |gstar| g* 1 like "*", but without using "\<" and "\>" +|g+| g+ go to newer text state N times +|g,| g, 1 go to N newer position in change list +|g-| g- go to older text state N times |g0| g0 1 when 'wrap' off go to leftmost character of the current line that is on the screen; when 'wrap' on go to the leftmost character of the current screen line |g8| g8 print hex value of bytes used in UTF-8 character under the cursor +|g;| g; 1 go to N older position in change list |g<| g< display previous command output |g?| g? 2 Rot13 encoding operator |g?g?| g?? 2 Rot13 encode current line @@ -734,6 +738,7 @@ tag char note action in Normal mode ~ the screen; when 'wrap' on go to the leftmost non-white character of the current screen line +|g_| g_ 1 cursor to the last CHAR N - 1 lines lower |ga| ga print ascii value of character under the cursor |gd| gd 1 go to definition of word under the cursor @@ -1128,6 +1133,8 @@ tag command action ~ |:cc| :cc go to specific error |:cclose| :ccl[ose] close quickfix window |:cd| :cd change directory +|:cdo| :cdo execute command in each valid error list entry +|:cfdo| :cfdo execute command in each file in error list |:center| :ce[nter] format lines at the center |:cexpr| :cex[pr] read errors from expr and jump to first |:cfile| :cf[ile] read file with error messages and jump to first @@ -1239,7 +1246,6 @@ tag command action ~ |:hardcopy| :ha[rdcopy] send text to the printer |:help| :h[elp] open a help window |:helpclose| :helpc[lose] close one help window -|:helpfind| :helpf[ind] dialog to open a help window |:helpgrep| :helpg[rep] like ":grep" but searches help files |:helptags| :helpt[ags] generate help tags for a directory |:highlight| :hi[ghlight] specify highlighting methods @@ -1285,6 +1291,8 @@ tag command action ~ |:lchdir| :lch[dir] change directory locally |:lclose| :lcl[ose] close location window |:lcscope| :lcs[cope] like ":cscope" but uses location list +|:ldo| :ld[o] execute command in valid location list entries +|:lfdo| :lfd[o] execute command in each file in location list |:left| :le[ft] left align lines |:leftabove| :lefta[bove] make split window appear left or above |:let| :let assign a value to a variable or option diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 013eb6b97b..f931dfa341 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.4. Last change: 2015 May 22 +*insert.txt* For Vim version 7.4. Last change: 2015 Sep 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -78,8 +78,8 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about |word-motions|, for the definition of a word. *i_CTRL-U* CTRL-U Delete all entered characters before the cursor in the current - line. If there are no newly entereed characters and - 'backspace'is not empty, delete all characters before the + line. If there are no newly entered characters and + 'backspace' is not empty, delete all characters before the cursor in the current line. See |i_backspacing| about joining lines. *i_CTRL-I* *i_<Tab>* *i_Tab* @@ -148,7 +148,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R* CTRL-R a results in "ac". CTRL-R CTRL-R a results in "ab^Hc". < Options 'textwidth', 'formatoptions', etc. still apply. If - you also want to avoid these, use "<C-R><C-O>r", see below. + you also want to avoid these, use CTRL-R CTRL-O, see below. The '.' register (last inserted text) is still inserted as typed. @@ -1941,9 +1941,9 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of changed, the detected format is only used while reading the file. A similar thing happens with 'fileencodings'. -On non-MS-DOS and Win32 systems the message "[dos format]" is shown if +On non-Windows systems the message "[dos format]" is shown if a file is read in DOS format, to remind you that something unusual is done. -On Macintosh, MS-DOS, and Win32 the message "[unix format]" is shown if +On Macintosh and Windows the message "[unix format]" is shown if a file is read in Unix format. On non-Macintosh systems, the message "[Mac format]" is shown if a file is read in Mac format. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 0825ca8848..cbe017e051 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,4 +1,4 @@ -*intro.txt* For Vim version 7.4. Last change: 2014 May 24 +*intro.txt* For Vim version 7.4. Last change: 2015 Jan 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -131,7 +131,7 @@ http://www.vim.org/maillist.php Bug reports: *bugs* *bug-reports* *bugreport.vim* -Send bug reports to: Vim Developers <vim_dev@vim.org> +Send bug reports to: Vim Developers <vim-dev@vim.org> This is a maillist, you need to become a member first and many people will see the message. If you don't want that, e.g. because it is a security issue, send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram). @@ -251,7 +251,7 @@ Vim would never have become what it is now, without the help of these people! lots of patches Ingo Wilken Tcl interface Mike Williams PostScript printing - Juergen Weigert Lattice version, AUX improvements, UNIX and + Juergen Weigert Lattice version, AUX improvements, Unix and MS-DOS ports, autoconf Stefan 'Sec' Zehl Maintainer of vim.org @@ -452,7 +452,7 @@ notation meaning equivalent decimal value(s) ~ <C-...> control-key *control* *ctrl* *<C-* <M-...> alt-key or meta-key *meta* *alt* *<M-* <A-...> same as <M-...> *<A-* -<D-...> command-key (Macintosh only) *<D-* +<D-...> command-key or "super" key *<D-* <t_xx> key with "xx" entry in termcap ----------------------------------------------------------------------- diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index ab49b6f889..464c700a4d 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.4. Last change: 2014 Oct 03 +*map.txt* For Vim version 7.4. Last change: 2014 Dec 08 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 2e3a0141ac..c87ed317d4 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -43,16 +43,6 @@ features. Unfortunately, every system has its own way to deal with multibyte languages and it is quite complicated. -COMPILING - -If you already have a compiled Vim program, check if the |+multi_byte| feature -is included. The |:version| command can be used for this. - -If +multi_byte is not included, you should compile Vim with "normal", "big" or -"huge" features. You can further tune what features are included. See the -INSTALL files in the source directory. - - LOCALE First of all, you must make sure your current locale is set correctly. If @@ -107,14 +97,6 @@ is the difficult part. It depends on the system you are using, the locale and a few other things. See the chapters on fonts: |mbyte-fonts-X11| for X-Windows and |mbyte-fonts-MSwin| for MS-Windows. -For GTK+ 2, you can skip most of this section. The option 'guifontset' does -no longer exist. You only need to set 'guifont' and everything should "just -work". If your system comes with Xft2 and fontconfig and the current font -does not contain a certain glyph, a different font will be used automatically -if available. The 'guifontwide' option is still supported but usually you do -not need to set it. It is only necessary if the automatic font selection does -not suit your needs. - For X11 you can set the 'guifontset' option to a list of fonts that together cover the characters that are used. Example for Korean: > @@ -494,11 +476,6 @@ For Vim you may need to set 'encoding' to "utf-8". Unfortunately, using fonts in X11 is complicated. The name of a single-byte font is a long string. For multi-byte fonts we need several of these... -Note: Most of this is no longer relevant for GTK+ 2. Selecting a font via -its XLFD is not supported; see 'guifont' for an example of how to -set the font. Do yourself a favor and ignore the |XLFD| and |xfontset| -sections below. - First of all, Vim only accepts fixed-width fonts for displaying text. You cannot use proportionally spaced fonts. This excludes many of the available (and nicer looking) fonts. However, for menus and tooltips any font can be @@ -629,52 +606,6 @@ If you use a wrong "font" argument you will get an error message. Also make sure that you set 'guifontset' before setting fonts for highlight groups. - -USING RESOURCE FILES - -Instead of specifying 'guifontset', you can set X11 resources and Vim will -pick them up. This is only for people who know how X resource files work. - -For Motif and Athena insert these three lines in your $HOME/.Xdefaults file: - - Vim.font: |base_font_name_list| - Vim*fontSet: |base_font_name_list| - Vim*fontList: your_language_font - -Note: Vim.font is for text area. - Vim*fontSet is for menu. - Vim*fontList is for menu (for Motif GUI) - -For example, when you are using Japanese and a 14 dots font, > - - Vim.font: -misc-fixed-medium-r-normal--14-* - Vim*fontSet: -misc-fixed-medium-r-normal--14-* - Vim*fontList: -misc-fixed-medium-r-normal--14-* -< -or: > - - Vim*font: k14,r14 - Vim*fontSet: k14,r14 - Vim*fontList: k14,r14 -< -To have them take effect immediately you will have to do > - - xrdb -merge ~/.Xdefaults - -Otherwise you will have to stop and restart the X server before the changes -take effect. - - -The GTK+ version of GUI Vim does not use .Xdefaults, use ~/.gtkrc instead. -The default mostly works OK. But for the menus you might have to change -it. Example: > - - style "default" - { - fontset="-*-*-medium-r-normal--14-*-*-*-c-*-*-*" - } - widget_class "*" style "default" - ============================================================================== 6. Fonts on MS-Windows *mbyte-fonts-MSwin* @@ -847,20 +778,6 @@ For example, when you are using kinput2 as |IM-server| and sh, > export XMODIFIERS="@im=kinput2" < -FULLY CONTROLLED XIM - -You can fully control XIM, like with IME of MS-Windows (see |multibyte-ime|). -This is currently only available for the GTK GUI. - -Before using fully controlled XIM, one setting is required. Set the -'imactivatekey' option to the key that is used for the activation of the input -method. For example, when you are using kinput2 + canna as IM Server, the -activation key is probably Shift+Space: > - - :set imactivatekey=S-space - -See 'imactivatekey' for the format. - ============================================================================== 8. Input on MS-Windows *mbyte-IME* @@ -893,14 +810,11 @@ WHAT IS IME URL. WHAT IS GLOBAL IME *global-ime* - Global IME makes capability to input Chinese, Japanese, and Korean text - into Vim buffer on any language version of Windows 98, Windows 95, and - Windows NT 4.0. - On Windows 2000 and XP it should work as well (without downloading). On - Windows 2000 Professional, Global IME is built in, and the Input Locales - can be added through Control Panel/Regional Options/Input Locales. - Please see below URL for detail of Global IME. You can also find various - language version of Global IME at same place. + Global IME enables input of Chinese, Japanese, and Korean text into Vim + buffer on any language version of Windows. Global IME is built in, and + the Input Locales can be added through Control Panel/Regional + Options/Input Locales. Please see below URL for detail of Global IME. + You can also find various language version of Global IME at same place. - Global IME detailed information. http://search.microsoft.com/results.aspx?q=global+ime @@ -1201,14 +1115,12 @@ internally. Vim has comprehensive UTF-8 support. It works well in: - xterm with utf-8 support enabled -- Athena, Motif and GTK GUI - MS-Windows GUI - several other platforms Double-width characters are supported. This works best with 'guifontwide' or 'guifontset'. When using only 'guifont' the wide characters are drawn in the -normal width and a space to fill the gap. Note that the 'guifontset' option -is no longer relevant in the GTK+ 2 GUI. +normal width and a space to fill the gap. *bom-bytes* When reading a file a BOM (Byte Order Mark) can be used to recognize the @@ -1278,8 +1190,6 @@ doesn't always work. See the system specific remarks below, and 'langmenu'. USING UTF-8 IN X-Windows *utf-8-in-xwindows* -Note: This section does not apply to the GTK+ 2 GUI. - You need to specify a font to be used. For double-wide characters another font is required, which is exactly twice as wide. There are three ways to do this: diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index 2ef2a67c4a..114bb61d99 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -401,12 +401,6 @@ You have used an ":unabbreviate" command with an argument which is not an existing abbreviation. All variations of this command give the same message: ":cunabbrev", ":iunabbrev", etc. Check for trailing white space. -> - /dev/dsp: No such file or directory - -Only given for GTK GUI with Gnome support. Gnome tries to use the audio -device and it isn't present. You can ignore this error. - *E31* > No such mapping diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index d732e7f818..bafb9dfc2c 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -7,7 +7,7 @@ The Msgpack-RPC Interface to Nvim *msgpack-rpc* 1. Introduction |msgpack-rpc-intro| -2. API |msgpack-rpc-api| +2. API mapping |msgpack-rpc-api| 3. Connecting |msgpack-rpc-connecting| 4. Clients |msgpack-rpc-clients| 5. Types |msgpack-rpc-types| @@ -36,13 +36,13 @@ Nvim's msgpack-rpc interface is like a more powerful version of Vim's `clientserver` feature. ============================================================================== -2. API *msgpack-rpc-api* +2. API mapping *msgpack-rpc-api* -The Nvim C API is automatically exposed to the msgpack-rpc interface by the -build system, which parses headers at src/nvim/api from the project root. A -dispatch function is generated, which matches msgpack-rpc method names with -non-static API functions, converting/validating arguments and return values -back to msgpack. +The Nvim C API, see |nvim-api|, is automatically exposed to the msgpack-rpc +interface by the build system, which parses headers at src/nvim/api from the +project root. A dispatch function is generated, which matches msgpack-rpc method +names with non-static API functions, converting/validating arguments and return +values back to msgpack. Client libraries will normally provide wrappers that hide msgpack-rpc details from programmers. The wrappers can be automatically generated by reading @@ -63,7 +63,7 @@ Here's a simple way to get human-readable description of the API (requires Python and the `pyyaml`/`msgpack-python` pip packages): > nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml - +< ============================================================================== 3. Connecting *msgpack-rpc-connecting* @@ -162,8 +162,8 @@ https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/tran ============================================================================== 5. Types *msgpack-rpc-types* -Nvim's C API uses custom types for all functions (some are just typedefs -around C99 standard types). The types can be split into two groups: +Nvim's C API uses custom types for all functions, se |nvim-api-types|. +For the purpose of mapping to msgpack, he types can be split into two groups: - Basic types that map natively to msgpack (and probably have a default representation in msgpack-supported programming languages) diff --git a/runtime/doc/nvim_clipboard.txt b/runtime/doc/nvim_clipboard.txt index 1183ad7a3c..078382c7a7 100644 --- a/runtime/doc/nvim_clipboard.txt +++ b/runtime/doc/nvim_clipboard.txt @@ -22,6 +22,10 @@ is found in your `$PATH`. - xclip - xsel (newer alternative to xclip) - pbcopy/pbpaste (only for Mac OS X) +- lemonade (useful for SSH machine) + https://github.com/pocke/lemonade +- doitclient (another option for SSH setups from the maintainer of PuTTY) + http://www.chiark.greenend.org.uk/~sgtatham/doit/ The presence of a suitable clipboard tool implicitly enables the '+' and '*' registers. diff --git a/runtime/doc/nvim_provider.txt b/runtime/doc/nvim_provider.txt index a737d51ac4..91cd5fbfc7 100644 --- a/runtime/doc/nvim_provider.txt +++ b/runtime/doc/nvim_provider.txt @@ -26,7 +26,7 @@ are now decoupled from Nvim core as providers: The first example is clipboard integration: in the original Vim source code, clipboard functions account for more than 1k lines of C source code (and that -is just on ui.c), all to peform two tasks that are now accomplished with +is just on ui.c), all to perform two tasks that are now accomplished with simple shell commands such as xclip or pbcopy/pbpaste. The other example is Python scripting support: Vim has three files dedicated to diff --git a/runtime/doc/nvim_python.txt b/runtime/doc/nvim_python.txt index 1c345b4532..a2fc968db4 100644 --- a/runtime/doc/nvim_python.txt +++ b/runtime/doc/nvim_python.txt @@ -49,6 +49,9 @@ To use Vim Python 2/3 plugins with Nvim, do the following: > $ pip3 install --user neovim < +Note: If you previously installed the package, get the latest version by + appending the `--upgrade` flag to the commands above. + ============================================================================== *g:python_host_prog* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 70a585654e..83ae96a651 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2014 Dec 17 +*options.txt* For Vim version 7.4. Last change: 2016 Jan 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -49,9 +49,12 @@ achieve special effects. These options come in three forms: :se[t] {option}&vi Reset option to its Vi default value. :se[t] {option}&vim Reset option to its Vim default value. -:se[t] all& Set all options, except terminal options, to their - default value. The values of 'term', 'lines' and - 'columns' are not changed. +:se[t] all& Set all options to their default value. The values of + these options are not changed: + 'columns' + 'encoding' + 'lines' + Warning: This may have a lot of side effects. *:set-args* *E487* *E521* :se[t] {option}={value} or @@ -183,7 +186,7 @@ the option value, use '\"' instead. This example sets the 'titlestring' option to 'hi "there"': > :set titlestring=hi\ \"there\" -For MS-DOS and WIN32 backslashes in file names are mostly not removed. More +For Windows backslashes in file names are mostly not removed. More precise: For options that expect a file name (those where environment variables are expanded) a backslash before a normal file name character is not removed. But a backslash before a special character (space, backslash, comma, @@ -488,11 +491,11 @@ number can be specified where "vim:" or "Vim:" is used: vim<{vers}: version before {vers} vim={vers}: version {vers} vim>{vers}: version after {vers} -{vers} is 600 for Vim 6.0 (hundred times the major version plus minor). -For example, to use a modeline only for Vim 6.0 and later: - /* vim600: set foldmethod=marker: */ ~ -To use a modeline for Vim before version 5.7: - /* vim<570: set sw=4: */ ~ +{vers} is 700 for Vim 7.0 (hundred times the major version plus minor). +For example, to use a modeline only for Vim 7.0: + /* vim700: set foldmethod=marker */ ~ +To use a modeline for Vim after version 7.2: + /* vim>702: set cole=2: */ ~ There can be no blanks between "vim" and the ":". @@ -635,9 +638,9 @@ A jump table for the options with a short description can be found at |Q_op|. (or Vim is run inside an xterm invoked with "-cjkwidth" option.), this option should be set to "double" to match the width perceived by Vim with the width of glyphs in the font. Perhaps it also has - to be set to "double" under CJK Windows 9x/ME or Windows 2k/XP - when the system locale is set to one of CJK locales. See Unicode - Standard Annex #11 (http://www.unicode.org/reports/tr11). + to be set to "double" under CJK Windows XP when the system locale is + set to one of CJK locales. + See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11). Vim may set this option automatically at startup time when Vim is compiled with the |+termresponse| feature and if |t_u7| is set to the @@ -704,7 +707,8 @@ A jump table for the options with a short description can be found at |Q_op|. line. When 'smartindent' or 'cindent' is on the indent is changed in a different way. - The 'autoindent' option is reset when the 'paste' option is set. + The 'autoindent' option is reset when the 'paste' option is set and + restored when 'paste' is reset. {small difference from Vi: After the indent is deleted when typing <Esc> or <CR>, the cursor position when moving up or down is after the deleted indent; Vi puts the cursor somewhere in the deleted indent}. @@ -772,14 +776,13 @@ A jump table for the options with a short description can be found at |Q_op|. putting a ":gui" command in the gvimrc file, before where the value of 'background' is used (e.g., before ":syntax on"). - For MS-DOS and Windows the default is "dark". - For other systems "dark" is used when 'term' is "linux", - "screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark - background. Otherwise the default is "light". + For Windows the default is "dark". "dark" should be used if $COLORFGBG + suggests a dark background (not yet implemented). Otherwise the default + is "light". Normally this option would be set in the vimrc file. Possibly depending on the terminal name. Example: > - :if &term == "pcterm" + :if $TERM == "xterm" : set background=dark :endif < When this option is set, the default settings for the highlight groups @@ -900,7 +903,7 @@ A jump table for the options with a short description can be found at |Q_op|. impossible!). Writing may fail because of this. - A directory "." means to put the backup file in the same directory as the edited file. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the backup file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. ("." inside a directory name has no special meaning). @@ -1110,8 +1113,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'browsedir'* *'bsdir'* 'browsedir' 'bsdir' string (default: "last") global - {only for Motif, Athena, GTK, Mac and - Win32 GUI} + {only for Mac and Win32 GUI} Which directory to use for the file browser: last Use same directory as with last file browser, where a file was opened or saved. @@ -1194,6 +1196,9 @@ A jump table for the options with a short description can be found at |Q_op|. nofile only: The buffer name is fixed, it is not handled like a file name. It is not modified in response to a |:cd| command. + both: When using ":e bufname" and already editing "bufname" + the buffer is made empty and autocommands are + triggered as usual for |:edit|. *E676* "acwrite" implies that the buffer name is not related to a file, like "nofile", but it will be written. Thus, in contrast to "nofile" and @@ -1359,7 +1364,7 @@ A jump table for the options with a short description can be found at |Q_op|. option, yank and delete operations (but not put) will additionally copy the text into register '*'. See |nvim-clipboard|. -< + *clipboard-autoselect* autoselect Works like the 'a' flag in 'guioptions': If present, then whenever Visual mode is started, or the Visual @@ -2073,7 +2078,7 @@ A jump table for the options with a short description can be found at |Q_op|. the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" attribute is set and a dot prepended if possible. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the swap file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//" @@ -2129,7 +2134,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'edcompatible' 'ed' Removed. |vim-differences| {Nvim} *'encoding'* *'enc'* *E543* -'encoding' 'enc' string (default: "utf-8" or value from $LANG) +'encoding' 'enc' string (default: "utf-8") global {only available when compiled with the |+multi_byte| feature} @@ -2151,10 +2156,6 @@ A jump table for the options with a short description can be found at |Q_op|. can use: > if has("multi_byte_encoding") < - Normally 'encoding' will be equal to your current locale. This will - be the default if Vim recognizes your environment settings, otherwise - "utf-8" is used. - When you set this option, it fires the |EncodingChanged| autocommand event so that you can set up fonts if necessary. @@ -2171,22 +2172,20 @@ A jump table for the options with a short description can be found at |Q_op|. setting 'encoding' to one of these values instead of utf-8 only has effect for encoding used for files when 'fileencoding' is empty. - When 'encoding' is set to a Unicode encoding, and 'fileencodings' was - not set yet, the default for 'fileencodings' is changed. - *'endofline'* *'eol'* *'noendofline'* *'noeol'* 'endofline' 'eol' boolean (default on) local to buffer When writing a file and this option is off and the 'binary' option - is on, no <EOL> will be written for the last line in the file. This - option is automatically set when starting to edit a new file, unless - the file does not have an <EOL> for the last line in the file, in - which case it is reset. Normally you don't have to set or reset this - option. When 'binary' is off the value is not used when writing the - file. When 'binary' is on it is used to remember the presence of a - <EOL> for the last line in the file, so that when you write the file - the situation from the original file can be kept. But you can change - it if you want to. + is on, or 'fixeol' option is off, no <EOL> will be written for the + last line in the file. This option is automatically set or reset when + starting to edit a new file, depending on whether file has an <EOL> + for the last line in the file. Normally you don't have to set or + reset this option. + When 'binary' is off and 'fixeol' is on the value is not used when + writing the file. When 'binary' is on or 'fixeol' is off it is used + to remember the presence of a <EOL> for the last line in the file, so + that when you write the file the situation from the original file can + be kept. But you can change it if you want to. *'equalalways'* *'ea'* *'noequalalways'* *'noea'* 'equalalways' 'ea' boolean (default on) @@ -2278,6 +2277,8 @@ A jump table for the options with a short description can be found at |Q_op|. <Tab>. Spaces are used in indents with the '>' and '<' commands and when 'autoindent' is on. To insert a real tab when 'expandtab' is on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|. + This option is reset when the 'paste' option is set and restored when + the 'paste' option is reset. *'exrc'* *'ex'* *'noexrc'* *'noex'* 'exrc' 'ex' boolean (default off) @@ -2343,9 +2344,7 @@ A jump table for the options with a short description can be found at |Q_op|. old short name was 'fe', which is no longer used. *'fileencodings'* *'fencs'* -'fileencodings' 'fencs' string (default: "ucs-bom", - "ucs-bom,utf-8,default,latin1" when - 'encoding' is set to a Unicode value) +'fileencodings' 'fencs' string (default: "ucs-bom,utf-8,default,latin1") global {only available when compiled with the |+multi_byte| feature} @@ -2385,9 +2384,8 @@ A jump table for the options with a short description can be found at |Q_op|. because Vim cannot detect an error, thus the encoding is always accepted. The special value "default" can be used for the encoding from the - environment. This is the default value for 'encoding'. It is useful - when 'encoding' is set to "utf-8" and your environment uses a - non-latin1 encoding, such as Russian. + environment. It is useful when 'encoding' is set to "utf-8" and + your environment uses a non-latin1 encoding, such as Russian. When 'encoding' is "utf-8" and a file contains an illegal byte sequence it won't be recognized as UTF-8. You can use the |8g8| command to find the illegal byte sequence. @@ -2402,7 +2400,7 @@ A jump table for the options with a short description can be found at |Q_op|. is read. *'fileformat'* *'ff'* -'fileformat' 'ff' string (MS-DOS and MS-Windows default: "dos", +'fileformat' 'ff' string (Windows default: "dos", Unix default: "unix", Macintosh default: "mac") local to buffer @@ -2446,8 +2444,8 @@ A jump table for the options with a short description can be found at |Q_op|. 2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat' is set to "unix". Note that when a <NL> is found without a preceding <CR>, "unix" is preferred over "dos". - 3. If 'fileformat' has not yet been set, and if 'fileformats' - includes "mac", 'fileformat' is set to "mac". + 3. If 'fileformat' has not yet been set, and if a <CR> is found, and + if 'fileformats' includes "mac", 'fileformat' is set to "mac". This means that "mac" is only chosen when: "unix" is not present or no <NL> is found in the file, and "dos" is not present or no <CR><NL> is found in the file. @@ -2541,6 +2539,17 @@ A jump table for the options with a short description can be found at |Q_op|. fold:c Folded |hl-Folded| diff:c DiffDelete |hl-DiffDelete| + *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* +'fixendofline' 'fixeol' boolean (default on) + local to buffer + {not in Vi} + When writing a file and this option is on, <EOL> at the end of file + will be restored if missing. Turn this option off if you want to + preserve the situation from the original file. + When the 'binary' option is set the value of this option doesn't + matter. + See the 'endofline' option. + *'fkmap'* *'fk'* *'nofkmap'* *'nofk'* 'fkmap' 'fk' boolean (default off) *E198* global @@ -2808,10 +2817,7 @@ A jump table for the options with a short description can be found at |Q_op|. written even on filesystems which do metadata-only journaling. This will force the harddrive to spin up on Linux systems running in laptop mode, so it may be undesirable in some situations. Be warned that - turning this off increases the chances of data loss after a crash. On - systems without an fsync() implementation, this variable is always - off. - Also see 'swapsync' for controlling fsync() on swap files. + turning this off increases the chances of data loss after a crash. *'gdefault'* *'gd'* *'nogdefault'* *'nogd'* 'gdefault' 'gd' boolean (default off) @@ -2864,14 +2870,14 @@ A jump table for the options with a short description can be found at |Q_op|. r-cr:hor20-Cursor/lCursor, sm:block-Cursor -blinkwait175-blinkoff150-blinkon175", - for MS-DOS and Win32 console: + for Windows console: "n-v-c:block,o:hor50,i-ci:hor15, r-cr:hor30,sm:block") global {only available when compiled with GUI enabled, and - for MS-DOS and Win32 console} + for Windows console} This option tells Vim what the cursor should look like in different - modes. It fully works in the GUI. In an MSDOS or Win32 console, only + modes. It fully works in the GUI. In a Windows console, only the height of the cursor can be changed. This can be done by specifying a block cursor, or a percentage for a vertical or horizontal cursor. @@ -2970,28 +2976,18 @@ A jump table for the options with a short description can be found at |Q_op|. the case of X). The font names given should be "normal" fonts. Vim will try to find the related bold and italic fonts. - For Win32, GTK, Motif, and Mac OS: > + For Win32 and Mac OS: > :set guifont=* < will bring up a font requester, where you can pick the font you want. The font name depends on the GUI used. See |setting-guifont| for a way to set 'guifont' for various systems. - For the GTK+ 2 GUI the font name looks like this: > - :set guifont=Andale\ Mono\ 11 -< That's all. XLFDs are not used. For Chinese this is reported to work - well: > - if has("gui_gtk2") - set guifont=Bitstream\ Vera\ Sans\ Mono\ 12,Fixed\ 12 - set guifontwide=Microsoft\ Yahei\ 12,WenQuanYi\ Zen\ Hei\ 12 - endif -< For Mac OSX you can use something like this: > :set guifont=Monaco:h10 < *E236* Note that the fonts must be mono-spaced (all characters have the same - width). An exception is GTK 2: all fonts are accepted, but - mono-spaced fonts look best. + width). To preview a font on X11, you might be able to use the "xfontsel" program. The "xlsfonts" program gives a list of all available fonts. @@ -3024,7 +3020,6 @@ A jump table for the options with a short description can be found at |Q_op|. global {only available when compiled with GUI enabled and with the |+xfontset| feature} - {not available in the GTK+ 2 GUI} When not empty, specifies two (or more) fonts to be used. The first one for normal English, the second one for your special language. See |xfontset|. @@ -3052,24 +3047,12 @@ A jump table for the options with a short description can be found at |Q_op|. Note: The size of these fonts must be exactly twice as wide as the one specified with 'guifont' and the same height. - All GUI versions but GTK+ 2: - 'guifontwide' is only used when 'encoding' is set to "utf-8" and 'guifontset' is empty or invalid. When 'guifont' is set and a valid font is found in it and 'guifontwide' is empty Vim will attempt to find a matching double-width font and set 'guifontwide' to it. - GTK+ 2 GUI only: *guifontwide_gtk2* - - If set and valid, 'guifontwide' is always used for double width - characters, even if 'encoding' is not set to "utf-8". - Vim does not attempt to find an appropriate value for 'guifontwide' - automatically. If 'guifontwide' is empty Pango/Xft will choose the - font for characters not available in 'guifont'. Thus you do not need - to set 'guifontwide' at all unless you want to override the choice - made by Pango/Xft. - Windows +multibyte only: *guifontwide_win_mbyte* If set and valid, 'guifontwide' is used for IME instead of 'guifont'. @@ -3077,7 +3060,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'guiheadroom'* *'ghr'* 'guiheadroom' 'ghr' number (default 50) global - {only for GTK and X11 GUI} + {only for X11 GUI} The number of pixels subtracted from the screen height when fitting the GUI window on the screen. Set this before the GUI is started, e.g., in your |gvimrc| file. When zero, the whole screen height will @@ -3087,8 +3070,7 @@ A jump table for the options with a short description can be found at |Q_op|. screen. *'guioptions'* *'go'* -'guioptions' 'go' string (default "egmrLT" (MS-Windows), - "aegimrLT" (GTK, Motif and Athena)) +'guioptions' 'go' string (default "egmrLT" (MS-Windows)) global {only available when compiled with GUI enabled} This option only has an effect in the GUI version of Vim. It is a @@ -3134,10 +3116,9 @@ A jump table for the options with a short description can be found at |Q_op|. 'guitablabel' can be used to change the text in the labels. When 'e' is missing a non-GUI tab pages line may be used. The GUI tabs are only supported on some systems, currently - GTK, Motif, Mac OS/X and MS-Windows. + Mac OS/X and MS-Windows. *'go-i'* - 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper - corner of the window. + 'i' Use a Vim icon. *'go-m'* 'm' Menu bar is present. *'go-M'* @@ -3149,10 +3130,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'go-g'* 'g' Grey menu items: Make menu items that are not active grey. If 'g' is not included inactive menu items are not shown at all. - Exception: Athena will always use grey menu items. *'go-T'* - 'T' Include Toolbar. Currently only in Win32, GTK+, Motif, - and Athena GUIs. + 'T' Include Toolbar. Currently only in Win32 GUI. *'go-r'* 'r' Right-hand scrollbar is always present. *'go-R'* @@ -3184,8 +3163,6 @@ A jump table for the options with a short description can be found at |Q_op|. the right moment, try adding this flag. This must be done before starting the GUI. Set it in your |gvimrc|. Adding or removing it after the GUI has started has no effect. - *'go-F'* - 'F' Add a footer. Only for Motif. See |gui-footer|. *'guipty'* *'noguipty'* @@ -3433,59 +3410,15 @@ A jump table for the options with a short description can be found at |Q_op|. global Ignore case in search patterns. Also used when searching in the tags file. - Also see 'smartcase'. + Also see 'smartcase' and 'tagcase'. Can be overruled by using "\c" or "\C" in the pattern, see |/ignorecase|. *'imactivatefunc'* *'imaf'* -'imactivatefunc' 'imaf' string (default "") - global - {only available when compiled with |+xim| and - |+GUI_GTK|} - This option specifies a function that will be called to - activate/inactivate Input Method. +'imactivatefunc' 'imaf' Removed. |vim-differences| {Nvim} - Example: > - function ImActivateFunc(active) - if a:active - ... do something - else - ... do something - endif - " return value is not used - endfunction - set imactivatefunc=ImActivateFunc -< *'imactivatekey'* *'imak'* -'imactivatekey' 'imak' string (default "") - global - {only available when compiled with |+xim| and - |+GUI_GTK|} *E599* - Specifies the key that your Input Method in X-Windows uses for - activation. When this is specified correctly, vim can fully control - IM with 'imcmdline', 'iminsert' and 'imsearch'. - You can't use this option to change the activation key, the option - tells Vim what the key is. - Format: - [MODIFIER_FLAG-]KEY_STRING - - These characters can be used for MODIFIER_FLAG (case is ignored): - S Shift key - L Lock key - C Control key - 1 Mod1 key - 2 Mod2 key - 3 Mod3 key - 4 Mod4 key - 5 Mod5 key - Combinations are allowed, for example "S-C-space" or "SC-space" are - both shift+ctrl+space. - See <X11/keysymdef.h> and XStringToKeysym for KEY_STRING. - - Example: > - :set imactivatekey=S-space -< "S-space" means shift+space. This is the activation key for kinput2 + - canna (Japanese), and ami (Korean). +'imactivatekey' 'imak' Removed. |vim-differences| {Nvim} *'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'* 'imcmdline' 'imc' boolean (default off) @@ -3527,8 +3460,6 @@ A jump table for the options with a short description can be found at |Q_op|. |i_CTRL-^|. The value is set to 1 when setting 'keymap' to a valid keymap name. It is also used for the argument of commands like "r" and "f". - The value 0 may not work correctly with Athena and Motif with some XIM - methods. Use 'imdisable' to disable XIM then. *'imsearch'* *'ims'* 'imsearch' 'ims' number (default 0, 2 when an input method is supported) @@ -3544,25 +3475,9 @@ A jump table for the options with a short description can be found at |Q_op|. |c_CTRL-^|. The value is set to 1 when it is not -1 and setting the 'keymap' option to a valid keymap name. - The value 0 may not work correctly with Athena and Motif with some XIM - methods. Use 'imdisable' to disable XIM then. *'imstatusfunc'* *'imsf'* -'imstatusfunc' 'imsf' string (default "") - global - {only available when compiled with |+xim| and - |+GUI_GTK|} - This option specifies a function that is called to obtain the status - of Input Method. It must return a positive number when IME is active. - - Example: > - function ImStatusFunc() - let is_active = ...do something - return is_active ? 1 : 0 - endfunction - set imstatusfunc=ImStatusFunc -< - NOTE: This function is invoked very often. Keep it fast. +'imstatusfunc' 'imsf' Removed. |vim-differences| {Nvim} *'include'* *'inc'* 'include' 'inc' string (default "^\s*#\s*include") @@ -3704,7 +3619,7 @@ A jump table for the options with a short description can be found at |Q_op|. When executing commands with |:normal| 'insertmode' is not used. *'isfname'* *'isf'* -'isfname' 'isf' string (default for MS-DOS and Win32: +'isfname' 'isf' string (default for Windows: "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") global @@ -3755,7 +3670,7 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. *'isident'* *'isi'* -'isident' 'isi' string (default for MS-DOS and Win32: +'isident' 'isi' string (default for Windows: "@,48-57,_,128-167,224-235" otherwise: "@,48-57,_,192-255") global @@ -3770,10 +3685,8 @@ A jump table for the options with a short description can be found at |Q_op|. change 'iskeyword' instead. *'iskeyword'* *'isk'* -'iskeyword' 'isk' string (Vim default for - Win32: @,48-57,_,128-167,224-235 - otherwise: @,48-57,_,192-255 - Vi default: @,48-57,_) +'iskeyword' 'isk' string (default: @,48-57,_,192-255 + Vi default: @,48-57,_) local to buffer Keywords are used in searching and recognizing with many commands: "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See @@ -3785,8 +3698,7 @@ A jump table for the options with a short description can be found at |Q_op|. When the 'lisp' option is on the '-' character is always included. *'isprint'* *'isp'* -'isprint' 'isp' string (default for MS-DOS, Win32, and Macintosh: - "@,~-255"; otherwise: "@,161-255") +'isprint' 'isp' string (default: "@,161-255") global The characters given by this option are displayed directly on the screen. It is also used for "\p" in a |pattern|. The characters from @@ -3873,7 +3785,7 @@ A jump table for the options with a short description can be found at |Q_op|. feature} This option allows switching your keyboard into a special language mode. When you are typing text in Insert mode the characters are - inserted directly. When in command mode the 'langmap' option takes + inserted directly. When in Normal mode the 'langmap' option takes care of translating these special characters to the original meaning of the key. This means you don't have to change the keyboard mode to be able to execute Normal mode commands. @@ -4077,8 +3989,9 @@ A jump table for the options with a short description can be found at |Q_op|. conceal:c Character to show in place of concealed text, when 'conceallevel' is set to 1. A space when omitted. *lcs-nbsp* - nbsp:c Character to show for a non-breakable space (character - 0xA0, 160). Left blank when omitted. + nbsp:c Character to show for a non-breakable space character + (0xA0 (160 decimal) and U+202F). Left blank when + omitted. The characters ':' and ',' should not be used. UTF-8 characters can be used when 'encoding' is "utf-8", otherwise only printable @@ -4239,8 +4152,11 @@ A jump table for the options with a short description can be found at |Q_op|. global Maximum amount of memory in Kbyte to use for all buffers together. The maximum usable value is about 2000000 (2 Gbyte). Use this to work - without a limit. On 64 bit machines higher values might work. But - hey, do you really need more than 2 Gbyte for text editing? + without a limit. + On 64 bit machines higher values might work. But hey, do you really + need more than 2 Gbyte for text editing? Keep in mind that text is + stored in the swap file, one can edit files > 2 Gbyte anyway. We do + need the memory to store undo info. Also see 'maxmem'. *'menuitems'* *'mis'* @@ -4381,7 +4297,7 @@ A jump table for the options with a short description can be found at |Q_op|. The mouse pointer is restored when the mouse is moved. *'mousemodel'* *'mousem'* -'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32) +'mousemodel' 'mousem' string (default "extend", "popup" for Windows) global Sets the model to use for the mouse. The name mostly specifies what the right mouse button is used for: @@ -4483,12 +4399,12 @@ A jump table for the options with a short description can be found at |Q_op|. *'mousetime'* *'mouset'* 'mousetime' 'mouset' number (default 500) global - Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum + Only for GUI, Windows and Unix with xterm. Defines the maximum time in msec between two mouse clicks for the second click to be recognized as a multi click. *'nrformats'* *'nf'* -'nrformats' 'nf' string (default "hex") +'nrformats' 'nf' string (default "bin,hex") local to buffer This defines what bases Vim will consider for numbers when using the CTRL-A and CTRL-X commands for adding to and subtracting from a number @@ -4501,6 +4417,9 @@ A jump table for the options with a short description can be found at |Q_op|. hex If included, numbers starting with "0x" or "0X" will be considered to be hexadecimal. Example: Using CTRL-X on "0x100" results in "0x0ff". + bin If included, numbers starting with "0b" or "0B" will be + considered to be binary. Example: Using CTRL-X on + "0b1000" subtracts one, resulting in "0b0111". Numbers which simply begin with a digit in the range 1-9 are always considered decimal. This also happens for numbers that are not recognized as octal or hex. @@ -4564,11 +4483,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'opendevice'* *'odev'* *'noopendevice'* *'noodev'* 'opendevice' 'odev' boolean (default off) global - {only for MS-DOS and MS-Windows} + {only for Windows} Enable reading and writing from devices. This may get Vim stuck on a device that can be opened but doesn't actually do the I/O. Therefore it is off by default. - Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also + Note that on Windows editing "aux.h", "lpt1.txt" and the like also result in editing a device. @@ -4607,19 +4526,21 @@ A jump table for the options with a short description can be found at |Q_op|. When the 'paste' option is switched on (also when it was already on): - mapping in Insert mode and Command-line mode is disabled - abbreviations are disabled - - 'textwidth' is set to 0 - - 'wrapmargin' is set to 0 - 'autoindent' is reset - - 'smartindent' is reset - - 'softtabstop' is set to 0 + - 'expandtab' is reset + - 'formatoptions' is used like it is empty - 'revins' is reset - 'ruler' is reset - 'showmatch' is reset - - 'formatoptions' is used like it is empty + - 'smartindent' is reset + - 'smarttab' is reset + - 'softtabstop' is set to 0 + - 'textwidth' is set to 0 + - 'wrapmargin' is set to 0 These options keep their value, but their effect is disabled: - - 'lisp' - - 'indentexpr' - 'cindent' + - 'indentexpr' + - 'lisp' NOTE: When you start editing another file while the 'paste' option is on, settings from the modelines or autocommands may change the settings again, causing trouble when pasting text. You might want to @@ -4934,18 +4855,7 @@ A jump table for the options with a short description can be found at |Q_op|. instead of the number of lines. *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* -'restorescreen' 'rs' boolean (default on) - global - {only in Windows 95/NT console version} - When set, the screen contents is restored when exiting Vim. This also - happens when executing external commands. - - For non-Windows Vim: You can set or reset the 't_ti' and 't_te' - options in your vimrc. To disable restoring: - set t_ti= t_te= - To enable restoring (for an xterm): - set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8 - (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it) +'restorescreen' 'rs' Removed. |vim-differences| {Nvim} *'revins'* *'ri'* *'norevins'* *'nori'* 'revins' 'ri' boolean (default off) @@ -4953,7 +4863,8 @@ A jump table for the options with a short description can be found at |Q_op|. Inserting characters in Insert mode will work backwards. See "typing backwards" |ins-reverse|. This option can be toggled with the CTRL-_ command in Insert mode, when 'allowrevins' is set. - NOTE: This option is reset when 'paste' is set. + This option is reset when 'paste' is set and restored when 'paste' is + reset. *'rightleft'* *'rl'* *'norightleft'* *'norl'* 'rightleft' 'rl' boolean (default off) @@ -5002,7 +4913,8 @@ A jump table for the options with a short description can be found at |Q_op|. separated with a dash. For an empty line "0-1" is shown. For an empty buffer the line number will also be zero: "0,0-1". - This option is reset when the 'paste' option is set. + This option is reset when 'paste' is set and restored when 'paste' is + reset. If you don't want to see the ruler all the time but want to know where you are, use "g CTRL-G" |g_CTRL-G|. @@ -5353,7 +5265,7 @@ A jump table for the options with a short description can be found at |Q_op|. r Removable media. The argument is a string (up to the next ','). This parameter can be given several times. Each specifies the start of a path for which no marks will be - stored. This is to avoid removable media. For MS-DOS you + stored. This is to avoid removable media. For Windows you could use "ra:,rb:". You can also use it for temp files, e.g., for Unix: "r/tmp". Case is ignored. *shada-s* @@ -5391,8 +5303,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shell'* *'sh'* *E91* 'shell' 'sh' string (default $SHELL or "sh", - MS-DOS and Win32: "command.com" or - "cmd.exe") + Windows: "cmd.exe") global Name of the shell to use for ! and :! commands. When changing the value also check these options: 'shellpipe', 'shellslash' @@ -5403,27 +5314,50 @@ A jump table for the options with a short description can be found at |Q_op|. If the name of the shell contains a space, you might need to enclose it in quotes. Example: > :set shell=\"c:\program\ files\unix\sh.exe\"\ -f -< Note the backslash before each quote (to avoid starting a comment) and - each space (to avoid ending the option value). Also note that the - "-f" is not inside the quotes, because it is not part of the command - name. And Vim automagically recognizes the backslashes that are path - separators. +< Note the backslash before each quote (to avoid starting a comment) and + each space (to avoid ending the option value), so better use |:let-&| + like this: > + :let &shell='"C:\Program Files\unix\sh.exe" -f' +< Also note that the "-f" is not inside the quotes, because it is not + part of the command name. + *shell-unquoting* + Rules regarding quotes: + 1. Option is split on space and tab characters that are not inside + quotes: "abc def" runs shell named "abc" with additional argument + "def", '"abc def"' runs shell named "abc def" with no additional + arguments (here and below: additional means “additional to + 'shellcmdflag'”). + 2. Quotes in option may be present in any position and any number: + '"abc"', '"a"bc', 'a"b"c', 'ab"c"' and '"a"b"c"' are all equivalent + to just "abc". + 3. Inside quotes backslash preceding backslash means one backslash. + Backslash preceding quote means one quote. Backslash preceding + anything else means backslash and next character literally: + '"a\\b"' is the same as "a\b", '"a\\"b"' runs shell named literally + 'a"b', '"a\b"' is the same as "a\b" again. + 4. Outside of quotes backslash always means itself, it cannot be used + to escape quote: 'a\"b"' is the same as "a\b". + Note that such processing is done after |:set| did its own round of + unescaping, so to keep yourself sane use |:let-&| like shown above. + This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'shellcmdflag'* *'shcf'* 'shellcmdflag' 'shcf' string (default: "-c"; - MS-DOS and Win32, when 'shell' does not + Windows, when 'shell' does not contain "sh" somewhere: "/c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., - "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like + "bash.exe -c ls" or "cmd.exe /c dir". For Windows systems, the default is set according to the value of 'shell', to reduce the need to set this option by the user. On Unix it can have more than one flag. Each white space separated part is passed as an argument to the shell command. See |option-backslash| about including spaces and backslashes. - Also see |dos-shell| for MS-DOS and MS-Windows. + See |shell-unquoting| which talks about separating this option into + multiple arguments. + Also see |dos-shell| for Windows. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5438,7 +5372,7 @@ A jump table for the options with a short description can be found at |Q_op|. The name of the temporary file can be represented by "%s" if necessary (the file name is appended automatically if no %s appears in the value of this option). - For MS-DOS the default is ">". The output is directly saved in a file + For Windows the default is ">". The output is directly saved in a file and not echoed to the screen. For Unix the default it "| tee". The stdout of the compiler is saved in a file and echoed to the screen. If the 'shell' option is "csh" or @@ -5462,7 +5396,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellquote'* *'shq'* -'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell' +'shellquote' 'shq' string (default: ""; Windows, when 'shell' contains "sh" somewhere: "\"") global Quoting character(s), put around the command passed to the shell, for @@ -5470,7 +5404,7 @@ A jump table for the options with a short description can be found at |Q_op|. quoting. See 'shellxquote' to include the redirection. It's probably not useful to set both options. This is an empty string by default. Only known to be useful for - third-party shells on MS-DOS-like systems, such as the MKS Korn Shell + third-party shells on Windows systems, such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need to set this option by the user. See |dos-shell|. @@ -5535,7 +5469,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellxescape'* *'sxe'* 'shellxescape' 'sxe' string (default: ""; - for MS-DOS and MS-Windows: "\"&|<>()@^") + for Windows: "\"&|<>()@^") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible @@ -5617,6 +5551,9 @@ A jump table for the options with a short description can be found at |Q_op|. c don't give |ins-completion-menu| messages. For example, "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found", "Back at original", etc. + q use "recording" instead of "recording @a" + F don't give the file info when editing a file, like `:silent` + was used for the command This gives you the opportunity to avoid that a change between buffers requires you to hit <Enter>, but still gives as useful a message as @@ -5685,7 +5622,9 @@ A jump table for the options with a short description can be found at |Q_op|. jump is only done if the match can be seen on the screen. The time to show the match can be set with 'matchtime'. A Beep is given if there is no match (no matter if the match can be - seen or not). This option is reset when the 'paste' option is set. + seen or not). + This option is reset when 'paste' is set and restored when 'paste' is + reset. When the 'm' flag is not included in 'cpoptions', typing a character will immediately move the cursor back to where it belongs. See the "sm" field in 'guicursor' for setting the cursor shape and @@ -5704,8 +5643,7 @@ A jump table for the options with a short description can be found at |Q_op|. Use the 'M' flag in 'highlight' to set the type of highlighting for this message. When |XIM| may be used the message will include "XIM". But this - doesn't mean XIM is really active, especially when 'imactivatekey' is - not set. + doesn't mean XIM is really active. *'showtabline'* *'stal'* 'showtabline' 'stal' number (default 1) @@ -5785,7 +5723,8 @@ A jump table for the options with a short description can be found at |Q_op|. mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. When using the ">>" command, lines starting with '#' are not shifted right. - NOTE: When 'paste' is set smart indenting is disabled. + This option is reset when 'paste' is set and restored when 'paste' is + reset. *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'* 'smarttab' 'sta' boolean (default on) @@ -5800,6 +5739,8 @@ A jump table for the options with a short description can be found at |Q_op|. What gets inserted (a <Tab> or spaces) depends on the 'expandtab' option. Also see |ins-expandtab|. When 'expandtab' is not set, the number of spaces is minimized by using <Tab>s. + This option is reset when 'paste' is set and restored when 'paste' is + reset. *'softtabstop'* *'sts'* 'softtabstop' 'sts' number (default 0) @@ -5812,7 +5753,8 @@ A jump table for the options with a short description can be found at |Q_op|. commands like "x" still work on the actual characters. When 'sts' is zero, this feature is off. When 'sts' is negative, the value of 'shiftwidth' is used. - 'softtabstop' is set to 0 when the 'paste' option is set. + 'softtabstop' is set to 0 when the 'paste' option is set and restored + when 'paste' is reset. See also |ins-expandtab|. When 'expandtab' is not set, the number of spaces is minimized by using <Tab>s. The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is @@ -5884,7 +5826,8 @@ A jump table for the options with a short description can be found at |Q_op|. the two-letter, lower case region name. You can use more than one region by listing them: "en_us,en_ca" supports both US and Canadian English, but not words specific for Australia, New Zealand or Great - Britain. + Britain. (Note: currently en_au and en_nz dictionaries are older than + en_ca, en_gb and en_us). If the name "cjk" is included East Asian characters are excluded from spell checking. This is useful when editing text that also has Asian words. @@ -6090,11 +6033,39 @@ A jump table for the options with a short description can be found at |Q_op|. ( - Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. ) - End of item group. No width fields allowed. - T N For 'tabline': start of tab page N label. Use %T after the last - label. This information is used for mouse clicks. - X N For 'tabline': start of close tab N label. Use %X after the - label, e.g.: %3Xclose%X. Use %999X for a "close current tab" - mark. This information is used for mouse clicks. + T N For 'tabline': start of tab page N label. Use %T or %X to end + the label. Clicking this label with left mouse button switches + to the specified tab page. + X N For 'tabline': start of close tab N label. Use %X or %T to end + the label, e.g.: %3Xclose%X. Use %999X for a "close current + tab" label. Clicking this label with left mouse button closes + specified tab page. + @ N For 'tabline': start of execute function label. Use %X or %T to + end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this + label runs specified function: in the example when clicking once + using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l', + ' ')" expression will be run. Function receives the + following arguments in order: + 1. minwid field value or zero if no N was specified + 2. number of mouse clicks to detect multiple clicks + 3. mouse button used: "l", "r" or "m" for left, right or middle + button respectively; one should not rely on third argument + being only "l", "r" or "m": any other non-empty string value + that contains only ASCII lower case letters may be expected + for other mouse buttons + 4. modifiers pressed: string which contains "s" if shift + modifier was pressed, "c" for control, "a" for alt and "m" + for meta; currently if modifier is not pressed string + contains space instead, but one should not rely on presence + of spaces or specific order of modifiers: use |stridx()| to + test whether some modifier is present; string is guaranteed + to contain only ASCII letters and spaces, one letter per + modifier; "?" modifier may also be present, but its presence + is a bug that denotes that new mouse button recognition was + added without modifying code that reacts on mouse clicks on + this label. + Note: to test whether your version of Neovim contains this + feature use `has('tablineat')`. < - Where to truncate line if too long. Default is at the start. No width fields allowed. = - Separation point between left and right aligned items. @@ -6118,7 +6089,7 @@ A jump table for the options with a short description can be found at |Q_op|. become empty. This will make a group like the following disappear completely from the statusline when none of the flags are set. > :set statusline=...%(\ [%M%R%H]%)... -< +< *g:actual_curbuf* Beware that an expression is evaluated each and every time the status line is displayed. The current buffer and current window will be set temporarily to that of the window (and buffer) whose statusline is @@ -6201,7 +6172,7 @@ A jump table for the options with a short description can be found at |Q_op|. When 'swapfile' is reset, the swap file for the current buffer is immediately deleted. When 'swapfile' is set, and 'updatecount' is non-zero, a swap file is immediately created. - Also see |swap-file| and |'swapsync'|. + Also see |swap-file|. If you want to open a new buffer without creating a swap file for it, use the |:noswapfile| modifier. @@ -6209,18 +6180,7 @@ A jump table for the options with a short description can be found at |Q_op|. specify special kinds of buffers. See |special-buffers|. *'swapsync'* *'sws'* -'swapsync' 'sws' string (default "fsync") - global - When this option is not empty a swap file is synced to disk after - writing to it. This takes some time, especially on busy unix systems. - When this option is empty parts of the swap file may be in memory and - not written to disk. When the system crashes you may lose more work. - On Unix the system does a sync now and then without Vim asking for it, - so the disadvantage of setting this option off is small. On some - systems the swap file will not be written at all. For a unix system - setting it to "sync" will use the sync() call instead of the default - fsync(), which may work better on some systems. - The 'fsync' option is used for the actual file. +'swapsync' 'sws' Removed. |vim-differences| {Nvim} *'switchbuf'* *'swb'* 'switchbuf' 'swb' string (default "") @@ -6239,6 +6199,7 @@ A jump table for the options with a short description can be found at |Q_op|. split If included, split the current window before loading a buffer for a |quickfix| command that display errors. Otherwise: do not split, use current window. + vsplit Just like "split" but split vertically. newtab Like "split", but open a new tab page. Overrules "split" when both are present. @@ -6364,19 +6325,22 @@ A jump table for the options with a short description can be found at |Q_op|. < [The whitespace before and after the '0' must be a single <Tab>] When a binary search was done and no match was found in any of the - files listed in 'tags', and 'ignorecase' is set or a pattern is used + files listed in 'tags', and case is ignored or a pattern is used instead of a normal tag name, a retry is done with a linear search. Tags in unsorted tags files, and matches with different case will only be found in the retry. If a tag file indicates that it is case-fold sorted, the second, - linear search can be avoided for the 'ignorecase' case. Use a value - of '2' in the "!_TAG_FILE_SORTED" line for this. A tag file can be - case-fold sorted with the -f switch to "sort" in most unices, as in - the command: "sort -f -o tags tags". For "Exuberant ctags" version - 5.x or higher (at least 5.5) the --sort=foldcase switch can be used - for this as well. Note that case must be folded to uppercase for this - to work. + linear search can be avoided when case is ignored. Use a value of '2' + in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold + sorted with the -f switch to "sort" in most unices, as in the command: + "sort -f -o tags tags". For "Exuberant ctags" version 5.x or higher + (at least 5.5) the --sort=foldcase switch can be used for this as + well. Note that case must be folded to uppercase for this to work. + + By default, tag searches are case-sensitive. Case is ignored when + 'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is + "ignore". When 'tagbsearch' is off, tags searching is slower when a full match exists, but faster when no full match exists. Tags in unsorted tags @@ -6387,6 +6351,16 @@ A jump table for the options with a short description can be found at |Q_op|. This option doesn't affect commands that find all matching tags (e.g., command-line completion and ":help"). + *'tagcase'* *'tc'* +'tagcase' 'tc' string (default "followic") + global or local to buffer |global-local| + {not in Vi} + This option specifies how case is handled when searching the tags + file: + followic Follow the 'ignorecase' option + ignore Ignore case + match Match case + *'taglength'* *'tl'* 'taglength' 'tl' number (default 0) global @@ -6432,18 +6406,7 @@ A jump table for the options with a short description can be found at |Q_op|. mapping which should not change the tagstack. *'term'* *E529* *E530* *E531* -'term' string (default is $TERM, if that fails: - in the GUI: "builtin_gui" - on Mac: "mac-ansi" - on MS-DOS: "pcterm" - on Unix: "ansi" - on Win 32: "win32") - global - Name of the terminal. Used for choosing the terminal control - characters. Environment variables are expanded |:set_env|. - For example: > - :set term=$TERM -< See |termcap|. +'term' Removed. |vim-differences| {Nvim} *'termbidi'* *'tbidi'* *'notermbidi'* *'notbidi'* @@ -6461,6 +6424,14 @@ A jump table for the options with a short description can be found at |Q_op|. *'termencoding'* *'tenc'* 'termencoding' 'tenc' Removed. |vim-differences| {Nvim} + *'termguicolors'* *'tgc'* +'termguicolors' 'tgc' boolean (default off) + global + When on, uses |highlight-guifg| and |highlight-guibg| attributes in + the terminal (thus using 24-bit color). Requires a ISO-8613-3 + compatible terminal. + Must be set at startup (in your |init.vim| or |--cmd|). + *'terse'* *'noterse'* 'terse' boolean (default off) global @@ -6474,8 +6445,10 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer Maximum width of text that is being inserted. A longer line will be broken after white space to get this width. A zero value disables - this. 'textwidth' is set to 0 when the 'paste' option is set. When - 'textwidth' is zero, 'wrapmargin' may be used. See also + this. + 'textwidth' is set to 0 when the 'paste' option is set and restored + when 'paste' is reset. + When 'textwidth' is zero, 'wrapmargin' may be used. See also 'formatoptions' and |ins-textwidth|. When 'formatexpr' is set it will be used to break the line. @@ -6623,9 +6596,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'ttyscroll' 'tsl' Removed. |vim-differences| {Nvim} *'ttytype'* *'tty'* -'ttytype' 'tty' string (default from $TERM) - global - Alias for 'term', see above. +'ttytype' 'tty' Alias for 'term'. Removed. |vim-differences| {Nvim} *'undodir'* *'udir'* *E926* 'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo") @@ -6707,7 +6678,6 @@ A jump table for the options with a short description can be found at |Q_op|. When 'updatecount' is set from zero to non-zero, swap files are created for all buffers that have 'swapfile' set. When 'updatecount' is set to zero, existing swap files are not deleted. - Also see |'swapsync'|. This option has no meaning in buffers where |'buftype'| is "nofile" or "nowrite". @@ -7011,7 +6981,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'winaltkeys'* *'wak'* 'winaltkeys' 'wak' string (default "menu") global - {only used in Win32, Motif, and GTK} + {only used in Win32} Some GUI versions allow the access to menu entries by using the ALT key in combination with a character that appears underlined in the menu. This conflicts with the use of the ALT key for mappings and @@ -7026,8 +6996,7 @@ A jump table for the options with a short description can be found at |Q_op|. keys can be mapped. If the menu is disabled by excluding 'm' from 'guioptions', the ALT key is never used for the menu. - This option is not used for <F10>; on Win32 and with GTK <F10> will - select the menu, unless it has been mapped. + This option is not used for <F10>; on Win32. *'window'* *'wi'* 'window' 'wi' number (default screen height - 1) @@ -7195,6 +7164,6 @@ A jump table for the options with a short description can be found at |Q_op|. global The number of microseconds to wait for each character sent to the screen. When non-zero, characters are sent to the terminal one by - one. For MS-DOS pcterm this does not work. For debugging purposes. + one. For debugging purposes. vim:tw=78:ts=8:ft=help:noet:norl: diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt deleted file mode 100644 index 1c80f4d7a5..0000000000 --- a/runtime/doc/os_dos.txt +++ /dev/null @@ -1,292 +0,0 @@ -*os_dos.txt* For Vim version 7.4. Last change: 2006 Mar 30 - - - VIM REFERENCE MANUAL by Bram Moolenaar - - - *dos* *DOS* -This file documents some particularities of the Win32 -version of Vim. Also see |os_win32.txt|. - -1. File locations |dos-locations| -2. Using backslashes |dos-backslash| -3. Standard mappings |dos-standard-mappings| -4. Screen output and colors |dos-colors| -5. File formats |dos-file-formats| -6. :cd command |dos-:cd| -7. Interrupting |dos-CTRL-Break| -8. Temp files |dos-temp-files| -9. Shell option default |dos-shell| - -============================================================================== -1. File locations *dos-locations* - -If you keep the Vim executable in the directory that contains the help and -syntax subdirectories, there is no need to do anything special for Vim to -work. No registry entries or environment variables need to be set. Just make -sure that the directory is in your search path, or use a shortcut on the -desktop. - -Your vimrc files ("_vimrc" and "_gvimrc") are normally located one directory -up from the runtime files. If you want to put them somewhere else, set the -environment variable $VIM to the directory where you keep them. Example: > - set VIM=C:\user\piet -Will find "c:\user\piet\_vimrc". -Note: This would only be needed when the computer is used by several people. -Otherwise it's simpler to keep your _vimrc file in the default place. - -If you move the executable to another location, you also need to set the $VIM -environment variable. The runtime files will be found in "$VIM/vim{version}". -Example: > - set VIM=E:\vim -Will find the version 5.4 runtime files in "e:\vim\vim54". -Note: This is _not_ recommended. The preferred way is to keep the executable -in the runtime directory. - -If you move your executable AND want to put your "_vimrc" and "_gvimrc" files -somewhere else, you must set $VIM to where you vimrc files are, and set -$VIMRUNTIME to the runtime files. Example: > - set VIM=C:\usr\piet - set VIMRUNTIME=E:\vim\vim54 -Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54". - -See |$VIM| and |$VIMRUNTIME| for more information. - -Under Windows 95, you can set $VIM in your C:\autoexec.bat file. For -example: > - set VIM=D:\vim -Under Windows NT, you can set environment variables for each user separately -under "Start/Settings/Control Panel->System", or through the properties in the -menu of "My Computer", under the Environment Tab. - -============================================================================== -2. Using backslashes *dos-backslash* - -Using backslashes in file names can be a problem. Vi halves the number of -backslashes for some commands. Vim is a bit more tolerant and does not remove -backslashes from a file name, so ":e c:\foo\bar" works as expected. But when -a backslash occurs before a special character (space, comma, backslash, etc.), -Vim removes the backslash. Use slashes to avoid problems: ":e c:/foo/bar" -works fine. Vim replaces the slashes with backslashes internally to avoid -problems with some MS-DOS programs and Win32 programs. - -When you prefer to use forward slashes, set the 'shellslash' option. Vim will -then replace backslashes with forward slashes when expanding file names. This -is especially useful when using a Unix-like 'shell'. - -============================================================================== -3. Standard mappings *dos-standard-mappings* - -The mappings for CTRL-PageUp and CTRL-PageDown have been removed, they now -jump to the next or previous tab page |<C-PageUp>| |<C-PageDown>| - -If you want them to move to the first and last screen line you can use these -mappings: - -key key code Normal/Visual mode Insert mode ~ -CTRL-PageUp <M-N><M-C-D> H <C-O>H -CTRL-PageDown <M-N>v L$ <C-O>L<C-O>$ - -Additionally, these keys are available for copy/cut/paste. -In the Win32 version, they also use the clipboard. - -Shift-Insert paste text (from clipboard) *<S-Insert>* -CTRL-Insert copy Visual text (to clipboard) *<C-Insert>* -CTRL-Del cut Visual text (to clipboard) *<C-Del>* -Shift-Del cut Visual text (to clipboard) *<S-Del>* - -These mappings accomplish this (Win32 version of Vim): - -key key code Normal Visual Insert ~ -Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>* -CTRL-Insert <M-N><M-U> "*y -Shift-Del <M-N><M-W> "*d -CTRL-Del <M-N><M-X> "*d - -Or these mappings (non-Win32 version of Vim): - -key key code Normal Visual Insert ~ -Shift-Insert <M-N><M-T> P "-dP <C-R><C-O>" -CTRL-Insert <M-N><M-U> y -Shift-Del <M-N><M-W> d -CTRL-Del <M-N><M-X> d - -When the clipboard is supported, the "* register is used. - -============================================================================== -4. Screen output and colors *dos-colors* - -The default output method for the screen is to use bios calls. This works -right away on most systems. You do not need ansi.sys. You can use ":mode" to -set the current screen mode. See |:mode|. - -To change the screen colors that Vim uses, you can use the |:highlight| -command. The Normal highlight group specifies the colors Vim uses for normal -text. For example, to get grey text on a blue background: > - :hi Normal ctermbg=Blue ctermfg=grey -See |highlight-groups| for other groups that are available. - -A DOS console does not support attributes like bold and underlining. You can -set the color used in five modes with nine terminal options. Note that this -is not necessary since you can set the color directly with the ":highlight" -command; these options are for backward compatibility with older Vim versions. -The |'highlight'| option specifies which of the five modes is used for which -action. > - - :set t_mr=^V^[\|xxm start of invert mode - :set t_md=^V^[\|xxm start of bold mode - :set t_me=^V^[\|xxm back to normal text - - :set t_so=^V^[\|xxm start of standout mode - :set t_se=^V^[\|xxm back to normal text - - :set t_us=^V^[\|xxm start of underline mode - :set t_ue=^V^[\|xxm back to normal text - - :set t_ZH=^V^[\|xxm start of italics mode - :set t_ZR=^V^[\|xxm back to normal text - -^V is CTRL-V -^[ is <Esc> -You must replace xx with a decimal code, which is the foreground color number -and background color number added together: - -COLOR FOREGROUND BACKGROUND ~ -Black 0 0 -DarkBlue 1 16 -DarkGreen 2 32 -DarkCyan 3 48 -DarkRed 4 64 -DarkMagenta 5 80 -Brown, DarkYellow 6 96 -LightGray 7 112 -DarkGray 8 128 * -Blue, LightBlue 9 144 * -Green, LightGreen 10 160 * -Cyan, LightCyan 11 176 * -Red, LightRed 12 192 * -Magenta, LightMagenta 13 208 * -Yellow, LightYellow 14 224 * -White 15 240 * - -* Depending on the display mode, the color codes above 128 may not be - available, and code 128 will make the text blink. - -When you use 0, the color is reset to the one used when you started Vim -(usually 7, lightgray on black, but you can override this. If you have -overridden the default colors in a command prompt, you may need to adjust -some of the highlight colors in your vimrc---see below). -This is the default for t_me. - -The defaults for the various highlight modes are: - t_mr 112 reverse mode: Black text (0) on LightGray (112) - t_md 15 bold mode: White text (15) on Black (0) - t_me 0 normal mode (revert to default) - - t_so 31 standout mode: White (15) text on DarkBlue (16) - t_se 0 standout mode end (revert to default) - - t_czh 225 italic mode: DarkBlue text (1) on Yellow (224) - t_czr 0 italic mode end (revert to default) - - t_us 67 underline mode: DarkCyan text (3) on DarkRed (64) - t_ue 0 underline mode end (revert to default) - -These colors were chosen because they also look good when using an inverted -display, but you can change them to your liking. - -Example: > - :set t_mr=^V^[\|97m " start of invert mode: DarkBlue (1) on Brown (96) - :set t_md=^V^[\|67m " start of bold mode: DarkCyan (3) on DarkRed (64) - :set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112) - - :set t_so=^V^[\|37m " start of standout mode: DarkMagenta (5) on DarkGreen - (32) - :set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112) - -============================================================================== -5. File formats *dos-file-formats* - -If the 'fileformat' option is set to "dos" (which is the default), Vim accepts -a single <NL> or a <CR><NL> pair for end-of-line (<EOL>). When writing a -file, Vim uses <CR><NL>. Thus, if you edit a file and write it, Vim replaces -<NL> with <CR><NL>. - -If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL> -and shows <CR> as ^M. - -You can use Vim to replace <NL> with <CR><NL> by reading in any mode and -writing in Dos mode (":se ff=dos"). -You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and -writing in Unix mode (":se ff=unix"). - -Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is -the default), so you don't really have to worry about what you are doing. - |'fileformat'| |'fileformats'| - -If you want to edit a script file or a binary file, you should set the -'binary' option before loading the file. Script files and binary files may -contain single <NL> characters which Vim would replace with <CR><NL>. You can -set 'binary' automatically by starting Vim with the "-b" (binary) option. - -============================================================================== -6. :cd command *dos-:cd* - -The ":cd" command recognizes the drive specifier and changes the current -drive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\foo" to go -to the directory "foo" in the root of drive D. Vim also recognizes UNC names -if the system supports them; e.g., ":cd \\server\share\dir". |:cd| - -============================================================================== -7. Interrupting *dos-CTRL-Break* - -Use CTRL-Break instead of CTRL-C to interrupt searches. Vim does not detect -the CTRL-C until it tries to read a key. - -============================================================================== -8. Temp files *dos-temp-files* - -Only for the 16 bit and 32 bit DOS version: -Vim puts temporary files (for filtering) in the first of these directories -that exists and in which Vim can create a file: - $TMP - $TEMP - C:\TMP - C:\TEMP - current directory - -For the Win32 version (both console and GUI): -Vim uses standard Windows functions to obtain a temporary file name (for -filtering). The first of these directories that exists and in which Vim can -create a file is used: - $TMP - $TEMP - current directory - -============================================================================== -9. Shell option default *dos-shell* - -The default for the 'sh' ('shell') option is "command.com" on Windows 95 and -"cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if -SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external -commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command -subshell. Return to Vim with "exit". |'shell'| |CTRL-Z| - -If you are running a third-party shell, you may need to set the -|'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'| -('sxq') options. Unfortunately, this also depends on the version of Vim used. -For example, with the MKS Korn shell or with bash, the values of the options -on Win32 should be: - -'shellcmdflag' -c -'shellquote' (empty) -'shellxquote' " - -For Win32, this starts the shell as: - <shell> -c "command name >file" - -When starting up, Vim checks for the presence of "sh" anywhere in the 'shell' -option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or -'shellxquote' options will be set as described above. - - vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt index 603dbcddce..3c7ca4e36a 100644 --- a/runtime/doc/os_win32.txt +++ b/runtime/doc/os_win32.txt @@ -7,17 +7,15 @@ *win32* *Win32* *MS-Windows* This file documents the idiosyncrasies of the Win32 version of Vim. -The Win32 version of Vim works on Windows NT, XP, Vista and Windows 7. +The Win32 version of Vim works on Windows XP, Vista and Windows 7. There are both console and GUI versions. The 32 bit version also runs on 64 bit MS-Windows systems. 1. Known problems |win32-problems| 2. Startup |win32-startup| -3. Restore screen contents |win32-restore| -4. Using the mouse |win32-mouse| -5. Running under Windows 3.1 |win32-win3.1| -6. Win32 mini FAQ |win32-faq| +3. Using the mouse |win32-mouse| +4. Win32 mini FAQ |win32-faq| Additionally, there are a number of common Win32 and DOS items: File locations |dos-locations| @@ -34,7 +32,6 @@ Win32 GUI |gui-w32| Credits: The Win32 version was written by George V. Reilly <george@reilly.org>. -The original Windows NT port was done by Roger Knobbe <RogerK@wonderware.com>. The GUI version was made by George V. Reilly and Robert Webb. ============================================================================== @@ -79,14 +76,7 @@ make "!xxd" work, as it is in the Tools menu. And it also means that when executable() returns 1 the executable can actually be executed. ============================================================================== -3. Restore screen contents *win32-restore* - -When 'restorescreen' is set (which is the default), Vim will restore the -original contents of the console when exiting or when executing external -commands. If you don't want this, use ":set nors". |'restorescreen'| - -============================================================================== -4. Using the mouse *win32-mouse* +3. Using the mouse *win32-mouse* The Win32 version of Vim supports using the mouse. If you have a two-button mouse, the middle button can be emulated by pressing both left and right @@ -98,35 +88,7 @@ When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of the console. ============================================================================== -5. Running under Windows 3.1 *win32-win3.1* - - *win32s* *windows-3.1* -There is a special version of Gvim that runs under Windows 3.1 and 3.11. You -need the gvim.exe that was compiled with Visual C++ 4.1. - -To run the Win32 version under Windows 3.1, you need to install Win32s. You -might have it already from another Win32 application which you have installed. -If Vim doesn't seem to be running properly, get the latest version: 1.30c. -You can find it at: - - http://support.microsoft.com/download/support/mslfiles/pw1118.exe - -(Microsoft moved it again, we don't know where it is now :-( ). - -The reason for having two versions of gvim.exe is that the Win32s version was -compiled with VC++ 4.1. This is the last version of VC++ that supports Win32s -programs. VC++ 5.0 is better, so that one was used for the Win32 version. -Apart from that, there is no difference between the programs. If you are in a -mixed environment, you can use the gvim.exe for Win32s on both. - -The Win32s version works the same way as the Win32 version under 95/NT. When -running under Win32s the following differences apply: -- You cannot use long file names, because Windows 3.1 doesn't support them! -- When executing an external command, it doesn't return an exit code. After - doing ":make" you have to do ":cn" yourself. - -============================================================================== -6. Win32 mini FAQ *win32-faq* +4. Win32 mini FAQ *win32-faq* Q. How do I change the font? A. In the GUI version, you can use the 'guifont' option. Example: > @@ -134,14 +96,6 @@ A. In the GUI version, you can use the 'guifont' option. Example: > < In the console version, you need to set the font of the console itself. You cannot do this from within Vim. -Q. How do I type dead keys on Windows NT? -A. Dead keys work on NT 3.51. Just type them as you would in any other - application. - On NT 4.0, you need to make sure that the default locale (set in the - Keyboard part of the Control Panel) is the same as the currently active - locale. Otherwise the NT code will get confused and crash! This is a NT - 4.0 problem, not really a Vim problem. - Q. I'm using Vim to edit a symbolically linked file on a Unix NFS file server. When I write the file, Vim does not "write through" the symlink. Instead, it deletes the symbolic link and creates a new file in its place. Why? @@ -176,28 +130,6 @@ A. Basically what you need is to put a tee program that will copy its input :set shellpipe=\|\ tee < to your _vimrc. -Q. I'm storing files on a remote machine that works with VisionFS, and files - disappear! -A. VisionFS can't handle certain dot (.) three letter extension file names. - SCO declares this behavior required for backwards compatibility with 16bit - DOS/Windows environments. The two commands below demonstrate the behavior: -> - echo Hello > file.bat~ - dir > file.bat -< - The result is that the "dir" command updates the "file.bat~" file, instead - of creating a new "file.bat" file. This same behavior is exhibited in Vim - when editing an existing file named "foo.bat" because the default behavior - of Vim is to create a temporary file with a '~' character appended to the - name. When the file is written, it winds up being deleted. - - Solution: Add this command to your _vimrc file: > - :set backupext=.temporary - -Q. How do I change the blink rate of the cursor? -A. You can't! This is a limitation of the NT console. NT 5.0 is reported to - be able to set the blink rate for all console windows at the same time. - *:!start* Q. How can I run an external command or program asynchronously? A. When using :! to run an external command, you can run it with "start": > @@ -240,28 +172,6 @@ A. You have two possible solutions depending on what you want: < The first command runs notepad minimized and the second one runs it normally. -Q. I'm using Win32s, and when I try to run an external command like "make", - Vim doesn't wait for it to finish! Help! -A. The problem is that a 32-bit application (Vim) can't get notification from - Windows that a 16-bit application (your DOS session) has finished. Vim - includes a work-around for this, but you must set up your DOS commands to - run in a window, not full-screen. Unfortunately the default when you - install Windows is full-screen. To change this: - 1) Start PIF editor (in the Main program group). - 2) Open the file "_DEFAULT.PIF" in your Windows directory. - 3) Changes the display option from "Full Screen" to "Windowed". - 4) Save and exit. - - To test, start Vim and type > - :!dir C:\<CR>". -< You should see a DOS box window appear briefly with the directory listing. - -Q. I use Vim under Win32s and NT. In NT, I can define the console to default to - 50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in - W3.1x, or am I stuck with 80x25? -A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS - prompts and external DOS commands will now run in a 50-line window. - *windows-icon* Q. I don't like the Vim icon, can I change it? A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 1a76a4749a..5897f756d8 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.4. Last change: 2014 Sep 06 +*pattern.txt* For Vim version 7.4. Last change: 2016 Jan 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -59,6 +59,8 @@ explanations are in chapter 27 |usr_27.txt|. *n* n Repeat the latest "/" or "?" [count] times. + If the cursor doesn't move the search is repeated with + count + 1. |last-pattern| *N* @@ -129,7 +131,7 @@ gD Goto global Declaration. When the cursor is on a *CTRL-C* CTRL-C Interrupt current (search) command. Use CTRL-Break on - MS-DOS |dos-CTRL-Break|. + Windows |dos-CTRL-Break|. In Normal mode, any pending command is aborted. *:noh* *:nohlsearch* @@ -390,8 +392,8 @@ Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used. Use of "\v" means that in the pattern after it all ASCII characters except '0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic" -Use of "\V" means that in the pattern after it only the backslash has a -special meaning. "very nomagic" +Use of "\V" means that in the pattern after it only the backslash and the +terminating character (/ or ?) has a special meaning. "very nomagic" Examples: after: \v \m \M \V matches ~ @@ -399,6 +401,7 @@ after: \v \m \M \V matches ~ $ $ $ \$ matches end-of-line . . \. \. matches any character * * \* \* any number of the previous atom + ~ ~ \~ \~ latest substitute string () \(\) \(\) \(\) grouping into an atom | \| \| \| separating alternatives \a \a \a \a alphabetic character @@ -475,6 +478,7 @@ More explanation and examples below, follow the links. |/\%v| \%23v \%23v in virtual column 23 |/zero-width| Character classes: */character-classes* + magic nomagic matches ~ |/\i| \i \i identifier character (see 'isident' option) |/\I| \I \I like "\i", but excluding digits |/\k| \k \k keyword character (see 'iskeyword' option) @@ -505,6 +509,7 @@ Character classes: */character-classes* class with end-of-line included (end of character classes) + magic nomagic matches ~ |/\e| \e \e <Esc> |/\t| \t \t <Tab> |/\r| \r \r <CR> @@ -530,6 +535,7 @@ Character classes: */character-classes* |/\Z| \Z \Z ignore differences in Unicode "combining characters". Useful when searching voweled Hebrew or Arabic text. + magic nomagic matches ~ |/\m| \m \m 'magic' on for the following chars in the pattern |/\M| \M \M 'magic' off for the following chars in the pattern |/\v| \v \v the following chars in the pattern are "very magic" @@ -1050,7 +1056,10 @@ x A single character, with no special meaning, matches itself *E769* When the ']' is not there Vim will not give an error message but assume no collection is used. Useful to search for '['. However, you - do get E769 for internal searching. + do get E769 for internal searching. And be aware that in a + `:substitute` command the whole command becomes the pattern. E.g. + ":s/[/x/" searches for "[/x" and replaces it with nothing. It does + not search for "[" and replaces it with "x"! If the sequence begins with "^", it matches any single character NOT in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'. @@ -1082,10 +1091,13 @@ x A single character, with no special meaning, matches itself *[:backspace:]* [:backspace:] the <BS> character The brackets in character class expressions are additional to the brackets delimiting a collection. For example, the following is a - plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is, + plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is, a list of at least one character, each of which is either '-', '.', '/', alphabetic, numeric, '_' or '~'. - These items only work for 8-bit characters. + These items only work for 8-bit characters, except [:lower:] and + [:upper:] also work for multi-byte characters when using the new + regexp engine. In the future these items may work for multi-byte + characters. */[[=* *[==]* - An equivalence class. This means that characters are matched that have almost the same meaning, e.g., when ignoring accents. This diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 7f5825ba25..1705010ff2 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Jan 05 +*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Oct 31 ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell @@ -365,7 +365,12 @@ settings are described below, in |netrw-browser-options|, and in fun! MyFuncRef() endfun let g:Netrw_funcref= function("MyFuncRef") + < + *g:Netrw_UserMaps* specifies a function or |List| of functions which can + be used to set up user-specified maps and functionality. + See |netrw-usermaps| + *g:netrw_ftp* if it doesn't exist, use default ftp =0 use default ftp (uid password) =1 use alternate ftp method (user uid password) @@ -1062,9 +1067,10 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 < <F1> Causes Netrw to issue help <cr> Netrw will enter the directory or read the file |netrw-cr| <del> Netrw will attempt to remove the file/directory |netrw-del| - <c-h> Edit file hiding list |netrw-ctrl-h| - <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| - <c-r> Browse using a gvim server |netrw-ctrl-r| + <c-h> Edit file hiding list |netrw-ctrl-h| + <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| + <c-r> Browse using a gvim server |netrw-ctrl-r| + <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab| - Makes Netrw go up one directory |netrw--| a Toggles between normal display, |netrw-a| hiding (suppress display of files matching g:netrw_list_hide) @@ -1077,6 +1083,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 gd Force treatment as directory |netrw-gd| gf Force treatment as file |netrw-gf| gh Quick hide/unhide of dot-files |netrw-gh| + gn Make top of tree the directory below the cursor |netrw-gn| i Cycle between thin, long, wide, and tree listings |netrw-i| mb Bookmark current directory |netrw-mb| mc Copy marked files to marked-file target directory |netrw-mc| @@ -1105,7 +1112,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 qf Display information on file |netrw-qf| qF Mark files using a quickfix list |netrw-qF| r Reverse sorting order |netrw-r| - R Rename the designed file(s)/directory(ies) |netrw-R| + R Rename the designated file(s)/directory(ies) |netrw-R| s Select sorting style: by name, time, or file size |netrw-s| S Specify suffix priority for name-sorting |netrw-S| t Enter the file/directory under the cursor in a new tab|netrw-t| @@ -1174,10 +1181,10 @@ Addtionally, one may use :NetrwMB to bookmark files or directories. > < No bang: enters files/directories into Netrw's bookmark system No argument and in netrw buffer: - if there are marked files: bookmark marked files - otherwise : bookmark file/directory under cursor + if there are marked files : bookmark marked files + otherwise : bookmark file/directory under cursor No argument and not in netrw buffer: bookmarks current open file - Has arguments: globs them individually and bookmarks them + Has arguments : |glob()|s each arg and bookmarks them With bang: deletes files/directories from Netrw's bookmark system @@ -1394,8 +1401,8 @@ list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the the opposite, see |netrw-U|. The "u" map also accepts counts to go back in the history several slots. -For your convenience, |netrw-qb| lists the history number which can be -re-used in that count. +For your convenience, qb (see |netrw-qb|) lists the history number which may +be used in that count. *.netrwhist* See |g:netrw_dirhistmax| for how to control the quantity of history stack @@ -1412,7 +1419,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 With the "U" map, one can change to a later directory (successor). This map is the opposite of the "u" map. (see |netrw-u|) Use the -q map to list both the bookmarks and history. (see |netrw-qb|) +qb map to list both the bookmarks and history. (see |netrw-qb|) The "U" map also accepts counts to go forward in the history several slots. @@ -1420,7 +1427,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack slots. -CHANGING TREE TOP *netrw-ntree* *:Ntree* {{{2 +CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 One may specify a new tree top for tree listings using > @@ -1430,14 +1437,18 @@ Without a "dirname", the current line is used (and any leading depth information is elided). With a "dirname", the specified directory name is used. +The "gn" map will take the word below the cursor and use that for +changing the top of the tree listing. + NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 -With :NetrwClean one may easily remove netrw from one's home directory; +With NetrwClean one may easily remove netrw from one's home directory; more precisely, from the first directory on your |'runtimepath'|. -With :NetrwClean!, netrw will remove netrw from all directories on your -|'runtimepath'|. +With NetrwClean!, netrw will attempt to remove netrw from all directories on +your |'runtimepath'|. Of course, you have to have write/delete permissions +correct to do this. With either form of the command, netrw will first ask for confirmation that the removal is in fact what you want to do. If netrw doesn't have @@ -1454,6 +1465,7 @@ operating system). Netrw allows one to invoke such special handlers by: > * when Exploring, hit the "x" key * when editing, hit gx with the cursor atop the special filename < (latter not available if the |g:netrw_nogx| variable exists) + Netrw determines which special handler by the following method: * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to @@ -1629,19 +1641,23 @@ DIRECTORY EXPLORATION COMMANDS {{{2 of the current tab. It will open a netrw window on the current directory if [dir] is omitted; a :Lexplore [dir] will show the specified directory in the left-hand side browser display no matter - from which window the command is issued. By default, :Lexplore will - change an uninitialized |g:netrw_chgwin| to 2; edits will thus - preferentially be made in window#2. - The [N] specifies a |g:netrw_winsize| just for the new :Lexplore + from which window the command is issued. + + By default, :Lexplore will change an uninitialized |g:netrw_chgwin| + to 2; edits will thus preferentially be made in window#2. + + The [N] specifies a |g:netrw_winsize| just for the new :Lexplore window. - Those who like this method often also like tree style displays; + + Those who like this method often also often like tree style displays; see |g:netrw_liststyle|. - Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize| - |netrw-p| |netrw-P| |g:netrw_browse_split| + Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| + |netrw-p| |netrw-P| |g:netrw_chgwin| + |netrw-c-tab| |g:netrw_winsize| :[N]Lexplore! is like :Lexplore, except that the full-height Explorer window - will open on the right hand side, and an uninitialized |g:netrw_chgwin| + will open on the right hand side and an uninitialized |g:netrw_chgwin| will be set to 1. *netrw-:Sexplore* @@ -2125,19 +2141,18 @@ is unlikely to be fixed. UNMARKING FILES *netrw-mF* {{{2 - (also see |netrw-mf|) + (also see |netrw-mf|, |netrw-mu|) -This command will unmark all files in the current buffer. One may also use -mf (|netrw-mf|) on a specific file to unmark just that file. +The "mF" command will unmark all files in the current buffer. One may also use +mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 (also see |netrw-mf|) -One may convert the |quickfix-error-lists| into a marked file list using -"qF". You may then proceed with commands such as me (|netrw-me|) to -edit them. Quickfix error lists are generated, for example, by calls -to |:vimgrep|. +One may convert |quickfix-error-lists| into a marked file list using "qF". +You may then proceed with commands such as me (|netrw-me|) to edit them. +Quickfix error lists are generated, for example, by calls to |:vimgrep|. MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 @@ -2155,14 +2170,17 @@ MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the local marked-file list) -The "mv" map causes netrw execute an arbitrary vim command on each file -on the local marked file list, individually: +The "mv" map causes netrw to execute an arbitrary vim command on each file on +the local marked file list, individually: * 1split * sil! keepalt e file * run vim command * sil! keepalt wq! +A prompt, "Enter vim command: ", will be issued to elicit the vim command +you wish used. + MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) @@ -2194,13 +2212,13 @@ command to be applied to all marked files on the global marked file list. The command files -It is useful, for example, to select files and make a tarball: +This approach is useful, for example, to select files and make a tarball: > (mark files) mX Enter command: tar cf mynewtarball.tar - -The command that will be run in this example: +< +The command that will be run with this example: tar cf mynewtarball.tar 'file1' 'file2' ... @@ -2253,7 +2271,7 @@ MARKED FILES: EDITING *netrw-me* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the global marked file list) -This command will place the marked files on the |arglist| and commence +The "me" command will place the marked files on the |arglist| and commence editing them. One may return the to explorer window with |:Rexplore|. (use |:n| and |:p| to edit next and previous files in the arglist) @@ -2261,26 +2279,33 @@ MARKED FILES: GREP *netrw-mg* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the global marked file list) -This command will apply |:vimgrep| to the marked files. +The "mg" command will apply |:vimgrep| to the marked files. The command will ask for the requested pattern; one may then enter: > /pattern/[g][j] ! /pattern/[g][j] pattern < -In the cases of "j" option usage as shown above, "mg" will winnow the current -marked file list to just those possessing the specified pattern. -Thus, one may use > - mr ...file-pattern - mg ..contents-pattern -to have a marked file list satisfying the file-pattern but containing the -desired contents-pattern. +With /pattern/, editing will start with the first item on the |quickfix| list +that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|). The |:vimgrep| +command is in use, so without 'g' each line is added to quickfix list only +once; with 'g' every match is included. + +With /pattern/j, "mg" will winnow the current marked file list to just those +marked files also possessing the specified pattern. Thus, one may use > + + mr ...file-pattern... + mg /pattern/j +< +to have a marked file list satisfying the file-pattern but also restricted to +files containing some desired pattern. + MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the local marked file list) -This command extracts the suffices of the marked files and toggles their +The "mh" command extracts the suffices of the marked files and toggles their presence on the hiding list. Please note that marking the same suffix this way multiple times will result in the suffix's presence being toggled for each file (so an even quantity of marked files having the same suffix @@ -2309,16 +2334,16 @@ MARKED FILES: PRINTING *netrw-mp* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the local marked file list) -Netrw will apply the |:hardcopy| command to marked files. What it does -is open each file in a one-line window, execute hardcopy, then close the -one-line window. +When "mp" is used, netrw will apply the |:hardcopy| command to marked files. +What netrw does is open each file in a one-line window, execute hardcopy, then +close the one-line window. MARKED FILES: SOURCING *netrw-ms* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the local marked file list) -Netrw will source the marked files (using vim's |:source| command) +With "ms", netrw will source the marked files (using vim's |:source| command) MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 @@ -2341,6 +2366,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): This command uses |<q-args>|, so spaces in the directory name are permitted without escaping. + * With mouse-enabled vim or with gvim, one may select a target by using + <c-leftmouse> + There is only one copy/move-to target at a time in a vim session; ie. the target is a script variable (see |s:var|) and is shared between all netrw windows (in an instance of vim). @@ -2417,9 +2445,13 @@ Related topics: MARKED FILES: UNMARKING *netrw-mu* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) + (See |netrw-mf|, |netrw-mF|) + +The "mu" mapping will unmark all currently marked files. This command differs +from "mF" as the latter only unmarks files in the current directory whereas +"mu" will unmark global and all buffer-local marked files. +(see |netrw-mF|) -The "mu" mapping will unmark all currently marked files. *netrw-browser-settings* NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 @@ -2724,6 +2756,11 @@ your browsing preferences. (see also: |netrw-settings|) evaluation will be suppressed (see |'ballooneval'|) + *g:netrw_usetab* if this variable exists and is non-zero, then + the <tab> map supporting shrinking/expanding a + Lexplore or netrw window will be enabled. + (see |netrw-c-tab|) + *g:netrw_remote_mkdir* command for making a remote directory via ftp (also see |g:netrw_mkdir_cmd|) default: "mkdir" @@ -2760,7 +2797,8 @@ your browsing preferences. (see also: |netrw-settings|) |netrw-ctrl-r| to use for its server. default: "NETRWSERVER" - *g:netrw_sort_by* sort by "name", "time", or "size" + *g:netrw_sort_by* sort by "name", "time", "size", or + "exten". default: "name" *g:netrw_sort_direction* sorting direction: "normal" or "reverse" @@ -2872,6 +2910,10 @@ your browsing preferences. (see also: |netrw-settings|) take effect, for example). default: 50 (for 50%) + *g:netrw_wiw* =1 specifies the minimum window width to use + when shrinking a netrw/Lexplore window + (see |netrw-c-tab|). + *g:netrw_xstrlen* Controls how netrw computes string lengths, including multi-byte characters' string length. (thanks to N Weibull, T Mechelynck) @@ -2917,7 +2959,7 @@ help on what each of the variables do. ============================================================================== -OBTAINING A FILE *netrw-O* {{{2 +OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 If there are no marked files: @@ -2947,7 +2989,7 @@ Related topics: * To automatically make the currently browsed directory the current directory, see |g:netrw_keepdir|. - *netrw-createfile* + *netrw-newfile* *netrw-createfile* OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 To open a new file in netrw's current directory, press "%". This map @@ -2979,10 +3021,13 @@ These will: will use only 30% of the columns available; the rest of the window is used for the preview window. -Also see: |g:netrw_chgwin| |netrw-P| + Related: if you like this idea, you may also find :Lexplore + (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest +Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| -PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 + +PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 To edit a file or directory in the previously used (last accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one window, then the one window @@ -3004,7 +3049,7 @@ Associated setting variables: Also see: |g:netrw_chgwin| |netrw-p| -REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2 +REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or hit the <cr> when atop the ./ directory entry in the listing. One may also @@ -3024,11 +3069,12 @@ RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 If there are no marked files: (see |netrw-mf|) - Renaming/moving files and directories involves moving the cursor to the + Renaming files and directories involves moving the cursor to the file/directory to be moved (renamed) and pressing "R". You will then be - queried for where you want the file/directory to be moved. You may select + queried for what you want the file/directory to be renamed to You may select a range of lines with the "V" command (visual selection), and then - pressing "R". + press "R"; you will be queried for each file as to what you want it + renamed to. If there are marked files: (see |netrw-mf|) @@ -3046,6 +3092,14 @@ If there are marked files: (see |netrw-mf|) This example will mark all *.c files and then rename them to *.cpp files. + The ctrl-X character has special meaning for renaming files: > + + <c-x> : a single ctrl-x tells netrw to ignore the portion of the response + lying between the last '/' and the ctrl-x. + + <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any + portion of the string preceding the double ctrl-x's. +< WARNING:~ Note that moving files is a dangerous operation; copies are safer. That's @@ -3053,13 +3107,13 @@ If there are marked files: (see |netrw-mf|) the copy fails and the delete does not, you may lose the file. Use at your own risk. -The g:netrw_rename_cmd variable is used to implement renaming. By default its -value is: +The g:netrw_rename_cmd variable is used to implement remote renaming. By +default its value is: ssh HOSTNAME mv One may rename a block of files and directories by selecting them with -the V (|linewise-visual|). +V (|linewise-visual|) when using thin style SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 @@ -3072,18 +3126,19 @@ Related topics: |netrw-r| |netrw-S| Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| -SETTING EDITING WINDOW *netrw-C* *netrw-:NetrwC* {{{2 +SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 One may select a netrw window for editing with the "C" mapping, using the -:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window +:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window number. Subsequent selection of a file to edit (|netrw-cr|) will use that window. - * C by itself, will select the current window for editing via - |netrw-cr| + * C : by itself, will select the current window holding a netrw buffer + for editing via |netrw-cr|. The C mapping is only available while in + netrw buffers. - * [count]C the count will be used as the window number to be used - for editing via |netrw-cr|. + * [count]C : the count will be used as the window number to be used + for subsequent editing via |netrw-cr|. * :NetrwC will set |g:netrw_chgwin| to the current window @@ -3092,12 +3147,91 @@ window. Using > let g:netrw_chgwin= -1 -will restore the default editing behavior (ie. use the current window). +will restore the default editing behavior +(ie. editing will use the current window). Related topics: |netrw-cr| |g:netrw_browse_split| Associated setting variables: |g:netrw_chgwin| +SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 + +The <c-tab> key will toggle a netrw or |:Lexplore| window's width, +but only if |g:netrw_usetab| exists and is non-zero (and, of course, +only if your terminal supports differentiating <c-tab> from a plain +<tab>). + + * If the current window is a netrw window, toggle its width + (between |g:netrw_wiw| and its original width) + + * Else if there is a |:Lexplore| window in the current tab, toggle + its width + + * Else bring up a |:Lexplore| window + +If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping +for <c-tab>, then the <tab> will not be mapped. One may map something other +than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) > + + nmap <unique> (whatever) <Plug>NetrwShrink +< +Related topics: |:Lexplore| +Associated setting variable: |g:netrw_usetab| + + +USER SPECIFIED MAPS *netrw-usermaps* {{{1 + +One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, +to hold a |List| of lists of keymap strings and function names: > + + [["keymap-sequence","ExampleUserMapFunc"],...] +< +When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| +exists, then the internal function netrw#UserMaps(islocal) is called. +This function goes through all the entries in the |g:Netrw_UserMaps| list: + + * sets up maps: > + nno <buffer> <silent> KEYMAP-SEQUENCE + :call s:UserMaps(islocal,"ExampleUserMapFunc") +< * refreshes if result from that function call is the string + "refresh" + * if the result string is not "", then that string will be + executed (:exe result) + * if the result is a List, then the above two actions on results + will be taken for every string in the result List + +The user function is passed one argument; it resembles > + + fun! ExampleUserMapFunc(islocal) +< +where a:islocal is 1 if its a local-directory system call or 0 when +remote-directory system call. + +Use netrw#Expose("varname") to access netrw-internal (script-local) + variables. +Use netrw#Modify("varname",newvalue) to change netrw-internal variables. +Use netrw#Call("funcname"[,args]) to call a netrw-internal function with + specified arguments. + +Example: Get a copy of netrw's marked file list: > + + let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") +< +Example: Modify the value of netrw's marked file list: > + + call netrw#Modify("netrwmarkfilelist",[]) +< +Example: Clear netrw's marked file list via a mapping on gu > + " ExampleUserMap: {{{2 + fun! ExampleUserMap(islocal) + call netrw#Modify("netrwmarkfilelist",[]) + call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") + let retval= ["refresh"] + return retval + endfun + let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] +< + 10. Problems and Fixes *netrw-problems* {{{1 (This section is likely to grow as I get feedback) @@ -3272,6 +3406,7 @@ Associated setting variables: |g:netrw_chgwin| The first one (|g:netrw_ssh_cmd|) is the most important; most of the others will use the string in g:netrw_ssh_cmd by default. + *netrw-p9* *netrw-ml_get* P9. I'm browsing, changing directory, and bang! ml_get errors appear and I have to kill vim. Any way around this? @@ -3298,6 +3433,14 @@ Associated setting variables: |g:netrw_chgwin| P11. I want to have two windows; a thin one on the left and my editing window on the right. How may I accomplish this? + You probably want netrw running as in a side window. If so, you + will likely find that ":[N]Lexplore" does what you want. The + optional "[N]" allows you to select the quantity of columns you + wish the |:Lexplore|r window to start with (see |g:netrw_winsize| + for how this parameter works). + + Previous solution: + * Put the following line in your <.vimrc>: let g:netrw_altv = 1 * Edit the current directory: :e . @@ -3311,6 +3454,7 @@ Associated setting variables: |g:netrw_chgwin| <leftmouse> in the browser window and then press the <middlemouse> to select the file. + *netrw-p12* P12. My directory isn't sorting correctly, or unwanted letters are appearing in the listed filenames, or things aren't lining @@ -3388,7 +3532,7 @@ Associated setting variables: |g:netrw_chgwin| to open a swap file. (romainl) It looks like you are starting Vim from a protected - directory. Start if from your $HOME or another writable + directory. Start netrw from your $HOME or other writable directory. *netrw-p17* @@ -3412,6 +3556,58 @@ Associated setting variables: |g:netrw_chgwin| "Using Vim to Remotely Edit A File on ServerB Only Accessible From ServerA" + *netrw-P19* + P19. How do I get numbering on in directory listings? + With |g:netrw_bufsettings|, you can control netrw's buffer + settings; try putting > + let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" +< in your .vimrc. If you'd like to have relative numbering + instead, try > + let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" +< + *netrw-P20* + P20. How may I have gvim start up showing a directory listing? + Try putting the following code snippet into your .vimrc: > + augroup VimStartup + au! + au VimEnter * if expand("%") == "" && argc() == 0 && + \ (v:servername =~ 'GVIM\d*' || v:servername == "") + \ | e . | endif + augroup END +< You may use Lexplore instead of "e" if you're so inclined. + This snippet assumes that you have client-server enabled + (ie. a "huge" vim version). + + *netrw-P21* + P21. I've made a directory (or file) with an accented character, but + netrw isn't letting me enter that directory/read that file: + + Its likely that the shell or o/s is using a different encoding + than you have vim (netrw) using. A patch to vim supporting + "systemencoding" may address this issue in the future; for + now, just have netrw use the proper encoding. For example: > + + au FileType netrw set enc=latin1 +< + *netrw-P22* + P22. I get an error message when I try to copy or move a file: + + **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work! + + What's wrong? + + Netrw uses several system level commands to do things (see + + |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, + |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|). + + You may need to adjust the default commands for one or more of + these commands by setting them properly in your .vimrc. Another + source of difficulty is that these commands use vim's local + directory, which may not be the same as the browsing directory + shown by netrw (see |g:netrw_keepdir|). + + ============================================================================== 11. Debugging Netrw Itself *netrw-debug* {{{1 @@ -3502,6 +3698,46 @@ netrw: ============================================================================== 12. History *netrw-history* {{{1 + v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where + a file was not treated properly as a file + due to g:netrw_keepdir == 1 + Mar 25, 2015 * (requested by Ben Friz) one may now sort by + extension + Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot + of buffer-local mappings; however, some + plugins (such as vim-surround) set up + conflicting mappings that cause vim to wait. + The "<nowait>" modifier has been included + with most of netrw's mappings to avoid that + delay. + Jun 26, 2015 * |netrw-gn| mapping implemted + * :Ntree NotADir resulted in having + the tree listing expand in the error messages + window. Fixed. + Jun 29, 2015 * Attempting to delete a file remotely caused + an error with "keepsol" mentioned; fixed. + Jul 08, 2015 * Several changes to keep the |:jumps| table + correct when working with + |g:netrw_fastbrowse| set to 2 + * wide listing with accented characters fixed + (using %-S instead of %-s with a |printf()| + Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true + but kfmclient not installed. Changed order + in netrw#BrowseX(): checks if kde and + kfmclient, then will use xdg-open on a unix + system (if xdg-open is executable) + Aug 11, 2015 * (McDonnell) tree listing mode wouldn't + select a file in a open subdirectory. + * (McDonnell) when multiple subdirectories + were concurrently open in tree listing + mode, a ctrl-L wouldn't refresh properly. + * The netrw:target menu showed duplicate + entries + Oct 13, 2015 * (mattn) provided an exception to handle + windows with shellslash set but no shell + Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used + to control whether NetrwShrink is used + (see |netrw-c-tab|) v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 May 14, 2014 * changed s:PerformListing() so that it always sets ft=netrw for netrw buffers diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index 086d05613d..7565d1e976 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -677,7 +677,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS utility psselect. This utility has options -e and -o for printing just the even or odd pages of a PS file respectively. -First generate a PS file with the 'hardcopy' command, then generate a new +First generate a PS file with the 'hardcopy' command, then generate new files with all the odd and even numbered pages with: > psselect -o test.ps odd.ps diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 8c428e44ef..ff4fded0d9 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27 +*quickfix.txt* For Vim version 7.4. Last change: 2015 Sep 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -291,6 +291,74 @@ use this code: > au QuickfixCmdPost make call QfMakeConv() +EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: + *:cdo* +:cdo[!] {cmd} Execute {cmd} in each valid entry in the quickfix list. + It works like doing this: > + :cfirst + :{cmd} + :cnext + :{cmd} + etc. +< When the current file can't be |abandon|ed and the [!] + is not present, the command fails. + When an error is detected excecution stops. + The last buffer (or where an error occurred) becomes + the current buffer. + {cmd} can contain '|' to concatenate several commands. + + Only valid entries in the quickfix list are used. + A range can be used to select entries, e.g.: > + :10,$cdo cmd +< To skip entries 1 to 9. + + 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 |:bufdo|, |:tabdo|, |:argdo|, |:windo|, + |:ldo|, |:cfdo| and |:lfdo|. + + *:cfdo* +:cfdo[!] {cmd} Execute {cmd} in each file in the quickfix list. + It works like doing this: > + :cfirst + :{cmd} + :cnfile + :{cmd} + etc. +< Otherwise it works the same as `:cdo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + + *:ldo* +:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list + for the current window. + It works like doing this: > + :lfirst + :{cmd} + :lnext + :{cmd} + etc. +< Only valid entries in the location list are used. + Otherwise it works the same as `:cdo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + + *:lfdo* +:lfdo[!] {cmd} Execute {cmd} in each file in the location list for + the current window. + It works like doing this: > + :lfirst + :{cmd} + :lnfile + :{cmd} + etc. +< Otherwise it works the same as `:ldo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} ============================================================================= 2. The error window *quickfix-window* @@ -493,11 +561,11 @@ or simpler > "$*" can be given multiple times, for example: > :set makeprg=gcc\ -o\ $*\ $* -The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that -the output of the compiler is saved in a file and not shown on the screen -directly. For Unix "| tee" is used. The compiler output is shown on the -screen and saved in a file the same time. Depending on the shell used "|& -tee" or "2>&1| tee" is the default, so stderr output will be included. +The 'shellpipe' option defaults to ">" on Windows. This means that the output +of the compiler is saved in a file and not shown on the screen directly. For +Unix "| tee" is used. The compiler output is shown on the screen and saved in +a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is +the default, so stderr output will be included. If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful for compilers that write to an errorfile themselves. @@ -905,9 +973,9 @@ normally happens by matching following characters and items. When nothing is following the rest of the line is matched. If "%f" is followed by a '%' or a backslash, it will look for a sequence of 'isfname' characters. -On MS-DOS and MS-Windows a leading "C:" will be included in "%f", even when -using "%f:". This means that a file name which is a single alphabetical -letter will not be detected. +On Windows a leading "C:" will be included in "%f", even when using "%f:". +This means that a file name which is a single alphabetical letter will not be +detected. The "%p" conversion is normally followed by a "^". It's used for compilers that output a line like: > diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index ea73b99ad2..8e40628e25 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19 +*quickref.txt* For Vim version 7.4. Last change: 2015 Nov 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -617,6 +617,7 @@ Short explanation of each option: *option-list* 'balloondelay' 'bdlay' delay in mS before a balloon may pop up 'ballooneval' 'beval' switch on balloon evaluation 'balloonexpr' 'bexpr' expression to show in balloon +'belloff' 'bo' do not ring the bell for these reasons 'binary' 'bin' read/write/edit file in binary mode 'bomb' prepend a Byte Order Mark to the file 'breakat' 'brk' characters that may cause a line break @@ -688,6 +689,7 @@ Short explanation of each option: *option-list* 'fileignorecase' 'fic' ignore case when using file names 'filetype' 'ft' type of file, used for autocommands 'fillchars' 'fcs' characters to use for displaying special items +'fixendofline' 'fixeol' make sure last line in file has <EOL> 'fkmap' 'fk' Farsi keyboard mapping 'foldclose' 'fcl' close a fold when the cursor leaves it 'foldcolumn' 'fdc' width of the column used to indicate folds @@ -702,10 +704,10 @@ Short explanation of each option: *option-list* 'foldnestmax' 'fdn' maximum fold depth 'foldopen' 'fdo' for which commands a fold will be opened 'foldtext' 'fdt' expression used to display for a closed fold +'formatexpr' 'fex' expression used with "gq" command 'formatlistpat' 'flp' pattern used to recognize a list header 'formatoptions' 'fo' how automatic formatting is to be done 'formatprg' 'fp' name of external program used with "gq" command -'formatexpr' 'fex' expression used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write 'gdefault' 'gd' the ":substitute" flag 'g' is default on 'grepformat' 'gfm' format of 'grepprg' output @@ -730,13 +732,10 @@ Short explanation of each option: *option-list* 'icon' let Vim set the text of the window icon 'iconstring' string to use for the Vim icon text 'ignorecase' 'ic' ignore case in search patterns -'imactivatekey' 'imak' key that activates the X input method -'imactivatefunc' 'imaf' function to enable/disable the X input method 'imcmdline' 'imc' use IM when starting to edit a command line 'imdisable' 'imd' do not use the IM in any mode 'iminsert' 'imi' use :lmap or IM in Insert mode 'imsearch' 'ims' use :lmap or IM when typing a search pattern -'imstatusfunc' 'imsf' function to obtain X input method status 'include' 'inc' pattern to be used to find an include file 'includeexpr' 'inex' expression used to process an include line 'incsearch' 'is' highlight match while typing search pattern @@ -801,6 +800,7 @@ Short explanation of each option: *option-list* 'patchexpr' 'pex' expression used to patch a file 'patchmode' 'pm' keep the oldest version of a file 'path' 'pa' list of directories searched with "gf" et.al. +'perldll' name of the Perl dynamic library 'preserveindent' 'pi' preserve the indent structure when reindenting 'previewheight' 'pvh' height of the preview window 'previewwindow' 'pvw' identifies the preview window @@ -813,6 +813,8 @@ Short explanation of each option: *option-list* 'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy 'printoptions' 'popt' controls the format of :hardcopy output 'pumheight' 'ph' maximum height of the popup menu +'pythondll' name of the Python 2 dynamic library +'pythonthreedll' name of the Python 3 dynamic library 'quoteescape' 'qe' escape characters used in a string 'readonly' 'ro' disallow writing the buffer 'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting @@ -820,10 +822,10 @@ Short explanation of each option: *option-list* 'relativenumber' 'rnu' show relative line number in front of each line 'remap' allow mappings to work recursively 'report' threshold for reporting nr. of lines changed -'restorescreen' 'rs' Win32: restore screen when exiting 'revins' 'ri' inserting characters will work backwards 'rightleft' 'rl' window is right-to-left oriented 'rightleftcmd' 'rlc' commands for which editing works right-to-left +'rubydll' name of the Ruby dynamic library 'ruler' 'ru' show cursor line and column in the status line 'rulerformat' 'ruf' custom format for the ruler 'runtimepath' 'rtp' list of directories used for runtime files @@ -874,14 +876,14 @@ Short explanation of each option: *option-list* 'suffixes' 'su' suffixes that are ignored with multiple match 'suffixesadd' 'sua' suffixes added when searching for a file 'swapfile' 'swf' whether to use a swapfile for a buffer -'swapsync' 'sws' how to sync the swap file 'switchbuf' 'swb' sets behavior when switching to another buffer 'synmaxcol' 'smc' maximum column to find syntax items 'syntax' 'syn' syntax to be loaded for current buffer -'tabstop' 'ts' number of spaces that <Tab> in file uses 'tabline' 'tal' custom format for the console tab pages line 'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all" +'tabstop' 'ts' number of spaces that <Tab> in file uses 'tagbsearch' 'tbs' use binary searching in tags files +'tagcase' 'tc' how to handle case when searching in tags files 'taglength' 'tl' number of significant characters for a tag 'tagrelative' 'tr' file names in tag file are relative 'tags' 'tag' list of file names used by the tag command @@ -985,11 +987,9 @@ Short explanation of each option: *option-list* |g_CTRL-G| g CTRL-G show cursor column, line, and character position |CTRL-C| CTRL-C during searches: Interrupt the search -|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search +|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search |<Del>| <Del> while entering a count: delete last character |:version| :ve[rsion] show version information -|:mode| :mode N MS-DOS: set screen mode to N (number, C80, - C4350, etc.) |:normal| :norm[al][!] {commands} execute Normal mode commands |Q| Q switch to "Ex" mode diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt index 28b0e1c623..c35fb2f139 100644 --- a/runtime/doc/quotes.txt +++ b/runtime/doc/quotes.txt @@ -178,14 +178,14 @@ Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions that vi sorely needs: highlighting for executing commands on blocks, an easily navigable and digestible help screen, and more. (Paul Pax) -The reason WHY I don't have this amazingly useful macro any more, is that I +The reason WHY I don't have this amazingly useful macro anymore, is that I now use VIM - and this is built in!! (Stephen Riehm, Germany) I am a user of VIM and I love it. I use it to do all my programming, C, C++, HTML what ever. (Tim Allwine) I discovered VIM after years of struggling with the original vi, and I just -can't live without it any more. (Emmanuel Mogenet, USA) +can't live without it anymore. (Emmanuel Mogenet, USA) Emacs has not a bit of chance to survive so long as VIM is around. Besides, it also has the most detailed software documentation I have ever seen---much diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 34a579f499..e09138b2f5 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -60,7 +60,7 @@ Disadvantages: If you want to put swap files in a fixed place, put a command resembling the following ones in your vimrc: :set dir=~/tmp (for Unix) - :set dir=c:\\tmp (for MS-DOS and Win32) + :set dir=c:\\tmp (for Windows) This is also very handy when editing files on floppy. Of course you will have to create that "tmp" directory for this to work! @@ -92,10 +92,7 @@ changed, not when you only moved around. The reason why it is not kept up to date all the time is that this would slow down normal work too much. You can change the 200 character count with the 'updatecount' option. You can set the time with the 'updatetime' option. The time is given in milliseconds. -After writing to the swap file Vim syncs the file to disk. This takes some -time, especially on busy Unix systems. If you don't want this you can set the -'swapsync' option to an empty string. The risk of losing work becomes bigger -though. +After writing to the swap file Vim syncs the file to disk. If the writing to the swap file is not wanted, it can be switched off by setting the 'updatecount' option to 0. The same is done when starting Vim diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 81ab72a100..933ab3a444 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -1,4 +1,4 @@ -*remote.txt* For Vim version 7.4. Last change: 2008 May 24 +*remote.txt* For Vim version 7.4. Last change: 2015 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,7 +34,8 @@ The following command line arguments are available: The remote Vim is raised. If you don't want this use > vim --remote-send "<C-\><C-N>:n filename<CR>" -< --remote-silent [+{cmd}] {file} ... *--remote-silent* +< + --remote-silent [+{cmd}] {file} ... *--remote-silent* As above, but don't complain if there is no server and the file is edited locally. --remote-wait [+{cmd}] {file} ... *--remote-wait* diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index d029391c60..b2e935eb3f 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 7.4. Last change: 2015 Jan 07 +*repeat.txt* For Vim version 7.4. Last change: 2015 Apr 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -109,6 +109,12 @@ q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"} while executing a register, and it doesn't work inside a mapping and |:normal|. + Note: If the register being used for recording is also + used for |y| and |p| the result is most likely not + what is expected, because the put will paste the + recorded macro and the yank will overwrite the + recorded macro. + q Stops recording. Implementation note: The 'q' that stops recording is not stored in the register, unless it was the result @@ -287,13 +293,13 @@ with CTRL-V followed by the three digit decimal code. This does NOT work for the <t_xx> termcap codes, these can only be used in mappings. *:source_crnl* *W15* -MS-DOS and Win32: Files that are read with ":source" normally have -<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s -(for example, a file made on Unix), this will be recognized if 'fileformats' -is not empty and the first line does not end in a <CR>. This fails if the -first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If -the first line ends in a <CR>, but following ones don't, you will get an error -message, because the <CR> from the first lines will be lost. +Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s. +These always work. If you are using a file with <NL> <EOL>s (for example, a +file made on Unix), this will be recognized if 'fileformats' is not empty and +the first line does not end in a <CR>. This fails if the first line has +something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line +ends in a <CR>, but following ones don't, you will get an error message, +because the <CR> from the first lines will be lost. Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s. These always work. If you are using a file with <NL> <EOL>s (for example, a @@ -303,7 +309,7 @@ linebreaks which has a <CR> in first line. On other systems, Vim expects ":source"ed files to end in a <NL>. These always work. If you are using a file with <CR><NL> <EOL>s (for example, a -file made on MS-DOS), all lines will have a trailing <CR>. This may cause +file made on Windows), all lines will have a trailing <CR>. This may cause problems for some commands (e.g., mappings). There is no automatic <EOL> detection, because it's common to start with a line that defines a mapping that ends in a <CR>, which will confuse the automaton. @@ -390,7 +396,7 @@ To enter debugging mode use one of these methods: useful to find out what is happening when Vim is starting up. A side effect is that Vim will switch the terminal mode before initialisations have finished, with unpredictable results. - For a GUI-only version (Windows, Macintosh) the debugging will start as + For a GUI-only version (Windows) the debugging will start as soon as the GUI window has been opened. To make this happen early, add a ":gui" command in the vimrc file. *:debug* @@ -583,6 +589,7 @@ For example, to profile the one_script.vim script file: > :prof[ile] start {fname} *:prof* *:profile* *E750* Start profiling, write the output in {fname} upon exit. + "~/" and environment variables in {fname} will be expanded. If {fname} already exists it will be silently overwritten. The variable |v:profiling| is set to one. @@ -658,10 +665,6 @@ long you take to respond to the input() prompt is irrelevant. Profiling should give a good indication of where time is spent, but keep in mind there are various things that may clobber the results: -- The accuracy of the time measured depends on the gettimeofday() system - function. It may only be as accurate as 1/100 second, even though the times - are displayed in micro seconds. - - Real elapsed time is measured, if other processes are busy they may cause delays at unpredictable moments. You may want to run the profiling several times and use the lowest results. diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index b4d9347470..e4e495bb18 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -106,9 +106,6 @@ o Does not support reverse insert and rightleft modes on the command-line. o Somewhat slower in right-to-left mode, because right-to-left motion is emulated inside Vim, not by the controlling terminal. -o When the Athena GUI is used, the bottom scrollbar works in the wrong - direction. This is difficult to fix. - o When both 'rightleft' and 'revins' are on: 'textwidth' does not work. Lines do not wrap at all; you just get a single, long line. diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 8626a1a7f6..f2a6f713e6 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -245,26 +245,6 @@ dragging the scrollbar of the current window. How many lines are scrolled depends on your mouse driver. If the scroll action causes input focus problems, see |intellimouse-wheel-problems|. -For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key -presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and -<ScrollWheelRight>. For example, if you push the scroll wheel upwards a -<ScrollWheelUp> key press is generated causing the window to scroll upwards -(while the text is actually moving downwards). The default action for these -keys are: - <ScrollWheelUp> scroll three lines up *<ScrollWheelUp>* - <S-ScrollWheelUp> scroll one page up *<S-ScrollWheelUp>* - <C-ScrollWheelUp> scroll one page up *<C-ScrollWheelUp>* - <ScrollWheelDown> scroll three lines down *<ScrollWheelDown>* - <S-ScrollWheelDown> scroll one page down *<S-ScrollWheelDown>* - <C-ScrollWheelDown> scroll one page down *<C-ScrollWheelDown>* - <ScrollWheelLeft> scroll six columns left *<ScrollWheelLeft>* - <S-ScrollWheelLeft> scroll one page left *<S-ScrollWheelLeft>* - <C-ScrollWheelLeft> scroll one page left *<C-ScrollWheelLeft>* - <ScrollWheelRight> scroll six columns right *<ScrollWheelRight>* - <S-ScrollWheelRight> scroll one page right *<S-ScrollWheelRight>* - <C-ScrollWheelRight> scroll one page right *<C-ScrollWheelRight>* -This should work in all modes, except when editing the command line. - Note that horizontal scrolling only works if 'nowrap' is set. Also, unless the "h" flag in 'guioptions' is set, the cursor moves to the longest visible line if the cursor line is about to be scrolled off the screen (similarly to @@ -281,13 +261,6 @@ You can also use Alt and Ctrl modifiers. This only works when Vim gets the scroll wheel events, of course. You can check if this works with the "xev" program. -When using XFree86, the /etc/XF86Config file should have the correct entry for -your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: > - Protocol "MouseMan" - Device "/dev/psm0" - ZAxisMapping 4 5 -See the XFree86 documentation for information. - *<MouseDown>* *<MouseUp>* The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp> instead of <MouseDown> and use <ScrollWheelDown> instead of <MouseUp>. diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 8dc229df41..44a5361c5d 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -75,12 +75,8 @@ DEFINING A SIGN. *:sign-define* *E255* *E160* *E612* Define the file name where the bitmap can be found. Should be a full path. The bitmap should fit in the place of two characters. This is not checked. If the bitmap is too big it - will cause redraw problems. Only GTK 2 can scale the bitmap - to fit the space available. + will cause redraw problems. toolkit supports ~ - GTK 1 pixmap (.xpm) - GTK 2 many - Motif pixmap (.xpm) Win32 .bmp, .ico, .cur pixmap (.xpm) |+xpm_w32| diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index a45a97a0fe..752444a3bd 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -35,9 +35,7 @@ Vim only checks words for spelling, there is no grammar check. If the 'mousemodel' option is set to "popup" and the cursor is on a badly spelled word or it is "popup_setpos" and the mouse pointer is on a badly spelled word, then the popup menu will contain a submenu to replace the bad -word. Note: this slows down the appearance of the popup menu. Note for GTK: -don't release the right mouse button until the menu appears, otherwise it -won't work. +word. Note: this slows down the appearance of the popup menu. To search for the next misspelled word: diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index f46a258e2e..46efe1996a 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -217,7 +217,7 @@ argument. :set to display option values. When 'verbose' is non-zero messages are printed (for debugging, to stderr). - 'term' and $TERM are not used. + $TERM is not used. If Vim appears to be stuck try typing "qa!<Enter>". You don't get a prompt thus you can't see Vim is waiting for you to type something. @@ -315,9 +315,10 @@ argument. When {vimrc} is equal to "NONE" (all uppercase), all initializations from files and environment variables are skipped, including reading the |ginit.vim| file when the GUI - starts. Loading plugins is also skipped. + starts. Plugins and syntax highlighting are also skipped. When {vimrc} is equal to "NORC" (all uppercase), this has the - same effect as "NONE", but loading plugins is not skipped. + same effect as "NONE", but plugins and syntax highlighting are + not skipped. *-i* -i {shada} The file {shada} is used instead of the default ShaDa @@ -349,18 +350,15 @@ argument. -W {scriptout} Like -w, but do not append, overwrite an existing file. ============================================================================== -3. Initialization *initialization* *startup* +2. Initialization *initialization* *startup* At startup, Vim checks environment variables and files and sets values accordingly. Vim proceeds in this order: -1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM* +1. Set the 'shell' option *SHELL* *COMSPEC* *TERM* The environment variable SHELL, if it exists, is used to set the - 'shell' option. On MS-DOS and Win32, the COMSPEC variable is used + 'shell' option. On Windows, the COMSPEC variable is used if SHELL is not set. - The environment variable TERM, if it exists, is used to set the 'term' - option. However, 'term' will change later when starting the GUI (step - 8 below). 2. Process the arguments The options and file names from the command that start Vim are @@ -382,6 +380,8 @@ accordingly. Vim proceeds in this order: Places for your personal initializations: Unix $XDG_CONFIG_HOME/nvim/init.vim (default for $XDG_CONFIG_HOME is ~/.config) + Windows $XDG_CONFIG_HOME/nvim/init.vim + (default for $XDG_CONFIG_HOME is ~/AppData/Local) The files are searched in the order specified above and only the first one that is found is read. @@ -394,7 +394,8 @@ accordingly. Vim proceeds in this order: All following initializations until 4. are skipped. $MYVIMRC is not set. "vim -u NORC" can be used to skip these initializations without - reading a file. "vim -u NONE" also skips loading plugins. |-u| + reading a file. "vim -u NONE" also skips plugins and syntax + highlighting. |-u| If Vim was started in Ex mode with the "-s" argument, all following initializations until 4. are skipped. Only the "-u" option is @@ -427,7 +428,22 @@ accordingly. Vim proceeds in this order: - The file ".exrc" (for Unix) "_exrc" (for Win32) -4. Load the plugin scripts. *load-plugins* +4. Enable filetype and indent plugins. + This does the same as the commands: > + :runtime! filetype.vim + :runtime! ftplugin.vim + :runtime! indent.vim +< This step is skipped if ":filetype ..." was called before now or if + the "-u NONE" command line argument was given. + +5. Enable syntax highlighting. + This does the same as the command: > + :runtime! syntax/syntax.vim +< Note: This enables filetype detection even if ":filetype off" was + called before now. + This step is skipped if the "-u NONE" command line argument was given. + +6. Load the plugin scripts. *load-plugins* This does the same as the command: > :runtime! plugin/**/*.vim < The result is that all directories in the 'runtimepath' option will be @@ -443,31 +459,30 @@ accordingly. Vim proceeds in this order: commands from the command line have not been executed yet. You can use "--cmd 'set noloadplugins'" |--cmd|. -5. Set 'shellpipe' and 'shellredir' +7. Set 'shellpipe' and 'shellredir' The 'shellpipe' and 'shellredir' options are set according to the value of the 'shell' option, unless they have been set before. This means that Vim will figure out the values of 'shellpipe' and 'shellredir' for you, unless you have set them yourself. -6. Set 'updatecount' to zero, if "-n" command argument used +8. Set 'updatecount' to zero, if "-n" command argument used -7. Set binary options +9. Set binary options If the "-b" flag was given to Vim, the options for binary editing will be set now. See |-b|. -8. Perform GUI initializations +10. Perform GUI initializations Only when starting "gvim", the GUI initializations will be done. See |gui-init|. -9. Read the ShaDa file - If the 'shada' option is not empty, the ShaDa file is read. See - |shada-file|. +11. Read the ShaDa file + See |shada-file|. -10. Read the quickfix file +12. Read the quickfix file If the "-q" flag was given to Vim, the quickfix file is read. If this fails, Vim exits. -11. Open all windows +13. Open all windows When the |-o| flag was given, windows will be opened (but not displayed yet). When the |-p| flag was given, tab pages will be created (but not @@ -476,7 +491,7 @@ accordingly. Vim proceeds in this order: If the "-q" flag was given to Vim, the first error is jumped to. Buffers for all windows will be loaded. -12. Execute startup commands +14. Execute startup commands If a "-t" flag was given to Vim, the tag is jumped to. The commands given with the |-c| and |+cmd| arguments are executed. The starting flag is reset, has("vim_starting") will now return zero. @@ -494,7 +509,7 @@ sessions. Put it in a place so that it will be found by 3b: Local setup: Put all commands that you need for editing a specific directory only into a vimrc file and place it in that directory under the name ".nvimrc" ("_nvimrc" -for MS-DOS and Win32). NOTE: To make Vim look for these special files you +for Windows). NOTE: To make Vim look for these special files you have to turn on the option 'exrc'. See |trojan-horse| too. System setup: @@ -516,10 +531,9 @@ interfere with Vi, then use the variable VIMINIT and the file init.vim instead. MS-DOS line separators: -On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all -the vimrc files have <CR> <NL> pairs as line separators. This will give -problems if you have a file with only <NL>s and have a line like -":map xx yy^M". The trailing ^M will be ignored. +On Windows systems Vim assumes that all the vimrc files have <CR> <NL> pairs +as line separators. This will give problems if you have a file with only +<NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored. The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or gvimrc file. @@ -587,7 +601,7 @@ This still won't work for systems where gvim does not use stdout at all though. ============================================================================== -4. $VIM and $VIMRUNTIME +3. $VIM and $VIMRUNTIME *$VIM* The environment variable "$VIM" is used to locate various user files for Vim, such as the user startup script |init.vim|. This depends on the system, see @@ -649,7 +663,7 @@ greps in the help files) you might be able to use this: > VIMRUNTIME="$(nvim -e --cmd 'echo $VIMRUNTIME|quit' 2>&1)" ============================================================================== -5. Suspending *suspend* +4. Suspending *suspend* *iconize* *iconise* *CTRL-Z* *v_CTRL-Z* CTRL-Z Suspend Vim, like ":stop". @@ -682,7 +696,7 @@ can't paste it in another application (since Vim is going to sleep an attempt to get the selection would make the program hang). ============================================================================== -6. Saving settings *save-settings* +5. Saving settings *save-settings* Mostly you will edit your vimrc files manually. This gives you the greatest flexibility. There are a few commands to generate a vimrc file automatically. @@ -706,8 +720,8 @@ vimrc file. These commands will write ":map" and ":set" commands to a file, in such a way that when these commands are executed, the current key mappings and options will be set to the same values. The options 'columns', 'endofline', -'fileformat', 'lines', 'modified', 'scroll', and 'term' are not included, -because these are terminal or file dependent. +'fileformat', 'lines', 'modified', and 'scroll' are not included, because +these are terminal or file dependent. Note that the options 'binary', 'paste' and 'readonly' are included, this might not always be what you want. @@ -739,7 +753,7 @@ these steps: You need to escape special characters, esp. spaces. ============================================================================== -7. Views and Sessions *views-sessions* +6. Views and Sessions *views-sessions* This is introduced in sections |21.4| and |21.5| of the user manual. @@ -883,7 +897,7 @@ To automatically save and restore views for *.c files: > au BufWinEnter *.c silent loadview ============================================================================== -8. The ShaDa file *shada* *shada-file* +7. The ShaDa file *shada* *shada-file* If you exit Vim and later start it again, you would normally lose a lot of information. The ShaDa file can be used to remember that information, which @@ -947,7 +961,7 @@ about to abandon with ":bdel", use ":wsh". The '[' and ']' marks are not stored, but the '"' mark is. The '"' mark is very useful for jumping to the cursor position when the file was last exited. No marks are saved for files that start with any string given with the "r" flag in 'shada'. This can be -used to avoid saving marks for files on removable media (for MS-DOS you would +used to avoid saving marks for files on removable media (for Windows you would use "ra:,rb:". The |v:oldfiles| variable is filled with the file names that the ShaDa file has marks for. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 67550365a3..81ba639dbe 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2015 Jan 07 +*syntax.txt* For Vim version 7.4. Last change: 2015 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -71,10 +71,10 @@ with: > For a color terminal see |:hi-normal-cterm|. For setting up your own colors syntax highlighting see |syncolor|. -NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>. -The files for Unix end in <NL>. This means you should use the right type of -file for your system. Although on MS-DOS and Windows the right format is -automatically selected if the 'fileformats' option is not empty. +NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files +for Unix end in <NL>. This means you should use the right type of file for +your system. Although on Windows the right format is automatically selected +if the 'fileformats' option is not empty. NOTE: When using reverse video ("gvim -fg white -bg black"), the default value of 'background' will not be set until the GUI window is opened, which is after @@ -206,7 +206,8 @@ thing. These are then linked to a highlight group that specifies the color. A syntax group name doesn't specify any color or attributes itself. The name for a highlight or syntax group must consist of ASCII letters, digits -and the underscore. As a regexp: "[a-zA-Z0-9_]*" +and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give +an error when using other characters. To be able to allow each user to pick his favorite set of colors, there must be preferred names for highlight groups that are common for many languages. @@ -416,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: > *:TOhtml* :[range]TOhtml The ":TOhtml" command is defined in a standard plugin. This command will source |2html.vim| for you. When a - range is given, set |g:html_start_line| and - |g:html_end_line| to the start and end of the range, - respectively. Default range is the entire buffer. - - If the current window is part of a |diff|, unless - |g:html_diff_one_file| is set, :TOhtml will convert - all windows which are part of the diff in the current - tab and place them side-by-side in a <table> element - in the generated HTML. With |g:html_line_ids| you can - jump to lines in specific windows with (for example) - #W1L42 for line 42 in the first diffed window, or - #W3L87 for line 87 in the third. + range is given, this command sets |g:html_start_line| + and |g:html_end_line| to the start and end of the + range, respectively. Default range is the entire + buffer. + + If the current window is part of a |diff|, unless + |g:html_diff_one_file| is set, :TOhtml will convert + all windows which are part of the diff in the current + tab and place them side-by-side in a <table> element + in the generated HTML. With |g:html_line_ids| you can + jump to lines in specific windows with (for example) + #W1L42 for line 42 in the first diffed window, or + #W3L87 for line 87 in the third. Examples: > @@ -741,6 +743,22 @@ and UTF-32 instead, use: > Note that documents encoded in either UTF-32 or UTF-16 have known compatibility problems with some major browsers. + *g:html_font* +Default: "monospace" +You can specify the font or fonts used in the converted document using +g:html_font. If this option is set to a string, then the value will be +surrounded with single quotes. If this option is set to a list then each list +item is surrounded by single quotes and the list is joined with commas. Either +way, "monospace" is added as the fallback generic family name and the entire +result used as the font family (using CSS) or font face (if not using CSS). +Examples: > + + " font-family: 'Consolas', monospace; + :let g:html_font = "Consolas" + + " font-family: 'DejaVu Sans Mono', 'Consolas', monospace; + :let g:html_font = ["DejaVu Sans Mono", "Consolas"] +< *convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml* Default: 0. When 0, generate standard HTML 4.01 (strict when possible). @@ -1058,7 +1076,8 @@ CPP *cpp.vim* *ft-cpp-syntax* Most of things are same as |ft-c-syntax|. Variable Highlight ~ -cpp_no_c11 don't highlight C++11 standard items +cpp_no_cpp11 don't highlight C++11 standard items +cpp_no_cpp14 don't highlight C++14 standard items CSH *csh.vim* *ft-csh-syntax* @@ -1130,6 +1149,8 @@ there are very long lines in the file. To disable translations: > :let diff_translations = 0 +Also see |diff-slow|. + DIRCOLORS *dircolors.vim* *ft-dircolors-syntax* @@ -1412,34 +1433,28 @@ 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. +If the form of the source code depends, in a non-standard way, 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|. 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. +determine which source form has been used by examining the file extension +using conventions common to the ifort, gfortran, Cray, NAG, and PathScale +compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for +free-source). If none of this works, then the script examines the first five +columns of the first 500 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 500 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 @@ -3304,6 +3319,32 @@ 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-* + +YAML *yaml.vim* *ft-yaml-syntax* + + *g:yaml_schema* *b:yaml_schema* +A YAML schema is a combination of a set of tags and a mechanism for resolving +non-specific tags. For user this means that YAML parser may, depending on +plain scalar contents, treat plain scalar (which can actually be only string +and nothing else) as a value of the other type: null, boolean, floating-point, +integer. `g:yaml_schema` option determines according to which schema values +will be highlighted specially. Supported schemas are + +Schema Description ~ +failsafe No additional highlighting. +json Supports JSON-style numbers, booleans and null. +core Supports more number, boolean and null styles. +pyyaml In addition to core schema supports highlighting timestamps, + but there are some differences in what is recognized as + numbers and many additional boolean values not present in core + schema. + +Default schema is `core`. + +Note that schemas are not actually limited to plain scalars, but this is the +only difference between schemas defined in YAML specification and the only +difference defined in the syntax file. + ============================================================================== 5. Defining a syntax *:syn-define* *E410* @@ -3401,7 +3442,7 @@ DEFINING KEYWORDS *:syn-keyword* :syntax keyword Type contained int long char :syntax keyword Type int long contained char :syntax keyword Type int long char contained -< *E789* +< *E789* *E890* 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: > @@ -3655,6 +3696,7 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. +Another way to conceal text with with |matchadd()|. concealends *:syn-concealends* @@ -4101,7 +4143,7 @@ example, for instance, can be done like this: > 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 +changes the \z1 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" @@ -4236,7 +4278,7 @@ 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 + :syntax sync maxlines=500 ccomment < *:syn-sync-linebreaks* When using a pattern that matches multiple lines, a change in one line may @@ -4504,7 +4546,7 @@ 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" +cterm a color terminal (Windows console, color-xterm, these have the "Co" termcap entry) gui the GUI @@ -4629,6 +4671,8 @@ ctermbg={color-nr} *highlight-ctermbg* Note that for some color terminals these names may result in the wrong colors! + You can also use "NONE" to remove the color. + *: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. @@ -4650,7 +4694,7 @@ ctermbg={color-nr} *highlight-ctermbg* *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 + colors for the Normal group and for the Windows console. Example, for reverse video: > :highlight Visual ctermfg=bg ctermbg=fg < Note that the colors are used that are valid at the moment this @@ -4676,7 +4720,7 @@ font={font-name} *highlight-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: + The following only works with Motif 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. @@ -4864,11 +4908,6 @@ 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. @@ -4878,11 +4917,6 @@ Scrollbar Current background and foreground of the main window's 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* diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 44e770dc12..70e6953211 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -48,8 +48,8 @@ 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. +This also works in a few GUI versions, esp. Win32. 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|. @@ -197,22 +197,29 @@ REORDERING TAB PAGES: 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. > + :.tabmove " do nothing :-tabmove " move the tab page to the left - :tabmove " move the tab page to the right - :.tabmove " as above - :+tabmove " as above + :+tabmove " move the tab page to the right :0tabmove " move the tab page to the beginning of the tab " list - :$tabmove " move the tab page to the end of the tab list -< + :tabmove 0 " as above + :tabmove " move the tab page to the last + :$tabmove " as above + :tabmove $ " as above + :tabm[ove] +[N] :tabm[ove] -[N] Move the current tab page N places to the right (with +) or to - the left (with -). + the left (with -). > + :tabmove - " move the tab page to the left + :tabmove -1 " as above + :tabmove + " move the tab page to the right + :tabmove +1 " as above + Note that although it is possible to move a tab behind the N-th one by using -:Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For -clarification what +N means in this context see |[range]|. +:Ntabmove. And move it by N places by using :+Ntabmove. For clarification what ++N means in this context see |[range]|. LOOPING OVER TAB PAGES: @@ -234,7 +241,8 @@ LOOPING OVER TAB PAGES: current tab page. {cmd} can contain '|' to concatenate several commands. {cmd} must not open or close tab pages or reorder them. - Also see |:windo|, |:argdo| and |:bufdo|. + Also see |:windo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| + and |:lfdo|. ============================================================================== 3. Other items *tab-page-other* @@ -265,8 +273,8 @@ 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 + TabEnter enter new tab page BufLeave leave current buffer BufEnter enter new empty buffer @@ -274,8 +282,8 @@ When switching to another tab page the order is: BufLeave WinLeave TabLeave - TabEnter WinEnter + TabEnter BufEnter When entering a new tab page (|:tabnew|), TabNew is triggered before TabEnter diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 7d3697db07..75d820d072 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -84,11 +84,13 @@ 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. +'ignorecase' option is off and 'tagcase' is "followic" or when 'tagcase' is +"match". They are found when a pattern is used (starting with a "/") and for +":tselect", also when 'ignorecase' is off and 'tagcase' is "followic" or when +'tagcase' is "match". 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* @@ -418,12 +420,13 @@ 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. +This also depends on whether case is ignored. Case is ignored when +'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is +"ignore". If case is not ignored, 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 case is ignored, 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 @@ -556,8 +559,10 @@ 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: +A tag file may be case-fold sorted to avoid a linear search when case is +ignored. (Case is ignored when 'ignorecase' is set and 'tagcase' is +"followic", or when 'tagcase' is "ignore".) 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 diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 618d4e5df9..7d47368ba3 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 7.4. Last change: 2014 May 13 +*term.txt* For Vim version 7.4. Last change: 2015 Nov 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -357,7 +357,7 @@ 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. +Vim has started, the escape sequences may not be recognized anymore. *xterm-resize* Window resizing with xterm only works if the allowWindowOps resource is @@ -425,11 +425,9 @@ 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". +Most terminals use the first method. 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. 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. @@ -672,10 +670,9 @@ 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. +only in some versions (GUI, Windows) 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 @@ -689,9 +686,9 @@ 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: +Double, triple and quadruple clicks are supported when the GUI is active, for +Windows and for an xterm. For selecting text, extra clicks extend the +selection: click select ~ double word or % match *<2-LeftMouse>* triple line *<3-LeftMouse>* @@ -747,7 +744,7 @@ Mouse clicks can be mapped. The codes for mouse clicks are: 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. +Currently X1 and X2 only work on Win32 and X11 environments. Examples: > :noremap <MiddleMouse> <LeftMouse><MiddleMouse> diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt index ee1c36d676..c228c65542 100644 --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -190,7 +190,7 @@ 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 has been +at the centre, I know them personally. Furthermore, the centre has been co-sponsored and inspected by World Vision, Save the Children Fund and is now under the supervision of Pacific Academy Outreach Society. The centre is visited about once a year to check the progress (at our own cost). I have diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 1342621516..c6c70ab6d2 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -250,8 +250,8 @@ ignored if its owner differs from the owner of the edited file, except when the owner of the undo file is the current user. Set 'verbose' to get a message about that when opening a file. -Undo files are normally saved in the same directory as the file. This can be -changed with the 'undodir' option. +Location of the undo files is controlled by the 'undodir' option, by default +they are saved to the dedicated directory in the application data folder. You can also save and restore undo histories by using ":wundo" and ":rundo" respectively: diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index cd25b14e32..6a288f8965 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 7.4. Last change: 2010 Jul 20 +*usr_02.txt* For Vim version 7.4. Last change: 2015 Apr 12 VIM USER MANUAL - by Bram Moolenaar @@ -29,11 +29,10 @@ 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: +On Unix you can type this at any command prompt. If you are running Windows, +open a command 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: +---------------------------------------+ |# | @@ -61,10 +60,9 @@ use this command: > 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. +the command prompt 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 @@ -80,7 +78,7 @@ 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 + 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 @@ -88,7 +86,7 @@ now have two lines of text in your Vim window: +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -110,7 +108,7 @@ of the window. This indicates you are in Insert mode. +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | |-- INSERT -- | @@ -187,7 +185,7 @@ look like this: +---------------------------------------+ |intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -202,7 +200,7 @@ insert mode (the final <Esc>). The result: +---------------------------------------+ |A young intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -215,7 +213,7 @@ 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 | + |Found programming Unix a hurdle | |~ | |~ | |~ | @@ -332,7 +330,7 @@ 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 ~ + Found programming Unix a hurdle ~ If you now use the "o" command and type new text: > @@ -342,7 +340,7 @@ The result is: A very intelligent turtle ~ That liked using Vim ~ - Found programming UNIX a hurdle ~ + Found programming Unix a hurdle ~ The "O" command (uppercase) opens a line above the cursor. @@ -518,9 +516,11 @@ Summary: *help-summary* > :help subject() < Function "subject". > :help -subject -< Command-line option "-subject". > +< Command-line argument "-subject". > :help +subject < Compile-time feature "+subject". > + :help /* +< Regular expression item "*" > :help EventName < Autocommand event "EventName". > :help digraphs.txt diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index a8139d60ca..b8f65d9309 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 7.4. Last change: 2006 Jun 21 +*usr_03.txt* For Vim version 7.4. Last change: 2015 Dec 12 VIM USER MANUAL - by Bram Moolenaar @@ -57,8 +57,11 @@ 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 +what Vim considers to be a word, see the 'iskeyword' option. If you try this +out in the help directly, 'iskeyword' needs to be reset for the examples to +work: > + :set iskeyword& +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: @@ -528,7 +531,7 @@ 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: +character is anything, and whose third character is m. Example: We use a computer that became the cummin winter. ~ xxx xxx xxx diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 86fcf0cc2f..5aecf33557 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -37,9 +37,10 @@ for you), you can edit it this way: > If you don't have a vimrc file yet, see |init.vim| to find out where you can create a vimrc file. -For Unix and Macintosh this file is always used and is recommended: +This file is always used and is recommended: - ~/.config/nvim/init.vim ~ + ~/.config/nvim/init.vim (Unix and OSX) ~ + ~/AppData/Local/nvim/init.vim (Windows) ~ 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 diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index 1cb3eb8673..b4b495ff9f 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -152,7 +152,7 @@ You could also write your own color scheme. This is how you do it: directory. For Unix, this should work: > !mkdir -p ~/.config/nvim/colors - !cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim + !cp $VIMRUNTIME/colors/morning.vim ~/.config/nvim/colors/mine.vim < This is done from Vim, because it knows the value of $VIMRUNTIME. diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt index 05cc32bceb..d68d734b8f 100644 --- a/runtime/doc/usr_09.txt +++ b/runtime/doc/usr_09.txt @@ -134,10 +134,10 @@ 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. +The default behavior of the mouse on Unix systems is xterm. The default +behavior on Windows systems is selected during the installation process. For +details about what the two behaviors are, see |:behave|. Here follows a +summary. XTERM MOUSE BEHAVIOR diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt index 64b0181c35..bf7ba18222 100644 --- a/runtime/doc/usr_10.txt +++ b/runtime/doc/usr_10.txt @@ -698,10 +698,10 @@ still be something that an external command can do better or faster. 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 + 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.) > +output.txt. This works on both Unix and Windows. > sort <input.txt >output.txt diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt index 2a810af6c2..1a72c300d7 100644 --- a/runtime/doc/usr_11.txt +++ b/runtime/doc/usr_11.txt @@ -293,7 +293,6 @@ If you really don't want to see this message, you can add the 'A' flag to the '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. diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index fba1b53274..237abae55f 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -309,7 +309,7 @@ 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 +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. @@ -324,7 +324,7 @@ 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 + 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 diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index bdb3b7afd6..4761203512 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -25,7 +25,7 @@ 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 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>. @@ -34,7 +34,7 @@ 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: > +try Unix format first and MS-DOS format second: > :set fileformats=unix,dos @@ -97,12 +97,12 @@ 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 +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: > +Unix: > :set fileformat=unix :write diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt index 46a22c683c..ba9d083fe0 100644 --- a/runtime/doc/usr_24.txt +++ b/runtime/doc/usr_24.txt @@ -563,9 +563,9 @@ 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. + The digraphs depend on the character set that Vim assumes you + are using. Always use ":digraphs" to find out which digraphs are + currently available. You can define your own digraphs. Example: > diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index fb096593f2..d837610698 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -83,7 +83,7 @@ matter if 'ignorecase' or 'smartcase' was changed. 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. + it with CTRL-C on Unix and CTRL-Break on Windows. ============================================================================== *27.2* Wrapping around the file end diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt index 22de2f6ce6..e495aad06d 100644 --- a/runtime/doc/usr_29.txt +++ b/runtime/doc/usr_29.txt @@ -255,7 +255,8 @@ function. RELATED ITEMS -You can set 'ignorecase' to make case in tag names be ignored. +To make case in tag names be ignored, you can set 'ignorecase' while leaving +'tagcase' as "followic", or set 'tagcase' to "ignore". 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 diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index fe9d9b4d62..fc8419a522 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 7.4. Last change: 2014 Aug 16 +*usr_41.txt* For Vim version 7.4. Last change: 2015 Nov 30 VIM USER MANUAL - by Bram Moolenaar @@ -888,6 +888,11 @@ Mappings: *mapping-functions* maparg() get rhs of a mapping wildmenumode() check if the wildmode is active +Testing: *test-functions* + assert_equal() assert that two expressions values are equal + assert_false() assert that an expression is false + assert_true() assert that an expression is true + Various: *various-functions* mode() get current editing mode visualmode() last visual mode used @@ -916,6 +921,7 @@ Various: *various-functions* py3eval() evaluate Python expression (|+python3|) pyeval() evaluate Python expression (|+python|) + wordcount() get byte/word/char count of buffer ============================================================================== *41.7* Defining a function @@ -1494,8 +1500,8 @@ 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 and the like, <CR><LF> is used. -This is important when using mappings that end in a <CR>. See |:source_crnl|. +character is used. For Windows <CR><LF> is used. This is important when +using mappings that end in a <CR>. See |:source_crnl|. WHITE SPACE diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt index e61e6af660..bab446af3c 100644 --- a/runtime/doc/usr_43.txt +++ b/runtime/doc/usr_43.txt @@ -1,4 +1,4 @@ -*usr_43.txt* For Vim version 7.4. Last change: 2008 Dec 28 +*usr_43.txt* For Vim version 7.4. Last change: 2015 Oct 23 VIM USER MANUAL - by Bram Moolenaar @@ -45,6 +45,7 @@ three-line comment. You do this with only two steps: setlocal softtabstop=4 noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc> + let b:undo_ftplugin = "setl softtabstop< | unmap <buffer> <LocalLeader>c" 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 @@ -59,6 +60,11 @@ buffer. This works with any mapping command: ":map!", ":vmap", etc. The |<LocalLeader>| in the mapping is replaced with the value of the "maplocalleader" variable. +The line to set b:undo_ftplugin is for when the filetype is set to another +value. In that case you will want to undo your preferences. The +b:undo_ftplugin variable is executed as a command. Watch out for characters +with a special meaning inside a string, such as a backslash. + You can find examples for filetype plugins in this directory: > $VIMRUNTIME/ftplugin/ diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 117e977e0d..af4224993f 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.4. Last change: 2014 Aug 06 +*various.txt* For Vim version 7.4. Last change: 2015 Nov 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -222,6 +222,10 @@ g8 Print the hex values of the bytes used in the modified, but can be forced with "!". See |termopen()| and |nvim-terminal-emulator| for more information. + To switch to terminal mode automatically: +> + autocmd BufEnter term://* startinsert +< *:!cmd* *:!* *E34* :!{cmd} Execute {cmd} with 'shell'. See also |:terminal|. @@ -272,19 +276,15 @@ g8 Print the hex values of the bytes used in the :!! 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: +:ve[rsion] Print the version number of the editor. 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 @@ -299,9 +299,6 @@ g8 Print the hex values of the bytes used in the *+acl* |ACL| 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 *+byte_offset* support for 'o' flag in 'statusline' option, "go" and ":goto" commands. @@ -321,7 +318,6 @@ 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 *+digraphs* |digraphs| *E196* - *+dnd* Support for DnD into the "~ register |quote_~|. N *+eval* expression evaluation |eval.txt| N *+ex_extra* Vim's extra Ex commands: |:center|, |:left|, |:normal|, |:retab| and |:right| @@ -331,12 +327,7 @@ 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| 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| *+iconv* Compiled with the |iconv()| function *+iconv/dyn* Likewise |iconv-dynamic| |/dyn| N *+insert_expand* |insert_expand| Insert mode completion @@ -376,9 +367,11 @@ N *+startuptime* |--startuptime| argument N *+statusline* Options 'statusline', 'rulerformat' and special formats of 'titlestring' and 'iconstring' N *+syntax* Syntax highlighting |syntax| +N *+tablineat* 'tabline' option recognizing %@Func@ items. 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| +B *+termguicolors* 24-bit color in xterm-compatible terminals support *+terminfo* uses |terminfo| instead of termcap N *+termresponse* support for |t_RV| and |v:termresponse| N *+textobjects* |text-objects| selection @@ -576,17 +569,11 @@ which it was defined is reported. :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). +< Can be interrupted with CTRL-C (CTRL-Break on Windows). "gs" stands for "goto sleep". While sleeping the cursor is positioned in the text, if at a visible position. - - *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. Using Vim like less or more *less* @@ -604,4 +591,12 @@ highlighting. The "h" key will give you a short overview of the available commands. +If you want to set options differently when using less, define the +LessInitFunc in your vimrc, for example: > + + func LessInitFunc() + set nocursorcolumn nocursorline + endfunc +< + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 7b61dbe6d7..ec35694c9e 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 7.4. Last change: 2013 Aug 22 +*vi_diff.txt* For Vim version 7.4. Last change: 2015 Nov 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -44,8 +44,7 @@ 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 -MS-DOS, 'maxmemtot' is set depending on the amount of memory available. +all buffers (in kilobytes). The defaults depend on the system used. 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 @@ -57,15 +56,9 @@ argument when starting Vim. 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). - - 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. - - Macintosh - 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. + - Modern Unix systems (*BSD, Linux, etc.) + - Windows (XP SP 2 or greater) + - OS X Multi level undo. |undo| 'u' goes backward in time, 'CTRL-R' goes forward again. Set option @@ -83,8 +76,7 @@ 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), and Macintosh. + platforms such as Win32. Multiple windows and buffers. |windows.txt| Vim can split the screen into several windows, each editing a @@ -347,9 +339,8 @@ Printing. |printing| Mouse support. |mouse-using| The mouse is supported in the GUI version, in an xterm for Unix, for - BSDs with sysmouse, 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. + BSDs with sysmouse, for Linux with gpm, and for 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. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index c6e98bc40c..508712ca75 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -11,7 +11,7 @@ the "{Nvim}" tag. This document is a complete and centralized list of all these differences. 1. Configuration |nvim-configuration| -2. Option defaults |nvim-option-defaults| +2. Defaults |nvim-defaults| 3. Changed features |nvim-features-changed| 4. New features |nvim-features-new| 5. Missing legacy features |nvim-features-missing| @@ -21,14 +21,17 @@ these differences. ============================================================================== 1. Configuration *nvim-configuration* -- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for storing +- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for storing configuration. - Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files. -- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent +- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent session information. ============================================================================== -2. Option defaults *nvim-option-defaults* +2. Defaults *nvim-defaults* + +- Syntax highlighting is enabled by default +- ":filetype plugin indent on" is enabled by default - 'autoindent' is set by default - 'autoread' is set by default @@ -45,7 +48,7 @@ these differences. - 'listchars' defaults to "tab:> ,trail:-,nbsp:+" - 'mouse' defaults to "a" - 'nocompatible' is always set -- 'nrformats' defaults to "hex" +- 'nrformats' defaults to "bin,hex" - 'sessionoptions' doesn't include "options" - 'smarttab' is set by default - 'tabpagemax' defaults to 50 @@ -68,54 +71,72 @@ are always available and may be used simultaneously in separate plugins. The |nvim-python|). |mkdir()| behaviour changed: -1. Assuming /tmp/foo does not exist and /tmp can be written to +1. Assuming /tmp/foo does not exist and /tmp can be written to mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar with 0700 permissions. Vim mkdir will create /tmp/foo with 0755. -2. If you try to create an existing directory with `'p'` (e.g. mkdir('/', +2. If you try to create an existing directory with `'p'` (e.g. mkdir('/', 'p')) mkdir() will silently exit. In Vim this was an error. 3. mkdir() error messages now include strerror() text when mkdir fails. 'encoding' cannot be changed after startup. |string()| and |:echo| behaviour changed: -1. No maximum recursion depth limit is applied to nested container +1. No maximum recursion depth limit is applied to nested container structures. -2. |string()| fails immediately on nested containers, not when recursion limit +2. |string()| fails immediately on nested containers, not when recursion limit was exceeded. 2. When |:echo| encounters duplicate containers like > let l = [] echo [l, l] < - it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is + it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is only used for recursive containers. -3. |:echo| printing nested containers adds "@level" after "..." designating - the level at which recursive container was printed: |:echo-self-refer|. - Same thing applies to |string()| (though it uses construct like - "{E724@level}"), but this is not reliable because |string()| continues to +3. |:echo| printing nested containers adds "@level" after "..." designating + the level at which recursive container was printed: |:echo-self-refer|. + Same thing applies to |string()| (though it uses construct like + "{E724@level}"), but this is not reliable because |string()| continues to error out. +4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled + back. +5. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in + nothing, |E908|, in Neovim it is internal error. + +|json_decode()| behaviour changed: +1. It may output |msgpack-special-dict|. +2. |msgpack-special-dict| is emitted also in case of duplicate keys, while in + Vim it errors out. +3. It accepts only valid JSON. Trailing commas are not accepted. + +|json_encode()| behaviour slightly changed: now |msgpack-special-dict| values +are accepted, but |v:none| is not. + +*v:none* variable is absent. In Vim it represents “no value” in “js” strings +like "[,]" parsed as "[v:none]" by |js_decode()|. + +*js_encode()* and *js_decode()* functions are also absent. -Viminfo text files were replaced with binary (messagepack) ShaDa files. +Viminfo text files were replaced with binary (messagepack) ShaDa files. Additional differences: - |shada-c| has no effect. - |shada-s| now limits size of every item and not just registers. -- When reading ShaDa files items are merged according to the timestamp. +- When reading ShaDa files items are merged according to the timestamp. |shada-merging| -- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for +- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for compatibility reasons. -- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old +- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old commands are still kept. - |:oldfiles| supports !. -- When writing (|:wshada| without bang or at exit) it merges much more data, - and does this according to the timestamp. Vim merges only marks. +- When writing (|:wshada| without bang or at exit) it merges much more data, + and does this according to the timestamp. Vim merges only marks. |shada-merging| -- ShaDa file format was designed with forward and backward compatibility in +- ShaDa file format was designed with forward and backward compatibility in mind. |shada-compatibility| -- Some errors make ShaDa code keep temporary file in-place for user to decide - what to do with it. Vim deletes temporary file in these cases. +- Some errors make ShaDa code keep temporary file in-place for user to decide + what to do with it. Vim deletes temporary file in these cases. |shada-error-handling| -- Vim keeps no timestamps at all, neither in viminfo file nor in the instance +- Vim keeps no timestamps at all, neither in viminfo file nor in the instance itself. - ShaDa file keeps search direction (|v:searchforward|), viminfo does not. @@ -134,8 +155,8 @@ Meta (alt) chords are recognized (even in the terminal). Note: Meta chords are case-sensitive (<M-a> is distinguished from <M-A>). -Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants (even in -the terminal). Specifically, the following are known to work: +Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants +(even in the terminal). Specifically, the following are known to work: <C-Tab>, <C-S-Tab> <C-BS>, <C-S-BS> <C-Enter>, <C-S-Enter> @@ -199,9 +220,15 @@ Other options: 'cpoptions' ('g', 'w', 'H', '*', '-', 'j', and all POSIX flags were removed) 'guioptions' (only the 't' flag was removed) 'guipty' + 'imactivatefunc' + 'imactivatekey' + 'imstatusfunc' 'macatsui' + 'restorescreen' 'shelltype' 'shortname' + 'swapsync' + 'term' 'termencoding' (Vim 7.4.852 also removed this for Windows) 'textauto' 'textmode' @@ -209,11 +236,14 @@ Other options: 'toolbariconsize' 'ttybuiltin' 'ttymouse' + 'ttyscroll' + 'ttytype' 'weirdinvert' Other commands: :Print :fixdel + :helpfind :mode (no longer accepts an argument) :open :shell diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index c009bec66e..51b73223b6 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 7.4. Last change: 2014 Dec 05 +*windows.txt* For Vim version 7.4. Last change: 2015 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -681,7 +681,6 @@ can also get to them with the buffer list commands, like ":bnext". When using the |:tab| modifier each argument is opened in a tab page. The last window is used if it's empty. Also see |++opt| and |+cmd|. - {only available when compiled with a GUI} ============================================================================== 8. Do a command in all buffers or windows *list-repeat* @@ -702,11 +701,12 @@ can also get to them with the buffer list commands, like ":bnext". the current window. {cmd} can contain '|' to concatenate several commands. {cmd} must not open or close windows or reorder them. - Also see |:tabdo|, |:argdo| and |:bufdo|. + Also see |:tabdo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo|. *:bufdo* :[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if - [range[ is given only for buffers for which their + [range] is given only for buffers for which their buffer name is in the [range]. It works like doing this: > :bfirst @@ -728,7 +728,8 @@ can also get to them with the buffer list commands, like ":bnext". autocommand event is disabled by adding it to 'eventignore'. This considerably speeds up editing each buffer. - Also see |:tabdo|, |:argdo| and |:windo|. + Also see |:tabdo|, |:argdo|, |:windo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo|. Examples: > @@ -984,8 +985,8 @@ list of buffers. |unlisted-buffer| (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. + thus 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) @@ -1098,13 +1099,13 @@ list of buffers. |unlisted-buffer| 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. - Also see ||+cmd|. + Also see |+cmd|. :[N]b[uffer][!] [+cmd] {bufname} Edit buffer for {bufname} 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. - Also see ||+cmd|. + Also see |+cmd|. :[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer* Split window and edit buffer [N] from the buffer list. If [N] @@ -1112,7 +1113,7 @@ list of buffers. |unlisted-buffer| "useopen" setting of 'switchbuf' when splitting. This will also edit a buffer that is not in the buffer list, without setting the 'buflisted' flag. - Also see ||+cmd|. + Also see |+cmd|. :[N]sb[uffer] [+cmd] {bufname} Split window and edit buffer for {bufname} from the buffer @@ -1121,13 +1122,13 @@ list of buffers. |unlisted-buffer| 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 # -< Also see ||+cmd|. +< Also see |+cmd|. :[N]bn[ext][!] [+cmd] [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 [!]. - Also see ||+cmd|. + Also see |+cmd|. 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. @@ -1140,21 +1141,21 @@ list of buffers. |unlisted-buffer| :[N]sbn[ext] [+cmd] [N] Split window and go to [N]th next buffer in buffer list. Wraps around the end of the buffer list. Uses 'switchbuf' - Also see ||+cmd|. + Also see |+cmd|. :[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88* :[N]bp[revious][!] [+cmd] [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'. - Also see ||+cmd|. + Also see |+cmd|. :[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious* :[N]sbp[revious] [+cmd] [N] Split window and go to [N]th previous buffer in buffer list. Wraps around the start of the buffer list. Uses 'switchbuf'. - Also see ||+cmd|. + Also see |+cmd|. :br[ewind][!] [+cmd] *:br* *:brewind* Go to first buffer in buffer list. If the buffer list is |