模拟代码Pen twilight 主题 [英] Emulate codePen twilight theme

查看:30
本文介绍了模拟代码Pen twilight 主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使 sublime 文本看起来像

(图片中的文字是 JavaScript.)

我想把紫色下划线的字改成紫色,把黄色改成黄色.词的关键字(作用域名称)是什么?

解决方案

示例中带黄色下划线的项目是类名(JavaScript(和大多数语言)中变量名的特例.

我不认为 JS 中存在类名的语法范围.似乎它们的范围是简单的变量.假设我是对的,您将需要定义自己的语法范围,可能将其称为className"或类似名称.定义特征似乎是前导大写字母后跟小写字母.

然后您需要在配色方案中引用该新名称并将其设为黄色 (#FFF000) http://htmlcolorcodes.com/.

紫色也是如此,您可能拥有成员或属性或任何可通过点表示法访问的内容(基于您的示例).同样,我认为您需要将自己的语法定义添加到要使用它的语言的语法定义文件中.正则表达式似乎是点 (.) 结尾后的任何字母数字在下一个点找到.名称可能是dotValue"或类似名称.然后,您需要将该新语法添加到颜色主题中,使 'dotValue's 变成紫色 (#9700FF).

在您开始进行任何需要通过反复试验达到您想要的目标之前,请确保您已备份处于已知良好状态的语法和颜色主题,以便您能够回到在任何时候都处于安全状态,您可能会出轨.

I'm trying to make sublime text to look like codepen.io twilight theme. I was able to copy it besides for some categories. I don't know what the name of the scope is. Here's an image with the different words I want to change.

(The text from the image is JavaScript.)

I want to change the purple underlined words to purple, and yellow to yellow. What are the keywords (scope names) for the words?

解决方案

The yellow underlined items in your example are class names (a special case of variable name in JavaScript (and most languages).

I don't believe a syntax scope exists in JS for class names. It seems they are scoped as simple variables. Assuming I am right you are going to need to define your own syntax scope, perhaps calling it 'className' or similar. The defining characteristic seems to be a leading Uppercase followed by a lowercase.

Then you'll need to reference that new name in the color scheme and make it yellow (#FFF000) http://htmlcolorcodes.com/.

The same goes for the purple where you might have a member or a property or anything accessible through dot notation (based on your example). Again I think you are going to need to add your own syntax definition to the syntactic definition file for the languages you want to use it in. The regex seems to be any alphanumerics following a dot (.) ending at the next dot found. The name might be 'dotValue' or similar. Then you'll need to add that new syntax to the color theme to make 'dotValue's purple (#9700FF).

Before you start doing any of the playing about required to get where you want to be by trial and error make very sure you have backups of the syntax and color themes in a known good state so you are able to get back to a safe state at any point you might go off the rails.

这篇关于模拟代码Pen twilight 主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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