diff --git a/doc/eval.jax b/doc/eval.jax index 30273c765..3ab802abc 100644 --- a/doc/eval.jax +++ b/doc/eval.jax @@ -1,4 +1,4 @@ -*eval.txt* For Vim バージョン 9.1. Last change: 2025 Aug 20 +*eval.txt* For Vim バージョン 9.1. Last change: 2025 Aug 29 VIMリファレンスマニュアル by Bram Moolenaar @@ -2165,8 +2165,8 @@ v:beval_winid マウスポインタがあるウィンドウのウィンドウID v:char 'formatexpr' を評価しているときの引数。また、短縮入力 |:map-| で を指定しているとき、タイプされた文字を 保持する。 - これは |InsertCharPre|、|InsertEnter| および |KeyInputPre| イ - ベントでも使われる。 + これは |InsertCharPre|、|InsertEnter|、|KeyInputPre|、 + |CmdlineLeave| および |CmdlineLeavePre| イベントでも使われる。 *v:charconvert_from* *charconvert_from-variable* v:charconvert_from @@ -2183,8 +2183,10 @@ v:clipmethod 現在使用されているクリップボードへのアクセス かの値になる: wayland Wayland プロトコルが使用されている。 x11 X11 セレクションが使用されている。 - none 上記の方法は利用できないか、使用できな - い。 + gui GUI固有のメソッドが使用されている。 + other 他のメソッドが使用されています。 + none クリップボード機能が無効または使用でき + ない。 詳細は 'clipmethod' を参照。 *v:cmdarg* *cmdarg-variable* @@ -2783,14 +2785,14 @@ v:t_enumvalue |enumvalue| 型の値。読出し専用。 参照: |type()| *v:t_tuple* *t_tuple-variable* v:t_tuple |Tuple| 型の値。読出し専用。 参照: |type()| - *v:termresponse* *termresponse-variable* + *v:termresponse* *termresponse-variable* v:termresponse termcapのエントリ|t_RV|で端末から返されるエスケープシーケンス。 ESC [ または CSI で始まり、次に '>' または '?' が来て、途中数 字と ';' だけから構成され 'c' で終わるエスケープシーケンスを受 - け取ったとき代入される。このオプションがセットされると自動コマ - ンドイベント TermResponse が発生し、端末からの応答に反応するこ - とができる。また、同様に自動コマンドイベント TermResponseAll - が に "version" がセットされた状態で発生する。 + け取ったとき代入される。この変数がセットされると自動コマンドイ + ベント TermResponse が発生し、端末からの応答に反応することがで + きる。また、同様に自動コマンドイベント TermResponseAllが + に "version" がセットされた状態で発生する。 |terminalprops()| を使うことで Vim が端末をどのように認識した かを知ることができる。 新しいxtermからの応答は次の形式である: @@ -2801,39 +2803,58 @@ v:termresponse termcapのエントリ|t_RV|で端末から返されるエスケ でのみ動作する |xterm-codes|。 {Vimが|+termresponse|機能付きでコンパイルされたときのみ有効} - *v:termblinkresp* + *v:termblinkresp* *termblinkresp-variable* v:termblinkresp termcapのエントリ |t_RC| で端末から返されるエスケープシーケン ス。端末カーソルが点滅しているかを調べるために使用される。 - |term_getcursor()| で使用される。このオプションがセットされて - いるとき、 に "cursorblink" がセットされた状態で自動コ - マンドイベント TermResponseAll が発生する。 + |term_getcursor()| で使用される。この変数がセットされていると + き、 に "cursorblink" がセットされた状態で自動コマンド + イベント TermResponseAll が発生する。 - *v:termstyleresp* + *v:termstyleresp* *termstyleresp-variable* v:termstyleresp termcapのエントリ |t_RS| で端末から返されるエスケープシーケン ス。カーソルの形状を調べるために使用される。|term_getcursor()| - で使用される。このオプションがセットされているとき、 - に "cursorshape" がセットされた状態で自動コマンドイベント + で使用される。この変数がセットされているとき、 に + "cursorshape" がセットされた状態で自動コマンドイベント TermResponseAll が発生する。 - *v:termrbgresp* + *v:termrbgresp* *termrbgresp-variable* v:termrbgresp termcapのエントリ |t_RB| で端末から返されるエスケープシーケン ス。端末の背景色を調べるために使用される。'background' を参照。 このオプションがセットされているとき、 に "background" がセットされた状態で自動コマンドイベント TermResponseAll が発 生する。 + これは通常、Vim に同梱されている + $VIMRUNTIME/plugin/colorresp.vim プラグインによって設定される + が、何をしているのか分かっている場合は手動で設定することもでき + る。 + Note これを変更しても何も起こらないことに注意。 - *v:termrfgresp* + *v:termrfgresp* *termrfgresp-variable* v:termrfgresp termcapのエントリ |t_RF| で端末から返されるエスケープシーケン - ス。端末の文字色を調べるために使用される。このオプションがセッ - トされているとき、 に "foreground" がセットされた状態 - で自動コマンドイベント TermResponseAll が発生する。 + ス。端末の文字色を調べるために使用される。|v:termrbgresp| と同 + じように動作する - *v:termu7resp* + *v:termu7resp* *termu7resp-variable* v:termu7resp termcapのエントリ |t_u7| で端末から返されるエスケープシーケン ス。曖昧な幅の文字に対して端末が何をするか調べるのに使われる。 - 'ambiwidth' を参照。このオプションがセットされているとき、 - に "ambiguouswidth" がセットされた状態で自動コマンド - イベント TermResponseAll が発生する。 + 'ambiwidth' を参照。この変数がセットされているとき、 + に "ambiguouswidth" がセットされた状態で自動コマンドイベント + TermResponseAll が発生する。 + + *v:termda1* *termda1-variable* +v:termda1 端末からのプライマリデバイス属性 (DA1) クエリによって返される + エスケープシーケンス。この変数が設定されている場合、 + に "da1" が設定セットされた状態で TermResponseAll 自動コマンド + イベントが発生する。端末の OSC 52 サポートを検出するために使用 + できる。 + + *v:termosc* *termosc-variable* +v:termosc ターミナルから受信した最新の OSC 応答のエスケープシーケンス。 + この変数が設定されている場合、|TermResponseAll| 自動コマンドイ + ベントが発行され、 が "osc" に設定される。また、 + $VIMRUNTIME/plugin/colorresp.vim プラグイン経由で + |v:termrbgresp| および |v:termrfgresp| を設定する際にも使用さ + れる *v:testing* *testing-variable* v:testing `test_garbagecollect_now()` を使う前に設定する必要がある。 @@ -2902,7 +2923,7 @@ v:vim_did_enter ほとんどのスタートアップが完了するまでの間 v:warningmsg 最後に表示された警告メッセージ。この変数は代入することが許され ている。 - *v:wayland_display* + *v:wayland_display* *wayland_display-variable* v:wayland_display Vim が接続されている Wayland ディスプレイの名前。環境変数 $WAYLAND_DISPLAY に相当する。 @@ -3379,7 +3400,7 @@ text... - |Vim9| script ではエラーになる。 - 旧来のスクリプトでは黙って無視される。 -:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* +:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* :en[dif] {expr1}が非ゼロと評価された場合に、対応する `:else` か `:endif` までの命令を実行する。 短い記述でも動作するが、混乱を避け自動インデントを正し diff --git a/en/eval.txt b/en/eval.txt index 254372db6..efd6218d4 100644 --- a/en/eval.txt +++ b/en/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2025 Aug 20 +*eval.txt* For Vim version 9.1. Last change: 2025 Aug 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -972,8 +972,8 @@ is not available it returns -1 or the default value you specify: > Blob iteration ~ -The |:for| loop executes commands for each byte of a Blob. The loop variable is -set to each byte in the Blob. Example: > +The |:for| loop executes commands for each byte of a Blob. The loop variable +is set to each byte in the Blob. Example: > :for byte in 0z112233 : call Doit(byte) :endfor @@ -1547,9 +1547,9 @@ String. A negative index always results in an empty string (reason: backward compatibility). Use [-1:] to get the last byte or character. In Vim9 script a negative index is used like with a list: count from the end. -If expr10 is a |List| then it results the item at index expr1. See |list-index| -for possible index values. If the index is out of range this results in an -error. Example: > +If expr10 is a |List| then it results the item at index expr1. See +|list-index| for possible index values. If the index is out of range this +results in an error. Example: > :let item = mylist[-1] " get last item Generally, if a |List| index is equal to or higher than the length of the @@ -2227,8 +2227,8 @@ v:beval_winid The |window-ID| of the window, over which the mouse pointer *v:char* *char-variable* v:char Argument for evaluating 'formatexpr' and used for the typed character when using in an abbreviation |:map-|. - It is also used by the |InsertCharPre|, |InsertEnter| and - |KeyInputPre| events. + It is also used by the |InsertCharPre|, |InsertEnter|, + |KeyInputPre|, |CmdlineLeave| and |CmdlineLeavePre| events. *v:charconvert_from* *charconvert_from-variable* v:charconvert_from @@ -2245,8 +2245,10 @@ v:clipmethod The current method of accessing the clipboard that is being used. Can either have the value of: wayland The Wayland protocol is being used. x11 X11 selections are being used. - none The above methods are unavailable or - cannot be used. + gui GUI specific method is being used + other Some other method is being used + none Clipboard functionality is disabled or + unavailable. See 'clipmethod' for more details. *v:cmdarg* *cmdarg-variable* @@ -2315,9 +2317,9 @@ v:colornames A dictionary that maps color names to hex color strings. These It is possible to remove entries from this dictionary but doing so is NOT recommended, because it is disruptive to other scripts. It is also unlikely to achieve the desired - result because the |:colorscheme| and |:highlight| commands will - both automatically load all `colors/lists/default.vim` color - scripts. + result because the |:colorscheme| and |:highlight| commands + will both automatically load all `colors/lists/default.vim` + color scripts. You can make changes to that file, but make sure to add new keys instead of updating existing ones, otherwise Vim will skip @@ -2718,9 +2720,10 @@ v:python3_version should exactly match the Python library up to the minor version (e.g. 3.10.2 and 3.10.3 are compatible as the minor version is "10", whereas 3.9.4 and 3.10.3 are not compatible). - When |python-stable-abi| is used, this will be the minimum Python - version that you can use instead. (e.g. if v:python3_version - indicates 3.9, you can use 3.9, 3.10, or anything above). + When |python-stable-abi| is used, this will be the minimum + Python version that you can use instead. (e.g. if + v:python3_version indicates 3.9, you can use 3.9, 3.10, or + anything above). This number is encoded as a hex number following Python ABI versioning conventions. Do the following to have a @@ -2858,16 +2861,16 @@ v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()| *v:t_tuple* *t_tuple-variable* v:t_tuple Value of |Tuple| type. Read-only. See: |type()| - *v:termresponse* *termresponse-variable* + *v:termresponse* *termresponse-variable* v:termresponse The escape sequence returned by the terminal for the |t_RV| termcap entry. It is set when Vim receives an escape sequence that starts with ESC [ or CSI, then '>' or '?' and ends in a 'c', with only digits and ';' in between. - When this option is set, the TermResponse autocommand event is - fired, so that you can react to the response from the + When this variable is set, the TermResponse autocommand event + is fired, so that you can react to the response from the terminal. The TermResponseAll event is also fired, with - set to "version". You can use |terminalprops()| to see - what Vim figured out about the terminal. + set to "version". You can use |terminalprops()| to + see what Vim figured out about the terminal. The response from a new xterm is: "[> Pp ; Pv ; Pc c". Pp is the terminal type: 0 for vt100 and 1 for vt220. Pv is the patch level (since this was introduced in patch 95, it's @@ -2876,41 +2879,54 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV| codes. This only works with xterm |xterm-codes|. {only when compiled with |+termresponse| feature} - *v:termblinkresp* + *v:termblinkresp* *termblinkresp-variable* v:termblinkresp The escape sequence returned by the terminal for the |t_RC| termcap entry. This is used to find out whether the terminal cursor is blinking. This is used by |term_getcursor()|. When - this option is set, the TermResponseAll autocommand event is + this variable is set, the TermResponseAll autocommand event is fired, with set to "cursorblink". - *v:termstyleresp* + *v:termstyleresp* *termstyleresp-variable* v:termstyleresp The escape sequence returned by the terminal for the |t_RS| termcap entry. This is used to find out what the shape of the cursor is. This is used by |term_getcursor()|. When this - option is set, the TermResponseAll autocommand event is fired, - with set to "cursorshape". + variable is set, the TermResponseAll autocommand event is + fired, with set to "cursorshape". - *v:termrbgresp* + *v:termrbgresp* *termrbgresp-variable* v:termrbgresp The escape sequence returned by the terminal for the |t_RB| termcap entry. This is used to find out what the terminal - background color is; see 'background'. When this option is - set, the TermResponseAll autocommand event is fired, with - set to "background". + background color is; see 'background'. This is set by the + $VIMRUNTIME/plugin/colorresp.vim plugin normally included with + Vim, but can be set manually if you know what you are doing. + Note that changing this will not do anything. - *v:termrfgresp* + *v:termrfgresp* *termrfgresp-variable* v:termrfgresp The escape sequence returned by the terminal for the |t_RF| termcap entry. This is used to find out what the terminal - foreground color is. When this option is set, the - TermResponseAll autocommand event is fired, with set - to "foreground". + foreground color is. Behaves the same as |v:termrbgresp| - *v:termu7resp* + *v:termu7resp* *termu7resp-variable* v:termu7resp The escape sequence returned by the terminal for the |t_u7| termcap entry. This is used to find out what the terminal does with ambiguous width characters, see 'ambiwidth'. When - this option is set, the TermResponseAll autocommand event is + this variable is set, the TermResponseAll autocommand event is fired, with set to "ambiguouswidth". + *v:termda1* *termda1-variable* +v:termda1 The escape sequence returned by a primary device attributes + (DA1) query from the terminal. When this variable is set, the + TermResponseAll autocommand event is fired, with set + to "da1". Can be used to detect OSC 52 support in a terminal. + + *v:termosc* *termosc-variable* +v:termosc The escape sequence of the most recent OSC response received + from the terminal. When this variable is set, the + |TermResponseAll| autocommand event is fired, with + set to "osc". Also used to set the |v:termrbgresp| and + |v:termrfgresp| via the $VIMRUNTIME/plugin/colorresp.vim + plugin + *v:testing* *testing-variable* v:testing Must be set before using `test_garbagecollect_now()`. Also, when set certain error messages won't be shown for 2 @@ -2978,7 +2994,7 @@ v:vim_did_enter Zero until most of startup is done. It is set to one just *v:warningmsg* *warningmsg-variable* v:warningmsg Last given warning message. It's allowed to set this variable. - *v:wayland_display* + *v:wayland_display* *wayland_display-variable* v:wayland_display The name of the Wayland display that Vim is connected to. Equivalent to the $WAYLAND_DISPLAY environment variable. @@ -3340,7 +3356,8 @@ text... One or more items from a |List| can be removed: > :unlet list[3] " remove fourth item :unlet list[3:] " remove fourth item to last -< One item from a |Dictionary| can be removed at a time: > +< One item from a |Dictionary| can be removed at a time: +> :unlet dict['two'] :unlet dict.two < This is especially useful to clean up used global @@ -3471,7 +3488,7 @@ text... - In |Vim9| script an error is given. - In legacy script this is silently ignored. -:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* +:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* :en[dif] Execute the commands until the next matching `:else` or `:endif` if {expr1} evaluates to non-zero. Although the short forms work, it is recommended to @@ -3809,8 +3826,9 @@ text... message in the |message-history|. When used in a script or function the line number will be added. Spaces are placed between the arguments as with the - `:echomsg` command. When used inside a try conditional, - the message is raised as an error exception instead + `:echomsg` command. When used inside a try + conditional, the message is raised as an error + exception instead (see |try-echoerr|). Example: > :echoerr "This script just failed!" @@ -5156,8 +5174,8 @@ to execute the given executable. For security reasons users may not want to have Vim execute random executables or may have forbidden to do so for specific filetypes by setting the "_exec" variable (|plugin_exec|). -It returns |true| or |false| to indicate whether the plugin should run the given -executable. It takes the following arguments: +It returns |true| or |false| to indicate whether the plugin should run the +given executable. It takes the following arguments: argument type ~