" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. UseVimball finish after/ftplugin/actionscript_snippets.vim 5 if !exists('loaded_snippet') || &cp finish endif Snippet dm duplicateMovieClip(, , );" after/ftplugin/asp_snippets.vim 13 if !exists('loaded_snippet') || &cp finish endif Snippet rr Response.Redirect()<> Snippet app Application("<>")<> Snippet forin For in <>Next<> Snippet ifelse If Then<>Else<>End if<> Snippet rw Response.Write <> Snippet sess Session("<>")<> Snippet rf Request.Form("<>")<> Snippet rq Request.QueryString("<>")<> Snippet while While <>Wend<> after/ftplugin/c_snippets.vim 44 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 if a:count == 0 return "" else return repeat(', <>', a:count) endif endfunction Snippet do do{<>} while (<>); Snippet readfile std::vector v;if(FILE* fp = fopen("", "r")){uint8_t buf[1024];while(size_t len = fread(buf, 1, sizeof(buf), fp))v.insert(v.end(), buf, buf + len);fclose(fp);}<> Snippet beginend .begin(), .end()<> Snippet once #ifndef __#define __<>#endif /* __ */<> Snippet class class {public: ();virtual ~();private:<:D('/* data */')>};<> " TODO This is a good one but I can't quite work out the syntax yet Snippet printf printf("<"%s">\n" <"%s":CArgList(Count(@z, '%[^%]'))>);<> Snippet vector std::vector<> v<>; Snippet struct struct {<:D('/* data */')>};<> Snippet template template ><> " TODO this one as well. Wish I knew more C " Snippet namespace namespace ${1:${TM_FILENAME/(.*?)\\..*/\\L$1/}}\n{\n\t$0\n};<> Snippet namespace namespace <:substitute(expand('%'),'.','\l&', 'g')>{<>};<> Snippet map std::map<, > map<>;<> Snippet mark #if 0<:D('#pragma mark -'}#pragma mark <>#endif<> Snippet if if(<>){<>}<> Snippet main int main (int argc, char const* argv[]){<>return 0;<> Snippet Inc #include <<:D('.h')>><> Snippet inc #include "<>.h" Snippet for for( <:D('unsigned int')> = <:D('0')>; < ; += <:D('1')>){<>}<> after/ftplugin/css_snippets.vim 26 if !exists('loaded_snippet') || &cp finish endif Snippet visibility <:D('visible/hidden/collapse')>;<> Snippet list list-style-image: url(<>);<> Snippet text text-shadow: rgb(<:D('255')>, <:D('255')>, <:D('255')>, <:D('10px')> <:D('10px')> <:D('2px')>;<> Snippet overflow overflow: <:D('visible/hidden/scroll/auto')>;<> Snippet white white-space: <:D('normal/pre/nowrap')>;<> Snippet clear cursor: url(<>);<> Snippet margin padding-top: <:D('20px')>;<> Snippet background background #<:D('DDD')> url(<>) <:D('repeat/repeat-x/repeat-y/no-repeat')> <:D('scroll/fixed')> top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x% y%/x-pos y-pos')>;<> Snippet word word-spacing: <:D('10px')>;<> Snippet z z-index: <>;<> Snippet vertical vertical-align: <:D('baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%')>;<> Snippet marker marker-offset: <:D('10px')>;<> Snippet cursor cursor: <:D('default/auto/crosshair/pointer/move/*-resize/text/wait/help')>;<> Snippet border border-right: <:D('1')>px <:D('solid')> #<:D('999')>;<> Snippet display display: block;<> Snippet padding padding: <:D('20px')> <:D('0px')>;<> Snippet letter letter-spacing: <>em;<> Snippet color color: rgb(<:D('255')>, <:D('255')>, <:D('255')>);<> Snippet font font-weight: <:D('normal/bold')>;<> Snippet position position: <:D('static/relative/absolute/fixed')>;<> Snippet direction direction: <:D('ltr|rtl')>;<> Snippet float float: <:D('left/right/none')>;<> after/ftplugin/django_snippets.vim 50 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) exec "echom \"index: ". string(index) . "\"" endwhile exec "echom \"found ". string(counter) . " needles\"" 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 if a:count == 0 return "(,)" else return '('.repeat('<>, ', a:count).')' endif endfunction Snippet {{ {% templatetag openvariable %}<> Snippet }} {% templatetag closevariable %}<> Snippet {% {% templatetag openblock %}<> Snippet %} {% templatetag closeblock %}<> Snippet now {% now "<>" %}<> Snippet firstof {% firstof <> %}<> Snippet ifequal {% ifequal <> <> %}<>{% endifequal %}<> Snippet ifchanged {% ifchanged %}<>{% endifchanged %}<> Snippet regroup {% regroup <> by <> as <> %}<> Snippet extends {% extends "<>" %}<> Snippet filter {% filter <> %}<><% endfilter %} Snippet block {% block <> %}<>{% endblock %}<> Snippet cycle {% cycle <> as <> %}<> Snippet if {% if <> %}<>{% endif %}<> Snippet debug {% debug %}<> Snippet ifnotequal {% ifnotequal <> <> %}<>{% endifnotequal %}<> Snippet include {% include <> %}<> Snippet comment {% comment %}<>{% endcomment %}<> Snippet for {% for <> in <> %}<>{% endfor %}<> Snippet ssi {% ssi <> <:D('parsed')> %}<> Snippet model class <>(models.Model):"""<:D('model description')>"""<> = <>class ADMIN:passdef __str__(self):return "<"%s">" <"%s":DjangoArgList(Count(@z, '%[^%]'))><> Snippet widthratio {% widthration <:D('this_value')> <:D('max_value')> <:D('100')> %}<> Snippet load {% load <> %}<> after/ftplugin/f-script_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif Snippet tbd to:<> by:<> do:[ <:D(':i')> |<>].<> Snippet it ifTrue:[<>].<> Snippet ift ifFalse:[<>] ifTrue:[<>].<> Snippet itf ifTrue:[<>] ifFalse:[<>].<> Snippet td to:<> do:[<> <:D(':i')> |<>].<> Snippet if ifFalse:[<>].<> after/ftplugin/haskell_snippets.vim 5 if !exists('loaded_snippet') || &cp finish endif Snippet mod module: <:D('Main')> where<> after/ftplugin/html_snippets.vim 43 if !exists('loaded_snippet') || &cp finish endif function! Onload() return 'onload="<>"' endfunction function! Id() return ' id="<>"' endfunction function! Cellspacing() return ' cellspacing="<:D('5')>"' endfunction function! FileNoExt() return substitute(expand('%'), '\(.*\)\..*$', '\1','') endfunction function! Target() return ' target="<>"' endfunction Snippet doctype "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><> Snippet head <:substitute(expand('%'),'\(.*\)\..*$','\1','')><><> Snippet script <> Snippet title <:substitute(expand('%'),'\(.*\)\..*$','\1','')> Snippet body <><> Snippet scriptsrc <> Snippet textarea <> Snippet meta <> Snippet movie classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"codebase="http://www.apple.com/qtactivex/qtplugin.cab">value="<>" />width="<:D('320')>" height=""controller="<:D('true')>" autoplay="<:D('true')>"scale="tofit" cache="true"pluginspage="http://www.apple.com/quicktime/download/"/><> Snippet div ><><> Snippet mailto <:D('email me')><> Snippet table cellpadding="<:D('5')>">
<:D('Header')>
<>
Snippet link Snippet form
<>

