blob: 1f61e50b8d675131286a3115d1c5ccb0428c4754 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaarec7944a2013-06-12 21:29:15 +02002" Language: Objective-C
3" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
Bram Moolenaar52b91d82013-06-15 21:39:51 +02004" Last Change: 2013 Jun 13
Bram Moolenaarec7944a2013-06-12 21:29:15 +02005" Remark: Modern Objective-C Edition
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaarec7944a2013-06-12 21:29:15 +02007""" Preparation for loading ObjC stuff
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
Bram Moolenaarec7944a2013-06-12 21:29:15 +020011if &filetype != 'objcpp'
12 syn clear
13 runtime! syntax/c.vim
14endif
15let s:cpo_save = &cpo
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020016set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000017
Bram Moolenaarec7944a2013-06-12 21:29:15 +020018""" ObjC proper stuff follows...
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
Bram Moolenaarec7944a2013-06-12 21:29:15 +020020syn keyword objcPreProcMacro __OBJC__ __OBJC2__ __clang__
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
Bram Moolenaarec7944a2013-06-12 21:29:15 +020022" Defined Types
Bram Moolenaar52b91d82013-06-15 21:39:51 +020023syn keyword objcPrincipalType id Class SEL IMP BOOL instancetype
Bram Moolenaarec7944a2013-06-12 21:29:15 +020024syn keyword objcUsefulTerm nil Nil NO YES
Bram Moolenaar071d4272004-06-13 20:20:40 +000025
Bram Moolenaarec7944a2013-06-12 21:29:15 +020026" Preprocessor Directives
27syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
28syn match objcImported display contained "<[^>]*>"
29syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
Bram Moolenaarec7944a2013-06-12 21:29:15 +020031" ObjC Compiler Directives
32syn match objcObjDef display /@interface\>\|@implementation\>\|@end\>\|@class\>/
33syn match objcProtocol display /@protocol\>\|@optional\>\|@required\>/
34syn match objcProperty display /@property\>\|@synthesize\>\|@dynamic\>/
35syn match objcIvarScope display /@private\>\|@protected\>\|@public\>/
36syn match objcInternalRep display /@selector\>\|@encode\>/
37syn match objcException display /@try\>\|@throw\>\|@catch\|@finally\>/
38syn match objcThread display /@synchronized\>/
39syn match objcPool display /@autoreleasepool\>/
Bram Moolenaar52b91d82013-06-15 21:39:51 +020040syn match objcModuleImport display /@import\>/
Bram Moolenaar071d4272004-06-13 20:20:40 +000041
Bram Moolenaarec7944a2013-06-12 21:29:15 +020042" ObjC Constant Strings
43syn match objcSpecial display contained "%@"
Bram Moolenaar071d4272004-06-13 20:20:40 +000044syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial
45
Bram Moolenaarec7944a2013-06-12 21:29:15 +020046" ObjC Hidden Arguments
47syn keyword objcHiddenArgument self _cmd super
48
49" ObjC Type Qualifiers for Blocks
50syn keyword objcBlocksQualifier __block
51" ObjC Type Qualifiers for Object Lifetime
52syn keyword objcObjectLifetimeQualifier __strong __weak __unsafe_unretained __autoreleasing
53" ObjC Type Qualifiers for Toll-Free Bridge
54syn keyword objcTollFreeBridgeQualifier __bridge __bridge_retained __bridge_transfer
55
56" ObjC Type Qualifiers for Remote Messaging
57syn match objcRemoteMessagingQualifier display contained /\((\s*oneway\s\+\|(\s*in\s\+\|(\s*out\s\+\|(\s*inout\s\+\|(\s*bycopy\s\+\(in\(out\)\?\|out\)\?\|(\s*byref\s\+\(in\(out\)\?\|out\)\?\)/hs=s+1
58
59" shorthand
60syn cluster objcTypeQualifier contains=objcBlocksQualifier,objcObjectLifetimeQualifier,objcTollFreeBridgeQualifier,objcRemoteMessagingQualifier
61
62" ObjC Fast Enumeration
63syn match objcFastEnumKeyword display /\sin\(\s\|$\)/
64
65" ObjC Literal Syntax
66syn match objcLiteralSyntaxNumber display /@\(YES\>\|NO\>\|\d\|-\|+\)/ contains=cNumber,cFloat,cOctal
67syn match objcLiteralSyntaxSpecialChar display /@'/ contains=cSpecialCharacter
68syn match objcLiteralSyntaxChar display /@'[^\\]'/
69syn match objcLiteralSyntaxOp display /@\((\|\[\|{\)/me=e-1,he=e-1
70
71" ObjC Declared Property Attributes
72syn match objDeclPropAccessorNameAssign display /\s*=\s*/ contained
73syn region objcDeclPropAccessorName display start=/\(getter\|setter\)/ end=/\h\w*/ contains=objDeclPropAccessorNameAssign
74syn keyword objcDeclPropAccessorType readonly readwrite contained
75syn keyword objcDeclPropAssignSemantics assign retain copy contained
76syn keyword objcDeclPropAtomicity nonatomic contained
77syn keyword objcDeclPropARC strong weak contained
78syn region objcDeclProp display transparent keepend start=/@property\s*(/ end=/)/ contains=objcProperty,objcDeclPropAccessorName,objcDeclPropAccessorType,objcDeclPropAssignSemantics,objcDeclPropAtomicity,objcDeclPropARC
79
80" To distinguish colons in methods and dictionaries from those in C's labels.
81syn match objcColon display /^\s*\h\w*\s*\:\(\s\|.\)/me=e-1,he=e-1
82
83" To distinguish a protocol list from system header files
84syn match objcProtocolList display /<\h\w*\(\s*,\s*\h\w*\)*>/ contains=objcPrincipalType,cType,Type
85
86" shorthand
87syn cluster objcCEntities contains=cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,cStatement,cLabel,cConditional,cRepeat
Bram Moolenaar52b91d82013-06-15 21:39:51 +020088syn cluster objcObjCEntities contains=objcHiddenArgument,objcPrincipalType,objcString,objcUsefulTerm,objcProtocol,objcInternalRep,objcException,objcThread,objcPool,objcModuleImport,@objcTypeQualifier,objcLiteralSyntaxNumber,objcLiteralSyntaxOp,objcLiteralSyntaxChar,objcLiteralSyntaxSpecialChar,objcProtocolList,objcColon,objcFastEnumKeyword,objcType,objcClass,objcMacro,objcEnum,objcEnumValue,objcExceptionValue,objcNotificationValue,objcConstVar,objcPreProcMacro
Bram Moolenaarec7944a2013-06-12 21:29:15 +020089
Bram Moolenaar071d4272004-06-13 20:20:40 +000090" Objective-C Message Expressions
Bram Moolenaarec7944a2013-06-12 21:29:15 +020091syn region objcMethodCall start=/\[/ end=/\]/ contains=objcMethodCall,objcBlocks,@objcObjCEntities,@objcCEntities
Bram Moolenaar071d4272004-06-13 20:20:40 +000092
Bram Moolenaarec7944a2013-06-12 21:29:15 +020093" To distinguish class method and instance method
94syn match objcInstanceMethod display /^s*-\s*/
95syn match objcClassMethod display /^s*+\s*/
Bram Moolenaar071d4272004-06-13 20:20:40 +000096
Bram Moolenaarec7944a2013-06-12 21:29:15 +020097" ObjC Blocks
98syn region objcBlocks start=/\(\^\s*([^)]\+)\s*{\|\^\s*{\)/ end=/}/ contains=objcBlocks,objcMethodCall,@objcObjCEntities,@objcCEntities
Bram Moolenaar071d4272004-06-13 20:20:40 +000099
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200100syn cluster cParenGroup add=objcMethodCall
101syn cluster cPreProcGroup add=objcMethodCall
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200103""" Foundation Framework
104syn match objcClass /Protocol\s*\*/me=s+8,he=s+8
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200106"""""""""""""""""
107" NSObjCRuntime.h
108syn keyword objcType NSInteger NSUInteger NSComparator
109syn keyword objcEnum NSComparisonResult
110syn keyword objcEnumValue NSOrderedAscending NSOrderedSame NSOrderedDescending
111syn keyword objcEnum NSEnumerationOptions
112syn keyword objcEnumValue NSEnumerationConcurrent NSEnumerationReverse
113syn keyword objcEnum NSSortOptions
114syn keyword objcEnumValue NSSortConcurrent NSSortStable
115syn keyword objcEnumValue NSNotFound
116syn keyword objcMacro NSIntegerMax NSIntegerMin NSUIntegerMax
117" NSRange.h
118syn keyword objcType NSRange NSRangePointer
119" NSGeometry.h
120syn keyword objcType NSPoint NSPointPointer NSPointArray NSSize NSSizePointer NSSizeArray NSRect NSRectPointer NSRectArray
121syn keyword objcEnum NSRectEdge
122syn keyword objcEnumValue NSMinXEdge NSMinYEdge NSMaxXEdge NSMaxYEdge
123syn keyword objcConstVar NSZeroPoint NSZeroSize NSZeroRect
124syn keyword cType CGFloat CGPoint CGSize CGRect
125syn keyword objcEnum NSAlignmentOptions
126syn keyword objcEnumValue NSAlignMinXInward NSAlignMinYInward NSAlignMaxXInward NSAlignMaxYInward NSAlignWidthInward NSAlignHeightInward NSAlignMinXOutward NSAlignMinYOutward NSAlignMaxXOutward NSAlignMaxYOutward NSAlignWidthOutward NSAlignHeightOutward NSAlignMinXNearest NSAlignMinYNearest NSAlignMaxXNearest NSAlignMaxYNearest NSAlignWidthNearest NSAlignHeightNearest NSAlignRectFlipped NSAlignAllEdgesInward NSAlignAllEdgesOutward NSAlignAllEdgesNearest
127" NSDecimal.h
128syn keyword objcType NSDecimal
129syn keyword objcEnum NSRoundingMode
130syn keyword objcEnumValue NSRoundPlain NSRoundDown NSRoundUp NSRoundBankers
131syn keyword objcEnum NSCalculationError
132syn keyword objcEnumValue NSCalculationNoError NSCalculationLossOfPrecision NSCalculationUnderflow NSCalculationOverflow NSCalculationDivideByZero
133" NSDate.h
134syn match objcClass /NSDate\s*\*/me=s+6,he=s+6
135syn keyword objcType NSTimeInterval
136syn keyword objcNotificationValue NSSystemClockDidChangeNotification
137syn keyword objcMacro NSTimeIntervalSince1970
138" NSZone.h
139syn match objcType /NSZone\s*\*/me=s+6,he=s+6
140" NSError.h
141syn match objcClass /NSError\s*\*/me=s+7,he=s+7
142syn keyword objcConstVar NSCocoaErrorDomain NSPOSIXErrorDomain NSOSStatusErrorDomain NSMachErrorDomain NSUnderlyingErrorKey NSLocalizedDescriptionKey NSLocalizedFailureReasonErrorKey NSLocalizedRecoverySuggestionErrorKey NSLocalizedRecoveryOptionsErrorKey NSRecoveryAttempterErrorKey NSHelpAnchorErrorKey NSStringEncodingErrorKey NSURLErrorKey NSFilePathErrorKey
143" NSException.h
144syn match objcClass /NSException\s*\*/me=s+11,he=s+11
145syn keyword objcType NSUncaughtExceptionHandler
146syn keyword objcConstVar NSGenericException NSRangeException NSInvalidArgumentException NSInternalInconsistencyException NSMallocException NSObjectInaccessibleException NSObjectNotAvailableException NSDestinationInvalidException NSPortTimeoutException NSInvalidSendPortException NSInvalidReceivePortException NSPortSendException NSPortReceiveException NSOldStyleException
147" NSNotification.h
148syn match objcClass /NSNotification\s*\*/me=s+14,he=s+14
149syn match objcClass /NSNotificationCenter\s*\*/me=s+20,he=s+20
150" NSDistributedNotificationCenter.h
151syn match objcClass /NSDistributedNotificationCenter\s*\*/me=s+31,he=s+31
152syn keyword objcConstVar NSLocalNotificationCenterType
153syn keyword objcEnum NSNotificationSuspensionBehavior
154syn keyword objcEnumValue NSNotificationSuspensionBehaviorDrop NSNotificationSuspensionBehaviorCoalesce NSNotificationSuspensionBehaviorHold NSNotificationSuspensionBehaviorHold NSNotificationSuspensionBehaviorDeliverImmediately
155syn keyword objcEnumValue NSNotificationDeliverImmediately NSNotificationPostToAllSessions
156" NSNotificationQueue.h
157syn match objcClass /NSNotificationQueue\s*\*/me=s+19,he=s+19
158syn keyword objcEnum NSPostingStyle
159syn keyword objcEnumValue NSPostWhenIdle NSPostASAP NSPostNow
160syn keyword objcEnum NSNotificationCoalescing
161syn keyword objcEnumValue NSNotificationNoCoalescing NSNotificationCoalescingOnName NSNotificationCoalescingOnSender
162" NSEnumerator.h
163syn match objcClass /NSEnumerator\s*\*/me=s+12,he=s+12
164" NSIndexSet.h
165syn match objcClass /NSIndexSet\s*\*/me=s+10,he=s+10
166syn match objcClass /NSMutableIndexSet\s*\*/me=s+17,he=s+17
167" NSCharecterSet.h
168syn match objcClass /NSCharacterSet\s*\*/me=s+14,he=s+14
169" NSURL.h
170syn match objcClass /NSURL\s*\*/me=s+5,he=s+5
171syn keyword objcEnum NSURLBookmarkCreationOptions
172syn keyword objcEnumValue NSURLBookmarkCreationPreferFileIDResolution NSURLBookmarkCreationMinimalBookmark NSURLBookmarkCreationSuitableForBookmarkFile NSURLBookmarkCreationWithSecurityScope NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess
173syn keyword objcEnum NSURLBookmarkResolutionOptions
174syn keyword objcEnumValue NSURLBookmarkResolutionWithoutUI NSURLBookmarkResolutionWithoutMounting NSURLBookmarkResolutionWithSecurityScope
175syn keyword objcType NSURLBookmarkFileCreationOptions
176syn keyword objcConstVar NSURLFileScheme NSURLKeysOfUnsetValuesKey
177syn keyword objcConstVar NSURLNameKey NSURLLocalizedNameKey NSURLIsRegularFileKey NSURLIsDirectoryKey NSURLIsSymbolicLinkKey NSURLIsVolumeKey NSURLIsPackageKey NSURLIsSystemImmutableKey NSURLIsUserImmutableKey NSURLIsHiddenKey NSURLHasHiddenExtensionKey NSURLCreationDateKey NSURLContentAccessDateKey NSURLContentModificationDateKey NSURLAttributeModificationDateKey NSURLLinkCountKey NSURLParentDirectoryURLKey NSURLVolumeURLKey NSURLTypeIdentifierKey NSURLLocalizedTypeDescriptionKey NSURLLabelNumberKey NSURLLabelColorKey NSURLLocalizedLabelKey NSURLEffectiveIconKey NSURLCustomIconKey NSURLFileResourceIdentifierKey NSURLVolumeIdentifierKey NSURLPreferredIOBlockSizeKey NSURLIsReadableKey NSURLIsWritableKey NSURLIsExecutableKey NSURLFileSecurityKey NSURLIsExcludedFromBackupKey NSURLPathKey NSURLIsMountTriggerKey NSURLFileResourceTypeKey
178syn keyword objcConstVar NSURLFileResourceTypeNamedPipe NSURLFileResourceTypeCharacterSpecial NSURLFileResourceTypeDirectory NSURLFileResourceTypeBlockSpecial NSURLFileResourceTypeRegular NSURLFileResourceTypeSymbolicLink NSURLFileResourceTypeSocket NSURLFileResourceTypeUnknown
179syn keyword objcConstVar NSURLFileSizeKey NSURLFileAllocatedSizeKey NSURLTotalFileSizeKey NSURLTotalFileAllocatedSizeKey NSURLIsAliasFileKey
180syn keyword objcConstVar NSURLVolumeLocalizedFormatDescriptionKey NSURLVolumeTotalCapacityKey NSURLVolumeAvailableCapacityKey NSURLVolumeResourceCountKey NSURLVolumeSupportsPersistentIDsKey NSURLVolumeSupportsSymbolicLinksKey NSURLVolumeSupportsHardLinksKey NSURLVolumeSupportsJournalingKey NSURLVolumeIsJournalingKey NSURLVolumeSupportsSparseFilesKey NSURLVolumeSupportsZeroRunsKey NSURLVolumeSupportsCaseSensitiveNamesKey NSURLVolumeSupportsCasePreservedNamesKey NSURLVolumeSupportsRootDirectoryDatesKey NSURLVolumeSupportsVolumeSizesKey NSURLVolumeSupportsRenamingKey NSURLVolumeSupportsAdvisoryFileLockingKey NSURLVolumeSupportsExtendedSecurityKey NSURLVolumeIsBrowsableKey NSURLVolumeMaximumFileSizeKey NSURLVolumeIsEjectableKey NSURLVolumeIsRemovableKey NSURLVolumeIsInternalKey NSURLVolumeIsAutomountedKey NSURLVolumeIsLocalKey NSURLVolumeIsReadOnlyKey NSURLVolumeCreationDateKey NSURLVolumeURLForRemountingKey NSURLVolumeUUIDStringKey NSURLVolumeNameKey NSURLVolumeLocalizedNameKey
181syn keyword objcConstVar NSURLIsUbiquitousItemKey NSURLUbiquitousItemHasUnresolvedConflictsKey NSURLUbiquitousItemIsDownloadedKey NSURLUbiquitousItemIsDownloadingKey NSURLUbiquitousItemIsUploadedKey NSURLUbiquitousItemIsUploadingKey NSURLUbiquitousItemPercentDownloadedKey NSURLUbiquitousItemPercentUploadedKey
182""""""""""""
183" NSString.h
184syn match objcClass /NSString\s*\*/me=s+8,he=s+8
185syn match objcClass /NSMutableString\s*\*/me=s+15,he=s+15
186syn keyword objcType unichar
187syn keyword objcExceptionValue NSParseErrorException NSCharacterConversionException
188syn keyword objcMacro NSMaximumStringLength
189syn keyword objcEnum NSStringCompareOptions
190syn keyword objcEnumValue NSCaseInsensitiveSearch NSLiteralSearch NSBackwardsSearch NSAnchoredSearch NSNumericSearch NSDiacriticInsensitiveSearch NSWidthInsensitiveSearch NSForcedOrderingSearch NSRegularExpressionSearch
191syn keyword objcEnum NSStringEncoding
192syn keyword objcEnumValue NSASCIIStringEncoding NSNEXTSTEPStringEncoding NSJapaneseEUCStringEncoding NSUTF8StringEncoding NSISOLatin1StringEncoding NSSymbolStringEncoding NSNonLossyASCIIStringEncoding NSShiftJISStringEncoding NSISOLatin2StringEncoding NSUnicodeStringEncoding NSWindowsCP1251StringEncoding NSWindowsCP1252StringEncoding NSWindowsCP1253StringEncoding NSWindowsCP1254StringEncoding NSWindowsCP1250StringEncoding NSISO2022JPStringEncoding NSMacOSRomanStringEncoding NSUTF16StringEncoding NSUTF16BigEndianStringEncoding NSUTF16LittleEndianStringEncoding NSUTF32StringEncoding NSUTF32BigEndianStringEncoding NSUTF32LittleEndianStringEncoding
193syn keyword objcEnum NSStringEncodingConversionOptions
194syn keyword objcEnumValue NSStringEncodingConversionAllowLossy NSStringEncodingConversionExternalRepresentation
195syn keyword objcEnum NSStringEnumerationOptions
196syn keyword objcEnumValue NSStringEnumerationByLines NSStringEnumerationByParagraphs NSStringEnumerationByComposedCharacterSequences NSStringEnumerationByWords NSStringEnumerationBySentences NSStringEnumerationReverse NSStringEnumerationSubstringNotRequired NSStringEnumerationLocalized
197" NSAttributedString.h
198syn match objcClass /NSAttributedString\s*\*/me=s+18,he=s+18
199syn match objcClass /NSMutableAttributedString\s*\*/me=s+25,he=s+25
200syn keyword objcEnum NSAttributedStringEnumerationOptions
201syn keyword objcEnumValue NSAttributedStringEnumerationReverse NSAttributedStringEnumerationLongestEffectiveRangeNotRequired
202" NSValue.h
203syn match objcClass /NSValue\s*\*/me=s+7,he=s+7
204syn match objcClass /NSNumber\s*\*/me=s+8,he=s+8
205" NSDecimalNumber.h
206syn match objcClass /NSDecimalNumber\s*\*/me=s+15,he=s+15
207syn match objcClass /NSDecimalNumberHandler\s*\*/me=s+22,he=s+22
208syn keyword objcExceptionValue NSDecimalNumberExactnessException NSDecimalNumberOverflowException NSDecimalNumberUnderflowException NSDecimalNumberDivideByZeroException
209" NSData.h
210syn match objcClass /NSData\s*\*/me=s+6,he=s+6
211syn match objcClass /NSMutableData\s*\*/me=s+13,he=s+13
212syn keyword objcEnum NSDataReadingOptions
213syn keyword objcEnumValue NSDataReadingMappedIfSafe NSDataReadingUncached NSDataReadingMappedAlways NSDataReadingMapped NSMappedRead NSUncachedRead
214syn keyword objcEnum NSDataWritingOptions
215syn keyword objcEnumValue NSDataWritingAtomic NSDataWritingWithoutOverwriting NSDataWritingFileProtectionNone NSDataWritingFileProtectionComplete NSDataWritingFileProtectionCompleteUnlessOpen NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication NSDataWritingFileProtectionMask NSAtomicWrite
216syn keyword objcEnum NSDataSearchOptions
217syn keyword objcEnumValue NSDataSearchBackwards NSDataSearchAnchored
218" NSArray.h
219syn match objcClass /NSArray\s*\*/me=s+7,he=s+7
220syn match objcClass /NSMutableArray\s*\*/me=s+14,he=s+14
221syn keyword objcEnum NSBinarySearchingOptions
222syn keyword objcEnumValue NSBinarySearchingFirstEqual NSBinarySearchingLastEqual NSBinarySearchingInsertionIndex
223" NSDictionary.h
224syn match objcClass /NSDictionary\s*\*/me=s+12,he=s+12
225syn match objcClass /NSMutableDictionary\s*\*/me=s+19,he=s+19
226" NSSet.h
227syn match objcClass /NSSet\s*\*/me=s+5,me=s+5
228syn match objcClass /NSMutableSet\s*\*/me=s+12,me=s+12
229syn match objcClass /NSCountedSet\s*\*/me=s+12,me=s+12
230" NSOrderedSet.h
231syn match objcClass /NSOrderedSet\s*\*/me=s+12,me=s+12
232syn match objcClass /NSMutableOrderedSet\s*\*/me=s+19,me=s+19
233"""""""""""""""""""
234" NSPathUtilities.h
235syn keyword objcEnum NSSearchPathDirectory
236syn keyword objcEnumValue NSApplicationDirectory NSDemoApplicationDirectory NSDeveloperApplicationDirectory NSAdminApplicationDirectory NSLibraryDirectory NSDeveloperDirectory NSUserDirectory NSDocumentationDirectory NSDocumentDirectory NSCoreServiceDirectory NSAutosavedInformationDirectory NSDesktopDirectory NSCachesDirectory NSApplicationSupportDirectory NSDownloadsDirectory NSInputMethodsDirectory NSMoviesDirectory NSMusicDirectory NSPicturesDirectory NSPrinterDescriptionDirectory NSSharedPublicDirectory NSPreferencePanesDirectory NSApplicationScriptsDirectory NSItemReplacementDirectory NSAllApplicationsDirectory NSAllLibrariesDirectory NSTrashDirectory
237syn keyword objcEnum NSSearchPathDomainMask
238syn keyword objcEnumValue NSUserDomainMask NSLocalDomainMask NSNetworkDomainMask NSSystemDomainMask NSAllDomainsMask
239" NSFileManger.h
240syn match objcClass /NSFileManager\s*\*/me=s+13,he=s+13
241syn match objcClass /NSDirectoryEnumerator\s*\*/me=s+21,he=s+21
242syn keyword objcEnum NSVolumeEnumerationOptions
243syn keyword objcEnumValue NSVolumeEnumerationSkipHiddenVolumes NSVolumeEnumerationProduceFileReferenceURLs
244syn keyword objcEnum NSDirectoryEnumerationOptions
245syn keyword objcEnumValue NSDirectoryEnumerationSkipsSubdirectoryDescendants NSDirectoryEnumerationSkipsPackageDescendants NSDirectoryEnumerationSkipsHiddenFiles
246syn keyword objcEnum NSFileManagerItemReplacementOptions
247syn keyword objcEnumValue NSFileManagerItemReplacementUsingNewMetadataOnly NSFileManagerItemReplacementWithoutDeletingBackupItem
248syn keyword objcNotificationValue NSUbiquityIdentityDidChangeNotification
249syn keyword objcConstVar NSFileType NSFileTypeDirectory NSFileTypeRegular NSFileTypeSymbolicLink NSFileTypeSocket NSFileTypeCharacterSpecial NSFileTypeBlockSpecial NSFileTypeUnknown NSFileSize NSFileModificationDate NSFileReferenceCount NSFileDeviceIdentifier NSFileOwnerAccountName NSFileGroupOwnerAccountName NSFilePosixPermissions NSFileSystemNumber NSFileSystemFileNumber NSFileExtensionHidden NSFileHFSCreatorCode NSFileHFSTypeCode NSFileImmutable NSFileAppendOnly NSFileCreationDate NSFileOwnerAccountID NSFileGroupOwnerAccountID NSFileBusy NSFileProtectionKey NSFileProtectionNone NSFileProtectionComplete NSFileProtectionCompleteUnlessOpen NSFileProtectionCompleteUntilFirstUserAuthentication NSFileSystemSize NSFileSystemFreeSize NSFileSystemNodes NSFileSystemFreeNodes
250" NSFileHandle.h
251syn match objcClass /NSFileHandle\s*\*/me=s+12,he=s+12
252syn keyword objcExceptionValue NSFileHandleOperationException
253syn keyword objcNotificationValue NSFileHandleReadCompletionNotification NSFileHandleReadToEndOfFileCompletionNotification NSFileHandleConnectionAcceptedNotification NSFileHandleDataAvailableNotification NSFileHandleNotificationDataItem NSFileHandleNotificationFileHandleItem NSFileHandleNotificationMonitorModes
254syn match objcClass /NSPipe\s*\*/me=s+6,he=s+6
255""""""""""""
256" NSLocale.h
257syn match objcClass /NSLocale\s*\*/me=s+8,he=s+8
258syn keyword objcEnum NSLocaleLanguageDirection
259syn keyword objcEnumValue NSLocaleLanguageDirectionUnknown NSLocaleLanguageDirectionLeftToRight NSLocaleLanguageDirectionRightToLeft NSLocaleLanguageDirectionTopToBottom NSLocaleLanguageDirectionBottomToTop
260syn keyword objcNotificationValue NSCurrentLocaleDidChangeNotification
261syn keyword objcConstVar NSLocaleIdentifier NSLocaleLanguageCode NSLocaleCountryCode NSLocaleScriptCode NSLocaleVariantCode NSLocaleExemplarCharacterSet NSLocaleCalendar NSLocaleCollationIdentifier NSLocaleUsesMetricSystem NSLocaleMeasurementSystem NSLocaleDecimalSeparator NSLocaleGroupingSeparator NSLocaleCurrencySymbol NSLocaleCurrencyCode NSLocaleCollatorIdentifier NSLocaleQuotationBeginDelimiterKey NSLocaleQuotationEndDelimiterKey NSLocaleAlternateQuotationBeginDelimiterKey NSLocaleAlternateQuotationEndDelimiterKey NSGregorianCalendar NSBuddhistCalendar NSChineseCalendar NSHebrewCalendar NSIslamicCalendar NSIslamicCivilCalendar NSJapaneseCalendar NSRepublicOfChinaCalendar NSPersianCalendar NSIndianCalendar NSISO8601Calendar
262" NSFormatter.h
263syn match objcClass /NSFormatter\s*\*/me=s+11,he=s+11
264" NSNumberFormatter.h
265syn match objcClass /NSNumberFormatter\s*\*/me=s+17,he=s+17
266syn keyword objcEnum NSNumberFormatterStyle
267syn keyword objcEnumValue NSNumberFormatterNoStyle NSNumberFormatterDecimalStyle NSNumberFormatterCurrencyStyle NSNumberFormatterPercentStyle NSNumberFormatterScientificStyle NSNumberFormatterSpellOutStyle
268syn keyword objcEnum NSNumberFormatterBehavior
269syn keyword objcEnumValue NSNumberFormatterBehaviorDefault NSNumberFormatterBehavior10_0 NSNumberFormatterBehavior10_4
270syn keyword objcEnum NSNumberFormatterPadPosition
271syn keyword objcEnumValue NSNumberFormatterPadBeforePrefix NSNumberFormatterPadAfterPrefix NSNumberFormatterPadBeforeSuffix NSNumberFormatterPadAfterSuffix
272syn keyword objcEnum NSNumberFormatterRoundingMode
273syn keyword objcEnumValue NSNumberFormatterRoundCeiling NSNumberFormatterRoundFloor NSNumberFormatterRoundDown NSNumberFormatterRoundUp NSNumberFormatterRoundHalfEven NSNumberFormatterRoundHalfDown NSNumberFormatterRoundHalfUp
274" NSDateFormatter.h
275syn match objcClass /NSDateFormatter\s*\*/me=s+15,he=s+15
276syn keyword objcEnum NSDateFormatterStyle
277syn keyword objcEnumValue NSDateFormatterNoStyle NSDateFormatterShortStyle NSDateFormatterMediumStyle NSDateFormatterLongStyle NSDateFormatterFullStyle
278syn keyword objcEnum NSDateFormatterBehavior
279syn keyword objcEnumValue NSDateFormatterBehaviorDefault NSDateFormatterBehavior10_0 NSDateFormatterBehavior10_4
280" NSCalendar.h
281syn match objcClass /NSCalendar\s*\*/me=s+10,he=s+10
282syn keyword objcEnum NSCalendarUnit
283syn keyword objcEnumValue NSEraCalendarUnit NSYearCalendarUnit NSMonthCalendarUnit NSDayCalendarUnit NSHourCalendarUnit NSMinuteCalendarUnit NSSecondCalendarUnit NSWeekCalendarUnit NSWeekdayCalendarUnit NSWeekdayOrdinalCalendarUnit NSQuarterCalendarUnit NSWeekOfMonthCalendarUnit NSWeekOfYearCalendarUnit NSYearForWeekOfYearCalendarUnit NSCalendarCalendarUnit NSTimeZoneCalendarUnit
284syn keyword objcEnumValue NSWrapCalendarComponents NSUndefinedDateComponent
285syn match objcClass /NSDateComponents\s*\*/me=s+16,he=s+16
286" NSTimeZone.h
287syn match objcClass /NSTimeZone\s*\*/me=s+10,he=s+10
288syn keyword objcEnum NSTimeZoneNameStyle
289syn keyword objcEnumValue NSTimeZoneNameStyleStandard NSTimeZoneNameStyleShortStandard NSTimeZoneNameStyleDaylightSaving NSTimeZoneNameStyleShortDaylightSaving NSTimeZoneNameStyleGeneric NSTimeZoneNameStyleShortGeneric
290syn keyword objcNotificationValue NSSystemTimeZoneDidChangeNotification
291"""""""""""
292" NSCoder.h
293syn match objcClass /NSCoder\s*\*/me=s+7,he=s+7
294" NSArchiver.h
295syn match objcClass /NSArchiver\s*\*/me=s+10,he=s+10
296syn match objcClass /NSUnarchiver\s*\*/me=s+12,he=s+12
297syn keyword objcExceptionValue NSInconsistentArchiveException
298" NSKeyedArchiver.h
299syn match objcClass /NSKeyedArchiver\s*\*/me=s+15,he=s+15
300syn match objcClass /NSKeyedUnarchiver\s*\*/me=s+17,he=s+17
301syn keyword objcExceptionValue NSInvalidArchiveOperationException NSInvalidUnarchiveOperationException
302""""""""""""""""""
303" NSPropertyList.h
304syn keyword objcEnum NSPropertyListMutabilityOptions
305syn keyword objcEnumValue NSPropertyListImmutable NSPropertyListMutableContainers NSPropertyListMutableContainersAndLeaves
306syn keyword objcEnum NSPropertyListFormat
307syn keyword objcEnumValue NSPropertyListOpenStepFormat NSPropertyListXMLFormat_v1_0 NSPropertyListBinaryFormat_v1_0
308syn keyword objcType NSPropertyListReadOptions NSPropertyListWriteOptions
309" NSUserDefaults.h
310syn match objcClass /NSUserDefaults\s*\*/me=s+14,he=s+14
311syn keyword objcConstVar NSGlobalDomain NSArgumentDomain NSRegistrationDomain
312syn keyword objcNotificationValue NSUserDefaultsDidChangeNotification
313" NSBundle.h
314syn match objcClass /NSBundle\s*\*/me=s+8,he=s+8
315syn keyword objcEnumValue NSBundleExecutableArchitectureI386 NSBundleExecutableArchitecturePPC NSBundleExecutableArchitectureX86_64 NSBundleExecutableArchitecturePPC64
316syn keyword objcNotificationValue NSBundleDidLoadNotification NSLoadedClasses
317"""""""""""""""""
318" NSProcessInfo.h
319syn match objcClass /NSProcessInfo\s*\*/me=s+13,he=s+13
320syn keyword objcEnumValue NSWindowsNTOperatingSystem NSWindows95OperatingSystem NSSolarisOperatingSystem NSHPUXOperatingSystem NSMACHOperatingSystem NSSunOSOperatingSystem NSOSF1OperatingSystem
321" NSTask.h
322syn match objcClass /NSTask\s*\*/me=s+6,he=s+6
323syn keyword objcEnum NSTaskTerminationReason
324syn keyword objcEnumValue NSTaskTerminationReasonExit NSTaskTerminationReasonUncaughtSignal
325syn keyword objcNotificationValue NSTaskDidTerminateNotification
326" NSThread.h
327syn match objcClass /NSThread\s*\*/me=s+8,he=s+8
328syn keyword objcNotificationValue NSWillBecomeMultiThreadedNotification NSDidBecomeSingleThreadedNotification NSThreadWillExitNotification
329" NSLock.h
330syn match objcClass /NSLock\s*\*/me=s+6,he=s+6
331syn match objcClass /NSConditionLock\s*\*/me=s+15,he=s+15
332syn match objcClass /NSRecursiveLock\s*\*/me=s+15,he=s+15
333" NSDictributedLock
334syn match objcClass /NSDistributedLock\s*\*/me=s+17,he=s+17
335" NSOperation.h
336""""""""""""""""
337syn match objcClass /NSOperation\s*\*/me=s+11,he=s+11
338syn keyword objcEnum NSOperationQueuePriority
339syn keyword objcEnumValue NSOperationQueuePriorityVeryLow NSOperationQueuePriorityLow NSOperationQueuePriorityNormal NSOperationQueuePriorityHigh NSOperationQueuePriorityVeryHigh
340syn match objcClass /NSBlockOperation\s*\*/me=s+16,he=s+16
341syn match objcClass /NSInvocationOperation\s*\*/me=s+21,he=s+21
342syn keyword objcExceptionValue NSInvocationOperationVoidResultException NSInvocationOperationCancelledException
343syn match objcClass /NSOperationQueue\s*\*/me=s+16,he=s+16
344syn keyword objcEnumValue NSOperationQueueDefaultMaxConcurrentOperationCount
345" NSConnection.h
346syn match objcClass /NSConnection\s*\*/me=s+12,he=s+12
347syn keyword objcConstVar NSConnectionReplyMode
348syn keyword objcNotificationValue NSConnectionDidDieNotification NSConnectionDidInitializeNotification
349syn keyword objcExceptionValue NSFailedAuthenticationException
350" NSPort.h
351syn match objcClass /NSPort\s*\*/me=s+6,he=s+6
352syn keyword objcType NSSocketNativeHandle
353syn keyword objcNotificationValue NSPortDidBecomeInvalidNotification
354syn match objcClass /NSMachPort\s*\*/me=s+10,he=s+10
355syn keyword objcEnumValue NSMachPortDeallocateNone NSMachPortDeallocateSendRight NSMachPortDeallocateReceiveRight
356syn match objcClass /NSMessagePort\s*\*/me=s+13,he=s+13
357syn match objcClass /NSSocketPort\s*\*/me=s+12,he=s+12
358" NSPortMessage.h
359syn match objcClass /NSPortMessage\s*\*/me=s+13,he=s+13
360" NSDistantObject.h
361syn match objcClass /NSDistantObject\s*\*/me=s+15,he=s+15
362" NSPortNameServer.h
363syn match objcClass /NSPortNameServer\s*\*/me=s+16,he=s+16
364syn match objcClass /NSMessagePortNameServer\s*\*/me=s+23,he=s+23
365syn match objcClass /NSSocketPortNameServer\s*\*/me=s+22,he=s+22
366" NSHost.h
367syn match objcClass /NSHost\s*\*/me=s+6,he=s+6
368" NSInvocation.h
369syn match objcClass /NSInvocation\s*\*/me=s+12,he=s+12
370" NSMethodSignature.h
371syn match objcClass /NSMethodSignature\s*\*/me=s+17,he=s+17
372"""""
373" NSScanner.h
374syn match objcClass /NSScanner\s*\*/me=s+9,he=s+9
375" NSTimer.h
376syn match objcClass /NSTimer\s*\*/me=s+7,he=s+7
377" NSAutoreleasePool.h
378syn match objcClass /NSAutoreleasePool\s*\*/me=s+17,he=s+17
379" NSRunLoop.h
380syn match objcClass /NSRunLoop\s*\*/me=s+9,he=s+9
381syn keyword objcConstVar NSDefaultRunLoopMode NSRunLoopCommonModes
382" NSNull.h
383syn match objcClass /NSNull\s*\*/me=s+6,he=s+6
384" NSProxy.h
385syn match objcClass /NSProxy\s*\*/me=s+7,he=s+7
386" NSObject.h
387syn match objcClass /NSObject\s*\*/me=s+8,he=s+8
388
389""" Default Highlighting
390hi def link objcPreProcMacro cConstant
391hi def link objcPrincipalType cType
392hi def link objcUsefulTerm cConstant
393hi def link objcImport cInclude
394hi def link objcImported cString
395hi def link objcObjDef cOperator
396hi def link objcProtocol cOperator
397hi def link objcProperty cOperator
398hi def link objcIvarScope cOperator
399hi def link objcInternalRep cOperator
400hi def link objcException cOperator
401hi def link objcThread cOperator
402hi def link objcPool cOperator
Bram Moolenaar52b91d82013-06-15 21:39:51 +0200403hi def link objcModuleImport cOperator
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200404hi def link objcSpecial cSpecial
405hi def link objcString cString
406hi def link objcHiddenArgument cStatement
407hi def link objcBlocksQualifier cStorageClass
408hi def link objcObjectLifetimeQualifier cStorageClass
409hi def link objcTollFreeBridgeQualifier cStorageClass
410hi def link objcRemoteMessagingQualifier cStorageClass
411hi def link objcFastEnumKeyword cStatement
412hi def link objcLiteralSyntaxNumber cNumber
413hi def link objcLiteralSyntaxChar cCharacter
414hi def link objcLiteralSyntaxSpecialChar cCharacter
415hi def link objcLiteralSyntaxOp cOperator
416hi def link objcDeclPropAccessorName cConstant
417hi def link objcDeclPropAccessorType cConstant
418hi def link objcDeclPropAssignSemantics cConstant
419hi def link objcDeclPropAtomicity cConstant
420hi def link objcDeclPropARC cConstant
421hi def link objcInstanceMethod Function
422hi def link objcClassMethod Function
423hi def link objcType cType
424hi def link objcClass cType
425hi def link objcMacro cConstant
426hi def link objcEnum cType
427hi def link objcEnumValue cConstant
428hi def link objcExceptionValue cConstant
429hi def link objcNotificationValue cConstant
430hi def link objcConstVar cConstant
431
432""" Final step
Bram Moolenaar071d4272004-06-13 20:20:40 +0000433let b:current_syntax = "objc"
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200434let &cpo = s:cpo_save
435unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436
Bram Moolenaarec7944a2013-06-12 21:29:15 +0200437" vim: ts=8 sw=2 sts=2