如何在Atom的colorscheme中选择包含确定字符串的所有内容?(How to select everything that contains a determined string in At

编程入门 行业动态 更新时间:2024-10-24 08:20:23
如何在Atom的colorscheme中选择包含确定字符串的所有内容?(How to select everything that contains a determined string in Atom's colorscheme?)

现在,在我的自定义方案中,如果我写"SELECT * FROM table" ,我有以下颜色:

橙色:“,表 蓝色:SELECT,FROM 粉红色:*

那是因为我使用橙色表示字符串和标点符号,蓝色表示关键字,粉红色表示操作符。

使用开发人员工具挖掘我发现当一个字符串实际上是一个SQL查询时,它在CSS链中的某个点上有sql字。 例如,上面的句子是:

<span class="string quoted double single-line sql python"> <span class="punctuation definition string begin python">"</span> <span class="keyword other DML sql">SELECT</span> <span class="keyword operator star sql">*</span> <span class="keyword other DML sql">FROM</span> table<span class="punctuation definition string end python"> </span> </span>

所以我的问题是,是否可以编写一些规则,以便我可以将橙色应用于包含单词sql ? 我对改变整体关键字和运算符颜色不感兴趣,仅针对SQL查询。

像$.*sql* { color: @orange; } $.*sql* { color: @orange; } ,但显然这不起作用。

Right now, in my custom scheme, if I write "SELECT * FROM table", I have the following colors:

orange: ", table blue: SELECT, FROM pink: *

That's because I'm using orange for strings and punctuation marks, blue for keywords and pink for operators.

Digging with the developer tools I found that when a string is actually a SQL query, it has the sql word at some point in the CSS chain. For instance, the above sentence is:

<span class="string quoted double single-line sql python"> <span class="punctuation definition string begin python">"</span> <span class="keyword other DML sql">SELECT</span> <span class="keyword operator star sql">*</span> <span class="keyword other DML sql">FROM</span> table<span class="punctuation definition string end python"> </span> </span>

So my question is, is it possible to write some rule so that I could apply orange to everything that contains the word sql? I'm not interested in changing the overall keywords and operators colors, just for the SQL queries.

Something like $.*sql* { color: @orange; }, but obviously this doesn't work.

最满意答案

用这个

.sql{ color: orange; }

它将使用类sql为所有元素提供橙色

use this

.sql{ color: orange; }

it will give orange color to all elements with class sql

更多推荐

本文发布于:2023-07-07 21:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068544.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   所有内容   如何在   Atom   string

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!