patch 8.2.2128: there is no way to do something on CTRL-Z
Problem: There is no way to do something on CTRL-Z.
Solution: Add VimSuspend and VimResume autocommand events. (closes #7450)
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 3b37627..a29c5dd 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -306,6 +306,9 @@
|VimLeavePre| before exiting Vim, before writing the viminfo file
|VimLeave| before exiting Vim, after writing the viminfo file
+|VimSuspend| when suspending Vim
+|VimResume| when Vim is resumed after being suspended
+
Terminal
|TerminalOpen| after a terminal buffer was created
|TerminalWinOpen| after a terminal buffer was created in a new window
@@ -1231,6 +1234,17 @@
VimResized After the Vim window was resized, thus 'lines'
and/or 'columns' changed. Not when starting
up though.
+ *VimResume*
+VimResume When the Vim instance is resumed after being
+ suspended and |VimSuspend| was triggered.
+ Useful for triggering |:checktime| and ensure
+ the buffers content did not change while Vim
+ was suspended: >
+ :autocmd VimResume * checktime
+< *VimSuspend*
+VimSuspend When the Vim instance is suspended. Only when
+ CTRL-Z was typed inside Vim, not when the
+ SIGSTOP or SIGTSTP signal was sent to Vim.
*WinEnter*
WinEnter After entering another window. Not done for
the first window, when Vim has just started.