summaryrefslogtreecommitdiffstats
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-18 15:36:40 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-18 15:36:40 +0100
commit75ab590f8504a8912ca0b8c58f6b897bb7a34f07 (patch)
tree075bd9c71cdc8ed677ae82f9594668cf3a220109 /runtime/doc/autocmd.txt
parenta929c922b1cb7c84ad1b5d1d0fc9a4f7c68ab8e0 (diff)
Update runtime files
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt77
1 files changed, 40 insertions, 37 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 3b738b744f..0bbfd34a72 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 8.2. Last change: 2022 Apr 08
+*autocmd.txt* For Vim version 8.2. Last change: 2022 Apr 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -95,6 +95,7 @@ Or use `:execute`: >
:augroup mine | exe "au! BufRead *" | augroup END
:augroup mine | exe "au BufRead * set tw=70" | augroup END
+< *autocmd-expand*
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
arguments are not expanded when the autocommand is defined. These will be
expanded when the Event is recognized, and the {cmd} is executed. The only
@@ -473,13 +474,15 @@ BufRead or BufReadPost When starting to edit a new buffer, after
executing the modelines. See |BufWinEnter|
for when you need to do something after
processing the modelines.
- This does NOT work for ":r file". Not used
- when the file doesn't exist. Also used after
- successfully recovering a file.
- Also triggered for the filetypedetect group
- when executing ":filetype detect" and when
- writing an unnamed buffer in a way that the
- buffer gets a name.
+ Also triggered:
+ - when writing an unnamed buffer in a way that
+ the buffer gets a name
+ - after successfully recovering a file
+ - for the filetypedetect group when executing
+ ":filetype detect"
+ Not triggered:
+ - for the `:read file` command
+ - when the file doesn't exist
*BufReadCmd*
BufReadCmd Before starting to edit a new buffer. Should
read the file into the buffer. |Cmd-event|
@@ -707,9 +710,38 @@ CursorMoved After the cursor was moved in Normal or Visual
CursorMovedI After the cursor was moved in Insert mode.
Not triggered when the popup menu is visible.
Otherwise the same as CursorMoved.
+ *DiffUpdated*
+DiffUpdated After diffs have been updated. Depending on
+ what kind of diff is being used (internal or
+ external) this can be triggered on every
+ change or when doing |:diffupdate|.
+ *DirChangedPre*
+DirChangedPre The working directory is going to be changed,
+ as with |DirChanged|. The pattern is like
+ with |DirChanged|. The new directory can be
+ found in v:event.directory.
+ *DirChanged*
+DirChanged The working directory has changed in response
+ to the |:cd| or |:tcd| or |:lcd| commands, or
+ as a result of the 'autochdir' option.
+ The pattern can be:
+ "window" to trigger on `:lcd`
+ "tabpage" to trigger on `:tcd`
+ "global" to trigger on `:cd`
+ "auto" to trigger on 'autochdir'.
+ "drop" to trigger on editing a file
+ <afile> is set to the new directory name.
*EncodingChanged*
EncodingChanged Fires off after the 'encoding' option has been
changed. Useful to set up fonts, for example.
+ *ExitPre*
+ExitPre When using `:quit`, `:wq` in a way it makes
+ Vim exit, or using `:qall`, just after
+ |QuitPre|. Can be used to close any
+ non-essential window. Exiting may still be
+ cancelled if there is a modified buffer that
+ isn't automatically saved, use |VimLeavePre|
+ for really exiting.
*FileAppendCmd*
FileAppendCmd Before appending to a file. Should do the
appending to the file. Use the '[ and ']
@@ -737,35 +769,6 @@ FileChangedRO Before making the first change to a read-only
*E881*
If the number of lines changes saving for undo
may fail and the change will be aborted.
- *DiffUpdated*
-DiffUpdated After diffs have been updated. Depending on
- what kind of diff is being used (internal or
- external) this can be triggered on every
- change or when doing |:diffupdate|.
- *DirChangedPre*
-DirChangedPre The working directory is going to be changed,
- as with |DirChanged|. The pattern is like
- with |DirChanged|. The new directory can be
- found in v:event.directory.
- *DirChanged*
-DirChanged The working directory has changed in response
- to the |:cd| or |:tcd| or |:lcd| commands, or
- as a result of the 'autochdir' option.
- The pattern can be:
- "window" to trigger on `:lcd`
- "tabpage" to trigger on `:tcd`
- "global" to trigger on `:cd`
- "auto" to trigger on 'autochdir'.
- "drop" to trigger on editing a file
- <afile> is set to the new directory name.
- *ExitPre*
-ExitPre When using `:quit`, `:wq` in a way it makes
- Vim exit, or using `:qall`, just after
- |QuitPre|. Can be used to close any
- non-essential window. Exiting may still be
- cancelled if there is a modified buffer that
- isn't automatically saved, use |VimLeavePre|
- for really exiting.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.