diff --git a/doc/various.jax b/doc/various.jax index fc46e8a1b..212db3d0b 100644 --- a/doc/various.jax +++ b/doc/various.jax @@ -1,4 +1,4 @@ -*various.txt* For Vim バージョン 9.1. Last change: 2024 Nov 12 +*various.txt* For Vim バージョン 9.1. Last change: 2024 Nov 23 VIM リファレンスマニュアル by Bram Moolenaar @@ -257,6 +257,17 @@ g8 カーソル位置の文字のバイト列を 16 進数で表示します *:!cmd* *:!* :!{cmd} シェルで {cmd} を実行します。'shell' と 'shelltype' も 参照。フィルターコマンドについては、|:range!| を参照。 + + Vim は、オプション 'shell'、'shcf'、'sxq'、'shq' を使 + 用して、次の順序でコマンドラインを構築する: + `&sh &shcf &sxq &shq {cmd} &shq &sxq` + したがって、'sxq' と 'shq' の両方を設定することは可能 + だが、ほとんど役に立たない。`{cmd}` 内の追加のエスケー + プは、'sxe' オプションによるものである可能性もある。 + + また、{cmd} 内のすべての |cmdline-special| 文字は、シェ + ルに渡される前に Vim によって置き換えられる。 + *E34* {cmd} の中の '!' は以前使用した外部プログラムに置 き換えられます ('cpoptions' も参照)。'!' の前にバック @@ -310,7 +321,11 @@ g8 カーソル位置の文字のバイト列を 16 進数で表示します かを出力した場合は CTRL-L や ":redraw!" で再描画できま す。しかし、これは termcap の |t_ti| と |t_te| のエン トリに何が設定されているかに依存します。 - |shell-window|も参照。 + + ヒント: Vim ウィンドウで {cmd} を実行する場合は、 + |:terminal| コマンドを使用する。 + `:term ++shell ++close {cmd}` は、`:!{cmd}` の機能に近 + いものになる。 *:!!* :!! 最後の ":!{cmd}" を繰り返します。 diff --git a/en/various.txt b/en/various.txt index 5f0ad0635..0ebcd0684 100644 --- a/en/various.txt +++ b/en/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 9.1. Last change: 2024 Nov 12 +*various.txt* For Vim version 9.1. Last change: 2024 Nov 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -256,6 +256,17 @@ g8 Print the hex values of the bytes used in the :!{cmd} Execute {cmd} with the shell. See also the 'shell' and 'shelltype' option. For the filter command, see |:range!|. + + Vim builds command line using options 'shell', 'shcf', + 'sxq' and 'shq' in the following order: + `&sh &shcf &sxq &shq {cmd} &shq &sxq` + So setting both 'sxq' and 'shq' is possible but rarely + useful. Additional escaping inside `{cmd}` may also + be due to 'sxe' option. + + Also, all |cmdline-special| characters in {cmd} are + replaced by Vim before passing them to shell. + *E34* Any '!' in {cmd} is replaced with the previous external command (see also 'cpoptions'). But not when @@ -306,7 +317,10 @@ g8 Print the hex values of the bytes used in the CTRL-L or ":redraw!" if the command did display something. However, this depends on what the |t_ti| and |t_te| termcap entries are set to. - Also see |shell-window|. + + Hint: use |:terminal| command if you want to run {cmd} + in Vim window. `:term ++shell ++close {cmd}` could + serve as close approximation to what `:!{cmd}` does. *:!!* :!! Repeat last ":!{cmd}".