首页 > 技术文章 > 一.sublime配置 sublime 新建文档 默认html

non-clockwork-cheng 2017-02-10 20:32 原文

stackoverflow上的答案,所以有英文,顺手翻译了一部分. 

点击Tools -> New Plugin  打开这个

Then paste this over the file, hit save and call it "DefaultLanguage.py" or something

赋值如下代码

import sublime, sublime_plugin
class EverythingIsPowerShell(sublime_plugin.EventListener):
def on_new(self, view):
view.set_syntax_file('Packages/PowerShell/Support/PowershellSyntax.tmLanguage')

 

 

Of course, you can change the language from PowerShell to ... whatever you prefer. You just need the relative path to the tmLanguage. You can get that by opening a file in your favorite language and then open the console (View->Show Console) and type:

在console中用如下命令查看路径
view.settings().get('syntax')

直接把得到的结果覆盖掉 引号中的所有内容,不需要保留tmlLanguage,别忘了新建一个选项卡,设置想要的语言。
html:
Packages/HTML/HTML.sublime-syntax

推荐阅读