Home > Development Tools > sublime > body text

How to enter parameters in sublime

下次还敢
Release: 2024-04-03 06:15:18
Original
798 people have browsed it

Sublime 中输入参数的方法

在 Sublime 中输入参数主要有两种方法:

一、通过命令行参数

  1. 打开终端窗口。
  2. 导航到 Sublime Text 安装目录。
  3. 运行以下命令,其中 text.txt 是您要打开的文件路径,-a 用于指定要打开的文件类型:
<code>subl text.txt -a txt</code>
Copy after login

二、通过项目设置

  1. 打开 Sublime Text。
  2. 选择 "Project" 菜单 > "Project Options"。
  3. 在 "Settings - User" 文件中添加以下 JSON 代码:
<code class="json">{
  "cmd_line_args": ["-a", "txt", "text.txt"]
}</code>
Copy after login
  1. 其中 -a 指定要打开的文件类型,txt 是文件类型,text.txt 是文件路径。

注意:

  • 您还可以在命令行中传递多个参数:
<code>subl file1.txt -a type1 file2.txt -a type2</code>
Copy after login
  • 您可以在项目设置中覆盖命令行参数:
<code class="json">{
  "cmd_line_args": ["-a", "custom_type1", "custom_file1.txt"],
  "project_settings": {
    "file1.txt": {
      "cmd_line_args": ["-a", "custom_type2"]
    }
  }
}</code>
Copy after login

The above is the detailed content of How to enter parameters in sublime. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template