aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt26
1 files changed, 15 insertions, 11 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index ca1ddaabd4..cbc92a8cb5 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1623,11 +1623,11 @@ The valid escape sequences are
*<mods>* *<q-mods>* *:command-modifiers*
<mods> The command modifiers, if specified. Otherwise, expands to
nothing. Supported modifiers are |:aboveleft|, |:belowright|,
- |:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|,
- |:keepjumps|, |:keepmarks|, |:keeppatterns|, |:leftabove|,
- |:lockmarks|, |:noautocmd|, |:noswapfile| |:rightbelow|,
- |:sandbox|, |:silent|, |:tab|, |:topleft|, |:unsilent|,
- |:verbose|, and |:vertical|.
+ |:botright|, |:browse|, |:confirm|, |:hide|, |:horizontal|,
+ |:keepalt|, |:keepjumps|, |:keepmarks|, |:keeppatterns|,
+ |:leftabove|, |:lockmarks|, |:noautocmd|, |:noswapfile|
+ |:rightbelow|, |:sandbox|, |:silent|, |:tab|, |:topleft|,
+ |:unsilent|, |:verbose|, and |:vertical|.
Note that |:filter| is not supported.
Examples: >
command! -nargs=+ -complete=file MyEdit
@@ -1660,7 +1660,8 @@ The valid escape sequences are
If the first two characters of an escape sequence are "q-" (for example,
<q-args>) then the value is quoted in such a way as to make it a valid value
for use in an expression. This uses the argument as one single value.
-When there is no argument <q-args> is an empty string.
+When there is no argument <q-args> is an empty string. See the
+|q-args-example| below.
*<f-args>*
To allow commands to pass their arguments on to a user-defined function, there
is a special form <f-args> ("function args"). This splits the command
@@ -1670,10 +1671,10 @@ See the Mycmd example below. If no arguments are given <f-args> is removed.
To embed whitespace into an argument of <f-args>, prepend a backslash.
<f-args> replaces every pair of backslashes (\\) with one backslash. A
backslash followed by a character other than white space or a backslash
-remains unmodified. Overview:
+remains unmodified. Also see |f-args-example| below. Overview:
command <f-args> ~
- XX ab 'ab'
+ XX ab "ab"
XX a\b 'a\b'
XX a\ b 'a b'
XX a\ b 'a ', 'b'
@@ -1684,7 +1685,8 @@ remains unmodified. Overview:
XX a\\\\b 'a\\b'
XX a\\\\ b 'a\\', 'b'
-Examples >
+
+Examples for user commands: >
" Delete everything after here to the end
:com Ddel +,$d
@@ -1700,7 +1702,8 @@ Examples >
" Count the number of lines in the range
:com! -range -nargs=0 Lines echo <line2> - <line1> + 1 "lines"
- " Call a user function (example of <f-args>)
+< *f-args-example*
+Call a user function (example of <f-args>) >
:com -nargs=* Mycmd call Myfunc(<f-args>)
When executed as: >
@@ -1708,7 +1711,8 @@ When executed as: >
This will invoke: >
:call Myfunc("arg1","arg2")
- :" A more substantial example
+< *q-args-example*
+A more substantial example: >
:function Allargs(command)
: let i = 0
: while i < argc()