Sublimetext 3 & AngularJS - syntax highlighting (HTML)

Is there any syntax highlighting for angularjs html templates?

Example

ng-click="someVariable"

I want someVariable to be highlighted differently than other lines between ""or at least I want to highlight ng-someDirective.

+4
source share
2 answers

I highly recommend using this package:

https://github.com/angular-ui/AngularJS-sublime-package

It gives you autocomplete and more.

About syntax highlighting, I have mine:

What I've done Regarding syntax highlighting, you should change the html syntax parser.

( /opt/sublime_text/Packages).

Color Scheme - Default.sublime-package ( ZIP), Monokai.tmTheme( , ).

, <string>Tag attribute</string>, dict:

<dict>
  <key>name</key>
  <string>Tag ng attribute</string>
  <key>scope</key>
  <string>entity.other.attribute-name.ng</string>
  <key>settings</key>
  <dict>
    <key>fontStyle</key>
    <string>bold</string>
    <key>foreground</key>
    <string>#FF6600</string>
  </dict>
</dict>

"ZIP", .

2:

, HTML.tmLanguage, HTML.sublime-package.

:

    <key>tag-generic-attribute</key>
<dict>
    ...
</dict>

:

<key>tag-ng-attribute</key>
<dict>
    <key>match</key>
    <string>\b(ng-[a-zA-Z\-:]+)</string>
    <key>name</key>
    <string>entity.other.attribute-name.ng.html</string>
</dict>

, , sublime- voilá, , , . p >

, . : https://groups.google.com/forum/#!topic/angular/qCGSZ6a6KVA

,

+4

3 HTML.sublime-:

197 "tag-id-attribute"

tag-ng-attribute:
- match: \b(ng-[a-zA-Z\-:]+)
  captures:
    1: entity.other.attribute-name.ng.html
    2: punctuation.separator.key-value.html

, .

"- include: tag-id-attribute" :

- include: tag-ng-attribute
+1

All Articles