Community
    • Login

    How to: {{Moustache}} code highlighting for Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 5.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sam ZamS
      Sam Zam
      last edited by Sam Zam

      Hi folks!

      I have some .php files with Moustache {{}} code in them, and would like the code to be “highlighted correctly” by Notepad++.

      At the moment all is black and unrecognised!

      What steps must I undertake to enable Moustache{{ }} code highliting?

      Please do a step by step as i’m not a seasoned programmer, just content writer who happens to have fall in love with Notepad++ ;)

      Thanks!

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Sam Zam
        last edited by

        @Sam-Zam

        npp uses scintilla as its syntax highlighting engine.
        In order to make this work, the php (and maybe the html ) lexer needs to be changed.
        I found a discussion from 2012 and the author of scintilla
        refused to implement this.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Sam ZamS
          Sam Zam
          last edited by Sam Zam

          Dear Claudia

          Thank you for your answer. Does that mean that it is not possible let alone easy to have {{moustache}} syntax working in Notepad++?

          Greetings, Sam

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Sam Zam
            last edited by

            @Sam-Zam

            Does that mean that it is not possible let alone easy to have {{moustache}} syntax working in Notepad++?

            Yes, the only save way to make this happen is to change the lexer.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Gogo NeatzaG
              Gogo Neatza
              last edited by

              RegEx Helper as a plugin can offer some help (assuming that RegEx Helper is already installed):

              Open your file in Notepad++
              Set the language to Php
              Launch the plugin using Ctrl+F12
              Type in the “Regular Expression” window: ({{)|(}})
              Turn on the highlighting using ‘Mark’ button.

              Tested using this Moustache template:
              <strong>Hello, {{firstname}}</strong><br>
              <p>You are visitor number {{visitorNumber}}.</p>

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors