1
1
Fork 0

Add vim config

This commit is contained in:
Jonathan Schleifer 2014-03-19 00:17:19 +00:00
parent 087a38aa20
commit 770c7b3e9e
40 changed files with 7782 additions and 0 deletions

44
vim/after/syntax/objc.vim Normal file
View file

@ -0,0 +1,44 @@
" 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
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