aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-11-30 22:13:50 -0500
committerGitHub <noreply@github.com>2021-11-30 22:13:50 -0500
commit828bf128a64466f254629b102e283af35666cd05 (patch)
tree6cda5c2df8d799d87d86dcfabc595e2737b8feda /runtime
parent2635b77dba6fa218871441fa3380860405bf9240 (diff)
parent980c68d0362c3ca099c0facef2d08efede76aabf (diff)
downloadrneovim-828bf128a64466f254629b102e283af35666cd05.tar.gz
rneovim-828bf128a64466f254629b102e283af35666cd05.tar.bz2
rneovim-828bf128a64466f254629b102e283af35666cd05.zip
Merge pull request #15840 from vimpostor/vim-8.2.3430
vim-patch:8.2.{3430,3434,3462,3463,3555,3609,3610}: ModeChanged autocmd
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt22
1 files changed, 21 insertions, 1 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 5d9f9590e2..879a34bcaa 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -718,7 +718,27 @@ MenuPopup Just before showing the popup menu (under the
o Operator-pending
i Insert
c Command line
- *OptionSet*
+ *ModeChanged*
+ModeChanged After changing the mode. The pattern is
+ matched against `'old_mode:new_mode'`, for
+ example match against `*:c` to simulate
+ |CmdlineEnter|.
+ The following values of |v:event| are set:
+ old_mode The mode before it changed.
+ new_mode The new mode as also returned
+ by |mode()| called with a
+ non-zero argument.
+ When ModeChanged is triggered, old_mode will
+ have the value of new_mode when the event was
+ last triggered.
+ This will be triggered on every minor mode
+ change.
+ Usage example to use relative line numbers
+ when entering visual mode: >
+ :au ModeChanged [vV\x16]*:* let &l:rnu = mode() =~# '^[vV\x16]'
+ :au ModeChanged *:[vV\x16]* let &l:rnu = mode() =~# '^[vV\x16]'
+ :au WinEnter,WinLeave * let &l:rnu = mode() =~# '^[vV\x16]'
+< *OptionSet*
OptionSet After setting an option (except during
|startup|). The |autocmd-pattern| is matched
against the long option name. |<amatch>|