Skip to content

Instantly share code, notes, and snippets.

@mmichelli
Created July 3, 2011 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmichelli/1062600 to your computer and use it in GitHub Desktop.
Save mmichelli/1062600 to your computer and use it in GitHub Desktop.
silverstripe-mode
(define-derived-mode silverstripe-mode html-mode "Silverstripe"
(font-lock-add-keywords
nil
'(
("\\(<% \\| %>\\)" 1 font-lock-keyword-face)
("\\(\\(if\\|else\\|control\\|cacheblock\\|Level\\|end_[a-zA-Z1-9_\.]*\\|include\\)+\\)\\>" 1 font-lock-function-name-face)
("\\(.\\(Title\\|NexPageLink\\|Link\\|RelativeLink\\|ChildrenOf\\|Page\\|Level\\|Menu\\|Section2\\|LoginForm\\|SilverStripeNavigator\\|PageComments\\|Now\\|LinkTo\\|AbsoluteLink\\|CurrentMember\\|PastVisitor\\|PastMember\\|XML_val\\|RAW_val\\|SQL_val\\|JS_val\\|ATT_val\\|First\\|Last\\|FirstLast\\|MiddleString\\|Middle\\|Even\\|Odd\\|EvenOdd\\|Pos\\|TotalItems\\|BaseHref\\|Debug\\|CurrentPage\\|Top\\)+\\)\\>" 1 font-lock-constant-face)
("\\(.\\(ID\\|ClassName\\|Created\\|LastEdited\\|URLSegment\\|Title\\|MenuTitle\\|Content\\|MetaTitle\\|MetaDescription\\|MetaKeywords\\|ShowInMenus\\|ShowInSearch\\|HomepageForDomain\\|ProvideComments\\|Sort\\|LegacyURL\\|HasBrokenFile\\|HasBrokenLink\\|Status\\|ReportClass\\|ParentID\\|Version\\|EmailTo\\|EmailOnSubmit\\|SubmitButtonText\\|OnCompleteMessage\\|Subscribe\\|AllNewsletters\\|Subject\\|ErrorCode\\|LinkedPageID\\|RedirectionType\\|ExternalURL\\|LinkToID\\|VersionID\\|CopyContentFromID\\|RecordClassName\\)+\\)\\>" 1 font-lock-constant-face)
("\\(.\\(Link\\|LinkOrCurrent\\|LinkOrSection\\|LinkingMode\\|ElementName\\|InSection\\|Comments\\|Breadcrumbs\\|NestedTitle\\|MetaTags\\|ContentSource\\|MultipleParents\\|TreeTitle\\|CMSTreeClasses\\|Now\\|LinkTo\\|AbsoluteLink\\|CurrentMember\\|PastVisitor\\|PastMember\\|XML_val\\|RAW_val\\|SQL_val\\|JS_val\\|ATT_val\\|First\\|Last\\|FirstLast\\|MiddleString\\|Middle\\|Even\\|Odd\\|EvenOdd\\|Pos\\|TotalItems\\|BaseHref\\|CurrentPage\\|Top\\)+\\)\\>" 1 font-lock-constant-face)
("\\($[a-zA-Z1-9_\.]*\\)" 1 font-lock-type-face))
)
(font-lock-mode 1)
)
(setq auto-mode-alist (cons '( "\\.ss\\'" . silverstripe-mode ) auto-mode-alist ))
(provide 'silverstripe-mode)
@mmichelli
Copy link
Author

<% end_control %> breaks the tab-indent.

@SpiritLevel
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment