如何在adobe-brackets编辑器中添加文件扩展名? [英] how to add file extension in adobe-brackets editor ?
问题描述
我在Web项目中使用扩展名为 .html.eco 的文件,并且尝试在Adobe Brackets中进行编辑,但是我无法指定将其视为HTML文件以提供编辑html文件的典型功能(例如颜色支持,语法等)。
I am using files with .html.eco extension in my web project and I am trying to edit in Adobe Brackets but I can't specify that it should treat this as HTML file, to provide the typical features of editing html file (like color support, grammar, etc.).
事实上,我注意到在更改 languages.json文件时这是可能的,但是我使用的是二进制版本,而不是从源代码构建的。
In fact I noticed that this is possible when changing languages.json file, however I am using the binary version and I didn't build from source.
https://github.com/adobe/brackets/blob/master/src/language/languages.json
有帮助吗?
推荐答案
更新:现在,这要容易得多要做:
Update: this is now much easier to do:
- 打开.html.eco文件
- 在状态栏中(下方-右),单击显示文本的下拉列表
- 选择 HTML选项
- 再次打开下拉列表,然后选择设置为默认值 op
- Open the .html.eco file
- In the status bar (lower-right), click the dropdown that says "Text"
- Select the "HTML" option
- Open the dropdown again and select the "Set as Default" option at the top
原始答案:
有一个积压的项目,以使其易于配置(请赞成!),但与此同时,您可以通过编写一个非常简单的Brackets扩展程序来做到这一点:
There's a backlog item for making this easily configurable (please upvote!), but in the meantime you can do it by writing a very simple Brackets extension:
define(function (require, exports, module) {
var LanguageManager = brackets.getModule("language/LanguageManager");
var language = LanguageManager.getLanguage("html");
language.addFileExtension("html.eco");
});
- 将此代码放在名为main.js的文件中
- 在括号中,转到帮助>显示扩展文件夹
- 在
用户
下创建一个新文件夹,然后放置其中的main.js文件 - 重新启动括号
- Put this code in a file named main.js
- In Brackets, go to Help > Show Extensions Folder
- Create a new folder under
user
, and place the main.js file inside it - Restart Brackets
这是有关编写括号扩展名的更多信息(如果您感到好奇的话)。
Here's more info on writing Brackets extensions, if you're curious.
这篇关于如何在adobe-brackets编辑器中添加文件扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!