Skip to content

Commit f87b2b9

Browse files
authored
Merge pull request #1642 from vim-jp/hh-update-autocmd
Update autocmd.{txt,jax}
2 parents fc1818d + 31742e4 commit f87b2b9

File tree

2 files changed

+59
-22
lines changed

2 files changed

+59
-22
lines changed

doc/autocmd.jax

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim バージョン 9.1. Last change: 2024 Jun 21
1+
*autocmd.txt* For Vim バージョン 9.1. Last change: 2024 Jul 17
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -53,20 +53,20 @@
5353
する。
5454

5555
Vim9 script での例: >
56-
autocmd_add({replace: true,
56+
autocmd_add([{replace: true,
5757
group: 'DemoGroup',
5858
event: 'BufEnter',
5959
pattern: '*.txt',
6060
cmd: 'call DemoBufEnter()'
61-
})
61+
}])
6262
6363
旧来のスクリプトの例: >
64-
call autocmd_add(#{replace: v:true,
64+
call autocmd_add([#{replace: v:true,
6565
\ group: 'DemoGroup',
6666
\ event: 'BufEnter',
6767
\ pattern: '*.txt',
6868
\ cmd: 'call DemoBufEnter()'
69-
\ })
69+
\ }])
7070
7171
==============================================================================
7272
2. 自動コマンドの定義 *autocmd-define*
@@ -442,6 +442,8 @@ Vimは以下のイベントを認識する。イベント名が大文字か小
442442
|CompleteDonePre| 挿入モード補完が完了したとき、情報がクリアされる前
443443
|CompleteDone| 挿入モード補完が完了したとき、情報がクリアされた後
444444

445+
|KeyInputPre| キーが処理される前
446+
445447
|User| ":doautocmd" との組合せで使われる
446448
|SigUSR1| SIGUSER1シグナルを受けとった後
447449

@@ -751,10 +753,9 @@ CursorMoved ノーマルモードかビジュアルモードでカーソルが
751753
が予期しないことや時間のかかる処理は行わないこ
752754
と。
753755
*CursorMovedC*
754-
CursorMovedC コマンドラインのテキストが変更されていない状態
755-
の時に、コマンドラインでカーソルを移動した後。
756-
コマンドラインをぐちゃぐちゃにすると Vim がロッ
757-
ク状態になる可能性があるので注意。
756+
CursorMovedC コマンドラインでカーソルを移動した後。コマンド
757+
ラインをぐちゃぐちゃにすると Vim がロック状態
758+
になる可能性があるので注意。
758759
<afile> には、コマンドラインの種類を示す単一の
759760
文字が設定される。|cmdwin-char|
760761
*CursorMovedI*
@@ -905,11 +906,13 @@ FilterWritePre フィルタコマンド用のファイルを書き込んだり
905906
*FocusGained*
906907
FocusGained Vimが入力フォーカスを得たとき。GUI版と、入力
907908
フォーカスを認識できるいくつかのコンソール版で
908-
のみ有効。
909+
のみ有効。|xterm-focus-event|
909910
*FocusLost*
910911
FocusLost Vimが入力フォーカスを失ったとき。GUI版と、入力
911912
フォーカスを認識できるいくつかのコンソール版で
912-
のみ有効。
913+
のみ有効。|xterm-focus-event|
914+
ダイアログがポップアップした時にも発生する可能
915+
性がある。
913916
*FuncUndefined*
914917
FuncUndefined ユーザー定義関数が使われたが、定義されていなかっ
915918
たとき。必要なときのみ関数を定義するのに便利で
@@ -962,6 +965,22 @@ InsertLeavePre 挿入モードを抜ける前。CTRL-O |i_CTRL-O| を使っ
962965
InsertLeave 挿入モードを抜けた直後。CTRL-O |i_CTRL-O|
963966
使ったときにも発生する。|i_CTRL-C| のときは発
964967
生しない。
968+
*KeyInputPre*
969+
KeyInputPre マッピングが適用されてキーが処理される前。パ
970+
ターンは、現在のモードを示す文字列と照合され
971+
る。これは、`mode(1)` によって返されるものと同
972+
じである。
973+
|v:char| 変数は入力されたキーを示し、イベント
974+
中に変更して別のキーを処理することができ
975+
る。|v:char| が単一の文字または特殊キーでない
976+
場合は、最初の文字が使用される。
977+
The following values of |v:event| are set:
978+
|v:event| には以下の値が設定される:
979+
typed キーがタイプされたか否か。
980+
typedchar (実際に) タイプされたキー。
981+
テキスト |textlock| または現在のモードを変更す
982+
ることはできない。
983+
{+eval 機能が有効な場合のみ}
965984
*MenuPopup*
966985
MenuPopup (マウス右ボタンで)ポップアップメニューを表示す
967986
る直前。カーソル下やマウスポインタの下にあるも

en/autocmd.txt

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -54,20 +54,20 @@ Recommended use:
5454
without the autocommand being repeated.
5555

5656
Example in Vim9 script: >
57-
autocmd_add({replace: true,
57+
autocmd_add([{replace: true,
5858
group: 'DemoGroup',
5959
event: 'BufEnter',
6060
pattern: '*.txt',
6161
cmd: 'call DemoBufEnter()'
62-
})
62+
}])
6363
6464
In legacy script: >
65-
call autocmd_add(#{replace: v:true,
65+
call autocmd_add([#{replace: v:true,
6666
\ group: 'DemoGroup',
6767
\ event: 'BufEnter',
6868
\ pattern: '*.txt',
6969
\ cmd: 'call DemoBufEnter()'
70-
\ })
70+
\ }])
7171
7272
==============================================================================
7373
2. Defining autocommands *autocmd-define*
@@ -439,6 +439,8 @@ Name triggered by ~
439439
|CompleteDone| after Insert mode completion is done, after clearing
440440
info
441441

442+
|KeyInputPre| just before a key is processed
443+
442444
|User| to be used in combination with ":doautocmd"
443445
|SigUSR1| after the SIGUSR1 signal has been detected
444446

@@ -751,9 +753,8 @@ CursorMoved After the cursor was moved in Normal or Visual
751753
that is slow.
752754
*CursorMovedC*
753755
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.
757758
<afile> is set to a single character,
758759
indicating the type of command-line.
759760
|cmdwin-char|
@@ -915,12 +916,12 @@ FilterWritePre Before writing a file for a filter command or
915916
*FocusGained*
916917
FocusGained When Vim got input focus. Only for the GUI
917918
version and a few console versions where this
918-
can be detected.
919+
can be detected. |xterm-focus-event|
919920
*FocusLost*
920921
FocusLost When Vim lost input focus. Only for the GUI
921922
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.
924925
*FuncUndefined*
925926
FuncUndefined When a user function is used but it isn't
926927
defined. Useful for defining a function only
@@ -978,6 +979,23 @@ InsertLeavePre Just before leaving Insert mode. Also when
978979
*InsertLeave*
979980
InsertLeave Just after leaving Insert mode. Also when
980981
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}
981999
*MenuPopup*
9821000
MenuPopup Just before showing the popup menu (under the
9831001
right mouse button). Useful for adjusting the

0 commit comments

Comments
 (0)