


If you configure a small program file in Atom, let the code be highlighted!
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"]
Operation steps
##1. Open config.cson Configuration file
Press the shortcut keys Command
Shift
P to invoke the command panel, enter
Application: Open Your Config , click
Enter key, the file
config.cson
will open. 2. Modifyconfig.cson Configuration file
Add 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.
Principle
In fact, Atom does not recognize thewxml 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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
