mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-20 04:47:59 +01:00
added saner default snippets
This commit is contained in:
@@ -38,22 +38,26 @@ snippet impl
|
||||
@implementation ${1:`Filename('', 'someClass')`}
|
||||
${2}
|
||||
@end
|
||||
# Protocol
|
||||
snippet pro
|
||||
@protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
|
||||
${3}
|
||||
@end
|
||||
snippet init
|
||||
- (id)init
|
||||
{
|
||||
[super init];
|
||||
if (self = [super init]) {
|
||||
${1}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
snippet ifself
|
||||
if (self = [super init]) {
|
||||
${1:/* code */}
|
||||
}
|
||||
return self;
|
||||
snippet su
|
||||
[super ${1:init}]${2}
|
||||
snippet ibo
|
||||
IBOutlet ${1:NSSomeClass} *${2:$1};${3}
|
||||
# Category
|
||||
snippet cat
|
||||
@interface ${1:NSObject} (${2:Category})
|
||||
@interface ${1:NSObject} (${2:MyCategory})
|
||||
@end
|
||||
|
||||
@implementation $1 ($2)
|
||||
@@ -61,18 +65,9 @@ snippet cat
|
||||
@end
|
||||
# Category Interface
|
||||
snippet cath
|
||||
@interface ${1:NSObject} (${2:Category})
|
||||
@interface ${1:`Filename('$1', 'NSObject')`} (${2:MyCategory})
|
||||
${3}
|
||||
@end
|
||||
# NSArray
|
||||
snippet array
|
||||
NSMutableArray *${1:array} = [NSMutable array];${2}
|
||||
# NSDictionary
|
||||
snippet dict
|
||||
NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2}
|
||||
# NSBezierPath
|
||||
snippet bez
|
||||
NSBezierPath *${1:path} = [NSBezierPath bezierPath];${2}
|
||||
# Method
|
||||
snippet m
|
||||
- (${1:id})${2:method}
|
||||
@@ -100,8 +95,8 @@ snippet wake
|
||||
# Class Method
|
||||
snippet M
|
||||
+ (${1:id})${2:method}
|
||||
{${3}
|
||||
return nil;
|
||||
{
|
||||
${3:return nil;}
|
||||
}
|
||||
# Sub-method (Call super)
|
||||
snippet sm
|
||||
@@ -110,14 +105,6 @@ snippet sm
|
||||
[super $2];${3}
|
||||
return self;
|
||||
}
|
||||
# Method: Initialize
|
||||
snippet I
|
||||
+ (void) initialize
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWIthObjectsAndKeys:
|
||||
${1}@"value", @"key",
|
||||
nil]];
|
||||
}
|
||||
# Accessor Methods For:
|
||||
# Object
|
||||
snippet objacc
|
||||
@@ -160,7 +147,6 @@ snippet ret
|
||||
# release
|
||||
snippet rel
|
||||
[${1:foo} release];
|
||||
${2:$1 = nil;}
|
||||
# autorelease
|
||||
snippet arel
|
||||
[${1:foo} autorelease];
|
||||
@@ -177,7 +163,7 @@ snippet except
|
||||
userInfo:nil];
|
||||
[$1 raise];
|
||||
snippet prag
|
||||
#pragma mark ${1:foo}
|
||||
#pragma mark ${1:-}
|
||||
snippet cl
|
||||
@class ${1:Foo};${2}
|
||||
snippet color
|
||||
|
||||
Reference in New Issue
Block a user