summaryrefslogtreecommitdiffstats
path: root/after/syntax/objc.vim
diff options
context:
space:
mode:
Diffstat (limited to 'after/syntax/objc.vim')
-rw-r--r--after/syntax/objc.vim23
1 files changed, 23 insertions, 0 deletions
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