aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2017-11-22 22:35:20 +0100
committerGitHub <noreply@github.com>2017-11-22 22:35:20 +0100
commita4f6cec7a31ff8dbfa089b9e22227afbeb951e9b (patch)
tree9bcf55ca9e4ecdbea9390dc750d39027ba7d3acf /runtime
parent9393be477a733183c2a992cc8728e3ebc65a3118 (diff)
downloadrneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.tar.gz
rneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.tar.bz2
rneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.zip
cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
vim-patch:fafcf0dd59fd patch 8.0.1206: no autocmd for entering or leaving the command line Problem: No autocmd for entering or leaving the command line. Solution: Add CmdlineEnter and CmdlineLeave. https://github.com/vim/vim/commit/fafcf0dd59fd9c4ef743bb333ae40d1d322b6079
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt24
-rw-r--r--runtime/doc/cmdline.txt2
-rw-r--r--runtime/doc/eval.txt11
3 files changed, 33 insertions, 4 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 6cffbf4cb6..740f44414a 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -310,6 +310,8 @@ Name triggered by ~
|TabNew| when creating a new tab page
|TabNewEntered| after entering a new tab page
|TabClosed| after closing a tab page
+|CmdlineEnter| after entering cmdline mode
+|CmdlineLeave| before leaving cmdline mode
|CmdwinEnter| after entering the command-line window
|CmdwinLeave| before leaving the command-line window
@@ -492,6 +494,28 @@ CmdUndefined When a user command is used but it isn't
command is defined. An alternative is to
always define the user command and have it
invoke an autoloaded function. See |autoload|.
+ *CmdlineEnter*
+CmdlineEnter After moving the cursor to the command line,
+ where the user can type a command or search
+ string.
+ <afile> is set to a single character,
+ indicating the type of command-line.
+ |cmdline-char|
+ Sets these |v:event| keys:
+ cmdlevel
+ cmdtype
+ *CmdlineLeave*
+CmdlineLeave Before leaving the command line.
+ <afile> is set to a single character,
+ indicating the type of command-line.
+ |cmdline-char|
+ Sets these |v:event| keys:
+ abort (mutable)
+ cmdlevel
+ cmdtype
+ Note: `abort` can only be changed from false
+ to true. An autocmd cannot execute an already
+ aborted cmdline by changing it to false.
*CmdwinEnter*
CmdwinEnter After entering the command-line window.
Useful for setting options specifically for
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 4956b9e6fe..00e654841c 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1088,7 +1088,7 @@ Another example: >
:au CmdwinEnter [/?] startinsert
This will make Vim start in Insert mode in the command-line window.
- *cmdwin-char*
+ *cmdline-char* *cmdwin-char*
The character used for the pattern indicates the type of command-line:
: normal Ex command
> debug mode command |debug-mode|
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index b752667d9a..ea4393bc6f 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1527,16 +1527,21 @@ v:event Dictionary of event data for the current |autocommand|. Valid
< Keys vary by event; see the documentation for the specific
event, e.g. |DirChanged| or |TextYankPost|.
KEY DESCRIPTION ~
- cwd Current working directory
+ abort Whether the event triggered during
+ an aborting condition, i e |c_Esc| or
+ |c_CTRL-c|for |CmdlineLeave|.
+ cmdlevel Level of cmdline.
+ cmdtype Type of cmdline, |cmdline-char|.
+ cwd Current working directory.
scope Event-specific scope name.
operator Current |operator|. Also set for Ex
commands (unlike |v:operator|). For
example if |TextYankPost| is triggered
by the |:yank| Ex command then
- `v:event['operator']` is "y".
+ `v:event.operator` is "y".
regcontents Text stored in the register as a
|readfile()|-style list of lines.
- regname Requested register (e.g "x" for "xyy)
+ regname Requested register (e.g "x" for "xyy)
or the empty string for an unnamed
operation.
regtype Type of register as returned by