Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special color-markup for angular-templates in sublime text?

I'm looking for a syntax-markup for angularJS. Stuff like:

  • Special coloring of double curlybraces {{mytag}}
  • Special coloring of any attribute starting with ng-...

I already tried this package. It has html(angular) syntax, but it doesn't seem to do anything.

like image 756
Himmators Avatar asked Sep 16 '13 09:09

Himmators


1 Answers

I've tweaked HTML.tmlanguage file bit to do something like that.

HTML(angularjs).tmLanguage

you can download the file from my SublimeText2-Userfiles repo on GitHub

Here is how to use it:

  • Copy the file to your user folder and then while you've an angular.js template file open, click on the Syntax option in bottom right corner of sublime text status bar. select User>HTML (Angular.js)

  • You should also update you color scheme to add color highlighting for angular specific scopes. you can checkout my personal color-scheme on the same repo here. I think all you need is something like this.

            <dict>
                    <key>name</key>
                    <string>Angular</string>
                    <key>scope</key>
                    <string>entity.other.attribute-name.angular.html, source.angular.embedded.html</string>
                    <key>settings</key>
                    <dict>
                            <key>foreground</key>
                            <string>#FF3A83</string>
                    </dict>
            </dict>
    

Remember it's just a dirty hack to make my personal workflow easier. I would appreciate if you contribute and make it better. It needs a lot of improvements but it's almost all that you wanted.

like image 85
Allen Bargi Avatar answered Oct 13 '22 01:10

Allen Bargi