Atom 语法高亮指南 [英] Syntax Highlighting Guide for Atom

查看:32
本文介绍了Atom 语法高亮指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Github 的新编辑器非常满意.不幸的是,定制它并不容易.我想创建自己的语法高亮主题,因为我对可供下载的主题不满意(至少它们似乎不适合 Java)

I am very pleased with the new editor by Github. Unfortunately it isn't exactly easy to customize it. I wanted to create my own Syntax Highlighting Theme, because I am not happy with the ones available to download (at least they don't seem to do well with Java)

现在样式的文件(语法变量、color.less 等)似乎在:

Now the files (syntax-variables, color.less, etc.) to style seem to be in:

~/.atom/ .../packages (if you want to change existing themes)

问题只是我不知道哪个 (CSS) 类为语法的哪些元素设置样式.有没有地方可以查找如何更改例如变量类型声明的颜色?

The problem is just that I don't know which (CSS) classes style which elements of the syntax. Is there a place where I can look up how to change the color of for example variable type declarations?

推荐答案

是的,您可以使用命令 atom --dev 或使用菜单 View 在开发人员模式下启动 Atom>开发人员在开发模式下打开....执行此操作后,您可以右键单击 UI 中的任何元素,然后从上下文菜单中选择 Inspect Element,就像在 Web 浏览器中一样.

Yes, you can start Atom in Developer Mode by using the command atom --dev or by using the menu View > Developer > Open in Dev Mode .... When you do that you can right click on any element in the UI and select Inspect Element from the context menu, just like you would in your web browser.

此外,对于语法元素,您可以:

Additionally, for syntax elements you can:

  1. 将文本光标放在要设置样式的项目上
  2. 在OS X上按Cmd+Alt+P,在其他平台上按Ctrl+Alt+Shift+P,或者在命令中找到Editor: Log Cursor Scope"调色板显示语法元素的范围
  1. Put your text cursor on the item you want to style
  2. Press Cmd+Alt+P on OS X, Ctrl+Alt+Shift+P on other platforms, or find "Editor: Log Cursor Scope" in the command palette to display the scopes of the syntax element

语法元素的范围直接转换为 CSS 类.

The scopes of the syntax element translate directly to CSS classes.

这篇关于Atom 语法高亮指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