From b4b054ebf56caf4ac8d721b125e368d9b45b8551 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 6 Dec 2015 11:58:09 +0100 Subject: Add objc syntax highlighting, closes #77 --- after/syntax/objc.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 after/syntax/objc.vim (limited to 'after/syntax') diff --git a/after/syntax/objc.vim b/after/syntax/objc.vim new file mode 100644 index 00000000..7e64248d --- /dev/null +++ b/after/syntax/objc.vim @@ -0,0 +1,23 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1 + +" ARC type modifiers +syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained + +" Block modifiers +syn keyword objcTypeModifier __block + +" Remote messaging modifiers +syn keyword objcTypeModifier byref + +" Property keywords - these are only highlighted inside '@property (...)' +syn keyword objcPropertyAttribute contained getter setter readwrite readonly strong weak copy assign retain nonatomic +syn match objcProperty display "^\s*@property\>\s*([^)]*)" contains=objcPropertyAttribute + +" The @property directive must be defined after objcProperty or it won't be +" highlighted +syn match objcDirective "@property\|@synthesize\|@dynamic\|@package" + +" Highlight property attributes as if they were type modifiers +hi def link objcPropertyAttribute objcTypeModifier + +endif -- cgit v1.2.3