1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-19 20:38:05 +01:00

fixed some objc snippets

This commit is contained in:
Michael Sanders
2009-05-11 00:02:17 -04:00
parent 27e6362cdd
commit 4e61b3af8a

View File

@@ -18,50 +18,36 @@ snippet log
NSLog(@"${1}"${2});${3} NSLog(@"${1}"${2});${3}
# Class # Class
snippet objc snippet objc
@interface ${1:`Filename('', 'object')`} : ${2:NSObject} @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
{ {
} }
@end @end
@implementation $1 @implementation $1
- (id) init ${3}
{
if (self = [super init])
{${3}
}
return self;
}
@end @end
# Class Interface # Class Interface
snippet clh snippet int
@interface ${1:`Filename('', 'object')`} : ${2:NSObject} @interface ${1:`Filename('', 'someClass')`}
{${3} {${2}
} }
${4} ${3}
@end @end
# Class Implementation # Class Implementation
snippet clm snippet impl
@implementation ${1:`Filename('', 'object')`} : ${2:NSObject} @implementation ${1:`Filename('', 'someClass')`}
${2}
@end
snippet init
- (id)init - (id)init
{ {
if ((self = [super init])) if ((self = [super init]))
{$0 {${1}
} }
return self; return self;
} }
@end
# Interface
snippet int
@interface
${1}
@end
# Implementation
snippet impl
@implementation
${1}
@end
snippet ibo snippet ibo
IBOutlet ${1:NSSomeClass} *${2:$1}; IBOutlet ${1:NSSomeClass} *${2:$1};${3}
# Category # Category
snippet cat snippet cat
@interface ${1:NSObject} (${2:Category}) @interface ${1:NSObject} (${2:Category})
@@ -177,7 +163,7 @@ snippet arel
[${1:foo} autorelease]; [${1:foo} autorelease];
# autorelease pool # autorelease pool
snippet pool snippet pool
NSAutoReleasePool *${1:pool} = [[NSAutoReleasePool alloc] init]; NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
${2:/* code */} ${2:/* code */}
[$1 release]; [$1 release];
# Throw an exception # Throw an exception