<> Snippet ref <><> Snippet h1

<>

<> Snippet input /><> Snippet style <> Snippet base /><> after/ftplugin/java_snippets.vim 50 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 Snippet method // {{{ /** * <> */public () {<>}// }}}<> Snippet jps private static final <> = "<>";<> Snippet jtc try {<>} catch (<> e) {<>} finally {<>}<> Snippet jlog /** Logger for this class and subclasses. */protected final Log log = LogFactory.getLog(getClass());<> Snippet jpv private <>;<> Snippet bean // {{{ set/** * Setter for . * @param new new value for */public void set( new) { = new;}// }}}// {{{ get/** * Getter for . * @return */public get() {return ;}// }}}<> Snippet jwh while (<>) { // <><>}<> Snippet sout System.out.println("<>");<> " The following snippet is quite complicated and I'm not quite sure what the " syntax is supposed to be. "Snippet jtest package import junit.framework.TestCase;import ;/** * * * @author <> * @since <> */public class extends TestCase {private ;public get() { return this.; }public void set( ) { this. = ; }public void test<>() {<>}}<> Snippet jif if (<>) { // <><>}<> Snippet jelse if (<>) { // <><>} else { // <><>}<> Snippet jpm /** * <> * * @param <> <> * <:D('@return')> <> */private <>( <>) {<>}<> Snippet main public main static void main(String[] ars) {<"System.exit(0)">;}<> Snippet jpum /** * <> * * @param <> <> *<:D('@return')> <> */public <>( <>) {<>}<> Snippet jcout <> after/ftplugin/javascript_snippets.vim 6 if !exists('loaded_snippet') || &cp finish endif Snippet proto .prototype. = function(<>){<>};<> Snippet fun function (<>){<>}<> after/ftplugin/latex_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif Snippet sub \subsection{}\label{sub:}<> Snippet $$ \[<>\]<> Snippet ssub \subsubsection{}\label{ssub:}<> Snippet itd \item[] <> Snippet sec \section{}\label{sec:<> after/ftplugin/logo_snippets.vim 5 if !exists('loaded_snippet') || &cp finish endif Snippet to to <>end<> after/ftplugin/markdown_snippets.vim 6 if !exists('loaded_snippet') || &cp finish endif Snippet img ![]()<> Snippet link []()<> after/ftplugin/movable type_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif Snippet cat <$MTCategoryDescription$><> Snippet blog <$MTBlogName$><> Snippet archive <$MTArchiveFile$><> Snippet cal <><> Snippet entry <$MTEntryMore$><> Snippet entries <><> after/ftplugin/objc_snippets.vim 49 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) " 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 if a:count == 0 return "<>" else return '<>'.repeat(', <>', a:count) endif endfunction Snippet cat @interface ()@end@implementation ()<>@end<> Snippet delacc - (id)delegate;- (void)setDelegate:(id)delegate;<> Snippet ibo IBOutlet *;<> Snippet dict NSMutableDictionary * = [NSMutableDictionary dictionary];<> Snippet Imp #import <<>.h><> Snippet objc @interface : {}@end@implementation - (id)init{self = [super init]; if (self != nil){<>}return self;}@end<> Snippet imp #import "<>.h"<> Snippet bez NSBezierPath * = [NSBezierPath bezierPath];<> Snippet acc - (<"unsigned int">){return ;}- (void)set:(<"unsigned int">)new{ = new;}<> Snippet format [NSString stringWithFormat:@"<>", <>]<> Snippet focus [self lockFocus];<>[self unlockFocus];<> Snippet setprefs [[NSUserDefaults standardUserDefaults] setObject: forKey:];<> Snippet log NSLog(@"%s", );<> Snippet gsave [NSGraphicsContext saveGraphicsState];<>[NSGraphicsContext restoreGraphicsState];<> Snippet forarray for(unsigned int index = 0; index < [ count]; index += 1){object = [ objectAtIndex:index];<>}<> Snippet classi @interface : {<>}<>@end<> Snippet array NSMutableArray * = [NSMutableArray array];<> Snippet getprefs [[NSUserDefaults standardUserDefaults] objectForKey:];<> Snippet cati @interface ()<>@end<> after/ftplugin/ocaml_snippets.vim 22 if !exists('loaded_snippet') || &cp finish endif Snippet Queue Queue.fold <:D('(fun b v ->)')> <> Snippet Nativeint Nativeint.abs <> Snippet Printexc Printexc.print <> Snippet Sys Sys.Signal_ignore<> Snippet Hashtbl Hashtbl.iter <:D('(fun k v -> )')> <> Snippet Array Array.map <:D('(fun a -> )')> <> Snippet Printf Printf.fprintf "" <> Snippet Stream Stream.iter <:D('(fun x -> )')> <> Snippet Buffer Buffer.add_channel <> Snippet Int32 Int32.abs <> Snippet List List.rev_map <:D('(fun x -> )')> <> Snippet Scanf Scanf.bscaf "" <> Snippet Int64 Int64.abs <> Snippet Map Map.Make <:D('(Ord : OrderedType)')><> Snippet String String.iter <:D('(fun c -> )')> <> Snippet Genlex Genlex.make_lexer <"tok_lst"> <"char_stream"><> Snippet for for = <> to <> do<>done<> Snippet Stack Stack.iter <:D('(fun x -> )')> <> after/ftplugin/perl_snippets.vim 23 if !exists('loaded_snippet') || &cp finish endif function! MyX() return 'my ' endfunction Snippet sub sub {<>}<> Snippet class package ;<:D('use base qw(')>);}sub new {my \$class = shift;\$class = ref \$class if ref \$class;my $self = bless {}, \$class;\$self;}1;<> Snippet xfore foreach @;<> Snippet xwhile while ;<> Snippet xunless unless ;<> Snippet slurp my $;{ local $/ = undef; local *FILE; open FILE, "<"; $ = ; close FILE }<> Snippet if if (<>) {<>}<> Snippet unless unless (<>) {<2>}<> Snippet ifee if (<>) {<2>} elsif (<>) {<>} else {<>}}<> Snippet ife if (<>) {<>} else {<>}<> Snippet for for (my \$ = 0; \$ < ; \$++) {<>}<> Snippet fore foreach <:MyX()>(@) {<>}<> Snippet eval eval {<>};if ($@) {<>}<> Snippet while while (<>) {<>}<> Snippet xif if ;<> after/ftplugin/php_snippets.vim 26 if !exists('loaded_snippet') || &cp finish endif Snippet elseif elseif ( ){<>}<> Snippet do do{<>} while ( <:D('$a <= 10')> );<> Snippet reql require_once( '' );<> Snippet if? $ = ( ) ? : ;<> Snippet php <>?> Snippet switch switch ( ){case '':<>break;<>default:<>break;}<> Snippet class #doc#classname:#scope:##/docclass {#internal variables#Constructorfunction __construct ( ){<>}###}### Snippet incll include_once( '' );<> Snippet incl include( '${1:file}' );<> Snippet foreach foreach( $ as $ => $ ){<>}<> Snippet ifelse if ( ){<>}else{<>}<> Snippet $_ $_REQUEST['']<> Snippet case case '':<>break;<> Snippet print print ""<>;<><> Snippet function function (<>){<>}<> Snippet if if ( ){<>}<> Snippet else else{<>}<> Snippet array $ = array( '<>',<> );<> Snippet -globals $GLOBALS['']<><>;<> Snippet req require( '' );<> Snippet for for ( $=<>; $ < <>; $++ ){ <>}<> Snippet while while ( <> ){<>}<> after/ftplugin/phpdoc_snippets.vim 15 if !exists('loaded_snippet') || &cp finish endif Snippet doc_d /*** **/define(<>, <>);<><> Snippet doc_vp /*** ** @var <>**/<> Snippet doc_f /*** ** @return * @author <>**/<>function <>(<>){<>}<> Snippet doc_s /*** ** @return * @author <>**/<>function <>(<>);<> Snippet doc_h /*** <>** @author <>* @version $Id$* @copyright <>, <>* @package **//*** Define DocBlock**/<> Snippet doc_fp /*** ** @return * @author <>**/<> Snippet doc_i /*** ** @package * @author <>**/interface <>{<>} // END interface <><> Snippet doc_fp /*** <>**/<><> Snippet doc_v /*** ** @var **/ $<>;<><> Snippet doc_cp /*** ** @package * @author <>**/<> Snippet doc_c /*** ** @package * @author <>**/class {<>} // END class <> after/ftplugin/propel_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif Snippet <> Snippet ><><> Snippet <> Snippet /><> Snippet

