11

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: enter image description here

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! :)

Community
  • 1
  • 1
Samuel Plumppu
  • 325
  • 2
  • 13
  • @Chrismas007 I added the most important example. – Samuel Plumppu Dec 29 '14 at 16:19
  • 1
    @Chrismas007 it's fine to link to other SO questions if they provide context. – MattDMo Dec 29 '14 at 19:11
  • @MattDMo and yet it got the OP to add an edit with a picture making this independent question more complete. – Chrismas007 Dec 29 '14 at 19:18
  • @Chrismas007 the picture was **from** the other question. Regardless, intra-SO links are fine, and in fact are [encouraged](http://stackoverflow.com/help/how-to-ask). *Even if you don't find a useful answer elsewhere on the site, including links to related questions that haven't helped can help others in understanding how your question is different from the rest.* – MattDMo Dec 29 '14 at 19:37
  • 1
    Doesn't appear to be a setting to ignore syntax highlighting by default... but you could always do it manually in the REPL tab, click in the REPL tab type Ctrl + Shift + p then sspl hit enter. Doubt that helps but its the best I can see. – joe.dawley Mar 16 '15 at 17:17
  • 1
    @joe.dawley Thanks! I've used that command to change syntax highlighting many times before but i didn't know about the plain text option. It's exactly what I needed! :) – Samuel Plumppu Mar 25 '15 at 09:51

2 Answers2

9

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"
},
Aqueum
  • 106
  • 1
  • 6
0

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.

Samuel Plumppu
  • 325
  • 2
  • 13