Basically just the title said. The situation is basically I use a Domain-Specific Language called G’MIC, and to this day, I haven’t found a satisfactory answer to the issue of lack of syntax highlighting. At the moment, I am using KDE Kate as it’s pretty good at structuring the code with their find/replace feature, tab indicators, and multi-window support.

  • @[email protected]
    link
    fedilink
    English
    51 year ago

    Take a look at Sublime Text. It has pretty solid syntax support plus all the other things you need (tabs, structure, tab ind, multi windows) and I’m pretty sure can pretty easily have a custom highlight config written easily if you’re already comfortable with code.

    • @[email protected]
      link
      fedilink
      English
      3
      edit-2
      1 year ago

      I can second this. I wrote a syntax highlighter for a DSL in Sublime ages ago and all I remember is that it was easy.

      That said, you can definitely do this in VS Code, too (just I haven’t personally tried it). IMO VS Code is the better editor.

      • @AProfessional
        link
        English
        1
        edit-2
        1 year ago

        VSCode and Sublime use a TextMate-like format and can be converted between the two. I have made language support and recommend VSCode.

  • bsdGuy0
    link
    fedilink
    English
    21 year ago

    I would use VIM, personally. It may take some getting used to, but once you get it, it can be very useful. (VIM does have syntax highlighting, by the way)

  • @[email protected]
    link
    fedilink
    21 year ago

    What is stopping you from creating a syntax highlight file for Kate? I remember it as one of the more comfy formats.

    • @[email protected]OP
      link
      fedilink
      2
      edit-2
      1 year ago

      I actually did that, but it was not satisfactory. And I had hard time making it work like how I want to.

      Maybe I should use a XML editor or something to make it easier. I’ll give it another try (I just found the file again). Maybe from scratch even.

      EDIT: To make it clear, I have hard time getting working.

      • @[email protected]
        link
        fedilink
        11 year ago

        To make it clear, I have hard time getting “contexts” working.

        Are there any particular problems?

        However, if you’re using Windows/have Wine installed and feel that contexts are an overkill, there is Notepad++’ User Defined Languages, which as far as I can tell is purely based on lexemes.

        • @[email protected]OP
          link
          fedilink
          2
          edit-2
          1 year ago

          Getting highlighting for regex-based selection to work. That seems confusing. I have 7 criterias which is recommended for the G’MIC language.

          Note:

          1. Strings that matches #( |$|(#)+).* gets treated as if it was a comment.
          2. Strings that matches #@cli.* are treated as if they’re a header for CLI codes.
          3. Strings that matches \$(-\d+|\w+|\d+) gets treated as if they’re accessed variables.
          4. Strings that matches \w+: are treated as if they’re commands names.
          5. Any texts under control-flow item list gets highlighted as long as they’re outside any characters between 2 quotation marks and of course, taking into account of / being used as escape character.
          6. #@gui gets bolded.
          7. Anything between 2 quotation marks gets highlighted though escape characters would be considered.
            • @[email protected]OP
              link
              fedilink
              2
              edit-2
              1 year ago

              There’s no standard regarding G’MIC scripting. That being said, here’s a representative G’MIC script - https://pastebin.com/cEPW31HJ .

              The first one is basically a example script for testing syntax highlighting. The second one is a real world case study. The second one can be found in https://github.com/GreycLab/gmic-community/blob/master/include/reptorian.gmic .

              I haven’t included some concepts in the example_cli as you can see that reptorian.gmic introduces some concepts not seen in both. Basically, writing a syntax highlighter for G’MIC would be a nightmare. But doable if I can figure things out.

                • @[email protected]OP
                  link
                  fedilink
                  2
                  edit-2
                  1 year ago

                  So far, the most challenging part was highlighting things that counts as comment rather than pointers to image pixels or accessible variables. That’s not the end of my trouble though.

                  I do want to figure out how to highlight “expr” including newlines inside expr. expr is basically any mathematical expression that is utilized on JIT compilation.

                  • if expr
                  • repeat expr
                  • variable={expr}
                  • variable:=expr <- : can be replaced with operator and it will still apply.
                  • eval expr
                  • eval “expr”
                  • check “expr”
                  • fill expr
                  • fill “expr”
                  • eval>expr
                  • eval >“expr”
                  • fill >expr
                  • fill >“expr”
                  • {expr}
                  • for expr
                  • {“expr”}
                  • while expr

                  Along with that to set up regex inside it to highlight section of expr.

                  While still maintaining priority of regex. So, if one regex is more important, it’ll overwrite whatever highlighted.