How do I edit HTML.tmLanguage in sublime on mac osx

梦想的初衷 提交于 2019-12-19 21:45:25

问题


I'm to change it to support non-quote id, as in:

<div id=someId></div>

I found this http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8129

But am having issues finding where to edit the tmLanguage file


回答1:


Don't listen to Jamie's answer. You should never be editing the Pristine packages. Instead, you can find all of Sublime Text's packages and grammar files in ~/Library/Application Support/Sublime Text/Packages or, from within Sublime Text, go to Sublime Text > Preferences > Browse Packages. However, if you edit HTML.tmLanguage from within the HTML folder, your changes will be overridden when Sublime Text is updated. To prevent this, duplicate the HTML folder and renaming it to Better HTML. Then in your User Settings (Preferences > Settings - User) add the following:

"ignored_packages":
[
    "HTML",
    "Vintage"
],

By ignoring the default HTML package, Sublime Text will be forced to use your version of the HTML.tmLanguage file and your changes will be preserved.




回答2:


You can find the HTML.tmLanguage file by going to /Applications and then control/right click on Sublime Text 2.app and select 'Show Package Contents'. Then navigate to /Contents/Mac OS/Pristine Packages/.

Inside that folder, you should see a collection of sublime-package files. Find HTML.sublime-package and rename it to HTML.zip. You should then be able to extract the archive, just like any other zip folder, and inside you should find all assests related to Sublime's HTML package - including the HTML.tmlanguage.

Make sure to recompress and then rename the folder back to .sublime-package after making your edits!

EDIT: I have since recognised that this is incorrect, the Pristine Packages should never be edited. Follow BoundinCode's answer instead!



来源:https://stackoverflow.com/questions/11779823/how-do-i-edit-html-tmlanguage-in-sublime-on-mac-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!