|
1 |
| -*autocmd.txt* For Vim version 9.1. Last change: 2024 Jun 21 |
| 1 | +*autocmd.txt* For Vim version 9.1. Last change: 2024 Jul 17 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -54,20 +54,20 @@ Recommended use:
|
54 | 54 | without the autocommand being repeated.
|
55 | 55 |
|
56 | 56 | Example in Vim9 script: >
|
57 |
| - autocmd_add({replace: true, |
| 57 | + autocmd_add([{replace: true, |
58 | 58 | group: 'DemoGroup',
|
59 | 59 | event: 'BufEnter',
|
60 | 60 | pattern: '*.txt',
|
61 | 61 | cmd: 'call DemoBufEnter()'
|
62 |
| - }) |
| 62 | + }]) |
63 | 63 |
|
64 | 64 | In legacy script: >
|
65 |
| - call autocmd_add(#{replace: v:true, |
| 65 | + call autocmd_add([#{replace: v:true, |
66 | 66 | \ group: 'DemoGroup',
|
67 | 67 | \ event: 'BufEnter',
|
68 | 68 | \ pattern: '*.txt',
|
69 | 69 | \ cmd: 'call DemoBufEnter()'
|
70 |
| - \ }) |
| 70 | + \ }]) |
71 | 71 |
|
72 | 72 | ==============================================================================
|
73 | 73 | 2. Defining autocommands *autocmd-define*
|
@@ -439,6 +439,8 @@ Name triggered by ~
|
439 | 439 | |CompleteDone| after Insert mode completion is done, after clearing
|
440 | 440 | info
|
441 | 441 |
|
| 442 | +|KeyInputPre| just before a key is processed |
| 443 | + |
442 | 444 | |User| to be used in combination with ":doautocmd"
|
443 | 445 | |SigUSR1| after the SIGUSR1 signal has been detected
|
444 | 446 |
|
@@ -751,9 +753,8 @@ CursorMoved After the cursor was moved in Normal or Visual
|
751 | 753 | that is slow.
|
752 | 754 | *CursorMovedC*
|
753 | 755 | CursorMovedC After the cursor was moved in the command
|
754 |
| - line while the text in the command line hasn't |
755 |
| - changed. Be careful not to mess up the |
756 |
| - command line, it may cause Vim to lock up. |
| 756 | + line. Be careful not to mess up the command |
| 757 | + line, it may cause Vim to lock up. |
757 | 758 | <afile> is set to a single character,
|
758 | 759 | indicating the type of command-line.
|
759 | 760 | |cmdwin-char|
|
@@ -915,12 +916,12 @@ FilterWritePre Before writing a file for a filter command or
|
915 | 916 | *FocusGained*
|
916 | 917 | FocusGained When Vim got input focus. Only for the GUI
|
917 | 918 | version and a few console versions where this
|
918 |
| - can be detected. |
| 919 | + can be detected. |xterm-focus-event| |
919 | 920 | *FocusLost*
|
920 | 921 | FocusLost When Vim lost input focus. Only for the GUI
|
921 | 922 | version and a few console versions where this
|
922 |
| - can be detected. May also happen when a |
923 |
| - dialog pops up. |
| 923 | + can be detected. |xterm-focus-event| |
| 924 | + May also happen when a dialog pops up. |
924 | 925 | *FuncUndefined*
|
925 | 926 | FuncUndefined When a user function is used but it isn't
|
926 | 927 | defined. Useful for defining a function only
|
@@ -978,6 +979,23 @@ InsertLeavePre Just before leaving Insert mode. Also when
|
978 | 979 | *InsertLeave*
|
979 | 980 | InsertLeave Just after leaving Insert mode. Also when
|
980 | 981 | using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
| 982 | + *KeyInputPre* |
| 983 | +KeyInputPre Just before a key is processed after mappings |
| 984 | + have been applied. The pattern is matched |
| 985 | + against a string that indicates the current |
| 986 | + mode, which is the same as what is returned by |
| 987 | + `mode(1)`. |
| 988 | + The |v:char| variable indicates the key typed |
| 989 | + and can be changed during the event to process |
| 990 | + a different key. When |v:char| is not a |
| 991 | + single character or a special key, the first |
| 992 | + character is used. |
| 993 | + The following values of |v:event| are set: |
| 994 | + typed The key is typed or not. |
| 995 | + typedchar The (actual) typed key. |
| 996 | + It is not allowed to change the text |
| 997 | + |textlock| or the current mode. |
| 998 | + {only with the +eval feature} |
981 | 999 | *MenuPopup*
|
982 | 1000 | MenuPopup Just before showing the popup menu (under the
|
983 | 1001 | right mouse button). Useful for adjusting the
|
|
0 commit comments