Sublime Text 2 中 Jade 的语法高亮显示?
我刚刚开始在 Mac 上使用 Sublime Text 2。我也刚刚开始在 Node.js 中使用 Jade 来表达我的观点,我想知道是否有办法添加语法在 Sublime Text 2 中突出显示 Jade。
I just started using Sublime Text 2 on Mac. I also just started using Jade for my views in Node.js, and am wondering if there is a way to add syntax highlighting for Jade into Sublime Text 2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
如果你安装了 git,这对我来说非常有效:
额外让手写笔语法突出显示工作运行:
If you have git installed, this worked perfectly for me:
Bonus to get stylus syntax highlighting working run:
Sublime Text 2 支持 Textmate 语法定义文件。 https://github.com/miksago/jade-tmbundle 有一个 Jade Textmate 捆绑包。
通过在 Sublime Text“Packages”文件夹中创建一个新文件夹进行安装,调用新文件夹
Jade
,然后curl -O https://raw.github.com/miksago/jade-tmbundle /master/Syntaxes/Jade.tmLanguage
或以其他方式将该文件下载到新文件夹中。编辑器将立即加载语法。Sublime Text 2 supports Textmate syntax definition files. There is a Jade Textmate bundle at https://github.com/miksago/jade-tmbundle.
Install by creating a new folder in your Sublime Text "Packages" folder, call the new folder
Jade
, thencurl -O https://raw.github.com/miksago/jade-tmbundle/master/Syntaxes/Jade.tmLanguage
or otherwise download that file into the new folder. The editor will load the syntax immediately.为什么是的,有!它也使用了一个很好的打包系统:
现在,您可以为 Jade 提供语法高亮显示,并为其他 Sublime 好东西提供一个漂亮的包控制器。 此搜索显示了许多可用于使用 Jade、Jade+Bootstrap、pyjade 等的工具
< strong>编辑 - 安装此软件包后不需要重新启动 Sublime,因此删除了此步骤。
Why yes, there is! And it uses a nice packaging system too:
You now have syntax highlighting for Jade and a nifty package controller for other Sublime goodies. This search shows a lot of available tools for working with Jade, Jade+Bootstrap, pyjade, etc
Edit - Sublime doesn't need to be restarted after installing this package so this step was removed.
@jurka-
~/Library/Application Support/Sublime Text 2/Packages/
~/.Sublime Text 2/Packages/
%APPDATA%/Sublime Text 2/Packages/
克隆到上面显示的 Linux 路径。
@jurka -
~/Library/Application Support/Sublime Text 2/Packages/
~/.Sublime Text 2/Packages/
%APPDATA%/Sublime Text 2/Packages/
Clone into the path shown above for linux.
Jade 也可以通过 Sublime Package Control 获得。
Jade is also available via the Sublime Package Control.
对于 ubuntu 11.10,我的包的正确路径是 ~/.config/sublime-text-2/Packages
您可以使用菜单轻松找到您的包裹位置:“首选项”-> “浏览包...”
For ubuntu 11.10 correct path to packages for me is ~/.config/sublime-text-2/Packages
You can easily find your packages location using Menu: "Preferences" -> "Browse Packages..."
接受的答案是指已弃用且不再有效的插件。
对于那些仍在为 Sublime Text 寻找受支持的 Jade 插件的人,您应该使用此存储库:
https:// github.com/davidrios/jade-tmbundle
这也在 Package Control 上:
https://packagecontrol.io/packages/Jade
The accepted answer refers to a plugin that is deprecated and no longer active.
For those who are still looking for a supported Jade plugin for Sublime Text, you should use this repo:
https://github.com/davidrios/jade-tmbundle
This is also on Package Control:
https://packagecontrol.io/packages/Jade
如果您使用的是 Mac:
转到 Library/Applciation Support/Sublime Text 2/Packages/ 然后,
If you are on Mac:
Go to Library/Applciation Support/Sublime Text 2/Packages/ then,
我在 linux
ST2 build 2221
上做了以下操作:
I've made the following on linux
ST2 build 2221
:Then