From 4fdc7bcb394b43edb2cad8523309f4cbea2d8f1b Mon Sep 17 00:00:00 2001 From: "Leon.Xu" Date: Wed, 29 Jun 2016 09:26:59 +0800 Subject: [PATCH] + more syntaxes; fix: missing file extension while saving file(sublime.version > 3086) --- SublimeTmpl.sublime-settings | 95 ++++++++++++++++++++++++++++++------ sublime-tmpl.py | 1 + 2 files changed, 82 insertions(+), 14 deletions(-) diff --git a/SublimeTmpl.sublime-settings b/SublimeTmpl.sublime-settings index dc1a317..7ccbd8f 100644 --- a/SublimeTmpl.sublime-settings +++ b/SublimeTmpl.sublime-settings @@ -1,41 +1,108 @@ { "html": { - "syntax": "Packages/HTML/HTML.tmLanguage" - // ,"extension": "html" # default_extension + "syntax": "Packages/HTML/HTML.tmLanguage", + "extension": "html" // default_extension }, "js": { - "syntax": "Packages/JavaScript/JavaScript.tmLanguage" + "syntax": "Packages/JavaScript/JavaScript.tmLanguage", + "extension": "js" }, "css": { - "syntax": "Packages/CSS/CSS.tmLanguage" + "syntax": "Packages/CSS/CSS.tmLanguage", + "extension": "css" }, "xml": { - "syntax": "Packages/XML/XML.tmLanguage" + "syntax": "Packages/XML/XML.tmLanguage", + "extension": "xml" }, "php": { - "syntax": "Packages/PHP/PHP.tmLanguage" - // ,"extension": "php" + "syntax": "Packages/PHP/PHP.tmLanguage", + "extension": "php" }, "java": { - "syntax": "Packages/Java/Java.tmLanguage" + "syntax": "Packages/Java/Java.tmLanguage", + "extension": "java" }, "ruby": { - "syntax": "Packages/Ruby/Ruby.tmLanguage" + "syntax": "Packages/Ruby/Ruby.tmLanguage", + "extension": "rb" }, "python": { - "syntax": "Packages/Python/Python.tmLanguage" + "syntax": "Packages/Python/Python.tmLanguage", + "extension": "py" }, "objective-c": { - "syntax": "Packages/Objective-C/Objective-C.tmLanguage" + "syntax": "Packages/Objective-C/Objective-C.tmLanguage", + "extension": "m" }, "c++": { - "syntax": "Packages/C++/C++.tmLanguage" + "syntax": "Packages/C++/C++.tmLanguage", + "extension": "cpp" }, "C#": { - "syntax": "Packages/C#/C#.tmLanguage" + "syntax": "Packages/C#/C#.tmLanguage", + "extension": "cs" }, "Perl": { - "syntax": "Packages/Perl/Perl.tmLanguage" + "syntax": "Packages/Perl/Perl.tmLanguage", + "extension": "pl" + }, + "sass": { + "syntax": "Packages/SCSS/SCSS.tmLanguage", + // "syntax": "Packages/Sass/Syntaxes/Sass.tmLanguage", + "extension": "scss" + }, + "go": { + "syntax": "Packages/Go/Go.tmLanguage", + "extension": "go" + }, + "groovy": { + "syntax": "Packages/Groovy/Groovy.tmLanguage", + "extension": "groovy" + }, + "erlang": { + "syntax": "Packages/Erlang/Erlang.tmLanguage", + "extension": "erl" + }, + "jade": { + "syntax": "Packages/Jade/Syntaxes/Jade.tmLanguage", + "extension": "jade" + }, + "less": { + "syntax": "Packages/LESS/LESS.tmLanguage", + "extension": "less" + }, + "lisp": { + "syntax": "Packages/Lisp/Lisp.tmLanguage", + "extension": "lisp" + }, + "lua": { + "syntax": "Packages/Lua/Lua.tmLanguage", + "extension": "lua" + }, + "make": { + "syntax": "Packages/Makefile/Makefile.tmLanguage", + "extension": "make" + }, + "rust": { + "syntax": "Packages/Rust/Rust.tmLanguage", + "extension": "rs" + }, + "scala": { + "syntax": "Packages/Scala/Scala.tmLanguage", + "extension": "scala" + }, + "shellscript": { + "syntax": "Packages/ShellScript/Shell-Unix-Generic.tmLanguage", + "extension": "sh" + }, + "sql": { + "syntax": "Packages/SQL/SQL.tmLanguage", + "extension": "sql" + }, + "yaml": { + "syntax": "Packages/YAML/YAML.tmLanguage", + "extension": "yaml" }, "disable_keymap_actions": false, // "all"; "html,css" "date_format" : "%Y-%m-%d %H:%M:%S", diff --git a/sublime-tmpl.py b/sublime-tmpl.py index edc9aa6..8c7c500 100644 --- a/sublime-tmpl.py +++ b/sublime-tmpl.py @@ -43,6 +43,7 @@ def run(self, edit, type='html'): self.tab = self.creat_tab(view) self.set_syntax(opts) + # sublime.set_timeout(lambda: self.set_syntax(opts), 1000) self.set_code(tmpl) def get_settings(self, type=None):