aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/doc/autocmd.txt
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt25
1 files changed, 18 insertions, 7 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 01b21aa085..bf94383ec4 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -215,6 +215,8 @@ BufAdd Just after creating a new buffer which is
added to the buffer list, or adding a buffer
to the buffer list, a buffer in the buffer
list was renamed.
+ Not triggered for the initial buffers created
+ during startup.
Before |BufEnter|.
NOTE: Current buffer "%" may be different from
the buffer being created "<afile>".
@@ -461,7 +463,7 @@ CompleteDone After Insert mode completion is done. Either
*CursorHold*
CursorHold When the user doesn't press a key for the time
- specified with 'updatetime'. Not re-triggered
+ specified with 'updatetime'. Not triggered
until the user has pressed a key (i.e. doesn't
fire every 'updatetime' ms if you leave Vim to
make some coffee. :) See |CursorHold-example|
@@ -707,7 +709,7 @@ InsertEnter Just before starting Insert mode. Also for
string.
*InsertLeavePre*
InsertLeavePre Just before leaving Insert mode. Also when
- using CTRL-O |i_CTRL-O|. Be caseful not to
+ using CTRL-O |i_CTRL-O|. Be careful not to
change mode or use `:normal`, it will likely
cause trouble.
*InsertLeave*
@@ -1207,8 +1209,8 @@ name!
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
this if there is still an autocommand using
this group! You will get a warning if doing
- it anyway. when the group is the current group
- you will get error E936.
+ it anyway. When the group is the current
+ group you will get error E936.
To enter autocommands for a specific group, use this method:
1. Select the group with ":augroup {name}".
@@ -1267,9 +1269,18 @@ option will not cause any commands to be executed.
*:doautoa* *:doautoall*
:doautoa[ll] [<nomodeline>] [group] {event} [fname]
Like ":doautocmd", but apply the autocommands to each
- loaded buffer. Note that [fname] is used to select
- the autocommands, not the buffers to which they are
- applied.
+ loaded buffer. The current buffer is done last.
+
+ Note that [fname] is used to select the autocommands,
+ not the buffers to which they are applied. Example: >
+ augroup mine
+ autocmd!
+ autocmd FileType * echo expand('<amatch>')
+ augroup END
+ doautoall mine FileType Loaded-Buffer
+< Sourcing this script, you'll see as many
+ "Loaded-Buffer" echoed as there are loaded buffers.
+
Careful: Don't use this for autocommands that delete a
buffer, change to another buffer or change the
contents of a buffer; the result is unpredictable.