aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-10-10 21:51:25 -0400
committerScott Prager <splinterofchaos@gmail.com>2014-11-11 11:55:59 -0500
commit0051a7cb259f2b88e01b9efe92580aafc970fbe4 (patch)
tree6c0a364c26a4597103ad6d1b5aa5e02508615833 /runtime
parent8390accde7e37f1531b250ec2144b8d16cdee198 (diff)
downloadrneovim-0051a7cb259f2b88e01b9efe92580aafc970fbe4.tar.gz
rneovim-0051a7cb259f2b88e01b9efe92580aafc970fbe4.tar.bz2
rneovim-0051a7cb259f2b88e01b9efe92580aafc970fbe4.zip
vim-patch:7.4.414
Problem: Cannot define a command only when it's used. Solution: Add the CmdUndefined autocommand event. (partly by Yasuhiro Matsumoto) https://code.google.com/p/vim/source/detail?r=v7-4-414
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 451e60514c..55bd508109 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -278,6 +278,7 @@ Name triggered by ~
|ShellCmdPost| after executing a shell command
|ShellFilterPost| after filtering with a shell command
+|CmdUndefined| a user command is used but it isn't defined
|FuncUndefined| a user function is used but it isn't defined
|SpellFileMissing| a spell file is used but it can't be found
|SourcePre| before sourcing a Vim script
@@ -466,6 +467,16 @@ BufWriteCmd Before writing the whole buffer to a file.
*BufWritePost*
BufWritePost After writing the whole buffer to a file
(should undo the commands for BufWritePre).
+ *CmdUndefined*
+CmdUndefined When a user command is used but it isn't
+ defined. Useful for defining a command only
+ when it's used. The pattern is matched
+ against the command name. Both <amatch> and
+ <afile> are set to the name of the command.
+ NOTE: Autocompletion won't work until the
+ command is defined. An alternative is to
+ always define the user command and have it
+ invoke an autoloaded function. See |autoload|.
*CmdwinEnter*
CmdwinEnter After entering the command-line window.
Useful for setting options specifically for
@@ -671,6 +682,8 @@ FuncUndefined When a user function is used but it isn't
when it's used. The pattern is matched
against the function name. Both <amatch> and
<afile> are set to the name of the function.
+ NOTE: When writing Vim scripts a better
+ alternative is to use an autoloaded function.
See |autoload-functions|.
*GUIEnter*
GUIEnter After starting the GUI successfully, and after