diff --git a/doc/autocmd.jax b/doc/autocmd.jax index 531b19bff..348b6479c 100644 --- a/doc/autocmd.jax +++ b/doc/autocmd.jax @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim バージョン 9.2. Last change: 2026 Feb 25 +*autocmd.txt* For Vim バージョン 9.2. Last change: 2026 May 10 VIM リファレンスマニュアル by Bram Moolenaar @@ -425,6 +425,8 @@ Vimは以下のイベントを認識する。イベント名が大文字か小 |TextChangedP| ポップアップメニューが表示されているときに、挿入モード でテキストが変更された後 |TextChangedT| 端末モードでテキストが変更された後 +|TextPutPost| テキストが貼り付けされた後 +|TextPutPre| テキストが貼り付けされる前 |TextYankPost| テキストがヤンクもしくは削除された後 |SafeState| 保留中のものはなく、ユーザーの文字入力を待つとき @@ -1338,6 +1340,47 @@ TextChangedP 挿入モードでカレントバッファのテキストが変 TextChangedT 端末モードのカレントバッファのテキストが変更さ れたとき。 他は TextChanged と同じ。 + *TextPutPost* +TextPutPost テキストがカレントバッファに貼り付けされた後。 + |v:event| の以下の値は、|TextYankPost| とほぼ + 同じである。 + operator 実行された操作。'p' または 'P' + のいずれか。 + regcontents 貼り付けされたテキスト。 + |quote_=| の場合、これは式の結 + 果である。 + regname レジスタ名、または無名レジスタ + の場合は空の文字列。 + regtype レジスタの種類。 + |getregtype()| を参照。 + visual 操作が |Visual| モードで実行さ + れる場合は真となる。 + |quote_| が使用された場合、または再帰的に呼び + 出された場合はトリガーされない。 + バッファのテキストの変更は許可されていない。 + |textlock|を参照。 + Note |quote_.| レジスタの場合、最後に挿入され + たテキストは入力バッファにバッファリングされる + ため (バッファは直接変更されない)、この自動コ + マンドは |TextPutPre| の直後に呼び出されること + に注意。 + {Vim が +eval 機能付きでコンパイルされた場合の + み有効} + *TextPutPre* +TextPutPre テキストがカレントバッファに貼り付けされる前。 + |v:event| の |TextPutPost| と同じ値である。こ + の自動コマンドでは |setreg()|を呼び出すことが + でき、テキストが貼り付けされる前に + "regcontents" 内のテキストを処理および変更でき + る。ただし、これは |quote_#|、|quote_=|、 + |quote_%|、|quote_:|、|quote_/|、|quote_.| に + は適用されない。 + |quote_| が使用された場合、または再帰的に呼び + 出された場合はトリガーされない。 + バッファのテキストの変更は許可されていない。 + |textlock|を参照。 + {Vim が +eval 機能付きでコンパイルされた場合の + み有効} *TextYankPost* TextYankPost カレントバッファでテキストがヤンクもしくは削除 された後。|v:event| の以下の値は、この autocmd @@ -1364,7 +1407,8 @@ TextYankPost カレントバッファでテキストがヤンクもしくは "autoselect" が設定されているために、Vim がビ ジュアル選択の所有者になろうとしたときにも間接 的にトリガーされる。 - {+eval 機能付きでコンパイルされた場合のみ有効} + {Vim が +eval 機能付きでコンパイルされた場合の + み有効} *User* User 自動的に実行されることはない。コマンド diff --git a/en/autocmd.txt b/en/autocmd.txt index eba6e4354..62cd761e1 100644 --- a/en/autocmd.txt +++ b/en/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.2. Last change: 2026 Feb 25 +*autocmd.txt* For Vim version 9.2. Last change: 2026 May 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -421,6 +421,8 @@ Name triggered by ~ |TextChangedP| after a change was made to the text in Insert mode when popup menu visible |TextChangedT| after a change was made to the text in Terminal mode +|TextPutPost| after text has been put +|TextPutPre| before text is put |TextYankPost| after text has been yanked or deleted |SafeState| nothing pending, going to wait for the user to type a @@ -1359,6 +1361,45 @@ TextChangedP After a change was made to the text in the TextChangedT After a change was made to the text in the current buffer in Terminal mode. Otherwise the same as TextChanged. + *TextPutPost* +TextPutPost After text has been put in the current buffer. + The following values in |v:event| are mostly + the same as |TextYankPost|: + operator The operation performed, + either 'p' or 'P'. + regcontents Text that was put. For + |quote_=|, this is the result + of the expression. + regname Name of the register or empty + string for the unnamed + register. + regtype Type of the register, see + |getregtype()|. + visual True if the operation is + performed in |Visual| mode. + Not triggered when |quote_| is used nor when + called recursively. + It is not allowed to change the buffer text, + see |textlock|. + Note that for the |quote_.| register, since + the last inserted text is buffered into the + input buffer (buffer isn't modified directly), + this autocommand is called directly after + |TextPutPre|. + {only when compiled with the +eval feature} + *TextPutPre* +TextPutPre Before text has been put in the current buffer. + Same values as |TextPutPost| in |v:event|. It + is valid to call |setreg()| in this + autocommand, allowing you to process and + modify the text in "regcontents" before it is + put. However this does not apply to |quote_#|, + |quote_=|, |quote_%|, |quote_:|, |quote_/| or |quote_.|. + Not triggered when |quote_| is used nor when + called recursively. + It is not allowed to change the buffer text, + see |textlock|. + {only when compiled with the +eval feature} *TextYankPost* TextYankPost After text has been yanked or deleted in the current buffer. The following values of