configs  Artifact [4bf4193e3c]

Artifact 4bf4193e3cc35dbdb80c097c1d57fa1c7ff116f001307c081cec84d734bce637:

  • File vim/after/syntax/objc.vim — part of check-in [e78b6a8cac] at 2015-04-12 15:39:15 on branch trunk — objc.vim: Add of_stat_t and of_socket_t (user: js size: 2239)

" Author:       Michael Sanders (msanders42 [at] gmail [dot] com)
"		Some modifications by Jonathan Schleifer <js@webkeks.org>
" Description:  Better syntax highlighting for Objective-C files (part of the
"               cocoa.vim plugin).
" Last Updated: May 6, 2011
"
" Put to ~/.vim/after/syntax/objc.vim

syn match objcDirective '@synthesize\|@property\|@optional\|@required\|@autoreleasepool' display
syn keyword objcType IBOutlet IBAction Method __block instancetype
syn keyword objcType __unsafe_unretained __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak
syn keyword objcType of_unichar_t of_char16_t of_char32_t of_comparison_result_t
syn keyword objcType of_byte_order_t of_range_t of_point_t of_dimension_t
syn keyword objcType of_rectangle_t of_string_encoding_t of_time_interval_t
syn keyword objcType of_resolver_result_t of_udp_socket_address_t of_offset_t
syn keyword objcType of_stat_t of_socket_t
syn keyword objcConstant YES NO TRUE FALSE

syn region objcImp start='@implementation' end='@end' transparent
syn region objcHeader start='@interface' end='@end' transparent

syn match objcSubclass '\(@implementation\|@interface\)\@<=\s*\k\+' display contained containedin=objcImp,objcHeader
syn match objcSuperclass '\(@\(implementation\|interface\)\s*\k\+\s*:\)\@<=\s*\k*' display contained containedin=objcImp,objcHeader

" Matches "bar" in "[NSObject bar]" or "bar" in "[[NSObject foo: baz] bar]",
" but NOT "bar" in "[NSObject foo: bar]".
syn match objcMessageName '\(\[\s*\k\+\s\+\|\]\s*\)\@<=\k*\s*\]'me=e-1 display contained containedin=objcMessage
" Matches "foo:" in "[NSObject foo: bar]" or "[[NSObject new] foo: bar]"
syn match objcMessageColon '\(\_\S\+\_\s\+\)\@<=\k\+\s*:' display contained containedin=objcMessage
" Matches "foo:" in above
syn match objcMessageArg ')\@<=\s*\k\+' contained containedin=objcMessage

" Don't match these in this strange group for edge cases...
syn cluster cMultiGroup add=objcMessageColon,objcMessageName

hi link objcMessageArg Identifier

hi link objcMessageName objcMessageArg
hi link objcMessageColon objcMessageName
hi link objcMessageReceiver Special

hi link objcSubclass objcMethodName
hi link objcSuperclass String

hi link objcError Error