search
HomeDevelopment ToolsatomIf you configure a small program file in Atom, let the code be highlighted!
If you configure a small program file in Atom, let the code be highlighted!Jun 10, 2021 am 11:07 AM
atomcode highlightingWeChat applet

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.

If you configure a small program file in Atom, let the code be highlighted!

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

If you configure a small program file in Atom, let the code be highlighted!

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 file

Configuration completed! Reopen the files with the

.wxml, .wxss, wxs suffix, and you will see the colored codes.

Principle

In fact, Atom does not recognize the

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:

Introduction to Programming

! !

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!

Statement
This article is reproduced at:掘金社区. If there is any infringement, please contact admin@php.cn delete
微信小程序架构原理基础详解微信小程序架构原理基础详解Oct 11, 2022 pm 02:13 PM

本篇文章给大家带来了关于微信小程序的相关问题,其中主要介绍了关于基础架构原理的相关内容,其中包括了宿主环境、执行环境、小程序整体架构、运行机制、更新机制、数据通信机制等等内容,下面一起来看一下,希望对大家有帮助。

微信小程序云服务配置详解微信小程序云服务配置详解May 27, 2022 am 11:53 AM

本篇文章给大家带来了关于微信小程序的相关知识,其中主要介绍了关于云服务的配置详解,包括了创建使用云开发项目、搭建云环境、测试云服务等等内容,下面一起来看一下,希望对大家有帮助。

微信小程序常用API(总结分享)微信小程序常用API(总结分享)Dec 01, 2022 pm 04:08 PM

本篇文章给大家带来了关于微信小程序的相关知识,其中主要总结了一些常用的API,下面一起来看一下,希望对大家有帮助。

atom中 40+ 个常用插件推荐分享(附插件安装方法)atom中 40+ 个常用插件推荐分享(附插件安装方法)Dec 20, 2021 pm 04:14 PM

本篇文章给大家分享40+ 个atom常用插件,并附上在atom中安装插件的方法,希望对大家有所帮助!

浅析微信小程序中自定义组件的方法浅析微信小程序中自定义组件的方法Mar 25, 2022 am 11:33 AM

微信小程序中怎么自定义组件?下面本篇文章给大家介绍一下微信小程序中自定义组件的方法,希望对大家有所帮助!

微信小程序实战项目之富文本编辑器实现微信小程序实战项目之富文本编辑器实现Oct 08, 2022 pm 05:51 PM

本篇文章给大家带来了关于微信小程序的相关知识,其中主要介绍了关于富文本编辑器的实战示例,包括了创建发布页面、实现基本布局、实现编辑区操作栏的功能等内容,下面一起来看一下,希望对大家有帮助。

西安坐地铁用什么小程序西安坐地铁用什么小程序Nov 17, 2022 am 11:37 AM

西安坐地铁用的小程序为“乘车码”。使用方法:1、打开手机微信客户端,点击“发现”中的“小程序”;2、在搜索栏中输入“乘车码”进行搜索;3、直接定位城市西安,或者搜索西安,点击“西安地铁乘车码”选项的“去乘车”按钮;4、根据腾讯官方提示进行授权,开通“乘车码”业务即可利用该小程序提供的二维码来支付乘车了。

英特尔推出 Amston Lake 系列凌动 Atom 处理器,面向边缘和网络市场英特尔推出 Amston Lake 系列凌动 Atom 处理器,面向边缘和网络市场Apr 09, 2024 pm 09:22 PM

本站4月9日消息,英特尔今日在嵌入式展(EmbeddedWorld)2024上发布了AmstonLake系列凌动Atom处理器。AmstonLake处理器基于Intel7制程,支持单通道内存,可视为AlderLake-N处理器的一种分支变体,包含面向边缘的凌动x7000RE系列和面向网络的x7000C系列。本站2023年报道过至多四核的ADL-N架构凌动x7000E处理器,而如今的x7000RE系列进一步扩展了规格:其最高可选8核的凌动x7835RE,该处理器和四核心的x7433RE均搭载32E

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SecLists

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.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment