mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.
This commit is contained in:
@ -1,21 +1,21 @@
|
||||
# #import <...>
|
||||
snippet Imp
|
||||
#import <${1:Cocoa/Cocoa.h}>${2}
|
||||
#import <${1:Cocoa/Cocoa.h}>
|
||||
# #import "..."
|
||||
snippet imp
|
||||
#import "${1:`vim_snippets#Filename()`.h}"${2}
|
||||
#import "${1:`vim_snippets#Filename()`.h}"
|
||||
# @selector(...)
|
||||
snippet sel
|
||||
@selector(${1:method}:)${3}
|
||||
@selector(${1:method}:)
|
||||
# @"..." string
|
||||
snippet s
|
||||
@"${1}"${2}
|
||||
@"${1}"
|
||||
# Object
|
||||
snippet o
|
||||
${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5}
|
||||
${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};
|
||||
# NSLog(...)
|
||||
snippet log
|
||||
NSLog(@"${1:%@}"${2});${3}
|
||||
NSLog(@"${1:%@}"${2});
|
||||
# Class
|
||||
snippet objc
|
||||
@interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
|
||||
@ -24,45 +24,45 @@ snippet objc
|
||||
@end
|
||||
|
||||
@implementation $1
|
||||
${3}
|
||||
${0}
|
||||
@end
|
||||
# Class Interface
|
||||
snippet int
|
||||
@interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
|
||||
{${3}
|
||||
}
|
||||
${4}
|
||||
${0}
|
||||
@end
|
||||
snippet @interface
|
||||
@interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
|
||||
{${3}
|
||||
}
|
||||
${4}
|
||||
${0}
|
||||
@end
|
||||
# Class Implementation
|
||||
snippet impl
|
||||
@implementation ${1:`vim_snippets#Filename('', 'someClass')`}
|
||||
${2}
|
||||
${0}
|
||||
@end
|
||||
snippet @implementation
|
||||
@implementation ${1:`vim_snippets#Filename('', 'someClass')`}
|
||||
${2}
|
||||
${0}
|
||||
@end
|
||||
# Protocol
|
||||
snippet pro
|
||||
@protocol ${1:`vim_snippets#Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
|
||||
${3}
|
||||
${0}
|
||||
@end
|
||||
snippet @protocol
|
||||
@protocol ${1:`vim_snippets#Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
|
||||
${3}
|
||||
${0}
|
||||
@end
|
||||
# init Definition
|
||||
snippet init
|
||||
- (id)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
${1}
|
||||
${0}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -70,61 +70,61 @@ snippet init
|
||||
snippet dealloc
|
||||
- (void) dealloc
|
||||
{
|
||||
${1:deallocations}
|
||||
${0:deallocations}
|
||||
[super dealloc];
|
||||
}
|
||||
snippet su
|
||||
[super ${1:init}]${2}
|
||||
[super ${1:init}]
|
||||
snippet ibo
|
||||
IBOutlet ${1:NSSomeClass} *${2:$1};${3}
|
||||
IBOutlet ${1:NSSomeClass} *${2:$1};
|
||||
# Category
|
||||
snippet cat
|
||||
@interface ${1:NSObject} (${2:MyCategory})
|
||||
@end
|
||||
|
||||
@implementation $1 ($2)
|
||||
${3}
|
||||
${0}
|
||||
@end
|
||||
# Category Interface
|
||||
snippet cath
|
||||
@interface ${1:`vim_snippets#Filename('$1', 'NSObject')`} (${2:MyCategory})
|
||||
${3}
|
||||
${0}
|
||||
@end
|
||||
# Method
|
||||
snippet m
|
||||
- (${1:id})${2:method}
|
||||
{
|
||||
${3}
|
||||
${0}
|
||||
}
|
||||
# Method declaration
|
||||
snippet md
|
||||
- (${1:id})${2:method};${3}
|
||||
- (${1:id})${2:method};
|
||||
# IBAction declaration
|
||||
snippet ibad
|
||||
- (IBAction)${1:method}:(${2:id})sender;${3}
|
||||
- (IBAction)${1:method}:(${2:id})sender;
|
||||
# IBAction method
|
||||
snippet iba
|
||||
- (IBAction)${1:method}:(${2:id})sender
|
||||
{
|
||||
${3}
|
||||
${0}
|
||||
}
|
||||
# awakeFromNib method
|
||||
snippet wake
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
${1}
|
||||
${0}
|
||||
}
|
||||
# Class Method
|
||||
snippet M
|
||||
+ (${1:id})${2:method}
|
||||
{
|
||||
${3:return nil;}
|
||||
${0:return nil;}
|
||||
}
|
||||
# Sub-method (Call super)
|
||||
snippet sm
|
||||
- (${1:id})${2:method}
|
||||
{
|
||||
[super $2];${3}
|
||||
[super $2];${0}
|
||||
return self;
|
||||
}
|
||||
# Accessor Methods For:
|
||||
@ -140,29 +140,29 @@ snippet objacc
|
||||
[$3 retain];
|
||||
[$2 release];
|
||||
$2 = $3;
|
||||
}${4}
|
||||
}
|
||||
# for (object in array)
|
||||
snippet forin
|
||||
for (${1:Class} *${2:some$1} in ${3:array}) {
|
||||
${4}
|
||||
${0}
|
||||
}
|
||||
snippet fore
|
||||
for (${1:object} in ${2:array}) {
|
||||
${3:statements}
|
||||
${0:statements}
|
||||
}
|
||||
snippet forarray
|
||||
unsigned int ${1:object}Count = [${2:array} count];
|
||||
|
||||
for (unsigned int index = 0; index < $1Count; index++) {
|
||||
${3:id} $1 = [$2 $1AtIndex:index];
|
||||
${4}
|
||||
${0}
|
||||
}
|
||||
snippet fora
|
||||
unsigned int ${1:object}Count = [${2:array} count];
|
||||
|
||||
for (unsigned int index = 0; index < $1Count; index++) {
|
||||
${3:id} $1 = [$2 $1AtIndex:index];
|
||||
${4}
|
||||
${0}
|
||||
}
|
||||
# Try / Catch Block
|
||||
snippet @try
|
||||
@ -173,75 +173,75 @@ snippet @try
|
||||
${2:handler}
|
||||
}
|
||||
@finally {
|
||||
${3:statements}
|
||||
${0:statements}
|
||||
}
|
||||
snippet @catch
|
||||
@catch (${1:exception}) {
|
||||
${2:handler}
|
||||
${0:handler}
|
||||
}
|
||||
snippet @finally
|
||||
@finally {
|
||||
${1:statements}
|
||||
${0:statements}
|
||||
}
|
||||
# IBOutlet
|
||||
# @property (Objective-C 2.0)
|
||||
snippet prop
|
||||
@property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4}
|
||||
@property (${1:retain}) ${2:NSSomeClass} ${3:*$2};
|
||||
# @synthesize (Objective-C 2.0)
|
||||
snippet syn
|
||||
@synthesize ${1:property};${2}
|
||||
@synthesize ${1:property};
|
||||
# [[ alloc] init]
|
||||
snippet alloc
|
||||
[[${1:foo} alloc] init${2}];${3}
|
||||
[[${1:foo} alloc] init${2}];
|
||||
snippet a
|
||||
[[${1:foo} alloc] init${2}];${3}
|
||||
[[${1:foo} alloc] init${2}];
|
||||
# retain
|
||||
snippet ret
|
||||
[${1:foo} retain];${2}
|
||||
[${1:foo} retain];
|
||||
# release
|
||||
snippet rel
|
||||
[${1:foo} release];
|
||||
[${0:foo} release];
|
||||
# autorelease
|
||||
snippet arel
|
||||
[${1:foo} autorelease];
|
||||
[${0:foo} autorelease];
|
||||
# autorelease pool
|
||||
snippet pool
|
||||
NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
|
||||
${2}
|
||||
${0}
|
||||
[$1 drain];
|
||||
# Throw an exception
|
||||
snippet except
|
||||
NSException *${1:badness};
|
||||
$1 = [NSException exceptionWithName:@"${2:$1Name}"
|
||||
reason:@"${3}"
|
||||
reason:@"${0}"
|
||||
userInfo:nil];
|
||||
[$1 raise];
|
||||
snippet prag
|
||||
#pragma mark ${1:-}
|
||||
#pragma mark ${0:-}
|
||||
snippet cl
|
||||
@class ${1:Foo};${2}
|
||||
@class ${1:Foo};
|
||||
snippet color
|
||||
[[NSColor ${1:blackColor}] set];
|
||||
[[NSColor ${0:blackColor}] set];
|
||||
# NSArray
|
||||
snippet array
|
||||
NSMutableArray *${1:array} = [NSMutable array];${2}
|
||||
NSMutableArray *${1:array} = [NSMutable array];
|
||||
snippet nsa
|
||||
NSArray ${1}
|
||||
NSArray ${0}
|
||||
snippet nsma
|
||||
NSMutableArray ${1}
|
||||
NSMutableArray ${0}
|
||||
snippet aa
|
||||
NSArray * array;${1}
|
||||
NSArray * array;
|
||||
snippet ma
|
||||
NSMutableArray * array;${1}
|
||||
NSMutableArray * array;
|
||||
# NSDictionary
|
||||
snippet dict
|
||||
NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2}
|
||||
NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];
|
||||
snippet nsd
|
||||
NSDictionary ${1}
|
||||
NSDictionary ${0}
|
||||
snippet nsmd
|
||||
NSMutableDictionary ${1}
|
||||
NSMutableDictionary ${0}
|
||||
# NSString
|
||||
snippet nss
|
||||
NSString ${1}
|
||||
NSString ${0}
|
||||
snippet nsms
|
||||
NSMutableString ${1}
|
||||
NSMutableString ${0}
|
||||
|
Reference in New Issue
Block a user