Home Explore Blog CI



neovim

14th chunk of `runtime/doc/autocmd.txt`
70c22a58db058e286264bc1e7a021afd64774c6dfb4daaab0000000100000fa8
 of the file where
				this option was set. <amatch> expands to the
				new value of 'syntax'.
				See |:syn-on|.
							*TabEnter*
TabEnter			Just after entering a tab page. |tab-page|
				After WinEnter.
				Before BufEnter.
							*TabLeave*
TabLeave			Just before leaving a tab page. |tab-page|
				After WinLeave.
							*TabNew*
TabNew				When creating a new tab page. |tab-page|
				After WinEnter.
				Before TabEnter.
							*TabNewEntered*
TabNewEntered			After entering a new tab page. |tab-page|
				After BufEnter.
							*TabClosed*
TabClosed			After closing a tab page. <afile> expands to
				the tab page number.
							*TermOpen*
TermOpen			When a |terminal| job is starting.  Can be
				used to configure the terminal buffer.
							*TermEnter*
TermEnter			After entering |Terminal-mode|.
				After TermOpen.
							*TermLeave*
TermLeave			After leaving |Terminal-mode|.
				After TermClose.
							*TermClose*
TermClose			When a |terminal| job ends.
				Sets these |v:event| keys:
				    status
							*TermRequest*
TermRequest			When a |:terminal| child process emits an OSC,
				DCS, or APC sequence. Sets |v:termrequest|. The
				|event-data| is a table with the following
				fields:

				- sequence: the received sequence
				- cursor: (1,0)-indexed, buffer-relative
				  position of the cursor when the sequence was
				  received

				This is triggered even when inside an
				autocommand defined without |autocmd-nested|.

							*TermResponse*
TermResponse			When Nvim receives an OSC or DCS response from
				the host terminal. Sets |v:termresponse|. The
				|event-data| is a table with the following fields:

				- sequence: the received sequence

				This is triggered even when inside an
				autocommand defined without |autocmd-nested|.

				May be triggered during another event (file
				I/O, a shell command, or anything else that
				takes time).

				Example: >lua

				-- Query the terminal palette for the RGB value of color 1
				-- (red) using OSC 4
				vim.api.nvim_create_autocmd('TermResponse', {
				  once = true,
				  callback = function(args)
				    local resp = args.data.sequence
				    local r, g, b = resp:match("\027%]4;1;rgb:(%w+)/(%w+)/(%w+)")
				  end,
				})
				io.stdout:write("\027]4;1;?\027\\")
<
							*TextChanged*
TextChanged			After a change was made to the text in the
				current buffer in Normal mode.  That is after
				|b:changedtick| has changed (also when that
				happened before the TextChanged autocommand
				was defined).
				Not triggered when there is typeahead or when
				an operator is pending.
				Note: Cannot be skipped with `:noautocmd`.
				Careful: This is triggered very often, don't
				do anything that the user does not expect or
				that is slow.
							*TextChangedI*
TextChangedI			After a change was made to the text in the
				current buffer in Insert mode.
				Not triggered when the popup menu is visible.
				Otherwise the same as TextChanged.
							*TextChangedP*
TextChangedP			After a change was made to the text in the
				current buffer in Insert mode, only when the
				popup menu is visible.  Otherwise the same as
				TextChanged.
							*TextChangedT*
TextChangedT			After a change was made to the text in the
				current buffer in |Terminal-mode|.  Otherwise
				the same as TextChanged.
							*TextYankPost*
TextYankPost			Just after a |yank| or |deleting| command, but not
				if the black hole register |quote_| is used nor
				for |setreg()|. Pattern must be "*".
				Sets these |v:event| keys:
				    inclusive
				    operator
				    regcontents
				    regname
				    regtype
				    visual
				The `inclusive` flag combined with the |'[|
				and |']| marks can be used to calculate the
				precise region of the operation.

				Non-recursive (event cannot trigger itself).
				Cannot change the text. |textlock|
							*User*
User				Not executed automatically.  Use |:doautocmd|
				to trigger this, typically for "custom events"
				in a plugin.  Example: >
				    :autocmd

Title: Nvim Autocommand Events: Tab, Term, TextChanged, TextYankPost, User
Summary
This section details Nvim autocommand events. It covers TabEnter/Leave/New/NewEntered/Closed for tab page events; TermOpen/Enter/Leave/Close/Request/Response for terminal job events; TextChanged/TextChangedI/TextChangedP/TextChangedT after text changes in Normal, Insert, Popup menu visible in Insert mode, and Terminal modes, respectively; TextYankPost after yank or delete commands; and User, a custom event triggered by |:doautocmd|.