CSS 如何在 Notepad++ 中为 Less 添加语法高亮?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4913834/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:39:57  来源:igfitidea点击:

How do you add syntax highlighting for Less in Notepad++?

cssnotepad++highlightless

提问by Mattias Alfborger

I want Notepad++ to treat my .lessfiles just as my .cssfiles and thereby get syntax highlighting for any .lessfiles I open.

我希望 Notepad++ 将我的.less文件视为我的.css文件,从而为.less我打开的任何文件突出显示语法。

回答by kapex

To get LESS syntax highlighting, you have to download and import a user defined languagefile. Here are some links to language files:

要获得 LESS 语法突出显示,您必须下载并导入用户定义的语言文件。以下是一些语言文件的链接:

Installation instructions from the GitHub repository:

来自GitHub 存储库的安装说明:

  • Download the less.xmlfile
  • Open Notepad++
  • Go to Language -> Define your language..., click on Import...and select the less.xmlfile you've downloaded
  • Close and restart Notepad++
  • Done
  • 下载less.xml文件
  • 打开记事本++
  • 转到Language -> Define your language...,单击Import...并选择less.xml您下载的文件
  • 关闭并重新启动记事本++
  • 完毕

Another way to install language files is to copy them into a file in the Notepad++ installation directory.

另一种安装语言文件的方法是将它们复制到 Notepad++ 安装目录中的一个文件中

回答by Fred K

Download from this pagethe XML file of the language to add (such as Less)

从此页面下载要添加的语言的 XML 文件(例如Less

In Notepad++ open Languagemenu > Define your language...and Importthe file

在记事本++中打开Language菜单>Define your language...Import文件