简体   繁体   English

Sublime Javascript 关键字突出显示

[英]Sublime Javascript keyword highlighting

I'm playing with Sublime Text 2 recently and notified some odd Javascript syntax Highlighting:我最近在玩 Sublime Text 2 并通知了一些奇怪的 Javascript 语法突出显示:

(The words with * are hightlighted in turquoise, can't post images yet, sorry :( ) (带 * 的单词用绿松石高亮显示,目前还不能发图片,抱歉 :( )

*var* height = this.parent.*height*();
*var* width = this.parent.*width*();
this.*content*.*height*(height);
this.viewBottom.*width*(width);
this.viewTp.*width*(width);

The highlighting of "content", "height", "width" is a bit strange. “内容”、“高度”、“宽度”的突出显示有点奇怪。 Obviously they are keywords, but it is confusing to mark them with a different color in this case.显然它们是关键字,但在这种情况下用不同的颜色标记它们会令人困惑。

Is there a way to disable or reconfigure keyword highlighting for JavaScript in Sublime Text 2?有没有办法在 Sublime Text 2 中禁用或重新配置 JavaScript 的关键字突出显示?

My first attempt was to search through the JavaScript.tmLanguage file, but I'm new to Sublime and got lost in the xml structure.我的第一次尝试是搜索 JavaScript.tmLanguage 文件,但我是 Sublime 的新手并且迷失在 xml 结构中。

Thanks in advance!提前致谢!

You were looking at the right file to change the highlight, however, it is composed of many regex so you would have quite some trouble to disable highlight for those words and I am guessing you would like to disable it for almost every js property.您正在查看正确的文件来更改高亮显示,但是,它由许多正则表达式组成,因此您将很难为这些单词禁用高亮显示,我猜您想为几乎每个 js 属性禁用它。

You can make sublime to open all .js files as plain text but I think you would just lose a lot so my advice is to get used to it.您可以使用 sublime 以纯文本形式打开所有 .js 文件,但我认为您会损失很多,所以我的建议是习惯它。

In any case to disable javascript hightlighting, click at the bottom right of sublime, there should be a text Javascript (if you have a .js file open), at the menu select "Open all with current extesion files as..." -> Plain Text在任何情况下要禁用 javascript 高亮显示,请单击 sublime 的右下角,应该有一个文本 Javascript(如果您打开了 .js 文件),在菜单中选择“使用当前扩展文件打开所有...” - > 纯文本

Hope it helps you.希望对你有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM