This article will introduce to you AtomHow to configure code highlighting for WeChat applet files. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
The file extensions related to the mini program are .wxml
, .wxss
, .wxs
, However, the Atom editor does not automatically recognize these types of files by default. When you open these files, you can only see anti-human black and white code.
An elegant solution is to modify the configuration of Atom so that Atom treats .wxml
as .html
and .wxss
as .css
, treat .wxs
as .js
. In this way, you will see colored codes when opening these types of files. [Related recommendations: "atom tutorial"]
Configuration file
Command
Shift
P to invoke the command panel, enter
Application: Open Your Config , click
Enter key, the file
config.cson
Configuration file
customFileTypes: 'text.html.basic': [ 'wxml' ] 'source.css': [ 'wxss' ] 'source.js': [ 'wxs' ]
below
core The approximate structure of the file "*": core: customFileTypes: 'text.html.basic': [ 'wxml' ] 'source.css': [ 'wxss' ] 'source.js': [ 'wxs' ]
This There may be many other attributes in the file, because some plug-ins will automatically add configurations to this fileConfiguration completed! Reopen the files with the
.wxml,
.wxss,
wxs suffix, and you will see the colored codes.
wxml file as a
html file, but uses and ## Use the same syntax rules as #html
files to highlight code in wxml
files. text.html.basic
, source.css
, source.js
are the corresponding grammar rule names. These names can be found in language-xxx
Such Atom built-in or found in third-party Packages. For more programming-related knowledge, please visit:
The above is the detailed content of If you configure a small program file in Atom, let the code be highlighted!. For more information, please follow other related articles on the PHP Chinese website!