|
1 |
| -*autocmd.txt* For Vim version 8.2. Last change: 2022 Apr 08 |
| 1 | +*autocmd.txt* For Vim version 8.2. Last change: 2022 Apr 17 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -95,6 +95,7 @@ Or use `:execute`: >
|
95 | 95 | :augroup mine | exe "au! BufRead *" | augroup END
|
96 | 96 | :augroup mine | exe "au BufRead * set tw=70" | augroup END
|
97 | 97 |
|
| 98 | +< *autocmd-expand* |
98 | 99 | Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
|
99 | 100 | arguments are not expanded when the autocommand is defined. These will be
|
100 | 101 | 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
|
473 | 474 | executing the modelines. See |BufWinEnter|
|
474 | 475 | for when you need to do something after
|
475 | 476 | processing the modelines.
|
476 |
| - This does NOT work for ":r file". Not used |
477 |
| - when the file doesn't exist. Also used after |
478 |
| - successfully recovering a file. |
479 |
| - Also triggered for the filetypedetect group |
480 |
| - when executing ":filetype detect" and when |
481 |
| - writing an unnamed buffer in a way that the |
482 |
| - buffer gets a name. |
| 477 | + Also triggered: |
| 478 | + - when writing an unnamed buffer in a way that |
| 479 | + the buffer gets a name |
| 480 | + - after successfully recovering a file |
| 481 | + - for the filetypedetect group when executing |
| 482 | + ":filetype detect" |
| 483 | + Not triggered: |
| 484 | + - for the `:read file` command |
| 485 | + - when the file doesn't exist |
483 | 486 | *BufReadCmd*
|
484 | 487 | BufReadCmd Before starting to edit a new buffer. Should
|
485 | 488 | read the file into the buffer. |Cmd-event|
|
@@ -707,9 +710,38 @@ CursorMoved After the cursor was moved in Normal or Visual
|
707 | 710 | CursorMovedI After the cursor was moved in Insert mode.
|
708 | 711 | Not triggered when the popup menu is visible.
|
709 | 712 | Otherwise the same as CursorMoved.
|
| 713 | + *DiffUpdated* |
| 714 | +DiffUpdated After diffs have been updated. Depending on |
| 715 | + what kind of diff is being used (internal or |
| 716 | + external) this can be triggered on every |
| 717 | + change or when doing |:diffupdate|. |
| 718 | + *DirChangedPre* |
| 719 | +DirChangedPre The working directory is going to be changed, |
| 720 | + as with |DirChanged|. The pattern is like |
| 721 | + with |DirChanged|. The new directory can be |
| 722 | + found in v:event.directory. |
| 723 | + *DirChanged* |
| 724 | +DirChanged The working directory has changed in response |
| 725 | + to the |:cd| or |:tcd| or |:lcd| commands, or |
| 726 | + as a result of the 'autochdir' option. |
| 727 | + The pattern can be: |
| 728 | + "window" to trigger on `:lcd` |
| 729 | + "tabpage" to trigger on `:tcd` |
| 730 | + "global" to trigger on `:cd` |
| 731 | + "auto" to trigger on 'autochdir'. |
| 732 | + "drop" to trigger on editing a file |
| 733 | + <afile> is set to the new directory name. |
710 | 734 | *EncodingChanged*
|
711 | 735 | EncodingChanged Fires off after the 'encoding' option has been
|
712 | 736 | changed. Useful to set up fonts, for example.
|
| 737 | + *ExitPre* |
| 738 | +ExitPre When using `:quit`, `:wq` in a way it makes |
| 739 | + Vim exit, or using `:qall`, just after |
| 740 | + |QuitPre|. Can be used to close any |
| 741 | + non-essential window. Exiting may still be |
| 742 | + cancelled if there is a modified buffer that |
| 743 | + isn't automatically saved, use |VimLeavePre| |
| 744 | + for really exiting. |
713 | 745 | *FileAppendCmd*
|
714 | 746 | FileAppendCmd Before appending to a file. Should do the
|
715 | 747 | appending to the file. Use the '[ and ']
|
@@ -737,35 +769,6 @@ FileChangedRO Before making the first change to a read-only
|
737 | 769 | *E881*
|
738 | 770 | If the number of lines changes saving for undo
|
739 | 771 | may fail and the change will be aborted.
|
740 |
| - *DiffUpdated* |
741 |
| -DiffUpdated After diffs have been updated. Depending on |
742 |
| - what kind of diff is being used (internal or |
743 |
| - external) this can be triggered on every |
744 |
| - change or when doing |:diffupdate|. |
745 |
| - *DirChangedPre* |
746 |
| -DirChangedPre The working directory is going to be changed, |
747 |
| - as with |DirChanged|. The pattern is like |
748 |
| - with |DirChanged|. The new directory can be |
749 |
| - found in v:event.directory. |
750 |
| - *DirChanged* |
751 |
| -DirChanged The working directory has changed in response |
752 |
| - to the |:cd| or |:tcd| or |:lcd| commands, or |
753 |
| - as a result of the 'autochdir' option. |
754 |
| - The pattern can be: |
755 |
| - "window" to trigger on `:lcd` |
756 |
| - "tabpage" to trigger on `:tcd` |
757 |
| - "global" to trigger on `:cd` |
758 |
| - "auto" to trigger on 'autochdir'. |
759 |
| - "drop" to trigger on editing a file |
760 |
| - <afile> is set to the new directory name. |
761 |
| - *ExitPre* |
762 |
| -ExitPre When using `:quit`, `:wq` in a way it makes |
763 |
| - Vim exit, or using `:qall`, just after |
764 |
| - |QuitPre|. Can be used to close any |
765 |
| - non-essential window. Exiting may still be |
766 |
| - cancelled if there is a modified buffer that |
767 |
| - isn't automatically saved, use |VimLeavePre| |
768 |
| - for really exiting. |
769 | 772 | *FileChangedShell*
|
770 | 773 | FileChangedShell When Vim notices that the modification time of
|
771 | 774 | a file has changed since editing started.
|
@@ -1205,6 +1208,9 @@ TextYankPost After text has been yanked or deleted in the
|
1205 | 1208 | current buffer. The following values of
|
1206 | 1209 | |v:event| can be used to determine the operation
|
1207 | 1210 | that triggered this autocmd:
|
| 1211 | + inclusive TRUE if the motion is |
| 1212 | + |inclusive| else the motion is |
| 1213 | + |exclusive|. |
1208 | 1214 | operator The operation performed.
|
1209 | 1215 | regcontents Text that was stored in the
|
1210 | 1216 | register, as a list of lines,
|
|
0 commit comments