Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the Mini Program file to highlight the code in Atom

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to configure Mini Program files in Atom to highlight the code. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

Mini Program-related file suffixes are .wxml, .wxss, .wxs, but 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, .wxss as .css, and .wxs as .js. In this way, you will see the color code when you open these types of files.

Step 1: open the config.cson configuration file

At the same time, press the shortcut key Command + Shift + P to evoke the command panel, enter Application: Open Your Config, and click enter, which will open the file config.cson.

2. Modify config.cson configuration file

Add under core

CustomFileTypes: 'text.html.basic': [' wxml'] 'source.css': [' wxss'] 'source.js': [' wxs']

General structure of the document

"*": core: customFileTypes: 'text.html.basic': [' wxml'] 'source.css': [' wxss'] 'source.js': [' wxs']

There may be many other properties in this file, because some plug-ins automatically add configuration to this file

Configuration complete! Reopen the file with the .wxml, .wxss, wxs suffix and you will see the color code.

Principle

In fact, Atom does not recognize wxml files as html files, but uses the same syntax rules as html files to highlight the code in wxml files. Text.html.basic, source.css, and source.js are the corresponding syntax rule names, which can be found in Atom built-in or third-party Package such as language-xxx.

The above is all the contents of the article "how to configure Mini Program files in Atom to make the code highlight". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report