Skip to content
Merged
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
44 changes: 1 addition & 43 deletions 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 Oct 03
*repeat.txt* For Vim バージョン 9.2. Last change: 2026 Oct 13


VIM リファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -235,48 +235,6 @@ 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` の条件式も含まれる。
一方、そのようなブロック内にある定義は、条件が成立する
かどうかにかかわらず実行される。したがって、関数が二重
に定義されることもあり得るが、その場合は最後の定義が有
効となる。

旧来のスクリプトでは `let` が実行されないため、それに
よって作成されるはずのスクリプト変数は存在しない。
|:def| 関数からは "s:" を付けてその変数を使用できるが、
"s:" を付けずに読み出したり呼び出したりするとエラーに
なる。また、`function s:obj.Method()` のように、その変
数が保持する辞書内で関数を定義しようとしても失敗する。

インポートされるスクリプトも同様に読み込まれるが、オー
トロードスクリプトは読み込まれない。また、
|SourceCmd|、|SourcePre|、|SourcePost| のいずれの自動
コマンドも発生しない。
オートロードスクリプト内のクラスや enum は、それらから
オブジェクトが生成されていない場合、ドライランによって
再定義され、その後に通常の読み込みによっても再定義され
る。|vim9-reload| を参照。

Note: 定義にエラーがあっても読み込みは停止せず、スクリ
プトの残りの部分も読み込まれる。また、関数内の行にエ
ラーがあってもコンパイルは停止せず、エラーのあるすべて
の行が報告される。

*:source!*
:so[urce]! {file} Vimコマンドを{file}から読み込む。ノーマルモードでファ
イルの内容をあなたがタイプしたのと同じように実行される。
Expand Down
43 changes: 1 addition & 42 deletions 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 Oct 03
*repeat.txt* For Vim version 9.2. Last change: 2026 Oct 13


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -242,47 +242,6 @@ 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.

In a legacy script `let` is not executed, thus a
script variable created by it does not exist. A
|:def| function can use it with "s:", but reading it
or calling it without "s:" gives an error. Defining a
function in a Dictionary it holds, such as
`function s:obj.Method()`, fails as well.

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
Loading