magiblot/turbo

Toggle Syntax Highlighting

amay5267 opened this issue · 7 comments

Hi @magiblot
How to Toggle Syntax Highlighting?
Personally I would like to be able to toggle syntax highlighting on/off for C/CPP.

Hi @amay5267!

There is currently no way to select the syntax highlighting or disable it manually, but it gets automatically enabled in these cases:

  • When opening a file with C/C++ extension.
  • When saving a file with C/C++ extension.

So, for example, if you open a new editor with Ctrl+N, you can enable syntax highlighting by saving the file with a .cpp/.cc/.h/etc. extension. Or, if you want to create a source code file from the command line, and you run turbo newSourceFile.cc, you will get an editor with syntax highlighting even though the file newSourceFile.cc does not exist yet.

I don't know if this is enough for what you are trying to do.

Hi @magiblot
How to switch syntax off manually in source code for C/CPP?
I like how it behaves in C# source code case e.g. newSourceFile.cs - no syntax color you see.
How to do the same as C# but for pure C source code ?

How to not automatically enable syntax highlighting in newSourceFile.c and newSourceFile.cc files?

It is not automatically enabled in C# source code e.g. newSourceFile.cs

Okay, now I understand you. There's currently no way to do this; C# source files do not get syntax highlighting because it is not supported yet.

I can implement this.

Perfect! As a temporary workaround I write C source code but save it with .cs extension. Than I rename the file with Turbo and with .c extension

I am not sure if you are familiar with Vim.
If you do vim HelloWorld.c, vim opens HelloWorld.c with syntax on. Now if you are in vim and write :syntax off - magic happens.
I want the same magic in Turbo.