1- *map.txt* For Vim version 8.1. Last change: 2018 May 13
1+ *map.txt* For Vim version 8.1. Last change: 2018 Dec 08
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1223,14 +1223,19 @@ See |:verbose-cmd| for more information.
12231223 attributes (see below) are {attr} . If the command
12241224 already exists, an error is reported, unless a ! is
12251225 specified, in which case the command is redefined.
1226+ There is one exception: When sourcing a script again,
1227+ a command that was previously defined in that script
1228+ will be silently replaced.
1229+
12261230
12271231:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
12281232 Delete the user-defined command {cmd} .
12291233
12301234:comc[lear] *:comc* *:comclear*
12311235 Delete all user-defined commands.
12321236
1233- Command attributes
1237+
1238+ Command attributes ~
12341239
12351240User-defined commands are treated by Vim just like any other Ex commands. They
12361241can have arguments, or have a range specified. Arguments are subject to
@@ -1241,8 +1246,9 @@ There are a number of attributes, split into four categories: argument
12411246handling, completion behavior, range handling, and special cases. The
12421247attributes are described below, by category.
12431248
1244- Argument handling *E175* *E176* *:command-nargs*
12451249
1250+ Argument handling ~
1251+ *E175* *E176* *:command-nargs*
12461252By default, a user defined command will take no arguments (and an error is
12471253reported if any are supplied). However, it is possible to specify that the
12481254command can take arguments, using the -nargs attribute. Valid cases are:
@@ -1271,8 +1277,10 @@ defined, not where it is invoked! Example:
12711277 Executing script2.vim will result in "None" being echoed. Not what you
12721278intended! Calling a function may be an alternative.
12731279
1274- Completion behavior *:command-completion* *E179*
1275- *E180* *E181* *:command-complete*
1280+
1281+ Completion behavior ~
1282+ *:command-completion* *E179* *E180* *E181*
1283+ *:command-complete*
12761284By default, the arguments of user defined commands do not undergo completion.
12771285However, by specifying one or the other of the following attributes, argument
12781286completion can be enabled:
@@ -1317,9 +1325,9 @@ completion can be enabled:
13171325Note: That some completion methods might expand environment variables.
13181326
13191327
1320- Custom completion *:command-completion-custom*
1321- *:command-completion-customlist *
1322- *E467* *E468*
1328+ Custom completion ~
1329+ *:command-completion-custom *
1330+ *:command-completion-customlist* *E467* *E468*
13231331It is possible to define customized completion schemes via the "custom,{func} "
13241332or the "customlist,{func} " completion argument. The {func} part should be a
13251333function with the following signature: >
@@ -1364,8 +1372,8 @@ the 'path' option: >
13641372This example does not work for file names with spaces!
13651373
13661374
1367- Range handling *E177* *E178* *:command-range*
1368- *:command-count*
1375+ Range handling ~
1376+ *E177* *E178* *:command-range* *:command-count*
13691377By default, user-defined commands do not accept a line number range. However,
13701378it is possible to specify that the command does take a range (the -range
13711379attribute), or that it takes an arbitrary count value, either in the line
@@ -1399,8 +1407,11 @@ Possible values are:
13991407 -addr=loaded_buffers Range for loaded buffers
14001408 -addr=windows Range for windows
14011409 -addr=tabs Range for tab pages
1410+ -addr=other other kind of range
14021411
1403- Special cases *:command-bang* *:command-bar*
1412+
1413+ Special cases ~
1414+ *:command-bang* *:command-bar*
14041415 *:command-register* *:command-buffer*
14051416There are some special cases as well:
14061417
@@ -1418,7 +1429,8 @@ replacement text separately.
14181429Note that these arguments can be abbreviated, but that is a deprecated
14191430feature. Use the full name for new scripts.
14201431
1421- Replacement text
1432+
1433+ Replacement text ~
14221434
14231435The replacement text for a user defined command is scanned for special escape
14241436sequences, using <...> notation. Escape sequences are replaced with values
0 commit comments