Sublime Text 构建系统变量

Sublime Text Build Systems variables

Sublime Text 构建系统的 docs 状态:

you can use some variables in build systems too, as we have done above with $file, which expands to the active buffer’s filename.

除了 $file 之外还有更多变量吗?如果有,我可以从哪里了解它们?

它们在 reference section 之下。以下是当前支持的变量列表:

$file_path - The directory of the current file, e.g., C:\Files.

$file - The full path to the current file, e.g., C:\Files\Chapter1.txt.

$file_name - The name portion of the current file, e.g., Chapter1.txt.

$file_extension - The extension portion of the current file, e.g., txt.

$file_base_name - The name-only portion of the current file, e.g., Document.

$packages - The full path to the Packages folder.

$project - The full path to the current project file.

$project_path - The directory of the current project file.

$project_name - The name portion of the current project file.

$project_extension - The extension portion of the current project file.

$project_base_name - The name-only portion of the current project file.