Is it possible to disable syntax highlighting in Sublime REPL-tabs?

前提是你 提交于 2020-01-11 04:39:07

问题


Is there any way to disable the syntax highlighting in SublimeREPL-tabs when a script is running?

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

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.

This is what the output looks like:

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.

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

Thanks for any help! :)


回答1:


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

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

under "repl_view_settings": add:

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

so mine is now:

// 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"
},



回答2:


As @joe.dawley wrote in the comments to the original question there is a way to manually disable syntax highlighting in SublimeREPL by using the go to anything-command (Ctrl + Shift + P) and enter "sspl" to set the syntax to plain text.



来源:https://stackoverflow.com/questions/27692051/is-it-possible-to-disable-syntax-highlighting-in-sublime-repl-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!