Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Custom syntax colouring in BBEdit

Discussion in 'Wish List' started by matthewminer, Aug 10, 2007.

  1. matthewminer

    matthewminer

    Joined:
    Aug 29, 2005
    Posts:
    320
    I use BBEdit (fantastic program, tell your friends) to edit scripts in Unity. It works well, but I would like to have more Unity-esque syntax colouring in addition to the regular JavaScript syntax colouring. Unitron, for example, colours "GameObject" appropriately when you type it. It would be simply smashing to have this occur in BBEdit.

    I'm not sure how easy it is to write custom language syntax colouring schemes for BBEdit, but perhaps some intrepid programmagician knows their way around language modules. I may yet buckle down and write one myself, if there's enough support from other BBEdit users to warrant doing so.
     
  2. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    The simplest solution is to make a 'codeless language module'. This is just an easily editable plist. For example, here are modules I made last year for C# and Shaderlab. To use them, unzip the archive and put the files in ~/Library/Application Support/BBEdit/Language Modules/.

    Unfortunately, codeless language modules only have rudimentary highlighting support (at least for versions of BBEdit prior to 8.5, which is where I stopped updating). You can write your own non-codeless language modules in C to get a little bit more flexibility, but I didn't think it was worth the effort. I just switched to TextMate instead, which allows you to make very flexible language definitions by writing hairy regexes(!).

    Anyway, hopefully the examples above might give you some idea of where to start. :)
     
  3. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    The attached file is a codeless language module for BBEdit that colours Unity JavaScript. I imagine it won't be quite as good as the built-in JS mode (the built-in/coded modes can be pretty clever) but it does colour keywords, scan functions, etc.
     

    Attached Files:

  4. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Heya, Andeeee!

    BBEdit 10 just came out and looks kinda like a good Unitron-replacement.

    Do you (or anyone out there) have an up-to-date version of this very nice and labriously-assembled Unity Javascript BBEdit codeless language module?

    TIA!
     
unityunity