Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion doc/repeat.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*repeat.txt* For Vim バージョン 9.2. Last change: 2026 May 31
*repeat.txt* For Vim バージョン 9.2. Last change: 2026 Sep 12


VIM リファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -231,6 +231,37 @@ Vim script の書き方はユーザーマニュアルの41章|usr_41.txt|を参
れるが、2 つの行指定子の範囲が使用された場合のみであ
る。

*:source-dryrun*
:so[urce] ++dryrun {file}
:[range]so[urce] ++dryrun
スクリプトを実行せずに読み込む。つまり、何かを定義する
部分のみが実行され、その中のすべての |:def| 関数がコン
パイルされた上で、通常通りエラーが報告される。
実行されるもの: `vim9script`、`import`、`def`、
`function`、`class`、`interface`、`enum`、`type`、およ
び `var`、`const`、`final` を使用した宣言。宣言された
変数は、宣言に基づく型 (型指定がない場合は `any` 型)
とゼロ値が割り当てられ、式は評価されない。クラスの静的
変数も同様に扱われ、enum の値は生成されない。
それ以外の部分はすべてスキップされる。これには
`finish` や `if`、`while`、`for` の条件式も含まれる。
一方、そのようなブロック内にある定義は、条件が成立する
かどうかにかかわらず実行される。したがって、関数が二重
に定義されることもあり得るが、その場合は最後の定義が有
効となる。
インポートされるスクリプトも同様に読み込まれるが、オー
トロードスクリプトは読み込まれない。ま
た、|SourceCmd|、|SourcePre|、|SourcePost| のいずれの
自動コマンドも発生しない。
オートロードスクリプト内のクラスや enum は、それらから
オブジェクトが生成されていない場合、ドライランによって
再定義され、その後に通常の読み込みによっても再定義され
る。|vim9-reload| を参照。
Note: 定義にエラーがあっても読み込みは停止せず、スクリ
プトの残りの部分も読み込まれる。また、関数内の行にエ
ラーがあってもコンパイルは停止せず、エラーのあるすべて
の行が報告される。

*:source!*
:so[urce]! {file} Vimコマンドを{file}から読み込む。ノーマルモードでファ
イルの内容をあなたがタイプしたのと同じように実行される。
Expand Down
33 changes: 32 additions & 1 deletion en/repeat.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 9.2. Last change: 2026 May 31
*repeat.txt* For Vim version 9.2. Last change: 2026 Sep 12


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -239,6 +239,37 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
will be adjusted to the start and end of the fold,
but only if a two line specifiers range was used.

*:source-dryrun*
:so[urce] ++dryrun {file}
:[range]so[urce] ++dryrun
Read the script without running it: only what
defines something is executed, then every |:def|
function in it is compiled and the errors are reported
as usual.
What is executed: `vim9script`, `import`, `def`,
`function`, `class`, `interface`, `enum`, `type` and a
declaration with `var`, `const` or `final`. The
declared variable gets the type from the declaration,
or "any" when there is none, and a zero value; the
expression is not evaluated. A static class variable
is treated the same way and an enum value is not
created.
Everything else is skipped, also `finish` and the
condition of an `if`, `while` or `for`; a definition
inside such a block is executed whether the condition
holds or not. A function may therefore be defined
twice, the last definition counts.
A script that is imported is read the same way, but an
autoload script is not loaded. No |SourceCmd|,
|SourcePre| or |SourcePost| autocommand is triggered.
A class or enum in an autoload script is defined again
by a dry run, and after one by a normal load, since no
object was made from it; see |vim9-reload|.
Note: An error in a definition does not stop the
reading, the rest of the script is read as well. And
an error in a line of a function does not stop
compiling it, every line with an error is reported.

*:source!*
:so[urce]! {file} Read Vim commands from {file}. These are commands
that are executed from Normal mode, like you type
Expand Down