Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问怎么新建一个没包含的语言的tmpl #29

Open
daxinnan opened this issue Sep 6, 2019 · 1 comment
Open

请问怎么新建一个没包含的语言的tmpl #29

daxinnan opened this issue Sep 6, 2019 · 1 comment

Comments

@daxinnan
Copy link

daxinnan commented Sep 6, 2019

我想做一个julia.tmpl,请问我该怎么写这个文件呢?谢谢
我运行在Ubuntu18.04系统上。

@kairyou
Copy link
Owner

kairyou commented Sep 6, 2019

自定义语言 这里有文档

  1. 自定义模板文件:
    路径 "Data\Packages\User\SublimeTmpl\templates" 目录 (Preferences - Browse Packages, User/SublimeTmpl/templates), 新增比如 html5.tmpl.

  2. 新增SublimeTmpl里面没有的语言:
    如果要新增语法, 请选择: SublimeTmpl / Settings - User, 内容格式参考Settings - Default的内容, 比如:

{
    "html5": { // new
        "syntax": "Packages/HTML/HTML.tmLanguage",
        "extension": "html" // default_extension
    },
    "vue": { // new
        "syntax": "Packages/Vue Syntax Highlight/vue.tmLanguage",
        "extension": "vue"
    },
    "c++": { // new
        "syntax": "Packages/C++/C++.tmLanguage",
        "extension": "c++"
    },
    // "disable_keymap_actions": "html, js, python", // "all"
    "enable_project_variables": true, // ${project_base_name}, ${project_path} and ${platform}
    "enable_file_variables_on_save": true, // ${saved_filename}, ${saved_filepath} on save file
	"attr": {
        "author": "Your Name",
        "email": "[email protected]",
        "link": "http://example.org"
    }
}

html5:对应html5.tmpl, syntax是Packages目录内的syntax路径, extension是默认保存时使用的扩展名.

新增开始菜单: SublimeTmpl / Settings - Menu, 参照 Menu - Default.
新增快捷键: SublimeTmpl / Key Bindings User, 参照 Key Bindings Default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants