├── .gitignore ├── README.md ├── Syntaxes └── Homebrew Formula.tmLanguage └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Homebrew-formula-syntax 2 | ======================= 3 | 4 | Sublime Text 2 and 3 Syntax for Homebrew formulae (supporting the embedded diff) 5 | 6 | Homebrew (http://brew.sh) formulae support inlined diffs after an 7 | `__END__` keyword. Now, this Syntax desccription you see here, named 8 | "Homebrew Formula.tmLanguage", merges `source.ruby` with `source.diff` and 9 | if you have a [decent color theme](https://github.com/samueljohn/decent) that knows how to highlight diffs, it will make Homebrew formulae more beautiful. 10 | 11 | Ruby (.rb) files beginning with `require 'formula'` are automatically 12 | detected. 13 | 14 | This tmLanguange here is simple enough - I wrote it directly in xml. 15 | 16 | ![Screenshot](./screenshot.png) 17 | 18 | ### Note 19 | - Updates to either source.ruby or source.diff are automatically 20 | used by this Syntax, too, because they are just included. 21 | - I copy/pasted (start|stop)foldingStopMarker from 22 | Ruby.tmLanguage. 23 | 24 | ### Todo 25 | - Nothing. Do you have an idea? Let me know! 26 | 27 | ### Author 28 | - Samuel John (www.SamuelJohn.de) 29 | https://github.com/samueljohn/Homebrew-formula-syntax 30 | 31 | ### License: 32 | Public Domain. I don't care. Have fun. 33 | -------------------------------------------------------------------------------- /Syntaxes/Homebrew Formula.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | comment 6 | 7 | Homebrew (http://brew.sh) formulae support inlined diffs after an 8 | __END__ keyword. Now, this Syntax desccription you see here, named 9 | "Homebrew Formula.tmLanguage", merges `source.ruby` with `source.diff` and 10 | if you have a decent color theme, it will highlight changes in the diff 11 | and the __END__ as a keyword. 12 | 13 | Ruby (.rb) files beginning with `require 'formula'` are automatically 14 | detected. 15 | 16 | This tmLanguange here is simple enough, I wrote it directly in xml. 17 | 18 | Note: 19 | - Updates to either source.ruby or source.diff are automatically 20 | used by this Syntax, too, because they are just included. 21 | - I copy/pasted (start|stop)foldingStopMarker from 22 | Ruby.tmLanguage. 23 | 24 | Todo: 25 | - Nothing. Do you have an idea? Let me know! 26 | 27 | Author: Samuel John (www.SamuelJohn.de) 28 | License: Public Domain. I don't care. Have fun. 29 | 30 | fileTypes 31 | 32 | rb 33 | 34 | firstLineMatch 35 | ^(#.*\n)*require ['"]formula['""].*$ 36 | name 37 | Homebrew Formula (Ruby file) 38 | patterns 39 | 40 | 41 | begin 42 | ^(__END__)\n(.*\n)* 43 | name 44 | source.ruby.homebrew.patch 45 | captures 46 | 47 | 1 48 | 49 | name 50 | keyword.other 51 | 52 | 53 | patterns 54 | 55 | 56 | include 57 | source.diff 58 | 59 | 60 | end 61 | \n^$ 62 | 63 | 64 | include 65 | source.ruby 66 | 67 | 68 | scopeName 69 | source.ruby.homebrew 70 | uuid 71 | 8EBEA374-AB74-0815-BEEF-1244461A3666 72 | 73 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samueljohn/Homebrew-formula-syntax/bd9aaf482d0db0daac2becbe8e7b5765baac612c/screenshot.png --------------------------------------------------------------------------------