1- *autocmd.txt* For Vim version 9.1. Last change: 2025 Sep 14
1+ *autocmd.txt* For Vim version 9.1. Last change: 2025 Oct 12
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -236,7 +236,7 @@ autocmds.
236236
237237 *:autocmd-verbose*
238238When 'verbose' is non-zero, listing an autocommand will also display where it
239- was last defined. Example: >
239+ was last defined. Example: >
240240
241241 :verbose autocmd BufEnter
242242 FileExplorer BufEnter
@@ -346,7 +346,8 @@ Name triggered by ~
346346| GUIEnter | after starting the GUI successfully
347347| GUIFailed | after starting the GUI failed
348348| TermResponse | after the terminal response to | t_RV | is received
349- | TermResponseAll | after the terminal response to | t_RV | and others is received
349+ | TermResponseAll | after the terminal response to | t_RV | and others is
350+ received
350351
351352| QuitPre | when using `:quit ` , before deciding whether to exit
352353| ExitPre | when using a command that may make Vim exit
@@ -383,7 +384,8 @@ Name triggered by ~
383384| FocusGained | Vim got input focus
384385| FocusLost | Vim lost input focus
385386| CursorHold | the user doesn't press a key for a while
386- | CursorHoldI | the user doesn't press a key for a while in Insert mode
387+ | CursorHoldI | the user doesn't press a key for a while in Insert
388+ mode
387389| CursorMoved | the cursor was moved in Normal mode
388390| CursorMovedC | the cursor was moved in the | Command-line |
389391| CursorMovedI | the cursor was moved in Insert mode
@@ -568,7 +570,8 @@ BufWinEnter After a buffer is displayed in a window. This
568570 since it reloads that buffer.
569571 Does not happen for a terminal window, because
570572 it starts in Terminal-Job mode and Normal mode
571- commands won't work. Use | TerminalOpen | instead.
573+ commands won't work. Use | TerminalOpen |
574+ instead.
572575 *BufWinLeave*
573576BufWinLeave Before a buffer is removed from a window.
574577 Not when it's still visible in another window.
@@ -681,7 +684,7 @@ ColorScheme After loading a color scheme. |:colorscheme|
681684 Not triggered if the color scheme is not
682685 found.
683686 The pattern is matched against the
684- colorscheme name. <afile> can be used for the
687+ colorscheme name. <afile> can be used for the
685688 name of the actual file where this option was
686689 set, and <amatch> for the new colorscheme
687690 name.
@@ -750,7 +753,7 @@ CursorHold When the user doesn't press a key for the time
750753 triggered. | q |
751754 *<CursorHold>*
752755 Internally the autocommand is triggered by the
753- <CursorHold> key. In an expression mapping
756+ <CursorHold> key. In an expression mapping
754757 | getchar() | may see this character.
755758
756759 Note: Interactive commands cannot be used for
@@ -1016,7 +1019,7 @@ InsertLeave Just after leaving Insert mode. Also when
10161019 using CTRL-O | i_CTRL-O | . But not for | i_CTRL-C | .
10171020 *KeyInputPre*
10181021KeyInputPre Just before a key is processed after mappings
1019- have been applied. The pattern is matched
1022+ have been applied. The pattern is matched
10201023 against a string that indicates the current
10211024 mode, which is the same as what is returned by
10221025 `mode (1 )` .
@@ -1048,7 +1051,7 @@ MenuPopup Just before showing the popup menu (under the
10481051 c Command line
10491052 tl Terminal
10501053 *ModeChanged*
1051- ModeChanged After changing the mode. The pattern is
1054+ ModeChanged After changing the mode. The pattern is
10521055 matched against `' old_mode:new_mode' ` , for
10531056 example match against `* :c * ` to simulate
10541057 | CmdlineEnter | .
@@ -1084,18 +1087,18 @@ OptionSet After setting an option. The pattern is
10841087
10851088 | v:option_oldlocal | is only set when | :set |
10861089 or | :setlocal | or a | modeline | was used to set
1087- the option. Similarly | v:option_oldglobal | is
1090+ the option. Similarly | v:option_oldglobal | is
10881091 only set when | :set | or | :setglobal | was used.
10891092
10901093 This does not set | <abuf> | , you could use
10911094 | bufnr() | .
10921095
10931096 Note that when setting a | global-local | string
10941097 option with | :set | , then | v:option_old | is the
1095- old global value. However, for all other kinds
1096- of options (local string options, global-local
1097- number options, ...) it is the old local
1098- value.
1098+ old global value. However, for all other
1099+ kinds of options (local string options,
1100+ global-local number options, ...) it is the
1101+ old local value.
10991102
11001103 OptionSet is not triggered on startup and for
11011104 the 'key' option for obvious reasons.
@@ -1107,7 +1110,7 @@ OptionSet After setting an option. The pattern is
11071110
11081111 Note: It's a bad idea to reset an option
11091112 during this autocommand, this may break a
1110- plugin. You can always use `:noa ` to prevent
1113+ plugin. You can always use `:noa ` to prevent
11111114 triggering this autocommand.
11121115
11131116 When using | :set | in the autocommand the event
@@ -1138,7 +1141,7 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
11381141 *QuickFixCmdPost*
11391142QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
11401143 command is run, before jumping to the first
1141- location. For | :cfile | and | :lfile | commands
1144+ location. For | :cfile | and | :lfile | commands
11421145 it is run after the error file is read and
11431146 before moving to the first error.
11441147 See | QuickFixCmdPost-example | .
@@ -1182,7 +1185,7 @@ SafeState When nothing is pending, going to wait for the
11821185 screen was scrolled for messages.
11831186 *SafeStateAgain*
11841187SafeStateAgain Like SafeState but after processing any
1185- messages and invoking callbacks. This may be
1188+ messages and invoking callbacks. This may be
11861189 triggered often, don't do something that takes
11871190 time.
11881191
@@ -1286,12 +1289,12 @@ TermChanged After the value of 'term' has changed. Useful
12861289 settings. Executed for all loaded buffers.
12871290 *TerminalOpen*
12881291TerminalOpen Just after a terminal buffer was created, with
1289- `:terminal ` or | term_start() | . This event is
1292+ `:terminal ` or | term_start() | . This event is
12901293 triggered even if the buffer is created
12911294 without a window, with the ++hidden option.
12921295 *TerminalWinOpen*
12931296TerminalWinOpen Just after a terminal buffer was created, with
1294- `:terminal ` or | term_start() | . This event is
1297+ `:terminal ` or | term_start() | . This event is
12951298 triggered only if the buffer is created
12961299 with a window. Can be used to set window
12971300 local options for the terminal window.
@@ -1488,7 +1491,7 @@ WinLeave Before leaving a window. If the window to be
14881491 Not used for ":qa" or ":q" when exiting Vim.
14891492
14901493 *WinNewPre*
1491- WinNewPre Before creating a new window. Triggered
1494+ WinNewPre Before creating a new window. Triggered
14921495 before commands that modify window layout by
14931496 creating a split.
14941497 Not done when creating tab pages and for the
@@ -1797,8 +1800,8 @@ option will not cause any commands to be executed.
17971800 After applying the autocommands the modelines are
17981801 processed, so that their settings overrule the
17991802 settings from autocommands, like what happens when
1800- editing a file. This is skipped when the <nomodeline>
1801- argument is present. You probably want to use
1803+ editing a file. This is skipped when the <nomodeline>
1804+ argument is present. You probably want to use
18021805 <nomodeline> for events that are not used when loading
18031806 a buffer, such as | User | .
18041807 Processing modelines is also skipped when no
@@ -1810,7 +1813,7 @@ option will not cause any commands to be executed.
18101813 loaded buffer. The current buffer is done last.
18111814
18121815 Note that [fname] is used to select the autocommands,
1813- not the buffers to which they are applied. Example: >
1816+ not the buffers to which they are applied. Example: >
18141817 augroup mine
18151818 autocmd!
18161819 autocmd FileType * echo expand('<amatch>')
0 commit comments