" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. UseVimball finish after/ftplugin/actionscript_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet dm duplicateMovieClip(".st."target".et.", ".st."newName".et.", ".st."depth".et.");" after/ftplugin/asp_snippets.vim 17 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet rr Response.Redirect(".st."to".et.")".st.et."" exec "Snippet app Application(\"".st.et."\")".st.et."" exec "Snippet forin For ".st."var".et." in ".st."array".et."".st.et."Next".st.et."" exec "Snippet ifelse If ".st."condition".et." Then".st.et."Else".st.et."End if".st.et."" exec "Snippet rw Response.Write ".st.et."" exec "Snippet sess Session(\"".st.et."\")".st.et."" exec "Snippet rf Request.Form(\"".st.et."\")".st.et."" exec "Snippet rq Request.QueryString(\"".st.et."\")".st.et."" exec "Snippet while While ".st."NOT".et." ".st."condition".et."".st.et."Wend".st.et."" after/ftplugin/c_snippets.vim 51 if !exists('loaded_snippet') || &cp finish endif function! Count(haystack, needle) let counter = 0 let index = match(a:haystack, a:needle) while index > -1 let counter = counter + 1 let index = match(a:haystack, a:needle, index+1) endwhile return counter endfunction function! CArgList(count) " This returns a list of empty tags to be used as " argument list placeholders for the call to printf let st = g:snip_start_tag let et = g:snip_end_tag if a:count == 0 return "" else return repeat(', '.st.et, a:count) endif endfunction let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet do do{".st.et."} while (".st.et.");".st.et exec "Snippet readfile std::vector v;if(FILE* fp = fopen(\"".st."filename".et."\", \"r\")){uint8_t buf[1024];while(size_t len = fread(buf, 1, sizeof(buf), fp))v.insert(v.end(), buf, buf + len);fclose(fp);}".st.et exec "Snippet beginend ".st."v".et.".begin(), ".st."v".et.".end()".st.et exec "Snippet once #ifndef _``substitute(expand('%'),'\\(.\\)','\\u\\1','g')``_#define _``substitute(expand('%'),'\\(.\\)','\\u\\1','g')``_".st.et."#endif /* _``substitute(expand('%'),'\\(.\\)','\\u\\1','g')``_ */".st.et "exec "Snippet once #ifndef _".st."file:substitute(expand('%'),'\\(.\\)','\\u\\1','g')".et."_#define _".st."file".et."_".st.et."#endif /* _".st."file".et."_ */".st.et exec "Snippet class class ".st."name".et."{public:".st."name".et." (".st."arguments".et.");virtual ~".st."name".et."();private:".st.et."};".st.et " TODO This is a good one but I can't quite work out the syntax yet exec "Snippet printf printf(\"".st."\"%s\"".et."\\n\"".st."\"%s\":CArgList(Count(@z, '%[^%]'))".et.");".st.et exec "Snippet vector std::vector<".st."char".et."> v".st.et.";" exec "Snippet struct struct ".st."name".et."{".st.et."};".st.et exec "Snippet template template ".st.et " TODO this one as well. Wish I knew more C " Snippet namespace namespace ${1:${TM_FILENAME/(.*?)\\..*/\\L$1/}}\n{\n\t$0\n};.st.et exec "Snippet namespace namespace ".st.":substitute(expand('%'),'.','\\l&', 'g')".et."{".st.et."};".st.et exec "Snippet map std::map<".st."key".et.", ".st."value".et."> map".st.et.";".st.et exec "Snippet mark #if 0".st.et."#endif".st.et exec "Snippet if if(".st.et."){".st.et."}".st.et exec "Snippet main int main (int argc, char const* argv[]){".st.et."return 0;}".st.et exec "Snippet Inc #include <".st.et.">".st.et exec "Snippet inc #include \"".st.et.".h\"".st.et exec "Snippet for for( ".st.et." ".st."i".et." = ".st.et."; ".st."i".et." < ".st."count".et."; ".st."i".et." += ".st.et."){".st.et."}".st.et after/ftplugin/css_snippets.vim 30 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet visibility ".st.et.";".st.et exec "Snippet list list-style-image: url(".st.et.");".st.et exec "Snippet text text-shadow: rgb(".st.et.", ".st.et.", ".st.et.", ".st.et." ".st.et." ".st.et.";".st.et exec "Snippet overflow overflow: ".st.et.";".st.et exec "Snippet white white-space: ".st.et.";".st.et exec "Snippet clear cursor: url(".st.et.");".st.et exec "Snippet margin padding-top: ".st.et.";".st.et exec "Snippet background background #".st.et." url(".st.et.") ".st.et." ".st.et." top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x% y%/x-pos y-pos')".et.";".st.et exec "Snippet word word-spaceing: ".st.et.";".st.et exec "Snippet z z-index: ".st.et.";".st.et exec "Snippet vertical vertical-align: ".st.et.";".st.et exec "Snippet marker marker-offset: ".st.et.";".st.et exec "Snippet cursor cursor: ".st.et.";".st.et exec "Snippet border border-right: ".st.et."px ".st.et." #".st.et.";".st.et exec "Snippet display display: block;".st.et exec "Snippet padding padding: ".st.et." ".st.et.";".st.et exec "Snippet letter letter-spacing: ".st.et."em;".st.et exec "Snippet color color: rgb(".st.et.", ".st.et.", ".st.et.");".st.et exec "Snippet font font-weight: ".st.et.";".st.et exec "Snippet position position: ".st.et.";".st.et exec "Snippet direction direction: ".st.et.";".st.et exec "Snippet float float: ".st.et.";".st.et after/ftplugin/django_model_snippets.vim 61 if !exists('loaded_snippet') || &cp finish endif function! Count(haystack, needle) let counter = 0 let index = match(a:haystack, a:needle) while index > -1 let counter = counter + 1 let index = match(a:haystack, a:needle, index+1) endwhile return counter endfunction function! DjangoArgList(count) " This needs to be Python specific as print expects a " tuple and an empty tuple looks like this (,) so we'll need to make a " special case for it let st = g:snip_start_tag let et = g:snip_end_tag if a:count == 0 return "()" else return '('.repeat(st.et.', ', a:count).')' endif endfunction let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet mmodel class ".st.et."(models.Model):\"\"\"".st.et."\"\"\"".st.et." = ".st.et."class Admin:passdef __str__(self):return \"".st."s".et."\" % ".st."s:DjangoArgList(Count(@z, '%[^%]'))".et."".st.et exec "Snippet mauto models.AutoField(".st.et.")".st.et exec "Snippet mbool models.BooleanField()".st.et exec "Snippet mchar models.CharField(maxlength=".st."50".et.st.et.")".st.et exec "Snippet mcsi models.CommaSeparatedIntegerField(maxlength=".st."50".et.st.et.")".st.et exec "Snippet mdate models.DateField(".st.et.")".st.et exec "Snippet mdatet models.DateTimeField(".st.et.")".st.et exec "Snippet memail models.EmailField(".st.et.")".st.et exec "Snippet mfile models.FileField(upload_to=\"".st.et."\"".st.et.")".st.et exec "Snippet mfilep models.FilePathField(path=\"".st.et."\"".st.et.")".st.et exec "Snippet mfloat models.FloatField(max_digits=".st.et.", decimal_places=".st.et.")".st.et exec "Snippet mimage models.ImageField(".st.et.")".st.et exec "Snippet mint models.IntegerField(".st.et.")".st.et exec "Snippet mipadd models.IPAddressField(".st.et.")".st.et exec "Snippet mnull models.NullBooleanField()".st.et exec "Snippet mphone models.PhoneNumberField(".st.et.")".st.et exec "Snippet mpint models.PositiveIntegerField(".st.et.")".st.et exec "Snippet mspint models.PositiveSmallIntegerField(".st.et.")".st.et exec "Snippet mslug models.SlugField(".st.et.")".st.et exec "Snippet msint models.SmallIntegerField(".st.et.")".st.et exec "Snippet mtext models.TextField(".st.et.")".st.et exec "Snippet mtime models.TimeField(".st.et.")".st.et exec "Snippet murl models.URLField(verify_exists=".st."True".et.st.et.")".st.et exec "Snippet muss models.USStateField(".st.et.")".st.et exec "Snippet mxml models.XMLField(schema_path=\"".st.et."\"".st.et.")".st.et exec "Snippet mfor models.ForeignKey(".st.et.")".st.et exec "Snippet mm2o models.ForeignKey(".st.et.")".st.et exec "Snippet mm2m models.ManyToManyField(".st.et.")".st.et exec "Snippet mo2o models.OneToOneField(".st.et.")".st.et exec "Snippet mman models.Manager()".st.et after/ftplugin/django_template_snippets.vim 32 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet {{ {% templatetag openvariable %}".st.et exec "Snippet }} {% templatetag closevariable %}".st.et exec "Snippet {% {% templatetag openblock %}".st.et exec "Snippet %} {% templatetag closeblock %}".st.et exec "Snippet now {% now \"".st.et."\" %}".st.et exec "Snippet firstof {% firstof ".st.et." %}".st.et exec "Snippet ifequal {% ifequal ".st.et." ".st.et." %}".st.et."{% endifequal %}".st.et exec "Snippet ifchanged {% ifchanged %}".st.et."{% endifchanged %}".st.et exec "Snippet regroup {% regroup ".st.et." by ".st.et." as ".st.et." %}".st.et exec "Snippet extends {% extends \"".st.et."\" %}".st.et exec "Snippet filter {% filter ".st.et." %}".st.et."{% endfilter %}".st.et exec "Snippet block {% block ".st.et." %}".st.et."{% endblock %}".st.et exec "Snippet cycle {% cycle ".st.et." as ".st.et." %}".st.et exec "Snippet if {% if ".st.et." %}".st.et."{% endif %}".st.et exec "Snippet debug {% debug %}".st.et exec "Snippet ifnotequal {% ifnotequal ".st.et." ".st.et." %}".st.et."{% endifnotequal %}".st.et exec "Snippet include {% include ".st.et." %}".st.et exec "Snippet comment {% comment %}".st.et."{% endcomment %}".st.et exec "Snippet for {% for ".st.et." in ".st.et." %}".st.et."{% endfor %}".st.et exec "Snippet ssi {% ssi ".st.et." ".st.et." %}".st.et exec "Snippet widthratio {% widthratio ".st.et." ".st.et." ".st.et." %}".st.et exec "Snippet load {% load ".st.et." %}".st.et " Field snippet contributed by Alex Pounds exec "Snippet field

{{ form.".st."fieldname".et." }}{% if form.".st."fieldname".et.".errors %}*** {{ form.".st."fieldname".et.".errors|join:\", \" }} {% endif %}

".st.et after/ftplugin/f-script_snippets.vim 14 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet tbd to:".st.et." by:".st.et." do:[ ".st.et." |".st.et."].".st.et exec "Snippet it ifTrue:[".st.et."].".st.et exec "Snippet ift ifFalse:[".st.et."] ifTrue:[".st.et."].".st.et exec "Snippet itf ifTrue:[".st.et."] ifFalse:[".st.et."].".st.et exec "Snippet td to:".st.et." do:[".st.et." ".st.et." |".st.et."].".st.et exec "Snippet if ifFalse:[".st.et."].".st.et after/ftplugin/haskell_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet mod module: ".st.et." where".st.et after/ftplugin/html_snippets.vim 57 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim function! SelectDoctype() let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim let dt = inputlist(['Select doctype:', \ '1. HTML 4.01', \ '2. HTML 4.01 Transitional', \ '3. HTML 4.01 Frameset', \ '4. XHTML 1.0 Frameset', \ '5. XHTML Strict', \ '6. XHTML Transitional', \ '7. XHTML Frameset']) let dts = {1: "\n".st.et, \ 2: "\n".st.et, \ 3: "\n".st.et, \ 4: "\n".st.et, \ 5: "\n".st.et, \ 6: "\n".st.et, \ 7: "\n".st.et} return dts[dt] endfunction exec "Snippet doct ``SelectDoctype()``" exec "Snippet doctype \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">".st.et exec "Snippet doc4s \"http://www.w3.org/TR/html4/strict.dtd\">".st.et exec "Snippet doc4t \"http://www.w3.org/TR/html4/loose.dtd\">".st.et exec "Snippet doc4f \"http://www.w3.org/TR/html4/frameset.dtd\">".st.et exec "Snippet docxs \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">".st.et exec "Snippet docxt \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">".st.et exec "Snippet docxf \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">".st.et exec "Snippet head ".st.et."".st.et."".st.et exec "Snippet script ".st.et exec "Snippet title ".st.et."" exec "Snippet body ".st.et."".st.et exec "Snippet scriptsrc ".st.et exec "Snippet textarea ".st.et exec "Snippet meta ".st.et exec "Snippet movie classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">value=\"".st.et."\" />width=\"".st.et."\" height=\"".st."D('240')".et."\"controller=\"".st.et."\" autoplay=\"".st.et."\"scale=\"tofit\" cache=\"true\"pluginspage=\"http://www.apple.com/quicktime/download/\"/>".st.et exec "Snippet div
".st.et."
".st.et exec "Snippet mailto ".st.et."".st.et exec "Snippet table
<:D('Header')".et."
".st.et."
" exec "Snippet link " exec "Snippet form
".st.et."

".st.et exec "Snippet ref ".st.et."".st.et exec "Snippet h1

".st.et."

".st.et exec "Snippet input ".st.et exec "Snippet style ".st.et exec "Snippet base ".st.et after/ftplugin/java_snippets.vim 52 if !exists('loaded_snippet') || &cp finish endif function! UpFirst() return substitute(@z,'.','\u&','') endfunction function! JavaTestFileName(type) let filepath = expand('%:p') let filepath = substitute(filepath, '/','.','g') let filepath = substitute(filepath, '^.\(:\\\)\?','','') let filepath = substitute(filepath, '\','.','g') let filepath = substitute(filepath, ' ','','g') let filepath = substitute(filepath, '.*test.','','') if a:type == 1 let filepath = substitute(filepath, '.[A-Za-z]*.java','','g') elseif a:type == 2 let filepath = substitute(filepath, 'Tests.java','','') elseif a:type == 3 let filepath = substitute(filepath, '.*\.\([A-Za-z]*\).java','\1','g') elseif a:type == 4 let filepath = substitute(filepath, 'Tests.java','','') let filepath = substitute(filepath, '.*\.\([A-Za-z]*\).java','\1','g') elseif a:type == 5 let filepath = substitute(filepath, 'Tests.java','','') let filepath = substitute(filepath, '.*\.\([A-Za-z]*\).java','\1','g') let filepath = substitute(filepath, '.','\l&','') endif return filepath endfunction let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet method // {{{ ".st."method".et."/** * ".st.et." */public ".st."return".et." ".st."method".et."() {".st.et."}// }}}".st.et exec "Snippet jps private static final ".st."string".et." ".st.et." = \"".st.et."\";".st.et exec "Snippet jtc try {".st.et."} catch (".st.et." e) {".st.et."} finally {".st.et."}".st.et exec "Snippet jlog /** Logger for this class and subclasses. */protected final Log log = LogFactory.getLog(getClass());".st.et exec "Snippet jpv private ".st."string".et." ".st.et.";".st.et exec "Snippet bean // {{{ set".st."fieldName:UpFirst()".et."/** * Setter for ".st."fieldName".et.". * @param new".st."fieldName:UpFirst()".et." new value for ".st."fieldName".et." */public void set".st."fieldName:UpFirst()".et."(".st."String".et." new".st."fieldName:UpFirst()".et.") {".st."fieldName".et." = new".st."fieldName:UpFirst()".et.";}// }}}// {{{ get".st."fieldName:UpFirst()".et."/** * Getter for ".st."fieldName".et.". * @return ".st."fieldName".et." */public ".st."String".et." get".st."fieldName:UpFirst()".et."() {return ".st."fieldName".et.";}// }}}".st.et exec "Snippet jwh while (".st.et.") { // ".st.et."".st.et."}".st.et exec "Snippet sout System.out.println(\"".st.et."\");".st.et exec "Snippet jtest package ".st."j:JavaTestFileName(1)".et."import junit.framework.TestCase;import ".st."j:JavaTestFileName(2)".et.";/** * ".st."j:JavaTestFileName(3)".et." * * @author ".st.et." * @since ".st.et." */public class ".st."j:JavaTestFileName(3)".et." extends TestCase {private ".st."j:JavaTestFileName(4)".et." ".st."j:JavaTestFileName(5)".et.";public ".st."j:JavaTestFileName(4)".et." get".st."j:JavaTestFileName(4)".et."() { return this.".st."j:JavaTestFileName(5)".et."; }public void set".st."j:JavaTestFileName(4)".et."(".st."j:JavaTestFileName(4)".et." ".st."j:JavaTestFileName(5)".et.") { this.".st."j:JavaTestFileName(5)".et." = ".st."j:JavaTestFileName(5)".et."; }public void test".st.et."() {".st.et."}}".st.et exec "Snippet jif if (".st.et.") { // ".st.et."".st.et."}".st.et exec "Snippet jelse if (".st.et.") { // ".st.et."".st.et."} else { // ".st.et."".st.et."}".st.et exec "Snippet jpm /** * ".st.et." * * @param ".st.et." ".st.et." * ".st.et." ".st.et." */private ".st."void".et." ".st.et."(".st."String".et." ".st.et.") {".st.et."}".st.et exec "Snippet main public main static void main(String[] ars) {".st."\"System.exit(0)\"".et.";}".st.et exec "Snippet jpum /** * ".st.et." * * @param ".st.et." ".st.et." *".st.et." ".st.et." */public ".st."void".et." ".st.et."(".st."String".et." ".st.et.") {".st.et."}".st.et exec "Snippet jcout ".st.et after/ftplugin/javascript_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet proto ".st."className".et.".prototype.".st."methodName".et." = function(".st.et."){".st.et."};".st.et exec "Snippet fun function ".st."functionName".et." (".st.et."){".st.et."}".st.et after/ftplugin/latex_snippets.vim 13 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet sub \\subsection{".st."name".et."}\\label{sub:".st."name:substitute(@z,'.','\\l&','g')".et."}".st.et exec "Snippet $$ \\[".st.et."\\]".st.et exec "Snippet ssub \\subsubsection{".st."name".et."}\\label{ssub:".st."name:substitute(@z,'.','\\l&','g')".et."}".st.et exec "Snippet itd \\item[".st."desc".et."] ".st.et exec "Snippet sec \\section{".st."name".et."}\\label{sec:".st."name:substitute(@z,'.','\\l&','g')".et."}".st.et after/ftplugin/logo_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet to to ".st."name".et." ".st."argument".et."".st.et."end".st.et after/ftplugin/markdown_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet img ![".st."altText".et."](".st."SRC".et.")".st.et exec "Snippet link [".st."desc".et."](".st."HREF".et.")".st.et after/ftplugin/movable_type_snippets.vim 14 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet cat <$MTCategoryDescription$>".st.et exec "Snippet blog <$MTBlogName$>".st.et exec "Snippet archive <$MTArchiveFile$>".st.et exec "Snippet cal ".st.et."".st.et exec "Snippet entry <$MTEntryMore$>".st.et exec "Snippet entries ".st.et."".st.et after/ftplugin/objc_snippets.vim 53 if !exists('loaded_snippet') || &cp finish endif function! UpFirst() return substitute(@z,'.','\u&','') endfunction function! Count(haystack, needle) let counter = 0 let index = match(a:haystack, a:needle) while index > -1 let counter = counter + 1 let index = match(a:haystack, a:needle, index+1) endwhile return counter endfunction function! ObjCArgList(count) let st = g:snip_start_tag let et = g:snip_end_tag if a:count == 0 return st.et else return st.et.repeat(', '.st.et, a:count) endif endfunction let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet cat @interface ".st."NSObject".et." (".st."Category".et.")@end@implementation ".st."NSObject".et." (".st."Category".et.")".st.et."@end".st.et exec "Snippet delacc - (id)delegate;- (void)setDelegate:(id)delegate;".st.et exec "Snippet ibo IBOutlet ".st."NSSomeClass".et." *".st."someClass".et.";".st.et exec "Snippet dict NSMutableDictionary *".st."dict".et." = [NSMutableDictionary dictionary];".st.et exec "Snippet Imp #import <".st.et.".h>".st.et exec "Snippet objc @interface ".st."class".et." : ".st."NSObject".et."{}@end@implementation ".st."class".et."- (id)init{self = [super init]; if (self != nil){".st.et."}return self;}@end".st.et exec "Snippet imp #import \"".st.et.".h\"".st.et exec "Snippet bez NSBezierPath *".st."path".et." = [NSBezierPath bezierPath];".st.et exec "Snippet acc - (".st."\"unsigned int\"".et.")".st."thing".et."{return ".st."fThing".et.";}- (void)set".st."thing:UpFirst()".et.":(".st."\"unsigned int\"".et.")new".st."thing:UpFirst()".et."{".st."fThing".et." = new".st."thing:UpFirst()".et.";}".st.et exec "Snippet format [NSString stringWithFormat:@\"".st.et."\", ".st.et."]".st.et exec "Snippet focus [self lockFocus];".st.et."[self unlockFocus];".st.et exec "Snippet setprefs [[NSUserDefaults standardUserDefaults] setObject:".st."object".et." forKey:".st."key".et."];".st.et exec "Snippet log NSLog(@\"%s".st."s".et."\", ".st."s:ObjCArgList(Count(@z, '%[^%]'))".et.");".st.et exec "Snippet gsave [NSGraphicsContext saveGraphicsState];".st.et."[NSGraphicsContext restoreGraphicsState];".st.et exec "Snippet forarray for(unsigned int index = 0; index < [".st."array".et." count]; index += 1){".st."id".et."object = [".st."array".et." objectAtIndex:index];".st.et."}".st.et exec "Snippet classi @interface ".st."ClassName".et." : ".st."NSObject".et."{".st.et."}".st.et."@end".st.et exec "Snippet array NSMutableArray *".st."array".et." = [NSMutableArray array];".st.et exec "Snippet getprefs [[NSUserDefaults standardUserDefaults] objectForKey:];".st.et exec "Snippet cati @interface ".st."NSObject".et." (".st."Category".et.")".st.et."@end".st.et after/ftplugin/ocaml_snippets.vim 26 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet Queue Queue.fold ".st.et." ".st."base".et." ".st."q".et."".st.et exec "Snippet Nativeint Nativeint.abs ".st."ni".et.st.et exec "Snippet Printexc Printexc.print ".st."fn".et." ".st."x".et.st.et exec "Snippet Sys Sys.Signal_ignore".st.et exec "Snippet Hashtbl Hashtbl.iter ".st.et." ".st."h".et.st.et exec "Snippet Array Array.map ".st.et." ".st."arr".et.st.et exec "Snippet Printf Printf.fprintf ".st."buf".et." \"".st."format".et."\" ".st."args".et.st.et exec "Snippet Stream Stream.iter ".st.et." ".st."stream".et.st.et exec "Snippet Buffer Buffer.add_channel ".st."buf".et." ".st."ic".et." ".st."len".et.st.et exec "Snippet Int32 Int32.abs ".st."i32".et.st.et exec "Snippet List List.rev_map ".st.et." ".st."lst".et.st.et exec "Snippet Scanf Scanf.bscaf ".st."sbuf".et." \"".st."format".et."\" ".st."f".et.st.et exec "Snippet Int64 Int64.abs ".st."i64".et.st.et exec "Snippet Map Map.Make ".st.et exec "Snippet String String.iter ".st.et." ".st."str".et.st.et exec "Snippet Genlex Genlex.make_lexer ".st."\"tok_lst\"".et." ".st."\"char_stream\"".et.st.et exec "Snippet for for ".st."i}".et." = ".st.et." to ".st.et." do".st.et."done".st.et exec "Snippet Stack Stack.iter ".st.et." ".st."stk".et.st.et after/ftplugin/perl_snippets.vim 23 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet sub sub ".st."FunctionName".et." {".st.et."}".st.et exec "Snippet class package ".st."ClassName".et.";".st.et.st."ParentClass".et.st.et.";sub new {my \$class = shift;\$class = ref \$class if ref \$class;my $self = bless {}, \$class;\$self;}1;".st.et exec "Snippet xfore ".st."expression".et." foreach @".st."array".et.";".st.et exec "Snippet xwhile ".st."expression".et." while ".st."condition".et.";".st.et exec "Snippet xunless ".st."expression".et." unless ".st."condition".et.";".st.et exec "Snippet slurp my $".st."var".et.";{ local $/ = undef; local *FILE; open FILE, \"<".st."file".et.">\"; $".st."var".et." = ; close FILE }".st.et exec "Snippet if if (".st.et.") {".st.et."}".st.et exec "Snippet unless unless (".st.et.") {".st.et."}".st.et exec "Snippet ifee if (".st.et.") {".st.et."} elsif (".st.et.") {".st.et."} else {".st.et."}".st.et exec "Snippet ife if (".st.et.") {".st.et."} else {".st.et."}".st.et exec "Snippet for for (my \$".st."var".et." = 0; \$".st."var".et." < ".st."expression".et."; \$".st."var".et."++) {".st.et."}".st.et exec "Snippet fore foreach my \$".st."var".et." (@".st."array".et.") {".st.et."}".st.et exec "Snippet eval eval {".st.et."};if ($@) {".st.et."}".st.et exec "Snippet while while (".st.et.") {".st.et."}".st.et exec "Snippet xif ".st."expression".et." if ".st."condition".et.";".st.et after/ftplugin/php_snippets.vim 30 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet elseif elseif ( ".st."condition".et." ){".st.et."}".st.et exec "Snippet do do{".st.et."} while ( ".st.et." );".st.et exec "Snippet reql require_once( '".st."file".et."' );".st.et exec "Snippet if? $".st."retVal".et." = ( ".st."condition".et." ) ? ".st."a".et." : ".st."b".et." ;".st.et exec "Snippet php ".st.et."?>" exec "Snippet switch switch ( ".st."variable".et." ){case '".st."value".et."':".st.et."break;".st.et."default:".st.et."break;}".st.et exec "Snippet class #doc#classname:".st."ClassName".et."#scope:".st."PUBLIC".et."##/docclass ".st."ClassName".et." ".st."extendsAnotherClass".et."{#internal variables#Constructorfunction __construct ( ".st."argument".et."){".st.et."}###}###".st.et exec "Snippet incll include_once( '".st."file".et."' );".st.et exec "Snippet incl include( '".st."file".et."' );".st.et exec "Snippet foreach foreach( $".st."variable".et." as $".st."key".et." => $".st."value".et." ){".st.et."}".st.et exec "Snippet ifelse if ( ".st."condition".et." ){".st.et."}else{".st.et."}".st.et exec "Snippet $_ $_REQUEST['".st."variable".et."']".st.et exec "Snippet case case '".st."variable".et."':".st.et."break;".st.et exec "Snippet print print \"".st."string".et."\"".st.et.";".st.et."".st.et exec "Snippet function ".st."public".et."function ".st."FunctionName".et." (".st.et."){".st.et."}".st.et exec "Snippet if if ( ".st."condition".et." ){".st.et."}".st.et exec "Snippet else else{".st.et."}".st.et exec "Snippet array $".st."arrayName".et." = array( '".st.et."',".st.et." );".st.et exec "Snippet -globals $GLOBALS['".st."variable".et."']".st.et.st."something".et.st.et.";".st.et exec "Snippet req require( '".st."file".et."' );".st.et exec "Snippet for for ( $".st."i".et."=".st.et."; $".st."i".et." < ".st.et."; $".st."i".et."++ ){ ".st.et."}".st.et exec "Snippet while while ( ".st.et." ){".st.et."}".st.et after/ftplugin/phpdoc_snippets.vim 19 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet doc_d /*** ".st."undocumentedConstant".et."**/define(".st.et.", ".st.et.");".st.et."".st.et exec "Snippet doc_vp /*** ".st."undocumentedClassVariable".et."** @var ".st."string".et.st.et."**/".st.et."" exec "Snippet doc_f /*** ".st."undocumentedFunction".et."** @return ".st."void".et."* @author ".st.et."**/".st.et."function ".st.et."(".st.et."){".st.et."}".st.et exec "Snippet doc_s /*** ".st."undocumentedFunction".et."** @return ".st."void".et."* @author ".st.et."**/".st.et."function ".st.et."(".st.et.");".st.et exec "Snippet doc_h /*** ".st.et."** @author ".st.et."* @version $Id$* @copyright ".st.et.", ".st.et."* @package ".st."default".et."**//*** Define DocBlock**/".st.et exec "Snippet doc_fp /*** ".st."undocumentedFunction".et."** @return ".st."void".et."* @author ".st.et."**/".st.et."" exec "Snippet doc_i /*** ".st."undocumentedClass".et."** @package ".st."default".et."* @author ".st.et."**/interface ".st.et."{".st.et."} // END interface ".st.et."".st.et exec "Snippet doc_fp /*** ".st."undocumentedConstant".et.st.et."**/".st.et."".st.et exec "Snippet doc_v /*** ".st."undocumentedClassVariable".et."** @var ".st."string".et."**/ $".st.et.";".st.et."".st.et exec "Snippet doc_cp /*** ".st."undocumentedClass".et."** @package ".st."default".et."* @author ".st.et."**/".st.et exec "Snippet doc_c /*** ".st."undocumentedClass".et."** @package ".st."default".et."* @author ".st.et."**/".st."class".et."class ".st."a".et."{".st.et."} // END ".st."class".et."class ".st."a".et."".st.et after/ftplugin/propel_snippets.vim 14 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet ".st.et exec "Snippet ".st.et."".st.et exec "Snippet ".st.et exec "Snippet ".st.et exec "Snippet

".st.et exec "Snippet \"/>".st.et after/ftplugin/python_snippets.vim 202 if !exists('loaded_snippet') || &cp finish endif " Given a string containing a list of arguments (e.g. "one, two = 'test'"), " this function cleans it up by removing useless whitespace and commas. function! PyCleanupArgs(text) if a:text == 'args' return '' endif let text = substitute(a:text, '\(\w\)\s\(\w\)', '\1,\2', 'g') return ', '.join(split(text, '\s*,\s*'), ', ') endfunction " Given a string containing a list of arguments (e.g. "one = 'test', *args, " **kwargs"), this function returns a string containing only the variable " names, separated by spaces, e.g. "one two". function! PyGetVarnamesFromArgs(text) let text = substitute(a:text, 'self,*\s*', '', '') let text = substitute(text, '\*\*\?\k\+', '', 'g') let text = substitute(text, '=.\{-},', '', 'g') let text = substitute(text, '=.\{-}$', '', 'g') let text = substitute(text, '\s*,\s*', ' ', 'g') if text == ' ' return '' endif return text endfunction " Returns the current indent as a string. function! PyGetIndentString() if &expandtab let tabs = indent('.') / &shiftwidth let tabstr = repeat(' ', &shiftwidth) else let tabs = indent('.') / &tabstop let tabstr = '\t' endif return repeat(tabstr, tabs) endfunction " Given a string containing a list of arguments (e.g. "one = 'test', *args, " **kwargs"), this function returns them formatted correctly for the " docstring. function! PyGetDocstringFromArgs(text) let text = PyGetVarnamesFromArgs(a:text) if a:text == 'args' || text == '' return '' endif let indent = PyGetIndentString() let st = g:snip_start_tag let et = g:snip_end_tag let docvars = map(split(text), 'v:val." -- ".st.et') return '\n'.indent.join(docvars, '\n'.indent).'\n'.indent endfunction " Given a string containing a list of arguments (e.g. "one = 'test', *args, " **kwargs"), this function returns them formatted as a variable assignment in " the form "self._ONE = ONE", as used in class constructors. function! PyGetVariableInitializationFromVars(text) let text = PyGetVarnamesFromArgs(a:text) if a:text == 'args' || text == '' return '' endif let indent = PyGetIndentString() let st = g:snip_start_tag let et = g:snip_end_tag let assert_vars = map(split(text), '"assert ".v:val." ".st.et') let assign_vars = map(split(text), '"self._".v:val." = ".v:val') let assertions = join(assert_vars, '\n'.indent) let assignments = join(assign_vars, '\n'.indent) return assertions.'\n'.indent.assignments.'\n'.indent endfunction " Given a string containing a list of arguments (e.g. "one = 'test', *args, " **kwargs"), this function returns them with the default arguments removed. function! PyStripDefaultValue(text) return substitute(a:text, '=.*', '', 'g') endfunction " Returns the number of occurences of needle in haystack. function! Count(haystack, needle) let counter = 0 let index = match(a:haystack, a:needle) while index > -1 let counter = counter + 1 let index = match(a:haystack, a:needle, index+1) endwhile return counter endfunction " Returns replacement if the given subject matches the given match. " Returns the subject otherwise. function! PyReplace(subject, match, replacement) if a:subject == a:match return a:replacement endif return a:subject endfunction " Returns the % operator with a tuple containing n elements appended, where n " is the given number. function! PyHashArgList(count) if a:count == 0 return '' endif let st = g:snip_start_tag let et = g:snip_end_tag return ' % ('.st.et.repeat(', '.st.et, a:count - 1).')' endfunction let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim " Note to users: The following method of defininf snippets is to allow for " changes to the default tags. " Feel free to define your own as so: " Snippet mysnip This is the expansion text.<{}> " There is no need to use exec if you are happy to hardcode your own start and " end tags " Properties, setters and getters. exec "Snippet prop ".st."attribute".et." = property(get_".st."attribute".et.", set_".st."attribute".et.st.et.")".st.et exec "Snippet get def get_".st."name".et."(self):return self._".st."name".et."".st.et exec "Snippet set def set_".st."name".et."(self, ".st."value".et."): \self._".st."name".et." = ".st."value:PyStripDefaultValue(@z)".et." \".st.et " Functions and methods. exec "Snippet def def ".st."fname".et."(".st."args:PyCleanupArgs(@z)".et."): \\"\"\" \".st.et." \".st."args:PyGetDocstringFromArgs(@z)".et."\"\"\" \".st."pass".et." \".st.et exec "Snippet cm ".st."class".et." = classmethod(".st."class".et.")".st.et " Class definition. exec "Snippet cl class ".st."ClassName".et."(".st."object".et."): \\"\"\" \This class represents ".st.et." \\"\"\" \ \def __init__(self".st."args:PyCleanupArgs(@z)".et."): \\"\"\" \Constructor. \".st."args:PyGetDocstringFromArgs(@z)".et."\"\"\" \".st."args:PyGetVariableInitializationFromVars(@z)".et.st.et " Keywords exec "Snippet for for ".st."variable".et." in ".st."ensemble".et.":".st."pass".et."".st.et exec "Snippet pf print '".st."s".et."'".st."s:PyHashArgList(Count(@z, '%[^%]'))".et."".st.et exec "Snippet im import ".st."module".et."".st.et exec "Snippet from from ".st."module".et." import ".st.'name:PyReplace(@z, "name", "*")'.et."".st.et exec "Snippet % '".st."s".et."'".st."s:PyHashArgList(Count(@z, '%[^%]'))".et.st.et exec "Snippet ass assert ".st."expression".et.st.et " From Kib2 exec "Snippet bc \"\"\"".st.et."\"\"\"".st.et " Try, except, finally. exec "Snippet trye try: \".st.et." \except Exception, e: \".st.et." \".st.et exec "Snippet tryf try: \".st.et." \finally: \".st.et." \".st.et exec "Snippet tryef try: \".st.et." \except Exception, e: \".st.et." \finally: \".st.et." \".st.et " Other multi statement templates " From Panos exec "Snippet ifn if __name__ == '".st."main".et."':".st.et exec "Snippet ifmain if __name__ == '__main__':".st.et " Shebang exec "Snippet sb #!/usr/bin/env python# -*- coding: ".st."encoding".et." -*-".st.et exec "Snippet sbu #!/usr/bin/env python# -*- coding: UTF-8 -*-".st.et " From Kib2 exec "Snippet sbl1 #!/usr/bin/env python# -*- coding: Latin-1 -*-".st.et " Unit tests. exec "Snippet unittest if __name__ == '__main__': \import unittest \ \class ".st."ClassName".et."Test(unittest.TestCase): \def setUp(self): \".st."pass".et." \ \def runTest(self): \".st.et after/ftplugin/rails_snippets.vim 54 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet mrnt rename_table \"".st."oldTableName".et."\", \"".st."newTableName".et."\"".st.et exec "Snippet rfu render :file => \"".st."filepath".et."\", :use_full_path => ".st."false".et.st.et exec "Snippet rns render :nothing => ".st."true".et.", :status => ".st.et.st.et exec "Snippet ri render :inline => \"".st.et."\")>\"".st.et exec "Snippet rt render :text => \"".st.et."\"".st.et exec "Snippet mcc t.column \"".st."title".et."\", :".st."string".et.st.et exec "Snippet rpl render :partial => \"".st."item".et."\", :locals => { :".st."name".et." => \"".st."value".et."\"".st.et." }".st.et exec "Snippet rea redirect_to :action => \"".st."index".et."\"".st.et exec "Snippet rtlt render :text => \"".st.et."\", :layout => ".st."true".et.st.et exec "Snippet ft <%= form_tag :action => \"".st."update".et."\" %>".st.et exec "Snippet forin <% for ".st."item".et." in ".st.et." %><%= ".st."item".et.".".st."name".et." %><% end %>".st.et exec "Snippet lia <%= link_to \"".st.et."\", :action => \"".st."index".et."\" %>".st.et exec "Snippet rl render :layout => \"".st."layoutname".et."\"".st.et exec "Snippet ra render :action => \"".st."action".et."\"".st.et exec "Snippet mrnc rename_column \"".st."table".et."\", \"".st."oldColumnName".et."\", \"".st."newColumnName".et."\"".st.et exec "Snippet mac add_column \"".st."table".et."\", \"".st."column".et."\", :".st."string".et.st.et exec "Snippet rpc render :partial => \"".st."item".et."\", :collection => ".st."items".et.st.et exec "Snippet rec redirect_to :controller => \"".st."items".et."\"".st.et exec "Snippet rn render :nothing => ".st."true".et.st.et exec "Snippet lic <%= link_to \"".st.et."\", :controller => \"".st.et."\" %>".st.et exec "Snippet rpo render :partial => \"".st."item".et."\", :object => ".st."object".et.st.et exec "Snippet rts render :text => \"".st.et."\", :status => ".st.et exec "Snippet rcea render_component :action => \"".st."index".et."\"".st.et exec "Snippet recai redirect_to :controller => \"".st."items".et."\", :action => \"".st."show".et."\", :id => ".st.et exec "Snippet mcdt create_table \"".st."table".et."\" do |t|".st.et."end".st.et exec "Snippet ral render :action => \"".st."action".et."\", :layout => \"".st."layoutname".et."\"".st.et exec "Snippet rit render :inline => \"".st.et."\", :type => ".st.et exec "Snippet rceca render_component :controller => \"".st."items".et."\", :action => \"".st."index".et."\"".st.et exec "Snippet licai <%= link_to \"".st.et."\", :controller => \"".st."items".et."\", :action => \"".st."edit".et."\", :id => ".st.et." %>".st.et exec "Snippet verify verify :only => [:".st.et."], :method => :post, :render => {:status => 500, :text => \"use HTTP-POST\"}".st.et exec "Snippet mdt drop_table \"".st."table".et."\"".st.et exec "Snippet rp render :partial => \"".st."item".et."\"".st.et exec "Snippet rcec render_component :controller => \"".st."items".et."\"".st.et exec "Snippet mrc remove_column \"".st."table".et."\", \"".st."column".et."\"".st.et exec "Snippet mct create_table \"".st."table".et."\" do |t|".st.et."end".st.et exec "Snippet flash flash[:".st."notice".et."] = \"".st.et."\"".st.et exec "Snippet rf render :file => \"".st."filepath".et."\"".st.et exec "Snippet lica <%= link_to \"".st.et."\", :controller => \"".st."items".et."\", :action => \"".st."index".et."\" %>".st.et exec "Snippet liai <%= link_to \"".st.et."\", :action => \"".st."edit".et."\", :id => ".st.et." %>".st.et exec "Snippet reai redirect_to :action => \"".st."show".et."\", :id => ".st.et exec "Snippet logi logger.info \"".st.et."\"".st.et exec "Snippet marc add_column \"".st."table".et."\", \"".st."column".et."\", :".st."string".et."".st.et."".st.et exec "Snippet rps render :partial => \"".st."item".et."\", :status => ".st.et exec "Snippet ril render :inline => \"".st.et."\", :locals => { ".st.et." => \"".st."value".et."\"".st.et." }".st.et exec "Snippet rtl render :text => \"".st.et."\", :layout => \"".st.et."\"".st.et exec "Snippet reca redirect_to :controller => \"".st."items".et."\", :action => \"".st."list".et."\"".st.et after/ftplugin/ruby_snippets.vim 32 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet do do".st.et."end".st.et exec "Snippet class class ".st."className".et."".st.et."end".st.et exec "Snippet begin begin".st.et."rescue ".st."Exception".et." => ".st."e".et."".st.et."end".st.et exec "Snippet each_with_index0 each_with_index do |".st."element".et.", ".st."index".et."|".st."element".et.".".st.et."end".st.et exec "Snippet collect collect { |".st."element".et."| ".st."element".et.".".st.et." }".st.et exec "Snippet forin for ".st."element".et." in ".st."collection".et."".st."element".et.".".st.et."end".st.et exec "Snippet doo do |".st."object".et."|".st.et."end".st.et exec "Snippet : :".st."key".et." => \"".st."value".et."\"".st.et."".st.et exec "Snippet def def ".st."methodName".et."".st.et."end".st.et exec "Snippet case case ".st."object".et."when ".st."condition".et."".st.et."end".st.et exec "Snippet collecto collect do |".st."element".et."|".st."element".et.".".st.et."end".st.et exec "Snippet each each { |".st."element".et."| ".st."element".et.".".st.et." }".st.et exec "Snippet each_with_index each_with_index { |".st."element".et.", ".st."idx".et."| ".st."element".et.".".st.et." }".st.et exec "Snippet if if ".st."condition".et."".st.et."end".st.et exec "Snippet eacho each do |".st."element".et."|".st."element".et.".".st.et."end".st.et exec "Snippet unless unless ".st."condition".et."".st.et."end".st.et exec "Snippet ife if ".st."condition".et."".st.et."else".st.et."end".st.et exec "Snippet when when ".st."condition".et."".st.et exec "Snippet selecto select do |".st."element".et."|".st."element".et.".".st.et."end".st.et exec "Snippet injecto inject(".st."object".et.") do |".st."injection".et.", ".st."element".et."| ".st.et."end".st.et exec "Snippet reject { |".st."element".et."| ".st."element".et.".".st.et." }".st.et exec "Snippet rejecto reject do |".st."element".et."| ".st."element".et.".".st.et."end".st.et exec "Snippet inject inject(".st."object".et.") { |".st."injection".et.", ".st."element".et."| ".st.et." }".st.et exec "Snippet select select { |".st."element".et."| ".st."element".et.".".st.et." }".st.et after/ftplugin/sh_snippets.vim 12 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim "Snippet !env #!/usr/bin/env ${1:${TM_SCOPE/(?:source|.*)\\.(\\w+).*/$1/}} exec "Snippet if if [[ ".st."condition".et." ]]; then".st.et."fi".st.et exec "Snippet elif elif [[ ".st."condition".et." ]]; then".st.et exec "Snippet for for (( ".st."i".et." = ".st.et."; ".st."i".et." ".st.et."; ".st."i".et.st.et." )); do".st.et."done".st.et after/ftplugin/slate_snippets.vim 19 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet do do: [| :".st."each".et."| ".st.et."]".st.et exec "Snippet proto define: #".st."NewName".et." &parents: {".st."parents".et."} &slots: {".st."slotSpecs".et."}.".st.et exec "Snippet ifte ".st."condition".et." ifTrue: [".st.et.":then] ifFalse: [".st.et.":else]".st.et exec "Snippet collect collect: [| :".st."each".et."| ".st.et."]".st.et exec "Snippet if ".st."condition".et." ifTrue: [".st.et.":then]".st.et exec "Snippet until [".st."condition".et."] whileFalse: [".st.et.":body]".st.et exec "Snippet reject reject: [| :".st."each".et."| ".st.et."]".st.et exec "Snippet dowith doWithIndex: [| :".st."each".et." :".st."index".et." | ".st.et."]".st.et exec "Snippet select select: [| :".st."each".et."| ".st.et."]".st.et exec "Snippet while [".st."condition".et."] whileTrue: [".st.et.":body]".st.et exec "Snippet inject inject: ".st."object".et." [| :".st."injection".et.", :".st."each".et."| ".st.et."]".st.et after/ftplugin/smarty_snippets.vim 35 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet {cycle {cycle values=\"#SELSTART#".st."foo".et.",".st."bar".et."#SELEND#\" name=\"default\" print=true advance=true delimiter=\",\" assign=varname }".st.et exec "Snippet |regex_replace |regex_replace:\"".st."regex".et."\":\"".st.et."\"".st.et exec "Snippet {counter {counter name=\"#INSERTION#\" start=1 skip=1 direction=\"up\" print=trueassign=\"foo\" }{counter}".st.et exec "Snippet {eval {eval var=\"#SELSTART#{template_format}#SELEND#\" assign=varname} ".st.et "Snippet |date_format |date_format:"${1:strftime() formatting}" <{}> exec "Snippet |truncate |truncate:".st.et.":".st.et.":".st."false".et."" exec "Snippet {if {if ".st."varname".et.st.et."\"".st."foo".et."\"}{* $varname can also be a php call *}".st.et."{/if}".st.et "Snippet |string_format |string_format:"${1:sprintf formatting}" <{}> exec "Snippet {assign {assign var=".st.et." value=\"".st.et."\"}".st.et exec "Snippet {foreach {foreach from=".st."varname".et." item=i [key=k name=\"\"] }".st.et."{/foreach}".st.et exec "Snippet {capture {capture name=#INSERTION#}#SELECT#{/capture}".st.et exec "Snippet |wordwrap |wordwrap:".st.et.":\"".st.et."\":".st.et exec "Snippet |spacify |spacify:\"".st.et."\"".st.et." " exec "Snippet |default |default:\"".st.et."\"".st.et exec "Snippet {debug {debug output=\"#SELSTART#".st.et."#SELEND#\" }".st.et exec "Snippet |replace |replace:\"".st."needle".et."\":\"".st.et."\"".st.et exec "Snippet {include {include file=\"".st.et."\" [assign=varname foo=\"bar\"] }".st.et exec "Snippet |escape |escape:\"".st.et."\"".st.et exec "Snippet {strip {strip}".st.et."{/strip}".st.et exec "Snippet {math {math equation=\"".st.et."\" assign=".st.et." ".st.et."}".st.et exec "Snippet {config_load {config_load file=\"#INSERTION#\" [section=\"\" scope=\"local|parent|global\"] }".st.et exec "Snippet |cat |cat:\"".st.et."\"".st.et exec "Snippet {insert {insert name=\"insert_".st.et."\" [assign=varname script=\"foo.php\" foo=\"bar\"] }".st.et exec "Snippet {fetch {fetch file=\"#SELSTART#http:// or file#SELEND#\" assign=varname}".st.et exec "Snippet {literal {literal}".st.et."{/literal}".st.et exec "Snippet {include_php {include_php file=\"".st.et."\" [once=true]}".st.et exec "Snippet |strip |strip:[\"".st.et."\"]".st.et after/ftplugin/symfony_snippets.vim 21 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet image_tag image_tag('".st."imageName".et."'".st.et.")".st.et exec "Snippet get public function get".st.et." (){return $this->".st.et.";}".st.et exec "Snippet link_to link_to('".st."linkName".et."', '".st."moduleName".et."/".st."actionName".et.st.et."')".st.et exec "Snippet sexecute public function execute(){".st.et."}".st.et exec "Snippet set public function set".st.et." ($".st.et."){$this->".st.et." = ".st.et.";}".st.et exec "Snippet execute /*** ".st."className".et."**/public function execute(){".st.et."}".st.et exec "Snippet tforeach ".st.et."".st.et exec "Snippet getparam $this->getRequestParameter('".st."id".et."')".st.et exec "Snippet div ".st.et."".st.et exec "Snippet tif ".st.et."".st.et exec "Snippet setget public function set".st."var".et." (".st."arg".et."){$this->".st."arg".et." = ".st."arg".et.";}public function get".st."var".et." (){return $this->".st."var".et.";}".st.et exec "Snippet echo ".st.et exec "Snippet tfor ".st.et."".st.et after/ftplugin/tcl_snippets.vim 14 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet switch switch ".st.et." -- $".st."var".et." {".st."match".et." {".st.et."}default{".st.et."}}".st.et exec "Snippet foreach foreach ".st."var".et." $".st."list".et." {".st.et."}".st.et exec "Snippet proc proc ".st."name".et." {".st."args".et."} {".st.et."}".st.et exec "Snippet if if {".st."condition".et."} {".st.et."}".st.et exec "Snippet for for {".st."i".et." {".st.et."} {".st.et."} {".st.et."}".st.et exec "Snippet while while {".st."condition".et."} {".st.et."}".st.et after/ftplugin/template_toolkit_snippets.vim 13 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet wrap [% WRAPPER ".st."template".et." %]".st.et."[% END %]".st.et exec "Snippet if [% IF ".st."condition".et." %]".st.et."[% ELSE %]".st.et."[% END %]".st.et exec "Snippet unl [% UNLESS ".st."condition".et." %]".st.et."[% END %]".st.et exec "Snippet inc [% INCLUDE ".st."template".et." %]".st.et exec "Snippet for [% FOR ".st."var".et." IN ".st."set".et." %]".st.et."[% END %]".st.et after/ftplugin/tex_snippets.vim 13 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet sub \\subsection{".st."name".et."}\\label{sub:".st."name:substitute(@z,'.','\\l&','g')".et."}".st.et exec "Snippet $$ \\[".st.et."\\]".st.et exec "Snippet ssub \\subsubsection{".st."name".et."}\\label{ssub:".st."name:substitute(@z,'.','\\l&','g')".et."}".st.et exec "Snippet itd \\item[".st."desc".et."] ".st.et exec "Snippet sec \\section{".st."name".et."}\\label{sec:".st."name:substitute(@z,'.','\\l&','g')".et."".st.et after/ftplugin/xhtml_snippets.vim 48 if !exists('loaded_snippet') || &cp finish endif let st = g:snip_start_tag let et = g:snip_end_tag let cd = g:snip_elem_delim exec "Snippet doctype \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">".st.et exec "Snippet aref ".st.et."".st.et exec "Snippet head ".st.et."".st.et exec "Snippet script ".st.et exec "Snippet html lang=\"".st."en".et."\">".st.et."" exec "Snippet h3

".st.et."

".st.et exec "Snippet h4

".st.et."

".st.et exec "Snippet h5
".st.et."
".st.et exec "Snippet h6
".st.et."
".st.et exec "Snippet fieldset
".st.et."
".st.et exec "Snippet noscript ".st.et exec "Snippet ul
    ".st.et."
".st.et exec "Snippet xml ".st.et exec "Snippet body ".st.et."".st.et exec "Snippet legend ".st.et."".st.et exec "Snippet title ".st."PageTitle".et."".st.et exec "Snippet scriptsrc ".st.et exec "Snippet img \"".st.et."\"".st.et exec "Snippet option ".st.et exec "Snippet optgroup ".st.et."".st.et exec "Snippet meta ".st.et exec "Snippet td ".st.et."".st.et exec "Snippet dt
".st.et."
".st.et."
".st.et exec "Snippet tfoot ".st.et."".st.et exec "Snippet div
".st.et."
".st.et exec "Snippet ol
    ".st.et."
".st.et exec "Snippet txtarea ".st.et exec "Snippet mailto ".st.et."".st.et exec "Snippet table ".st.et."
".st.et exec "Snippet hint ".st.et."".st.et exec "Snippet link ".st.et exec "Snippet form
".st.et."".st.et exec "Snippet tr ".st.et."".st.et exec "Snippet label ".st.et exec "Snippet image \"".st.et."\"".st.et exec "Snippet input ".st.et exec "Snippet select ".st.et exec "Snippet style ".st.et exec "Snippet divheader

".st."CompanyName".et."

".st.et exec "Snippet base ".st.et doc/snippets_emu.txt 375 *snippets_emu.txt* For Vim version 7.0. Last change: 2006 Dec 26 VIM REFERENCE MANUAL by Panos Laganakos and Felix Ingram 1. SnippetsEmu Features |snippets_emu-features| Basic Snippets |basic-snippet| Named Tags |named-tags| Tag Commands |snippet-commands| Buffer Specific Snippets |snip-buffer-specific| Filetype Specific Snippets |snip-ftplugin| Snippets menu |snip-menu| 2. SnippetsEmu Options |snippets_emu-options| Start and End Tags |snip-start-end-tags| Element Delimiter |snip-start-end-tags| Remapping the default jump key |snip-remap-key| 3. Detailed Explanations |snip-detailed-explanations| Valid Tag Names |snip-tag-name-syntax| Advanced Tag Command Examples |snip-advanced-tag-commands| 4. SnippetsEmu Contact Details |snip-contact-details| 5. Contributors |snip-contributors| 6. SnippetsEmu Known Bugs |snippets_emu-bugs| 7. Troubleshooting |snippets_emu-troubleshooting| {Vi does not have any of these features} ============================================================================== SNIPPETSEMU FEATURES *snippets_emu-features* SnippetsEmu attempts to emulate several of the snippets features of the OS X editor TextMate, in particular the variable bouncing and replacement behaviour. Simple usage is built up around the following functionality: Basic Snippet |basic-snippet| Named Tags |named-tags| Executable Snippet |snippet-commands| Buffer Specific Snippets |snip-buffer-specific| *basic-snippet* *:Snippet* Basic Snippet ~ A basic snippet can save you a lot of typing. Define a word trigger and on insertion it will be expanded to the full snippet. SnippetsEmu allows the user to define markers within the larger piece of text which will be used to place the cursor upon expansion. The command used to define a snippet is 'Snippet'. Basic Syntax: > :Snippet trigger_name The cursor will be placed here: <{}> Trailing text In insert mode typing 'trigger_name' will remove 'trigger_name' and replace it with the text: 'The cursor will be placed here: Trailing text'. The cursor will be placed between the two spaces before the word 'Trailing' NOTE: All text should be entered on the same command line. The formatting of this document may mean that examples are wrapped but they should all be entered on a single line. *named-tags* Named tags ~ Instead of the simple '<{}>' tags used for cursor placement a user can define named tags. When the value of a named tag is changed then all other tags with that name will be changed to the same value. E.g. > :Snippet trigger My name is <{forename}> <{surname}>. Call me <{forename}>. In insert mode typing 'trigger' will place the cursor inside the '<{forename}>' tag. Whatever is entered inside the tag will replace the other similarly named tag at the end of the line after the user presses 'Tab'. If no value is entered for a named tag then the tag's name will be used instead. This is one way of defining default values. Using the above example, entering 'trigger' and pressing 'Tab' twice will result in the following text: > My name is forename surname. Please call me forename. The rules for what constitutes a valid tag name are explained below. See |snip-tag-name-syntax|. *snippet-commands* Tag commands ~ Tags can contain commands. Commands can be any Vim function, including user defined functions. A common example is performing substitutions. E.g. > :Snippet trigger My name is <{name}>. I SAID: MY NAME IS <{name:substitute(@z,'.','\u&','g')}>! The value entered in the <{name}> tag will be passed to the command in the second <{name}> tag in the @z register (any value already in @z will be preserved and restored). The substitute command will change the entered value to be in upper case. I.e. Entering 'trigger' and typing 'Tycho' will result in the following text: > My name is Tycho. I SAID: MY NAME IS TYCHO! ~ *snip-special-vars* There is a set of special variables which can be included in snippets. These will be replaced before the snippet's text is inserted into the buffer. The list of available variables is detailed below: * SNIP_FILE_NAME - The current file name (from 'expand("%")') * SNIP_ISO_DATE - The current date in YYYY-MM-DD format. *snip-snippet-commands* In addition to tag commands it is also possible to define commands which will be executed before the snippet is inserted into the buffer. These are defined within double backticks. E.g. > :Snippet date The current date is ``strftime("%c")`` Commands are standard Vim commands and will be 'exec'uted and the command output substituted into the text. *snip-buffer-specific* Buffer Specific Snippets ~ The Snippet command defines buffer specific snippets. This is the recommended option when using filetype specific snippets. It is possible to define 'global' snippets which will act across all buffers. These can be defined using the legacy 'Iabbr' command (note the capital 'I'). E.g. > Iabbr for for <{var}> in <{list}>:<{}> ~ *snip-ftplugin* The preferred practice for defining filetype specific snippets is to include them in files named _snippets.vim and for these files to be placed in the ~/.vim/after/ftplugin directory (or vimfiles\after\ftplugin under Windows). When a file of a specific type is loaded so will all of the defined snippets. The 'after' directory is used to ensure that the plugin has been loaded. It is also recommended that the following is included at the top of the file: > if !exists('loaded_snippet') || &cp finish endif This will stop errors being generated if the plugin has not loaded for any reason. Users wishing to add their own filetype snippets should add them to a separate file to ensure they are not lost when upgrading the plugin. Naming the files _mysnippets.vim or similar is the preferred practice. *snip-menu* When loading the plugin will search for all files named '*_snippets.vim'. These will be added to the 'Snippets' menu which is available in Normal mode. Selecting options from the menu will source the file and hence load any snippets defined within it. *snippets-commands-overview* *defining-snippets* *Snippet* Snippet [ []] Without arguments the Snippet command will list all of the currently defined triggers for the current buffer. With just a (valid) trigger as the first argument the command will show the definition for that trigger. NB. The command supports auto-complete so one can use to cycle through the currently defined triggers. With both a trigger and a definition provided the command will create a new snippet as detailed above. *removing-snippets* *DelSnippet* DelSnippet The DelSnippet command will remove the appropriate snippet from the current set defined in the buffer. Auto-complete can be used to cycle through the currently defined triggers. *creating-snippets* *CreateSnippet* [range]CreateSnippet The CreateSnippet command allows the simple creation of snippets for use within your own file. Without a range the current line will be used. When passed a range then all the lines in the range will be converted for use in a command. Snippets created by the command will be added to a scratch buffer called 'Snippets'. The current value of an empty tag (snip_start_tag.snip_end_tag, '<{}>' by default) will be added to the unnamed register and so can be inserted with appropriate paste commands. *CreateBundleSnippet* [range]CreateBundleSnippet CreateBundleSnippet works exactly like CreateSnippet but the resulting text will be suitable for including in one of the included bundles. The unnamed register will include the text '"st.et."' so start and end tag agnostic empty tags can be included. =============================================================================== SNIPPETSEMU OPTIONS *snippets_emu-options* *snip-start-end-tags* Start and End Tags ~ By default the start and end tags are set to be '<{' and '}>'. These can be changed by setting the following variables in vimrc: > g:snip_start_tag g:snip_end_tag They can be also changed for a specific buffer by setting the following: > b:snip_start_tag b:snip_end_tag ~ *snip-elem-delimiter* Element Delimiter ~ The value of snip_elem_delim is used to separate a tag's name and its command. By default it is set to ':' but can be set as above either globally or for a specific buffer using the following variables: > g:snip_elem_delim b:snip_elem_delim ~ *snip-remap-key* Remapping the default jump key ~ The trigger key is mapped to Tab by default. Some people may wish to remap this if it causes conflicts with other plugins. The key can be set in your <.vimrc> by setting the 'g:snippetsEmu_key' variable. An example > let g:snippetsEmu_key = "" Snippets will now be triggered by Shift-Tab rather than just Tab. NB, this example may not work in all terminals as some trap Shift-Tab before it gets to Vim. ~ ============================================================================== DETAILED EXPLANATIONS *snip-detailed-explanations* *snip-tag-name-syntax* Valid Tag Names ~ Tag names cannot contain whitespace unless they are enclosed in quotes. Valid Examples: > <{validName}> <{"valid name"}> <{tagName:command}> <{"Tag Name":command}> Invalid Examples: > <{invalid name}> <{Tag Name:command}> <{:command}> ~ *snip-advanced-tag-commands* Advanced Tag Command Examples ~ Commands in tags can be as complex as desired. Readability is the main limitation as the command will be placed in the document before execution. The preferred method for defining complex commands is to hide the functionality in a user function. Example: > function! Count(haystack, needle) let counter = 0 let index = match(a:haystack, a:needle) while index > -1 let counter = counter + 1 let index = match(a:haystack, a:needle, index+1) endwhile return counter endfunction function! PyArgList(count) if a:count == 0 return "(,)" else return '('.repeat('<{}>, ', a:count).')' endif endfunction Snippet pf print "<{s}>" % <{s:PyArgList(Count(@z, '%[^%]'))}><{}> The above snippet will expand 'pf' to 'print "<{s}>" ...'. The user then enters a format string. Once the string is entered the Count and PyArgList functions are used to generate a number of empty tags. *snip-limitations* The above represents once of the limitations of the plugin. Due to the way tags are identified it is not possible to include empty tags in another tag's command. The only way to generate empty tags is to return them from a function as in the above example. For other examples see the included bundles. *snip-bundles* The included bundles are not defined in the 'preferred style'. In order to accommodate users who wish to redefine the default tags all snippet definitions are 'executed' with the 'exec' command. E.g. > exec "Snippet test This isn't the right way to ".st.et." define snippets" Executing the command allows 'st' and 'et' to be used in place of start and end tags. 'st' and 'et' are defined elsewhere in the bundle file. ============================================================================== SNIPPETSEMU CONTACT DETAILS *snip-contact-details* To contact the author please email: F Ingram lists gmail com The author welcomes corrections to this documentation, example snippets and bug reports. The plugin is also currently hosted at Google Code: http://code.google.com/p/snippetsemu Bug reports can also be posted on the hosting site: http://code.google.com/p/snippetsemu/issues/list *snip-contributors* Contributors to SnippetsEmu ~ Patches: Ori Avtalion - Improvements to Snippet command Freddy Vulto - Improved behaviour Andy Block - Bug with commands on same line. This is why I should do better test suites. Priit Tamboom - Bug when 'h' and 'l' are remapped. Rick Denatale - Added DelSnippet command to remove snippets. Documentation: Panos Laganakos - Greek translation (coming soon) Bundles: Panos Laganakos - Python snippets Alex Pounds - Django snippets Packetwhore - C snippets updates Golubev Nikolay - C snippets updates Thiago Salves - C snippets update KnipKnap - Python snippets ============================================================================== SNIPPETSEMU KNOWN BUGS *snippets_emu-bugs* Bugs are currently tracked on Google Code. Please post any you find on the issue tracker: http://code.google.com/p/snippetsemu/issues/list ============================================================================== SNIPPETSEMU TROUBLESHOOTING *snippets_emu-troubleshooting* Problem: Bundles are not loading. Answer: Ensure that you have filetype plugins turned on. Include the following in your vimrc: > filetype plugin on vim:tw=78:sw=4:ts=8:ft=help:norl: plugin/snippetsEmu.vim 961 " File: snippetsEmu.vim " Author: Felix Ingram " ( f.ingram.lists gmail.com ) " Description: An attempt to implement TextMate style Snippets. Features include " automatic cursor placement and command execution. " $LastChangedDate$ " Version: 1.1 " $Revision$ " " This file contains some simple functions that attempt to emulate some of the " behaviour of 'Snippets' from the OS X editor TextMate, in particular the " variable bouncing and replacement behaviour. " " {{{ USAGE: " " Place the file in your plugin directory. " Define snippets using the Snippet command. " Snippets are best defined in the 'after' subdirectory of your Vim home " directory ('~/.vim/after' on Unix). Filetype specific snippets can be defined " in '~/.vim/after/ftplugin/_snippets.vim. Using the argument will " By default snippets are buffer specific. To define general snippets available " globally use the 'Iabbr' command. " " Example One: " Snippet fori for <{datum}> in <{data}>:<{datum}>.<{}> " " The above will expand to the following (indenting may differ): " " for <{datum}> in <{data}>: " <{datum}>.<{}> " " The cursor will be placed after the first '<{' in insert mode. " Pressing will 'tab' to the next place marker (<{data}>) in " insert mode. Adding text between <{ and }> and then hitting <{Tab}> will " remove the angle brackets and replace all markers with a similar identifier. " " Example Two: " With the cursor at the pipe, hitting will replace: " for <{MyVariableName|datum}> in <{data}>: " <{datum}>.<{}> " " with (the pipe shows the cursor placement): " " for MyVariableName in <{data}>: " MyVariableName.<{}> " " Enjoy. " " For more information please see the documentation accompanying this plugin. " " Additional Features: " " Commands in tags. Anything after a ':' in a tag will be run with Vim's " 'execute' command. The value entered by the user (or the tag name if no change " has been made) is passed in the @z register (the original contents of the " register are restored once the command has been run). " " Named Tags. Naming a tag (the <{datum}> tag in the example above) and changing " the value will cause all other tags with the same name to be changed to the " same value (as illustrated in the above example). Not changing the value and " hitting will cause the tag's name to be used as the default value. " " Test tags for pattern matching: " The following are examples of valid and invalid tags. Whitespace can only be " used in a tag name if the name is enclosed in quotes. " " Valid tags " <{}> " <{tagName}> " <{tagName:command}> " <{"Tag Name"}> " <{"Tag Name":command}> " " Invalid tags, random text " <{:}> " <{:command}> " <{Tag Name}> " <{Tag Name:command}> " <{"Tag Name":}> " <{Tag }> " <{OpenTag " " Here's our magic search term (assumes '<{',':' and '}>' as our tag delimiters: " <{\([^[:punct:] \t]\{-}\|".\{-}"\)\(:[^}>]\{-1,}\)\?}> " }}} if v:version < 700 echomsg "snippetsEmu plugin requires Vim version 7 or later" finish endif if globpath(&rtp, 'plugin/snippetEmu.vim') != "" call confirm("It looks like you've got an old version of snippetsEmu installed. Please delete the file 'snippetEmu.vim' from the plugin directory. Note lack of 's'") endif let s:debug = 0 let s:Disable = 0 function! s:Debug(func, text) if exists('s:debug') && s:debug == 1 echom "Snippy: ".a:func.": ".a:text endif endfunction if (exists('loaded_snippet') || &cp) && !s:debug finish endif call s:Debug("","Started the plugin") let loaded_snippet=1 " {{{ Set up variables if !exists("g:snip_start_tag") let g:snip_start_tag = "<{" endif if !exists("g:snip_end_tag") let g:snip_end_tag = "}>" endif if !exists("g:snip_elem_delim") let g:snip_elem_delim = ":" endif if !exists("g:snippetsEmu_key") let g:snippetsEmu_key = "" endif call s:Debug("", "Set variables") " }}} " {{{ Set up menu for def_file in split(globpath(&rtp, "after/ftplugin/*_snippets.vim"), '\n') call s:Debug("","Adding ".def_file." definitions to menu") let snip = substitute(def_file, '.*[\\/]\(.*\)_snippets.vim', '\1', '') exec "nmenu S&nippets.".snip." :source ".def_file."" endfor " }}} " {{{ Sort out supertab function! s:GetSuperTabSNR() let a_sav = @a redir @a exec "silent function" redir END let funclist = @a let @a = a_sav let func = split(split(matchstr(funclist,'.SNR.\{-}SuperTab(command)'),'\n')[-1])[1] return matchlist(func, '\(.*\)S')[1] endfunction function! s:SetupSupertab() if !exists('s:supInstalled') let s:supInstalled = 0 endif if s:supInstalled == 1 || globpath(&rtp, 'plugin/supertab.vim') != "" call s:Debug("SetupSupertab", "Supertab installed") let s:SupSNR = s:GetSuperTabSNR() let s:supInstalled = 1 let s:done_remap = 0 endif endfunction call s:SetupSupertab() " }}} " {{{ Map Jumper to the default key if not set already function! s:SnipMapKeys() if (!hasmapto('Jumper','i')) if s:supInstalled == 1 exec 'imap '.g:snippetsEmu_key.' Jumper' else exec 'imap '.g:snippetsEmu_key.' Jumper' endif endif if (!hasmapto( 'i'.g:snippetsEmu_key, 's')) exec 'smap '.g:snippetsEmu_key.' i'.g:snippetsEmu_key endif imap