aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-08-15 17:45:18 +0200
committerGitHub <noreply@github.com>2020-08-15 17:45:18 +0200
commit37aa9c9c94551ffed8ba5721d5b8ea8e172d7377 (patch)
treeedc210f304d4353dbeb4224b5e42941f332d7a1d /runtime/doc
parent75aeb815b4db487186e1f4471b37f54430468c76 (diff)
parent056d99b0f6072030a8946303fce58a86fd83bf57 (diff)
downloadrneovim-37aa9c9c94551ffed8ba5721d5b8ea8e172d7377.tar.gz
rneovim-37aa9c9c94551ffed8ba5721d5b8ea8e172d7377.tar.bz2
rneovim-37aa9c9c94551ffed8ba5721d5b8ea8e172d7377.zip
Merge pull request #12713 from janlazo/vim-8.2.1347
vim-patch:8.1.{573,1674,2097,2098,2341},8.2.{1347,1360,1361,1364,1369,1377,1379,1386,1409,1410,1438,1441,1458}
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/eval.txt14
-rw-r--r--runtime/doc/map.txt30
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--runtime/doc/vim_diff.txt2
4 files changed, 37 insertions, 13 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index efb6272e58..448885296d 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2224,6 +2224,7 @@ inputsecret({prompt} [, {text}])
String like input() but hiding the text
insert({list}, {item} [, {idx}])
List insert {item} in {list} [before {idx}]
+interrupt() none interrupt script execution
invert({expr}) Number bitwise invert
isdirectory({directory}) Number |TRUE| if {directory} is a directory
isinf({expr}) Number determine if {expr} is infinity value
@@ -5412,6 +5413,19 @@ insert({list}, {item} [, {idx}]) *insert()*
Note that when {item} is a |List| it is inserted as a single
item. Use |extend()| to concatenate |Lists|.
+interrupt() *interrupt()*
+ Interrupt script execution. It works more or less like the
+ user typing CTRL-C, most commands won't execute and control
+ returns to the user. This is useful to abort execution
+ from lower down, e.g. in an autocommand. Example: >
+ :function s:check_typoname(file)
+ : if fnamemodify(a:file, ':t') == '['
+ : echomsg 'Maybe typo'
+ : call interrupt()
+ : endif
+ :endfunction
+ :au BufWritePre * call s:check_typoname(expand('<amatch>'))
+
invert({expr}) *invert()*
Bitwise invert. The argument is converted to a number. A
List, Dict or Float argument causes an error. Example: >
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index ed31ecc42e..1514f03c55 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1078,6 +1078,10 @@ When executing an autocommand or a user command, it will run in the context of
the script it was defined in. This makes it possible that the command calls a
local function or uses a local mapping.
+In case the value is used in a context where <SID> cannot be correctly
+expanded, use the expand() function: >
+ let &includexpr = expand('<SID>') .. 'My_includeexpr()'
+
Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can
@@ -1162,6 +1166,10 @@ See |:verbose-cmd| for more information.
attributes (see below) are {attr}. If the command
already exists, an error is reported, unless a ! is
specified, in which case the command is redefined.
+ There is one exception: When sourcing a script again,
+ a command that was previously defined in that script
+ will be silently replaced.
+
:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
Delete the user-defined command {cmd}.
@@ -1169,7 +1177,8 @@ See |:verbose-cmd| for more information.
:comc[lear] *:comc* *:comclear*
Delete all user-defined commands.
-Command attributes
+
+Command attributes ~
User-defined commands are treated by Vim just like any other Ex commands. They
can have arguments, or have a range specified. Arguments are subject to
@@ -1180,8 +1189,9 @@ There are a number of attributes, split into four categories: argument
handling, completion behavior, range handling, and special cases. The
attributes are described below, by category.
-Argument handling *E175* *E176* *:command-nargs*
+Argument handling ~
+ *E175* *E176* *:command-nargs*
By default, a user defined command will take no arguments (and an error is
reported if any are supplied). However, it is possible to specify that the
command can take arguments, using the -nargs attribute. Valid cases are:
@@ -1257,9 +1267,9 @@ completion can be enabled:
Note: That some completion methods might expand environment variables.
-Custom completion *:command-completion-custom*
- *:command-completion-customlist*
- *E467* *E468*
+Custom completion ~
+ *:command-completion-custom*
+ *:command-completion-customlist* *E467* *E468*
It is possible to define customized completion schemes via the "custom,{func}"
or the "customlist,{func}" completion argument. The {func} part should be a
function with the following signature: >
@@ -1304,8 +1314,8 @@ the 'path' option: >
This example does not work for file names with spaces!
-Range handling *E177* *E178* *:command-range*
- *:command-count*
+Range handling ~
+ *E177* *E178* *:command-range* *:command-count*
By default, user-defined commands do not accept a line number range. However,
it is possible to specify that the command does take a range (the -range
attribute), or that it takes an arbitrary count value, either in the line
@@ -1342,7 +1352,8 @@ Possible values are:
-addr=other other kind of range
-Special cases *:command-bang* *:command-bar*
+Special cases ~
+ *:command-bang* *:command-bar*
*:command-register* *:command-buffer*
There are some special cases as well:
@@ -1360,7 +1371,8 @@ replacement text separately.
Note that these arguments can be abbreviated, but that is a deprecated
feature. Use the full name for new scripts.
-Replacement text
+
+Replacement text ~
The replacement text for a user defined command is scanned for special escape
sequences, using <...> notation. Escape sequences are replaced with values
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 29f4abf250..8efd876d76 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5043,9 +5043,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Don't include both "curdir" and "sesdir".
When neither "curdir" nor "sesdir" is included, file names are stored
with absolute paths.
- "slash" and "unix" are useful on Windows when sharing session files
- with Unix. The Unix version of Vim cannot source dos format scripts,
- but the Windows version of Vim can source unix format scripts.
+ "slash" and "unix" are always enabled.
*'shada'* *'sd'* *E526* *E527* *E528*
'shada' 'sd' string (Vim default for
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 24b562543e..0ba2711090 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -50,7 +50,7 @@ the differences.
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
- 'nrformats' defaults to "bin,hex"
- 'ruler' is enabled
-- 'sessionoptions' excludes "options"
+- 'sessionoptions' enables "slash,unix", excludes "options"
- 'shortmess' includes "F", excludes "S"
- 'showcmd' is enabled
- 'sidescroll' defaults to 1