1. graphviz:
我把graphviz文件扩展名定为.gv,sublime不能识别。我就下载了插件:syntaxManager,参考https://packagecontrol.io/packages/Syntax%20Manager。
然后在Preference->syntaxManager中:
{ "syntaxmgr_settings": [ { // platforms, can be osx, windows or linux "platforms": ["linux", "windows"], "settings": { "font_size" : 14 } }, { // apply this setting when first line matches // be careful that it is not a list but a string "first_line_match": "#!/.*?/sh", "settings": { // the syntax can be identified by running // // view.settings().get("syntax") // // at sublime console (ctrl + ` ) // "syntax" : "Packages/ShellScript/Shell-Unix-Generic.tmLanguage" } }, { // the scope of the document can be obtained by pressing // cmd+alt+p (mac) or ctrl+alt+shift+p (linux / windows) // for c and python files "scopes": ["source.c", "source.python"], "settings": { "trim_trailing_white_space_on_save_scope" : true, "auto_match_enabled" : true } }, { // all text files "scopes": ["text"], "settings": { "spell_check": true, "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme" } }, { // use latex syntex for these extensions // make sure the syntax is applied first and then the settings "extensions": ["ltx", "latex", "l"], "settings": { "syntax": "Packages/LaTeX/LaTeX.tmLanguage" } }, { // for all text files, excluding latex files "scopes": ["text"], "scopes_excluded": ["text.tex"], "settings": { "spell_check": false } } ] }
其中增加一段 :
//"first_line_match": ["digraph", "graph"],
"extensions": ["gv", "dot"],
"settings": {
// the syntax can be identified by running
//
// view.settings().get("syntax")
//
// at sublime console (ctrl + ` )
//
"syntax" : "Packages/Graphviz/DOT.tmLanguage"
}
"first_line_match": ["digraph*", "graph*"]”不起作用。
因为first_line_match的语法不清楚,所以只能用extensions。
时间: 2024-10-13 15:56:41