// // Leonhard's text macro specifications // // They are all Objective-C language macros and also show up for Objective-C++ // Version 08.01.2010 // ( // Helpful Comment Blocks to Structure Your Code { Identifier = leonhard; Name = "Leonhard"; IsMenu = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.singleline; BasedOn = leonhard; IsMenuItem = YES; Name = "--- Dashed Line ---"; TextString = "// ---------------------------------------------------------------------------------------------------------------------\n"; CompletionPrefix = "line"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.doubleline; BasedOn = leonhard; IsMenuItem = YES; Name = "== Dashed Line =="; TextString = "// =====================================================================================================================\n"; CompletionPrefix = "lline"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.section; BasedOn = leonhard; IsMenuItem = YES; Name = "Section Header"; TextString = "// ---------------------------------------------------------------------------------------------------------------------\n#pragma mark -\n#pragma mark <#Section Title#>\n// ---------------------------------------------------------------------------------------------------------------------\n"; CompletionPrefix = "section"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, // The proper way to do definitions and declarations of global constant varables, i.e. keystrings { Identifier = leonhard.glodec; BasedOn = leonhard; IsMenuItem = YES; Name = "Declaration of Global Variable"; TextString = "extern NSString *const k<#Prefix#><#Name#>Key;"; CompletionPrefix = "glodec"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.glodef; BasedOn = leonhard; IsMenuItem = YES; Name = "Definition of Global Variable"; TextString = "NSString *const k<#Prefix#><#Name#>Key\t\t\t= @\"<#String Value#>\";"; CompletionPrefix = "glodef"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, // Doxygen comment stubs { Identifier = leonhard.doxygenmethod; BasedOn = leonhard; IsMenuItem = YES; Name = "Method Documentation Comments"; TextString = "/// <#Brief Description#>.\n/**\n\t<#Long Description#>\n\n\t\\param[in]\t<#Variable#>\t<#Explanation#>\n\t\\return\t\t<#Explanation#>\n */"; CompletionPrefix = "doxm"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.doxygenclass; BasedOn = leonhard; IsMenuItem = YES; Name = "Class Documentation Comments"; TextString = "/// <#Brief Description#>.\n/**\n\t<#Long Description#>\n */"; CompletionPrefix = "doxc"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, // The always useful TODO: WHY: etc... { Identifier = leonhard.todo; BasedOn = leonhard; IsMenuItem = YES; Name = "TODO:"; TextString = "// TODO: <#What?#>"; CompletionPrefix = "todo"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, { Identifier = leonhard.why; BasedOn = leonhard; IsMenuItem = YES; Name = "WHY:"; TextString = "// WHY: <#Explanation#>"; CompletionPrefix = "why"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, // often used fragments { Identifier = leonhard.privateinterface; BasedOn = leonhard; IsMenuItem = YES; Name = "@interface(Private) Definition"; TextString = "// =====================================================================================================================\n@interface <#class#> ()\n// =====================================================================================================================\n\n<#methods#>\n\n@end\n"; CompletionPrefix = "@pinterface"; OnlyAtBOL = YES; ExcludeContexts = ( "xcode.lang.objc.implementation", "xcode.lang.objc.interface", "xcode.lang.objc.protocol" ); }, { Identifier = leonhard.userdefaults; BasedOn = leonhard; IsMenuItem = YES; Name = "NSUserDefaults* defaults =..."; TextString = "NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];"; CompletionPrefix = "ud"; OnlyAtBOL = YES; }, { Identifier = leonhard.defcon; BasedOn = leonhard; IsMenuItem = YES; Name = "Observe NSUserDefaultsController"; TextString = "[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@\"defaults.\" stringByAppendingString:<#defaults key#>] options:NSKeyValueObservingOptionNew context:NULL];"; CompletionPrefix = "defcon"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, // Debugging helpers { Identifier = leonhard.logf; BasedOn = leonhard; IsMenuItem = YES; Name = "Log Function Call"; TextString = "NSLog(@\"%s\", __PRETTY_FUNCTION__);"; CompletionPrefix = "logf"; OnlyAtBOL = YES; IncludeContexts = ( "xcode.lang.objc" ); }, )