Overview
Comment: | Merge after/syntax/objc.vim with file from Vim 7.3
Vim 7.4 comes with a heavily changed syntax file that does not work with |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
eb8a1e9b68d9c3fa0bc90a7e3ea491e8 |
User & Date: | js 2015-05-03 17:58:50 |
Context
2015-06-17
| ||
22:30 | vim/syntax/objc.vim: Add more keywords check-in: dd1c21d120 user: js tags: trunk | |
2015-05-03
| ||
17:58 | Merge after/syntax/objc.vim with file from Vim 7.3 check-in: eb8a1e9b68 user: js tags: trunk | |
2015-04-12
| ||
15:39 | objc.vim: Add of_stat_t and of_socket_t check-in: e78b6a8cac user: js tags: trunk | |
Changes
Deleted vim/after/syntax/objc.vim.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added vim/syntax/objc.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | " Vim syntax file " Language: Objective C " Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com> " Ex-maintainer: Anthony Hodsdon <ahodsdon@fastmail.fm> " First Author: Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de> " Last Change: 2007 Feb 21 " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif if &filetype != 'objcpp' " Read the C syntax to start with if version < 600 source <sfile>:p:h/c.vim else runtime! syntax/c.vim endif endif " Objective C extentions follow below " " NOTE: Objective C is abbreviated to ObjC/objc " and uses *.h, *.m as file extensions! " ObjC keywords, types, type qualifiers etc. syn keyword objcStatement self super _cmd syn keyword objcType id Class SEL IMP BOOL syn keyword objcTypeModifier bycopy in out inout oneway syn keyword objcConstant nil Nil " Match the ObjC #import directive (like C's #include) syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match objcImported display contained "<[-_0-9a-zA-Z.\/]*>" syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported " Match the important ObjC directives syn match objcScopeDecl "@public\|@private\|@protected" syn match objcDirective "@interface\|@implementation" syn match objcDirective "@class\|@end\|@defs" syn match objcDirective "@encode\|@protocol\|@selector" syn match objcDirective "@try\|@catch\|@finally\|@throw\|@synchronized" " Match the ObjC method types " " NOTE: here I match only the indicators, this looks " much nicer and reduces cluttering color highlightings. " However, if you prefer full method declaration matching " append .* at the end of the next two patterns! " syn match objcInstMethod "^\s*-\s*" syn match objcFactMethod "^\s*+\s*" " To distinguish from a header inclusion from a protocol list. syn match objcProtocol display "<[_a-zA-Z][_a-zA-Z0-9]*>" contains=objcType,cType,Type " To distinguish labels from the keyword for a method's parameter. syn region objcKeyForMethodParam display \ start="^\s*[_a-zA-Z][_a-zA-Z0-9]*\s*:\s*(" \ end=")\s*[_a-zA-Z][_a-zA-Z0-9]*" \ contains=objcType,objcTypeModifier,cType,cStructure,cStorageClass,Type " Objective-C Constant Strings syn match objcSpecial display "%@" contained syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial " Objective-C Message Expressions syn region objcMessage display start="\[" end="\]" contains=objcMessage,objcStatement,objcType,objcTypeModifier,objcString,objcConstant,objcDirective,cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,Type syn cluster cParenGroup add=objcMessage syn cluster cPreProcGroup add=objcMessage " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_objc_syntax_inits") if version < 508 let did_objc_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink objcImport Include HiLink objcImported cString HiLink objcTypeModifier objcType HiLink objcType Type HiLink objcScopeDecl Statement HiLink objcInstMethod Function HiLink objcFactMethod Function HiLink objcStatement Statement HiLink objcDirective Statement HiLink objcKeyForMethodParam None HiLink objcString cString HiLink objcSpecial Special HiLink objcProtocol None HiLink objcConstant cConstant delcommand HiLink endif let b:current_syntax = "objc" " vim: ts=8 " 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 3, 2015 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 '\%#=1\(\[\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 |