configs  Check-in [dd1c21d120]

Overview
Comment:vim/syntax/objc.vim: Add more keywords
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: dd1c21d12056104eb5c679293d420710be6c16711a5ea49fd1ea86f05ab2dea0
User & Date: js 2015-06-17 22:30:37
Context
2015-12-01
22:52
tmux.conf: Add a space as tmux now does it right check-in: 02a93e9c3f user: js tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to vim/syntax/objc.vim.

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
"
" 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!







|
|
>
>
>













>







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
"
" 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 nonnull nullable
syn keyword objcTypeModifier	bycopy in out inout oneway OF_GENERIC OF_INLINE
syn keyword objcTypeModifier	OF_CONST_FUNC OF_NO_RETURN OF_KINDOF
syn keyword objcTypeModifier	OF_RETURNS_INNER_POINTER OF_NONNULL
syn keyword objcTypeModifier	OF_NULLABLE OF_NULLABLE_PROPERTY
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"
syn match  objcDirective    "OF_ASSUME_NONNULL_BEGIN\|OF_ASSUME_NONNULL_END"

" 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!
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
130
131
" 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







|
>
|
|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
" 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_mutex_t of_rectangle_t of_string_encoding_t
syn keyword objcType of_time_interval_t of_resolver_result_t
syn keyword objcType of_udp_socket_address_t of_offset_t of_stat_t of_socket_t
syn keyword objcType of_spinlock_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