是否可以在Sublime REPL选项卡中禁用语法突出显示? [英] Is it possible to disable syntax highlighting in Sublime REPL-tabs?

查看:83
本文介绍了是否可以在Sublime REPL选项卡中禁用语法突出显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在脚本运行时禁用SublimeREPL选项卡中的语法突出显示吗?

请在上下文中查看此问题: SublimeREPL(python)中的字符串后面出现红线了吗?

Please see this question for context: Red lines coming up after strings in SublimeREPL (python)?

例如,当python脚本在Sublime REPL中运行时,输出文本中的撇号(')会突出显示为语法. 因此,该行的最后一部分被突出显示,好像字符串(实际上是文本输出而不是实际的代码)未正确关闭.

For example, when python-scripts run in Sublime REPL, apostrophes (') in the output-text get highlighted as syntax. Because of this, the last part of the line is highlighted as if the string (which in fact is text-output and not actual code) was not closed properly.

这是输出的样子:

当Sublime REPL运行交互式python shell时,突出显示很有用,但是当它只应运行脚本时,我希望得到文本输出而无需突出显示,就像在任何命令行界面中一样. 当然,我可以只在命令行中运行脚本,但是最好将所有工作集中在一个程序上.

The highlighting is useful when Sublime REPL is running the interactive python shell, but when it just should run a script, I would like to get the text output without highlighting, like in any commandline-interface. Of course I could just run the scripts in the commandline, but it would be nice to keep all work focused in just one program.

也许有一些可以改变这种行为的Sublime REPL环境设置(交互式,从脚本运行等)?

Maybe there are settings for the different kinds of Sublime REPL-enveronments (Interactive, run from script, etc.) that could change this behaviour?

感谢您的帮助! :)

推荐答案

转到 Sublime Text>首选项>程序包设置> SublimeREPL>设置-用户

Go to Sublime Text > Preferences > Package Settings > SublimeREPL > Settings - User

(如果您的设置-用户"为空,请首先复制设置-默认"的内容)

(If your 'Settings - User' is empty, first copy in the contents of 'Settings - Default')

在"repl_view_settings"下:添加:

under "repl_view_settings": add:

,
    "syntax": "Packages/Text/Plain text.tmLanguage"

所以我现在是:

// standard sublime view settings that will be overwritten on each repl view
// this has to be customized as a whole dictionary
"repl_view_settings": {
    "translate_tabs_to_spaces": false,
    "auto_indent": false,
    "smart_indent": false,
    "spell_check": false,
    "indent_subsequent_lines": false,
    "detect_indentation": false,
    "auto_complete": true,
    "line_numbers": false,
    "gutter": false,
    "syntax": "Packages/Text/Plain text.tmLanguage"
},

这篇关于是否可以在Sublime REPL选项卡中禁用语法突出显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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