Open Gerst20051 opened 2 years ago
Are those tmLanguage files not for the xml plist format? This syntax is generally used in Sublime Text for that: https://github.com/SublimeText/PackageDev/blob/69a906404fdb9401bb192078cb81759206c45a83/Package/Property%20List/Property%20List.sublime-syntax
That text you provided doesn't look like any plist I have ever seen. Some kinda json hybrid? :) yeah, from the wiki page you linked, I'm guessing its NSJSONSerialization.
Thanks @keith-hall for pointing out NSJSONSerialization
! I think that's a great search term to use!
I'll keep searching but I did find this file that builds the output for that:
That text you provided doesn't look like any plist I have ever seen.
This is the original property list format used by NeXTSTEP, which was the Unix-like OS that became the foundation of Mac OS/X (i.e., Darwin). Apple switched to an XML-based format for their .plist
files though, a decision I wish I could kick them for.
You'll see the original plist format referred to variously as "old-style property lists", "ASCII property lists", or "OpenStep property lists" (the latter used on GitHub). Some programs and APIs in macOS (most notably defaults
) still read or emit data formatted in the OG property list format.
If you want syntax highlighting, I have good news: TextMate's own plist grammar has excellent highlighting support. But you'll need to support other TextMate-compatible grammar files in order to make use of it. 😛
Some kinda json hybrid?
It's actually older than JSON, and also a much nicer format to read and write. 😁
Syntax Highlighting For The Output From
defaults read
[$]> defaults read com.googlecode.iterm2
https://en.wikipedia.org/wiki/Property_list
I believe this has already been implemented in some other tools! They appear to be using the same file.
Textmate
https://github.com/textmate/property-list.tmbundle/blob/textmate-1.x/Syntaxes/Property%20List.tmLanguage
Sublime
https://github.com/tyrone-sudeium/st3-binaryplist/blob/master/Property_List.tmLanguage
Delta Issue https://github.com/dandavison/delta/issues/1132