<> Snippet <> after/ftplugin/python_snippets.vim 62 if !exists('loaded_snippet') || &cp finish endif function! PyInit(text) if a:text != "args" return ', '.a:text else return '' endif endfunction function! PyInitVars(text) if a:text != "args" let text = substitute(a:text,'=.\{-},','','g') let text = substitute(text,'=.\{-}$','','g') let text = substitute(text,',','','g') let ret = '' for Arg in split(text, ' ') let ret = ret.'self.'.Arg.' = '.Arg.'\n\t\t' endfor return ret else return "pass" endif 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! PyArgList(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 if a:count == 0 return "()" else return '('.repeat('<>, ', a:count).')' endif endfunction Snippet pf print "" % <> Snippet get def get(self): return self._<> Snippet classi class ():def __init__(self):<> Snippet set def set(self, ):self._$1 = <> Snippet . self.<> Snippet def def ():<> " Contributed by Panos Snippet ifn if __name__ == '__main__':<> " Contributed by Kib2 Snippet bc """"""<> Snippet lc # <> Snippet sbl1 #!/usr/bin/env python# -*- coding: Latin-1 -*-<> Snippet kfor for in :<> Snippet cm = classmethod()<> after/ftplugin/rails_snippets.vim 50 if !exists('loaded_snippet') || &cp finish endif Snippet mrnt rename_table "", ""<> Snippet rfu render :file => "", :use_full_path => <> Snippet rns render :nothing => , :status => <:D('401')><> Snippet ri render :inline => "<:D("<%= 'hello' %>")>"<> Snippet rt render :text => "<>"<> Snippet mcc t.column "", :<string><> Snippet rpl render :partial => "<item>", :locals => { :<name> => "<value>"<> }<> Snippet rea redirect_to :action => "<index>"<> Snippet rtlt render :text => "<>", :layout => <true><> Snippet ft <%= form_tag :action => "<update>" %><> Snippet forin <% for <item> in <:D('@items')> %><CR><%= <item>.<name> %><CR><% end %><CR><> Snippet lia <%= link_to "<>", :action => "<index>" %><> Snippet rl render :layout => "<layoutname>"<> Snippet ra render :action => "<action>"<> Snippet mrnc rename_column "<table>", "<oldColumnName>", "<newColumnName>"<> Snippet mac add_column "<table>", "<column>", :<string><> Snippet rpc render :partial => "<item>", :collection => <items><> Snippet rec redirect_to :controller => "<items>"<> Snippet rn render :nothing => <true><> Snippet lic <%= link_to "<>", :controller => "<>" %><> Snippet rpo render :partial => "<item>", :object => <object><> Snippet rts render :text => "<>", :status => <:D('401')><> Snippet rcea render_component :action => "<index>"<> Snippet recai redirect_to :controller => "<items>", :action => "<show>", :id => <:D('@item')><> Snippet mcdt create_table "<table>" do |t|<CR><><CR>end<CR><><CR><> Snippet ral render :action => "<action>", :layout => "<layoutname>"<> Snippet rit render :inline => "<>", :type => <:D(':rxml')><> Snippet rceca render_component :controller => "<items>", :action => "<index>"<> Snippet licai <%= link_to "<>", :controller => "<items>", :action => "<edit>", :id => <:D('@item')> %><> Snippet verify verify :only => [:<>], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"}<> Snippet mdt drop_table "<table>"<> Snippet rp render :partial => "<item>"<> Snippet rcec render_component :controller => "<items>"<> Snippet mrc remove_column "<table>", "<column>"<> Snippet mct create_table "<table>" do |t|<CR><><CR>end<CR><> Snippet flash flash[:<notice>] = "<>"<> Snippet rf render :file => "<filepath>"<> Snippet lica <%= link_to "<>", :controller => "<items>", :action => "<index>" %><> Snippet liai <%= link_to "<>", :action => "<edit>", :id => <:D('@item')> %><> Snippet reai redirect_to :action => "<show>", :id => <:D('@item')><> Snippet logi logger.info "<>"<> Snippet marc add_column "<table>", "<column>", :<string><CR><CR><><CR><> Snippet rps render :partial => "<item>", :status => <:D('500')><> Snippet ril render :inline => "<>", :locals => { <:D(':name')> => "<value>"<> }<> Snippet rtl render :text => "<>", :layout => "<>"<> Snippet reca redirect_to :controller => "<items>", :action => "<list>"<> after/ftplugin/ruby_snippets.vim 28 if !exists('loaded_snippet') || &cp finish endif Snippet do do<CR><>end<CR><> Snippet class class <className><CR><>end<CR><> Snippet begin begin<CR><><CR>rescue <Exception> => <e><CR><>end<CR><> Snippet each_with_index0 each_with_index do |<element>, <index>|<CR><element>.<><CR>end<CR><> Snippet collect collect { |<element>| <element>.<> }<CR><> Snippet forin for <element> in <collection><CR><element>.<><CR>end<CR><> Snippet doo do |<object>|<CR><><CR>end<CR><> Snippet : :<key> => "<value>"<><CR><> Snippet def def <methodName><CR><><CR>end<CR><> Snippet case case <object><CR>when <condition><CR><><CR>end<CR><> Snippet collecto collect do |<element>|<CR><element>.<><CR>end<CR><> Snippet each each { |<element>| <element>.<> }<CR><> Snippet each_with_index each_with_index { |<element>, <idx>| <element>.<> }<CR><> Snippet if if <condition><CR><><CR>end<CR><> Snippet eacho each do |<element>|<CR><element>.<><CR>end<CR><> Snippet unless unless <condition><CR><><CR>end<CR><> Snippet ife if <condition><CR><><CR>else<CR><><CR>end<CR><> Snippet when when <condition><CR><> Snippet selecto select do |<element>|<CR><element>.<><CR>end<CR><> Snippet injecto inject(<object>) do |<injection>, <element>| <CR><><CR>end<CR><> Snippet reject { |<element>| <element>.<> }<CR><> Snippet rejecto reject do |<element>| <CR><element>.<><CR>end<CR><> Snippet inject inject(<object>) { |<injection>, <element>| <> }<CR><> Snippet select select { |<element>| <element>.<> }<CR><> after/ftplugin/sh_snippets.vim 8 if !exists('loaded_snippet') || &cp finish endif "Snippet !env #!/usr/bin/env ${1:${TM_SCOPE/(?:source|.*)\\.(\\w+).*/$1/}} Snippet if if [[ <condition> ]]; then<CR><><CR>fi<> Snippet elif elif [[ <condition> ]]; then<CR><> Snippet for for (( <i> = <>; <i> <>; <i><> )); do<CR><><CR>done<> after/ftplugin/slate_snippets.vim 15 if !exists('loaded_snippet') || &cp finish endif Snippet do do: [| :<each>| <>]<CR><> Snippet proto define: #<NewName> &parents: {<parents>} &slots: {<slotSpecs>}.<CR><> Snippet ifte <condition> ifTrue: [<>:then] ifFalse: [<>:else]<CR><> Snippet collect collect: [| :<each>| <>]<CR><> Snippet if <condition> ifTrue: [<>:then]<> Snippet until [<condition>] whileFalse: [<>:body]<> Snippet reject reject: [| :<each>| <>]<CR><> Snippet dowith doWithIndex: [| :<each> :<index> | <>]<CR><> Snippet select select: [| :<each>| <>]<> Snippet while [<condition>] whileTrue: [<>:body]<> Snippet inject inject: <object> [| :<injection>, :<each>| <>]<> after/ftplugin/smarty_snippets.vim 31 if !exists('loaded_snippet') || &cp finish endif Snippet {cycle {cycle values="#SELSTART#<foo>,<bar>#SELEND#" name="default" print=true advance=true delimiter="," assign=varname }<CR><> Snippet |regex_replace |regex_replace:"<regex>":"<>"<> Snippet {counter {counter name="#INSERTION#" start=1 skip=1 direction="up" print=true<CR>assign="foo" }<CR><CR>{counter}<CR><> Snippet {eval {eval var="#SELSTART#{template_format}#SELEND#" assign=varname} <CR><> "Snippet |date_format |date_format:"${1:strftime() formatting}" <CR><> Snippet |truncate |truncate:<:D('80')>:<>:<false> Snippet {if {if <varname><><CR>"<foo>"}<CR><CR>{* $varname can also be a php call *}<CR><CR><><CR><CR>{/if}<CR><> "Snippet |string_format |string_format:"${1:sprintf formatting}" <CR><> Snippet {assign {assign var=<> value="<>"}<> Snippet {foreach {foreach from=<varname> item=i [key=k name=""] }<CR><CR><><CR><CR>{/foreach}<CR><CR><> Snippet {capture {capture name=#INSERTION#}<CR><CR>#SELECT#<CR><CR>{/capture}<CR><> Snippet |wordwrap |wordwrap:<:D('80')>:"<>":<> Snippet |spacify |spacify:"<>"<> Snippet |default |default:"<>"<> Snippet {debug {debug output="#SELSTART#<>#SELEND#" }<> Snippet |replace |replace:"<needle>":"<>"<> Snippet {include {include file="<>" [assign=varname foo="bar"] }<> Snippet |escape |escape:"<>"<> Snippet {strip {strip}<CR><><CR>{/strip}<> Snippet {math {math equation="<>" assign=<> <>}<> Snippet {config_load {config_load file="#INSERTION#" [section="" scope="local|parent|global"] }<> Snippet |cat |cat:"<>"<> Snippet {insert {insert name="insert_<>" [assign=varname script="foo.php" foo="bar"] }<> Snippet {fetch {fetch file="#SELSTART#http:// or file#SELEND#" assign=varname}<> Snippet {literal {literal}<CR><CR><><CR><CR>{/literal}<> Snippet {include_php {include_php file="<>" [once=true]}<> Snippet |strip |strip:["<>"]<> after/ftplugin/symfony_snippets.vim 17 if !exists('loaded_snippet') || &cp finish endif Snippet image_tag image_tag('<imageName>'<>)<> Snippet get public function get<> ()<CR>{<CR>return $this-><>;<CR>}<CR><CR><> Snippet link_to link_to('<linkName>', '<moduleName>/<actionName><>')<> Snippet sexecute public function execute<Action>()<CR>{<CR><><CR>}<CR><> Snippet set public function set<> ($<>)<CR>{<CR>$this-><> = <>;<CR>}<CR><CR><> Snippet execute /**<CR>* <className><CR>*<CR>*/<CR>public function execute<Action>()<CR>{<CR><><CR>}<CR><> Snippet tforeach <?php foreach ($<variable> as $<key><>): ?><CR><><CR><?php endforeach ?><CR><> Snippet getparam $this->getRequestParameter('<id>')<> Snippet div <div<>><CR><><CR></div><> Snippet tif <?php if (<condition>): ?><CR><><CR><?php endif ?><CR><> Snippet setget public function set<var> (<arg>)<CR>{<CR>$this-><arg> = <arg>;<CR>}<CR><CR>public function get<var> ()<CR>{<CR>return $this-><var>;<CR>}<CR><CR><> Snippet echo <?php echo <> ?><> Snippet tfor <?php for($<i> = <>; $<i> <= <>; $<i>++): ?><CR><><CR><?php endfor ?><CR><> after/ftplugin/tcl_snippets.vim 10 if !exists('loaded_snippet') || &cp finish endif Snippet switch switch<> -- $<var> {<CR><match> {<CR><><CR>}<CR>default<CR>{<>}<CR>}<CR><> Snippet foreach foreach <var> $<list> {<CR><><CR>}<CR><> Snippet proc proc <name> {<args>} <CR>{<CR><><CR>}<CR><> Snippet if if {<condition>} {<CR><><CR>}<CR><> Snippet for for {<i> {<>} {<>} {<CR><><CR>}<CR><> Snippet while while {<condition>} {<CR><><CR>}<CR><> after/ftplugin/template_toolkit_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif Snippet wrap [% WRAPPER <template> %]<CR><><CR>[% END %]<CR><> Snippet if [% IF <condition> %]<CR><><CR>[% ELSE %]<CR><><CR>[% END %]<CR><> Snippet unl [% UNLESS <condition> %]<CR><><CR>[% END %]<CR><> Snippet inc [% INCLUDE <template> %]<CR><> Snippet for [% FOR <var> IN <set> %]<CR><><CR>[% END %]<> after/ftplugin/tex_snippets.vim 9 if !exists('loaded_snippet') || &cp finish endif Snippet sub \subsection{<name>}\label{sub:<name:substitute(@z,'.','\l&','g')>}<CR><> Snippet $$ \[<CR><><CR>\]<CR><> Snippet ssub \subsubsection{<name>}\label{ssub:<name:substitute(@z,'.','\l&','g')>}<CR><> Snippet itd \item[<desc>] <> Snippet sec \section{<name>}\label{sec:<name:substitute(@z,'.','\l&','g')><CR><> after/ftplugin/xhtml_snippets.vim 44 if !exists('loaded_snippet') || &cp finish endif Snippet doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<CR>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><CR><> Snippet aref <a href="<>" id="<>" title="<>"><></a><> Snippet head <head><CR><><CR></head><> Snippet script <script type="text/javascript" language="<javascript>" charset="<:D('utf-8')>"><CR>// <![CDATA[<CR><><CR>// ]]><CR></script><> Snippet html <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<en>"<CR>lang="<en>"><CR><><CR></html> Snippet h3 <h3><></h3><> Snippet h4 <h4><></h4><> Snippet h5 <h5><></h5><> Snippet h6 <h6><></h6><> Snippet fieldset <fieldset><CR><><CR></fieldset><> Snippet noscript <noscript><CR><><CR></noscript><> Snippet ul <ul <>><CR><><CR></ul><> Snippet xml <?xml version="1.0" encoding="iso-8859-1"?><CR><CR><> Snippet body <body id="<>" <>><CR><><CR></body><> Snippet legend <legend align="<>" accesskey="<>"><CR><><CR></legend><> Snippet title <title><PageTitle><> Snippet scriptsrc <> Snippet img <><> Snippet option <> Snippet optgroup <><> Snippet meta <> Snippet td ><><> Snippet dt
<>
<> Snippet tfoot <><> Snippet div
<>
<> Snippet ol
    ><>
<> Snippet txtarea <> Snippet mailto <><> Snippet table <>
<> Snippet hint <><> Snippet link <> Snippet form
<><> Snippet tr ><><> Snippet label <> Snippet image <>/> Snippet input /><> Snippet select <> Snippet style <> Snippet div.header

<> Snippet base /><> doc/snippets_emu.txt 275 *snippets_emu.txt* For Vim version 7.0. Last change: 2006 Oct 19 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| 2. SnippetsEmu Options |snippets_emu-options| TextMate Compatible Mode |snip-textmate-cp| Tag Highlighting |snip-tag-highlighting| Start and End Tags |snip-start-end-tags| 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. SnippetsEmu Known Bugs |snippets_emu-bugs| {Vi does not have any of these features} ============================================================================== SNIPPETSEMU FEATURES *snippets_emu-features* SnippetsEmu attempts to emulate several of the snippets features of the OSX 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* Basic Snippet ~ Basic snippets build upon the ideas used by the built-in 'iabbr' command (See |:iabbrev|). The built-in abbreviations allow short sequences to be replaced by longer pieces of text. SnippetsEmu allows the user to define markers within the larger piece of text which will be used to place the cursor upon expansion. 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. The command used to define a snippet is 'Iabbr'. Observe the capital 'I'. Basic Syntax: > Iabbr 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' *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. > Iabbr trigger My name is . Please call me . In insert mode typing 'trigger' will place the cursor inside the '' 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. > Iabbr trigger My name is . I SAID: MY NAME IS ! The value entered in the tag will be passed to the command in the second 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-buffer-specific* Buffer Specific Snippets ~ The Iabbr command can take a option which will only set the snippet for the buffer in which it is defined. This is the recommended option when using filetype specific snippets. E.g. > Iabbr for for in :<> Iabbr for for ($ = <>; $ >= 1; $++) {<>} The first of the above is appropriate for use with Python and the second is appropriate for use with Perl. *snip-snippet-command* The command 'Snippet' can be used instead of 'Iabbr '. Both are functionally identical. I.e. the above can be rewritten as below: > Snippet for for in :<> Snippet for for ($ = <>; $ >= 1; $++) {<>} ~ *snip-ftplugin* Using the buffer specific command allows filetype specific snippets to be defined. The preferred practice is to include snippets 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. =============================================================================== SNIPPETSEMU OPTIONS *snippets_emu-options* *snip-textmate-cp* SnippetsEmu TextMate Compatible Mode ~ SnipppetsEmu maintains two modes currently, SnippetsEmu basic mode and TextMate compatible mode. TextMate compatible mode only expands snippets when 'Tab' is pressed after the trigger is entered. It also allows other functionality such as special characters in triggers. IMPORTANT: TextMate compatible mode will be the only mode from version 1.0 onwards; the original functionality will not be available. To enable the TextMate compatible mode you set the snip_set_textmate_cp variable to 1. This can be done by adding the following line in your vimrc > let g:snip_set_textmate_cp = 1 ~ *snip-tag-highlighting* Tag Highlighting ~ If syntax highlighting is enabled then tags within snippets will highlighted. To disable this option add the following line to your vimrc. > let g:snip_disable_highlight = 1 ~ *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 ============================================================================== 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: > <"valid name"> <"Tag Name":command> Invalid Examples: > ~ *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. > 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. ============================================================================== 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 ============================================================================== 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 vim:tw=78:sw=4:ts=8:ft=help:norl: plugin/snippetsEmu.vim 827 " 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. " Last Change: Monday 23rd October 2006 " Version: 0.6 " " 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 Iabbr command which takes similar arguments to the " built in iabbr 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 " restrict the abbreviations to the filetype only. " " Example One: " Iabbr fori for in :.<> " " The above will expand to the following (indenting may differ): " " for in : " .<> " " The cursor will be placed after the first < in insert mode. " Pressing will 'tab' to the next place marker () in " insert mode. Adding text between < and > and then hitting 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 in : " .<> " " with (the pipe shows the cursor placement): " " for MyVariableName in : " MyVariableName.<> " " Enjoy. " " 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 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. " " TextMate 'compatibility'. New since 0.5. Setting the variable " 'g:snip_set_textmate_cp' to '1' will change how the plugin operates. Snippets " will not be expanded automatically, instead the user must hit . If the " previous word was defined as a snippet then it's expanded. If there are still " active tags then the cursor is moved with replacements and commands being " performed as usual. If there is no snippet to expand and no active tags then a " is inserted. " The variable can be set in vimrc with the following command: " let g:snip_set_textmate_cp = 1 " " Multi-character start and end tags. Start and end tags can now be more than " one character in length. The main advantage of this is that a single set of " tags can be defined which will work on the majority of filetype. For example, " the default settings of '<' and '>' work for most languages except HTML " (and Visual Basic: do you know why?). You can now define tags such as '<{' and " '}>' (which probably break in some random web page template language but you " get the idea). " " Known Bugs: " " FIXED If the abbreviation starts with a tag and is inserted at the start of the line " then the cursor will not be placed in the correct tag. " " FIXED Empty tag replacement. Changing an empty tag will change all remaining " empty tags " " FIXED Short variable names. Having a single character in the tags will mess up " the insert point. " " FIXED Autoindentation breaks and too much whitespace can be swallowed. " Caused by using 'i' instead of 'a' in the redefined command. " " FIXED Search_str not defined " Sourcing the script but defining no snippets will generate an error " " FIXED Search_str not buffer specific. " Using different tags in different buffers will break the searching in all but " the most recently opened (assuming different tags for all buffers) " " FIXED Multiple commands on the same line " Having two tags with commands defined on the same line presents unexpected " behaviour " " FIXED Escape strings for matching in replacements " Special characters in commands or tag names can cause problems when replacing. " Infinite loops are very likely. " " FIXED Default value function doesn't work for named tags " Having a named tag will fill @z which in turn will cause the default function " to fail. One possible fix will be to remove the possibility for tag names to " act as default values. This may annoy, whoever. " Fix details: A script variable 's:CHANGED_VAL' is set when a user changes a " tag's value. The D() function checks for this and returns the appropriate " response. " " FIXED Snippets starting with 's' don't work due to bad regex. " Many thanks to nfowar for spotting this one. " " 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 " <> " " " <:command> " <"Tag Name"> " <"Tag Name":command> " @@ " @tagName@ " @tagName:command@ " @:command@ " @"Tag Name"@ " @"Tag Name":command@ " " Invalid tags, random text " <:> " " " <"Tag Name":> " " ' as our tag delimiters: " <\([^[:punct:] \t]\{-}\|".\{-}"\)\(:[^>]\{-1,}\)\?> " }}} if v:version < 700 echomsg "snippetsEmu plugin requires Vim version 7 or later" finish endif let s:debug = 0 function! Debug(text) if exists('s:debug') && s:debug == 1 echom a:text endif endfunction if (exists('loaded_snippet') || &cp) && !s:debug finish endif call 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 let s:just_expanded = 0 " }}} " {{{ Map Jumper to the default key if not set already if ( !hasmapto( 'Jumper', 'i' ) ) if exists("g:snip_set_textmate_cp") && g:snip_set_textmate_cp == 1 imap Jumper else imap Jumper endif endif if exists("g:snip_set_textmate_cp") && g:snip_set_textmate_cp == 1 imap