weekeight.github.io
weekeight.github.io copied to clipboard
atom 支持微信小程序开发环境
在使用 atom 作为微信小程序开发 IDE 时,由于微信小程序的模板文件拓展名为 .wxml 和样式文件名为 .wxss,使得 atom 无法识别语法做代码高亮,更不能使用 emmet 插件进行补全。
- 支持语法高亮
// 在 config.cson 里 `core` 配置下添加 `customFileTypes` 配置即可支持 .wxml 和 .wxss 的语法高亮
core:
customFileTypes:
'text.html.mustache': [
'wxml'
]
'source.css': [
'wxss'
]
- emmet tab 快捷键支持
.wxml补全
// emmet 要先识别当前文件的语法格式才能做自动拓展,故必须先完成上面步骤让 atom 能识别 wxml 语法才行
// 在 keymap.cson 中添加如下配置即可
'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
参考链接:
http://flight-manual.atom.io/using-atom/sections/basic-customization/#customizing-language-recognition
十分感谢你的笔记
十分感谢