Home Explore Blog CI



neovim

9th chunk of `runtime/doc/autocmd.txt`
a98abc4af71fadb401279d8aec32681c6bf8ea7c5fcd48f40000000100000fa7
 autocommand moves the cursor
				the effect of the change is undefined.
							*E788*
				Cannot switch buffers.  You can reload the
				buffer but not edit another one.
							*E881*
				If the number of lines changes saving for undo
				may fail and the change will be aborted.
							*FileChangedShell*
FileChangedShell		When Vim notices that the modification time of
				a file has changed since editing started.
				Also when the file attributes of the file
				change or when the size of the file changes.
				|timestamp|
				Triggered for each changed file, after:
				- executing a shell command
				- |:checktime|
				- |FocusGained|

				Not used when 'autoread' is set and the buffer
				was not changed.  If a FileChangedShell
				autocommand exists the warning message and
				prompt is not given.
				|v:fcs_reason| indicates what happened. Set
				|v:fcs_choice| to control what happens next.
				NOTE: Current buffer "%" is not the target
				buffer "<afile>" and "<abuf>". |<buffer=abuf>|
							*E246* *E811*
				Cannot switch, jump to or delete buffers.
				Non-recursive (event cannot trigger itself).
							*FileChangedShellPost*
FileChangedShellPost		After handling a file that was changed outside
				of Vim.  Can be used to update the statusline.
							*FileReadCmd*
FileReadCmd			Before reading a file with a ":read" command.
				Should do the reading of the file. |Cmd-event|
							*FileReadPost*
FileReadPost			After reading a file with a ":read" command.
				Note that Vim sets the '[ and '] marks to the
				first and last line of the read.  This can be
				used to operate on the lines just read.
							*FileReadPre*
FileReadPre			Before reading a file with a ":read" command.
							*FileType*
FileType			When the 'filetype' option has been set.  The
				pattern is matched against the filetype.
				<afile> is the name of the file where this
				option was set.  <amatch> is the new value of
				'filetype'.
				Cannot switch windows or buffers.
				See |filetypes|.
							*FileWriteCmd*
FileWriteCmd			Before writing to a file, when not writing the
				whole buffer.  Should do the writing to the
				file.  Should not change the buffer.  Use the
				|'[| and |']| marks for the range of lines.
				|Cmd-event|
							*FileWritePost*
FileWritePost			After writing to a file, when not writing the
				whole buffer.
							*FileWritePre*
FileWritePre			Before writing to a file, when not writing the
				whole buffer.  Use the |'[| and |']| marks for the
				range of lines.
							*FilterReadPost*
FilterReadPost			After reading a file from a filter command.
				Vim checks the pattern against the name of
				the current buffer as with FilterReadPre.
				Not triggered when 'shelltemp' is off.
							*FilterReadPre* *E135*
FilterReadPre			Before reading a file from a filter command.
				Vim checks the pattern against the name of
				the current buffer, not the name of the
				temporary file that is the output of the
				filter command.
				Not triggered when 'shelltemp' is off.
							*FilterWritePost*
FilterWritePost			After writing a file for a filter command or
				making a diff with an external diff (see
				|DiffUpdated| for internal diff).
				Vim checks the pattern against the name of
				the current buffer as with FilterWritePre.
				Not triggered when 'shelltemp' is off.
							*FilterWritePre*
FilterWritePre			Before writing a file for a filter command or
				making a diff with an external diff.
				Vim checks the pattern against the name of
				the current buffer, not the name of the
				temporary file that is the output of the
				filter command.
				Not triggered when 'shelltemp' is off.
							*FocusGained*
FocusGained			Nvim got focus.
							*FocusLost*
FocusLost			Nvim lost focus.  Also (potentially) when
				a GUI dialog pops up.
							*FuncUndefined*
FuncUndefined			When a user function is used but it isn't
				defined.  Useful for defining a function only
				when it's used.  The pattern is matched
				against the function

Title: Nvim Autocommand Events: File Changes, Reading/Writing, and Focus Management
Summary
This section details more Nvim autocommand events, including post-handling of externally changed files (FileChangedShellPost), file reading (FileReadCmd, FileReadPost, FileReadPre), setting file types (FileType), partial file writing (FileWriteCmd, FileWritePost, FileWritePre), filter command handling (FilterReadPost, FilterReadPre, FilterWritePost, FilterWritePre), focus management (FocusGained, FocusLost), and undefined function usage (FuncUndefined). It also notes restrictions on buffer manipulation during certain events and the use of shelltemp for filter-related events.