From e0b29dd5536deaa586ffcb452bf6f1efad81d723 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 16 Dec 2014 17:04:36 +0000 Subject: [PATCH 01/58] Ultisnips eruby: Start removing snippets duplication --- UltiSnips/eruby.snippets | 57 ++-------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/UltiSnips/eruby.snippets b/UltiSnips/eruby.snippets index ae58c9f..d1a26df 100644 --- a/UltiSnips/eruby.snippets +++ b/UltiSnips/eruby.snippets @@ -44,66 +44,13 @@ snippet fi "<%= Fixtures.identify(:symbol) %>" endsnippet snippet ft "form_tag" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => '${5:update}'}${6:, {:${8:class} => '${9:form}'\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` $0 `!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` endsnippet -snippet end "end (ERB)" -<% end -%> -endsnippet - -snippet for "for loop (ERB)" -<% if !${1:list}.blank? %> - <% for ${2:item} in ${1} %> - $3 - <% end %> -<% else %> - $4 -<% end %> - -endsnippet - -snippet ffcb "form_for check_box" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffff "form_for file_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffhf "form_for hidden_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffl "form_for label 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffpf "form_for password_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffrb "form_for radio_box 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - snippet ffs "form_for submit 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet ffta "form_for text_area 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet fftf "form_for text_field 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -endsnippet - -snippet fields "fields_for" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`fields_for :${1:model}, @${2:$1} do |$1|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 -`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${1:f}.submit '${2:Submit}'${3:, :disable_with => '${4:$2ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet f. "f_fields_for (nff)" From 4f2e0a03f14a8aa90515a58cb5948fc3e233fd04 Mon Sep 17 00:00:00 2001 From: guneysus Date: Thu, 18 Dec 2014 18:21:43 +0200 Subject: [PATCH 02/58] Python args and kwargs snippets --- snippets/python.snippets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snippets/python.snippets b/snippets/python.snippets index c221f46..a93b654 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -208,3 +208,9 @@ snippet kwg self.${1:var_name} = kwargs.get('$1', ${2:None}) snippet lkwg ${1:var_name} = kwargs.get('$1', ${2:None}) +snippet args + *args${1:,}${0} +snippet kwargs + **kwargs${1:,}${0} +snippet akw + *args, **kwargs${1:,}${0} From 6a679df97f4058d5c59d972a7b3029598da5dd67 Mon Sep 17 00:00:00 2001 From: Marcelo D Montu Date: Fri, 19 Dec 2014 15:00:31 -0200 Subject: [PATCH 03/58] Fix box and bbox snippets outside the first column --- UltiSnips/all.snippets | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/UltiSnips/all.snippets b/UltiSnips/all.snippets index f816ba4..e33d2c5 100644 --- a/UltiSnips/all.snippets +++ b/UltiSnips/all.snippets @@ -78,10 +78,12 @@ endglobal snippet box "A nice box with the current comment symbol" b `!p box = make_box(len(t[1])) -snip.rv = box[0] + '\n' + box[1] +snip.rv = box[0] +snip += box[1] `${1:content}`!p box = make_box(len(t[1])) -snip.rv = box[2] + '\n' + box[3]` +snip.rv = box[2] +snip += box[3]` $0 endsnippet @@ -89,10 +91,12 @@ snippet bbox "A nice box over the full width" b `!p width = int(vim.eval("&textwidth")) or 71 box = make_box(len(t[1]), width) -snip.rv = box[0] + '\n' + box[1] +snip.rv = box[0] +snip += box[1] `${1:content}`!p box = make_box(len(t[1]), width) -snip.rv = box[2] + '\n' + box[3]` +snip.rv = box[2] +snip += box[3]` $0 endsnippet From 60be56203393825044b2b7613fc01161f60ca381 Mon Sep 17 00:00:00 2001 From: Gustavo Chain Date: Sun, 28 Dec 2014 13:18:45 +0100 Subject: [PATCH 04/58] Added package snippet for Go --- snippets/go.snippets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snippets/go.snippets b/snippets/go.snippets index dafc6e4..af76e72 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -173,6 +173,9 @@ snippet main # new snippet nw new(${0:type}) +# package +snippet pa + package ${1:main} # panic snippet pn panic("${0:msg}") From e0fff1575abb816606c729751c8507c74e17c3cd Mon Sep 17 00:00:00 2001 From: Gilad Peleg Date: Mon, 5 Jan 2015 09:46:19 +0200 Subject: [PATCH 05/58] Convert stylus snippet spaces to tabs. Fixes #499 --- snippets/stylus.snippets | 994 +++++++++++++++++++-------------------- 1 file changed, 497 insertions(+), 497 deletions(-) diff --git a/snippets/stylus.snippets b/snippets/stylus.snippets index 4a30570..d03d178 100644 --- a/snippets/stylus.snippets +++ b/snippets/stylus.snippets @@ -1,993 +1,993 @@ snippet ! - !important + !important snippet bdi:m+ - -moz-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} + -moz-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} snippet bdi:m - -moz-border-image ${0} + -moz-border-image ${0} snippet bdrz:m - -moz-border-radius ${0} + -moz-border-radius ${0} snippet bxsh:m+ - -moz-box-shadow ${1:0} ${2:0} ${3:0} ${0} + -moz-box-shadow ${1:0} ${2:0} ${3:0} ${0} snippet bxsh:m - -moz-box-shadow ${0} + -moz-box-shadow ${0} snippet bdi:w+ - -webkit-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} + -webkit-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} snippet bdi:w - -webkit-border-image ${0} + -webkit-border-image ${0} snippet bdrz:w - -webkit-border-radius ${0} + -webkit-border-radius ${0} snippet bxsh:w+ - -webkit-box-shadow ${1:0} ${2:0} ${3:0} ${0} + -webkit-box-shadow ${1:0} ${2:0} ${3:0} ${0} snippet bxsh:w - -webkit-box-shadow ${0} + -webkit-box-shadow ${0} snippet @f - @font-face ${0} + @font-face ${0} snippet @i - @import '${0}' + @import '${0}' snippet @r - @require '${0}' + @require '${0}' snippet @m - @media ${1:screen} + @media ${1:screen} snippet @msmw - @media screen and (min-width: ${0}px) + @media screen and (min-width: ${0}px) snippet @ext - @extend .${1} - ${0} + @extend .${1} + ${0} snippet bg+ - background ${1} url(${2}) ${3:0} ${4:0} ${0:no-repeat} + background ${1} url(${2}) ${3:0} ${4:0} ${0:no-repeat} snippet bga - background-attachment ${0} + background-attachment ${0} snippet bga:f - background-attachment fixed + background-attachment fixed snippet bga:s - background-attachment scroll + background-attachment scroll snippet bgbk - background-break ${0} + background-break ${0} snippet bgbk:bb - background-break bounding-box + background-break bounding-box snippet bgbk:c - background-break continuous + background-break continuous snippet bgbk:eb - background-break each-box + background-break each-box snippet bgcp - background-clip ${0} + background-clip ${0} snippet bgcp:bb - background-clip border-box + background-clip border-box snippet bgcp:cb - background-clip content-box + background-clip content-box snippet bgcp:nc - background-clip no-clip + background-clip no-clip snippet bgcp:pb - background-clip padding-box + background-clip padding-box snippet bgc - background-color ${0} + background-color ${0} snippet bgc:t - background-color transparent + background-color transparent snippet bgi - background-image url(${0}) + background-image url(${0}) snippet bgi:n - background-image none + background-image none snippet bgo - background-origin ${0} + background-origin ${0} snippet bgo:bb - background-origin border-box + background-origin border-box snippet bgo:cb - background-origin content-box + background-origin content-box snippet bgo:pb - background-origin padding-box + background-origin padding-box snippet bgpx - background-position-x ${0} + background-position-x ${0} snippet bgpy - background-position-y ${0} + background-position-y ${0} snippet bgp - background-position ${1:0} ${0:0} + background-position ${1:0} ${0:0} snippet bgr - background-repeat ${0} + background-repeat ${0} snippet bgr:n - background-repeat no-repeat + background-repeat no-repeat snippet bgr:x - background-repeat repeat-x + background-repeat repeat-x snippet bgr:y - background-repeat repeat-y + background-repeat repeat-y snippet bgr:r - background-repeat repeat + background-repeat repeat snippet bgz - background-size ${0} + background-size ${0} snippet bgz:a - background-size auto + background-size auto snippet bgz:ct - background-size contain + background-size contain snippet bgz:cv - background-size cover + background-size cover snippet bg - background ${0} + background ${0} snippet bg:ie - filter progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}') + filter progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}') snippet bg:n - background none + background none snippet bd+ - border ${1:1px} ${2:solid} ${0} + border ${1:1px} ${2:solid} ${0} snippet bdb+ - border-bottom ${1:1px} ${2:solid} ${0} + border-bottom ${1:1px} ${2:solid} ${0} snippet bdbc - border-bottom-color ${0} + border-bottom-color ${0} snippet bdbi - border-bottom-image url(${0}) + border-bottom-image url(${0}) snippet bdbi:n - border-bottom-image none + border-bottom-image none snippet bdbli - border-bottom-left-image url(${0}) + border-bottom-left-image url(${0}) snippet bdbli:c - border-bottom-left-image continue + border-bottom-left-image continue snippet bdbli:n - border-bottom-left-image none + border-bottom-left-image none snippet bdblrz - border-bottom-left-radius ${0} + border-bottom-left-radius ${0} snippet bdbri - border-bottom-right-image url(${0}) + border-bottom-right-image url(${0}) snippet bdbri:c - border-bottom-right-image continue + border-bottom-right-image continue snippet bdbri:n - border-bottom-right-image none + border-bottom-right-image none snippet bdbrrz - border-bottom-right-radius ${0} + border-bottom-right-radius ${0} snippet bdbs - border-bottom-style ${0} + border-bottom-style ${0} snippet bdbs:n - border-bottom-style none + border-bottom-style none snippet bdbw - border-bottom-width ${0} + border-bottom-width ${0} snippet bdb - border-bottom ${0} + border-bottom ${0} snippet bdb:n - border-bottom none + border-bottom none snippet bdbk - border-break ${0} + border-break ${0} snippet bdbk:c - border-break close + border-break close snippet bdcl - border-collapse ${0} + border-collapse ${0} snippet bdcl:c - border-collapse collapse + border-collapse collapse snippet bdcl:s - border-collapse separate + border-collapse separate snippet bdc - border-color ${0} + border-color ${0} snippet bdci - border-corner-image url(${0}) + border-corner-image url(${0}) snippet bdci:c - border-corner-image continue + border-corner-image continue snippet bdci:n - border-corner-image none + border-corner-image none snippet bdf - border-fit ${0} + border-fit ${0} snippet bdf:c - border-fit clip + border-fit clip snippet bdf:of - border-fit overwrite + border-fit overwrite snippet bdf:ow - border-fit overwrite + border-fit overwrite snippet bdf:r - border-fit repeat + border-fit repeat snippet bdf:sc - border-fit scale + border-fit scale snippet bdf:sp - border-fit space + border-fit space snippet bdf:st - border-fit stretch + border-fit stretch snippet bdi - border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} + border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} snippet bdi:n - border-image none + border-image none snippet bdl+ - border-left ${1:1px} ${2:solid} ${0} + border-left ${1:1px} ${2:solid} ${0} snippet bdlc - border-left-color ${0} + border-left-color ${0} snippet bdli - border-left-image url(${0}) + border-left-image url(${0}) snippet bdli:n - border-left-image none + border-left-image none snippet bdls - border-left-style ${0} + border-left-style ${0} snippet bdls:n - border-left-style none + border-left-style none snippet bdlw - border-left-width ${0} + border-left-width ${0} snippet bdl - border-left ${0} + border-left ${0} snippet bdl:n - border-left none + border-left none snippet bdlt - border-length ${0} + border-length ${0} snippet bdlt:a - border-length auto + border-length auto snippet bdrz - border-radius ${0} + border-radius ${0} snippet bdr+ - border-right ${1:1px} ${2:solid} ${0} + border-right ${1:1px} ${2:solid} ${0} snippet bdrc - border-right-color ${0} + border-right-color ${0} snippet bdri - border-right-image url(${0}) + border-right-image url(${0}) snippet bdri:n - border-right-image none + border-right-image none snippet bdrs - border-right-style ${0} + border-right-style ${0} snippet bdrs:n - border-right-style none + border-right-style none snippet bdrw - border-right-width ${0} + border-right-width ${0} snippet bdr - border-right ${0} + border-right ${0} snippet bdr:n - border-right none + border-right none snippet bdsp - border-spacing ${0} + border-spacing ${0} snippet bds - border-style ${0} + border-style ${0} snippet bds:ds - border-style dashed + border-style dashed snippet bds:dtds - border-style dot-dash + border-style dot-dash snippet bds:dtdtds - border-style dot-dot-dash + border-style dot-dot-dash snippet bds:dt - border-style dotted + border-style dotted snippet bds:db - border-style double + border-style double snippet bds:g - border-style groove + border-style groove snippet bds:h - border-style hidden + border-style hidden snippet bds:i - border-style inset + border-style inset snippet bds:n - border-style none + border-style none snippet bds:o - border-style outset + border-style outset snippet bds:r - border-style ridge + border-style ridge snippet bds:s - border-style solid + border-style solid snippet bds:w - border-style wave + border-style wave snippet bdt+ - border-top ${1:1px} ${2:solid} ${0} + border-top ${1:1px} ${2:solid} ${0} snippet bdtc - border-top-color ${0} + border-top-color ${0} snippet bdti - border-top-image url(${0}) + border-top-image url(${0}) snippet bdti:n - border-top-image none + border-top-image none snippet bdtli - border-top-left-image url(${0}) + border-top-left-image url(${0}) snippet bdtli:c - border-corner-image continue + border-corner-image continue snippet bdtli:n - border-corner-image none + border-corner-image none snippet bdtlrz - border-top-left-radius ${0} + border-top-left-radius ${0} snippet bdtri - border-top-right-image url(${0}) + border-top-right-image url(${0}) snippet bdtri:c - border-top-right-image continue + border-top-right-image continue snippet bdtri:n - border-top-right-image none + border-top-right-image none snippet bdtrrz - border-top-right-radius ${0} + border-top-right-radius ${0} snippet bdts - border-top-style ${0} + border-top-style ${0} snippet bdts:n - border-top-style none + border-top-style none snippet bdtw - border-top-width ${0} + border-top-width ${0} snippet bdt - border-top ${0} + border-top ${0} snippet bdt:n - border-top none + border-top none snippet bdw - border-width ${0} + border-width ${0} snippet bd - border ${0} + border ${0} snippet bd:n - border none + border none snippet b - bottom ${0} + bottom ${0} snippet b:a - bottom auto + bottom auto snippet bxsh+ - box-shadow ${1:0} ${2:0} ${3:0} ${0} + box-shadow ${1:0} ${2:0} ${3:0} ${0} snippet bxsh - box-shadow ${0} + box-shadow ${0} snippet bxsh:n - box-shadow none + box-shadow none snippet bxz - box-sizing ${0} + box-sizing ${0} snippet bxz:bb - box-sizing border-box + box-sizing border-box snippet bxz:cb - box-sizing content-box + box-sizing content-box snippet cps - caption-side ${0} + caption-side ${0} snippet cps:b - caption-side bottom + caption-side bottom snippet cps:t - caption-side top + caption-side top snippet cl - clear ${0} + clear ${0} snippet cl:b - clear both + clear both snippet cl:l - clear left + clear left snippet cl:n - clear none + clear none snippet cl:r - clear right + clear right snippet cp - clip ${0} + clip ${0} snippet cp:a - clip auto + clip auto snippet cp:r - clip rect(${1:0} ${2:0} ${3:0} ${0:0}) + clip rect(${1:0} ${2:0} ${3:0} ${0:0}) snippet c - color ${0} + color ${0} snippet ct - content ${0} + content ${0} snippet ct:a - content attr(${0}) + content attr(${0}) snippet ct:cq - content close-quote + content close-quote snippet ct:c - content counter(${0}) + content counter(${0}) snippet ct:cs - content counters(${0}) + content counters(${0}) snippet ct:ncq - content no-close-quote + content no-close-quote snippet ct:noq - content no-open-quote + content no-open-quote snippet ct:n - content normal + content normal snippet ct:oq - content open-quote + content open-quote snippet coi - counter-increment ${0} + counter-increment ${0} snippet cor - counter-reset ${0} + counter-reset ${0} snippet cur - cursor ${0} + cursor ${0} snippet cur:a - cursor auto + cursor auto snippet cur:c - cursor crosshair + cursor crosshair snippet cur:d - cursor default + cursor default snippet cur:ha - cursor hand + cursor hand snippet cur:he - cursor help + cursor help snippet cur:m - cursor move + cursor move snippet cur:p - cursor pointer + cursor pointer snippet cur:t - cursor text + cursor text snippet d - display ${0} + display ${0} snippet d:mib - display -moz-inline-box + display -moz-inline-box snippet d:mis - display -moz-inline-stack + display -moz-inline-stack snippet d:b - display block + display block snippet d:cp - display compact + display compact snippet d:ib - display inline-block + display inline-block snippet d:itb - display inline-table + display inline-table snippet d:i - display inline + display inline snippet d:li - display list-item + display list-item snippet d:n - display none + display none snippet d:ri - display run-in + display run-in snippet d:tbcp - display table-caption + display table-caption snippet d:tbc - display table-cell + display table-cell snippet d:tbclg - display table-column-group + display table-column-group snippet d:tbcl - display table-column + display table-column snippet d:tbfg - display table-footer-group + display table-footer-group snippet d:tbhg - display table-header-group + display table-header-group snippet d:tbrg - display table-row-group + display table-row-group snippet d:tbr - display table-row + display table-row snippet d:tb - display table + display table snippet ec - empty-cells ${0} + empty-cells ${0} snippet ec:h - empty-cells hide + empty-cells hide snippet ec:s - empty-cells show + empty-cells show snippet exp - expression() + expression() snippet fl - float ${0} + float ${0} snippet fl:l - float left + float left snippet fl:n - float none + float none snippet fl:r - float right + float right snippet f+ - font ${1:1em} ${2:Arial},${0:sans-serif} + font ${1:1em} ${2:Arial},${0:sans-serif} snippet fef - font-effect ${0} + font-effect ${0} snippet fef:eb - font-effect emboss + font-effect emboss snippet fef:eg - font-effect engrave + font-effect engrave snippet fef:n - font-effect none + font-effect none snippet fef:o - font-effect outline + font-effect outline snippet femp - font-emphasize-position ${0} + font-emphasize-position ${0} snippet femp:a - font-emphasize-position after + font-emphasize-position after snippet femp:b - font-emphasize-position before + font-emphasize-position before snippet fems - font-emphasize-style ${0} + font-emphasize-style ${0} snippet fems:ac - font-emphasize-style accent + font-emphasize-style accent snippet fems:c - font-emphasize-style circle + font-emphasize-style circle snippet fems:ds - font-emphasize-style disc + font-emphasize-style disc snippet fems:dt - font-emphasize-style dot + font-emphasize-style dot snippet fems:n - font-emphasize-style none + font-emphasize-style none snippet fem - font-emphasize ${0} + font-emphasize ${0} snippet ff - font-family ${0} + font-family ${0} snippet ff:c - font-family ${0:'Monotype Corsiva','Comic Sans MS'},cursive + font-family ${0:'Monotype Corsiva','Comic Sans MS'},cursive snippet ff:f - font-family ${0:Capitals,Impact},fantasy + font-family ${0:Capitals,Impact},fantasy snippet ff:m - font-family ${0:Monaco,'Courier New'},monospace + font-family ${0:Monaco,'Courier New'},monospace snippet ff:ss - font-family ${0:Helvetica,Arial},sans-serif + font-family ${0:Helvetica,Arial},sans-serif snippet ff:s - font-family ${0:Georgia,'Times New Roman'},serif + font-family ${0:Georgia,'Times New Roman'},serif snippet fza - font-size-adjust ${0} + font-size-adjust ${0} snippet fza:n - font-size-adjust none + font-size-adjust none snippet fz - font-size ${0} + font-size ${0} snippet fsm - font-smooth ${0} + font-smooth ${0} snippet fsm:aw - font-smooth always + font-smooth always snippet fsm:a - font-smooth auto + font-smooth auto snippet fsm:n - font-smooth never + font-smooth never snippet fst - font-stretch ${0} + font-stretch ${0} snippet fst:c - font-stretch condensed + font-stretch condensed snippet fst:e - font-stretch expanded + font-stretch expanded snippet fst:ec - font-stretch extra-condensed + font-stretch extra-condensed snippet fst:ee - font-stretch extra-expanded + font-stretch extra-expanded snippet fst:n - font-stretch normal + font-stretch normal snippet fst:sc - font-stretch semi-condensed + font-stretch semi-condensed snippet fst:se - font-stretch semi-expanded + font-stretch semi-expanded snippet fst:uc - font-stretch ultra-condensed + font-stretch ultra-condensed snippet fst:ue - font-stretch ultra-expanded + font-stretch ultra-expanded snippet fs - font-style ${0} + font-style ${0} snippet fs:i - font-style italic + font-style italic snippet fs:n - font-style normal + font-style normal snippet fs:o - font-style oblique + font-style oblique snippet fv - font-variant ${0} + font-variant ${0} snippet fv:n - font-variant normal + font-variant normal snippet fv:sc - font-variant small-caps + font-variant small-caps snippet fw - font-weight ${0} + font-weight ${0} snippet fw:b - font-weight bold + font-weight bold snippet fw:br - font-weight bolder + font-weight bolder snippet fw:lr - font-weight lighter + font-weight lighter snippet fw:n - font-weight normal + font-weight normal snippet f - font ${0} + font ${0} snippet h - height ${0} + height ${0} snippet h:a - height auto + height auto snippet l - left ${0} + left ${0} snippet l:a - left auto + left auto snippet lts - letter-spacing ${0} + letter-spacing ${0} snippet lh - line-height ${0} + line-height ${0} snippet lisi - list-style-image url(${0}) + list-style-image url(${0}) snippet lisi:n - list-style-image none + list-style-image none snippet lisp - list-style-position ${0} + list-style-position ${0} snippet lisp:i - list-style-position inside + list-style-position inside snippet lisp:o - list-style-position outside + list-style-position outside snippet list - list-style-type ${0} + list-style-type ${0} snippet list:c - list-style-type circle + list-style-type circle snippet list:dclz - list-style-type decimal-leading-zero + list-style-type decimal-leading-zero snippet list:dc - list-style-type decimal + list-style-type decimal snippet list:d - list-style-type disc + list-style-type disc snippet list:lr - list-style-type lower-roman + list-style-type lower-roman snippet list:n - list-style-type none + list-style-type none snippet list:s - list-style-type square + list-style-type square snippet list:ur - list-style-type upper-roman + list-style-type upper-roman snippet lis - list-style ${0} + list-style ${0} snippet lis:n - list-style none + list-style none snippet mb - margin-bottom ${0} + margin-bottom ${0} snippet mb:a - margin-bottom auto + margin-bottom auto snippet ml - margin-left ${0} + margin-left ${0} snippet ml:a - margin-left auto + margin-left auto snippet mr - margin-right ${0} + margin-right ${0} snippet mr:a - margin-right auto + margin-right auto snippet mt - margin-top ${0} + margin-top ${0} snippet mt:a - margin-top auto + margin-top auto snippet m - margin ${0} + margin ${0} snippet m:4 - margin ${1:0} ${2:0} ${3:0} ${0:0} + margin ${1:0} ${2:0} ${3:0} ${0:0} snippet m:3 - margin ${1:0} ${2:0} ${0:0} + margin ${1:0} ${2:0} ${0:0} snippet m:2 - margin ${1:0} ${0:0} + margin ${1:0} ${0:0} snippet m:0 - margin 0 + margin 0 snippet m:a - margin auto + margin auto snippet mah - max-height ${0} + max-height ${0} snippet mah:n - max-height none + max-height none snippet maw - max-width ${0} + max-width ${0} snippet maw:n - max-width none + max-width none snippet mih - min-height ${0} + min-height ${0} snippet miw - min-width ${0} + min-width ${0} snippet op - opacity ${0} + opacity ${0} snippet op:ie - filter progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100}) + filter progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100}) snippet op:ms - -ms-filter 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})' + -ms-filter 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})' snippet orp - orphans ${0} + orphans ${0} snippet o+ - outline ${1:1px} ${2:solid} ${0} + outline ${1:1px} ${2:solid} ${0} snippet oc - outline-color ${0} + outline-color ${0} snippet oc:i - outline-color invert + outline-color invert snippet oo - outline-offset ${0} + outline-offset ${0} snippet os - outline-style ${0} + outline-style ${0} snippet ow - outline-width ${0} + outline-width ${0} snippet o - outline ${0} + outline ${0} snippet o:n - outline none + outline none snippet ovs - overflow-style ${0} + overflow-style ${0} snippet ovs:a - overflow-style auto + overflow-style auto snippet ovs:mq - overflow-style marquee + overflow-style marquee snippet ovs:mv - overflow-style move + overflow-style move snippet ovs:p - overflow-style panner + overflow-style panner snippet ovs:s - overflow-style scrollbar + overflow-style scrollbar snippet ovx - overflow-x ${0} + overflow-x ${0} snippet ovx:a - overflow-x auto + overflow-x auto snippet ovx:h - overflow-x hidden + overflow-x hidden snippet ovx:s - overflow-x scroll + overflow-x scroll snippet ovx:v - overflow-x visible + overflow-x visible snippet ovy - overflow-y ${0} + overflow-y ${0} snippet ovy:a - overflow-y auto + overflow-y auto snippet ovy:h - overflow-y hidden + overflow-y hidden snippet ovy:s - overflow-y scroll + overflow-y scroll snippet ovy:v - overflow-y visible + overflow-y visible snippet ov - overflow ${0} + overflow ${0} snippet ov:a - overflow auto + overflow auto snippet ov:h - overflow hidden + overflow hidden snippet ov:s - overflow scroll + overflow scroll snippet ov:v - overflow visible + overflow visible snippet pb - padding-bottom ${0} + padding-bottom ${0} snippet pl - padding-left ${0} + padding-left ${0} snippet pr - padding-right ${0} + padding-right ${0} snippet pt - padding-top ${0} + padding-top ${0} snippet p - padding ${0} + padding ${0} snippet p:4 - padding ${1:0} ${2:0} ${3:0} ${0:0} + padding ${1:0} ${2:0} ${3:0} ${0:0} snippet p:3 - padding ${1:0} ${2:0} ${0:0} + padding ${1:0} ${2:0} ${0:0} snippet p:2 - padding ${1:0} ${0:0} + padding ${1:0} ${0:0} snippet p:0 - padding 0 + padding 0 snippet pgba - page-break-after ${0} + page-break-after ${0} snippet pgba:aw - page-break-after always + page-break-after always snippet pgba:a - page-break-after auto + page-break-after auto snippet pgba:l - page-break-after left + page-break-after left snippet pgba:r - page-break-after right + page-break-after right snippet pgbb - page-break-before ${0} + page-break-before ${0} snippet pgbb:aw - page-break-before always + page-break-before always snippet pgbb:a - page-break-before auto + page-break-before auto snippet pgbb:l - page-break-before left + page-break-before left snippet pgbb:r - page-break-before right + page-break-before right snippet pgbi - page-break-inside ${0} + page-break-inside ${0} snippet pgbi:a - page-break-inside auto + page-break-inside auto snippet pgbi:av - page-break-inside avoid + page-break-inside avoid snippet pos - position ${0} + position ${0} snippet pos:a - position absolute + position absolute snippet pos:f - position fixed + position fixed snippet pos:r - position relative + position relative snippet pos:s - position static + position static snippet q - quotes ${0} + quotes ${0} snippet q:en - quotes '\201C' '\201D' '\2018' '\2019' + quotes '\201C' '\201D' '\2018' '\2019' snippet q:n - quotes none + quotes none snippet q:ru - quotes '\00AB' '\00BB' '\201E' '\201C' + quotes '\00AB' '\00BB' '\201E' '\201C' snippet rz - resize ${0} + resize ${0} snippet rz:b - resize both + resize both snippet rz:h - resize horizontal + resize horizontal snippet rz:n - resize none + resize none snippet rz:v - resize vertical + resize vertical snippet r - right ${0} + right ${0} snippet r:a - right auto + right auto snippet tbl - table-layout ${0} + table-layout ${0} snippet tbl:a - table-layout auto + table-layout auto snippet tbl:f - table-layout fixed + table-layout fixed snippet tal - text-align-last ${0} + text-align-last ${0} snippet tal:a - text-align-last auto + text-align-last auto snippet tal:c - text-align-last center + text-align-last center snippet tal:l - text-align-last left + text-align-last left snippet tal:r - text-align-last right + text-align-last right snippet ta - text-align ${0} + text-align ${0} snippet ta:c - text-align center + text-align center snippet ta:l - text-align left + text-align left snippet ta:r - text-align right + text-align right snippet td - text-decoration ${0} + text-decoration ${0} snippet td:l - text-decoration line-through + text-decoration line-through snippet td:n - text-decoration none + text-decoration none snippet td:o - text-decoration overline + text-decoration overline snippet td:u - text-decoration underline + text-decoration underline snippet te - text-emphasis ${0} + text-emphasis ${0} snippet te:ac - text-emphasis accent + text-emphasis accent snippet te:a - text-emphasis after + text-emphasis after snippet te:b - text-emphasis before + text-emphasis before snippet te:c - text-emphasis circle + text-emphasis circle snippet te:ds - text-emphasis disc + text-emphasis disc snippet te:dt - text-emphasis dot + text-emphasis dot snippet te:n - text-emphasis none + text-emphasis none snippet th - text-height ${0} + text-height ${0} snippet th:a - text-height auto + text-height auto snippet th:f - text-height font-size + text-height font-size snippet th:m - text-height max-size + text-height max-size snippet th:t - text-height text-size + text-height text-size snippet ti - text-indent ${0} + text-indent ${0} snippet ti:- - text-indent -9999px + text-indent -9999px snippet tj - text-justify ${0} + text-justify ${0} snippet tj:a - text-justify auto + text-justify auto snippet tj:d - text-justify distribute + text-justify distribute snippet tj:ic - text-justify inter-cluster + text-justify inter-cluster snippet tj:ii - text-justify inter-ideograph + text-justify inter-ideograph snippet tj:iw - text-justify inter-word + text-justify inter-word snippet tj:k - text-justify kashida + text-justify kashida snippet tj:t - text-justify tibetan + text-justify tibetan snippet to+ - text-outline ${1:0} ${2:0} ${0} + text-outline ${1:0} ${2:0} ${0} snippet to - text-outline ${0} + text-outline ${0} snippet to:n - text-outline none + text-outline none snippet tr - text-replace ${0} + text-replace ${0} snippet tr:n - text-replace none + text-replace none snippet tsh+ - text-shadow ${1:0} ${2:0} ${3:0} ${0} + text-shadow ${1:0} ${2:0} ${3:0} ${0} snippet tsh - text-shadow ${0} + text-shadow ${0} snippet tsh:n - text-shadow none + text-shadow none snippet tt - text-transform ${0} + text-transform ${0} snippet tt:c - text-transform capitalize + text-transform capitalize snippet tt:l - text-transform lowercase + text-transform lowercase snippet tt:n - text-transform none + text-transform none snippet tt:u - text-transform uppercase + text-transform uppercase snippet tw - text-wrap ${0} + text-wrap ${0} snippet tw:no - text-wrap none + text-wrap none snippet tw:n - text-wrap normal + text-wrap normal snippet tw:s - text-wrap suppress + text-wrap suppress snippet tw:u - text-wrap unrestricted + text-wrap unrestricted snippet t - top ${0} + top ${0} snippet t:a - top auto + top auto snippet va - vertical-align ${0} + vertical-align ${0} snippet va:bl - vertical-align baseline + vertical-align baseline snippet va:b - vertical-align bottom + vertical-align bottom snippet va:m - vertical-align middle + vertical-align middle snippet va:sub - vertical-align sub + vertical-align sub snippet va:sup - vertical-align super + vertical-align super snippet va:tb - vertical-align text-bottom + vertical-align text-bottom snippet va:tt - vertical-align text-top + vertical-align text-top snippet va:t - vertical-align top + vertical-align top snippet v - visibility ${0} + visibility ${0} snippet v:c - visibility collapse + visibility collapse snippet v:h - visibility hidden + visibility hidden snippet v:v - visibility visible + visibility visible snippet whsc - white-space-collapse ${0} + white-space-collapse ${0} snippet whsc:ba - white-space-collapse break-all + white-space-collapse break-all snippet whsc:bs - white-space-collapse break-strict + white-space-collapse break-strict snippet whsc:k - white-space-collapse keep-all + white-space-collapse keep-all snippet whsc:l - white-space-collapse loose + white-space-collapse loose snippet whsc:n - white-space-collapse normal + white-space-collapse normal snippet whs - white-space ${0} + white-space ${0} snippet whs:n - white-space normal + white-space normal snippet whs:nw - white-space nowrap + white-space nowrap snippet whs:pl - white-space pre-line + white-space pre-line snippet whs:pw - white-space pre-wrap + white-space pre-wrap snippet whs:p - white-space pre + white-space pre snippet wid - widows ${0} + widows ${0} snippet w - width ${0} + width ${0} snippet w:a - width auto + width auto snippet wob - word-break ${0} + word-break ${0} snippet wob:ba - word-break break-all + word-break break-all snippet wob:bs - word-break break-strict + word-break break-strict snippet wob:k - word-break keep-all + word-break keep-all snippet wob:l - word-break loose + word-break loose snippet wob:n - word-break normal + word-break normal snippet wos - word-spacing ${0} + word-spacing ${0} snippet wow - word-wrap ${0} + word-wrap ${0} snippet wow:no - word-wrap none + word-wrap none snippet wow:n - word-wrap normal + word-wrap normal snippet wow:s - word-wrap suppress + word-wrap suppress snippet wow:u - word-wrap unrestricted + word-wrap unrestricted snippet z - z-index ${0} + z-index ${0} snippet z:a - z-index auto + z-index auto snippet zoo - zoom 1 + zoom 1 snippet :h - :hover + :hover snippet :fc - :first-child + :first-child snippet :lc - :last-child + :last-child snippet :nc - :nth-child(${0}) + :nth-child(${0}) snippet :nlc - :nth-last-child(${0}) + :nth-last-child(${0}) snippet :oc - :only-child + :only-child snippet :a - :after + :after snippet :b - :before + :before snippet ::a - ::after + ::after snippet ::b - ::before + ::before snippet if - if ${0} + if ${0} snippet mix - ${1}(${0}) + ${1}(${0}) snippet for - for ${1:i} in ${0} + for ${1:i} in ${0} snippet keyf - @keyframes ${0} + @keyframes ${0} From 000fad2c34fe4686f33611671bf80d10a13f2f84 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Mon, 5 Jan 2015 09:37:56 +0100 Subject: [PATCH 06/58] Added Laravel Snippet --- UltiSnips/php_laravel.snippets | 260 +++++++++++++++++++++++++++++++++ snippets/laravel.snippets | 18 +++ 2 files changed, 278 insertions(+) create mode 100644 UltiSnips/php_laravel.snippets create mode 100644 snippets/laravel.snippets diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets new file mode 100644 index 0000000..1203862 --- /dev/null +++ b/UltiSnips/php_laravel.snippets @@ -0,0 +1,260 @@ +#resource controller +snippet l_rsc "Laravel resource controller" +/*! + * \class ${1:`!v expand('%:t:r')`} + * + * \author ${2:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +class $1 { + public function index() { + ${3} + } + + public function create() { + ${4} + } + + public function store($id) { + ${5} + } + + public function show($id) { + ${6} + } + + public function edit($id) { + ${7} + } + + public function update($id) { + ${8} + } + + public function destroy($id) { + ${9} + } +} +endsnippet + +#service service provider +snippet l_ssp "Laravel service provider for service" +/*! + * \namespace ${1:Services} + * \class ${2:`!v expand('%:t:r')`} + * + * \author ${3:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +use Illuminate\Support\ServiceProvider; + +class $2 extends ServiceProvider { + + public function register() { + $this->app->bind('${4}Service', function ($app) { + return new ${5}( + $app->make('Repositories\\${6}Interface'), + ); + }); + } +} +endsnippet + +#repository service provider +snippet l_rsp "Laravel service provider for repository" +/*! + * \namespace ${2:Repositories\\${1:}} + * \class ${3:`!v expand('%:t:r')`} + * + * \author ${4:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $4; + +use Entities\\$1; +use $2\\$1Repository; +use Illuminate\Support\ServiceProvider; + +class $3 extends ServiceProvider { + /*! + * \var defer + * \brief Defer service + */ + protected $defer = ${5:true}; + + public function register() { + $this->app->bind('$2\\$1Interface', function($app) { + return new $1Repository(new $1()); + }); + } + + /*! + * \brief If $defer == true need this fn + */ + public function provides() { + return ['$2\\$1Interface']; + } +} +endsnippet + +#model +snippet l_md "Laravel simple model" +/*! + * \namespace ${1:Entities} + * \class ${2:`!v expand('%:t:r')`} + * + * \author ${3:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +class $2 extends \Eloquent { + protected $table = '${4:`!p snip.rv = t[2].lower()`}'; + + public $timestamps = '${5:false}'; + + protected $hidden = array(${6}); + + protected $guarded = array(${7:'id'}); +} +endsnippet + +#abstract repository +snippet l_ar "Laravel abstract Repository" +/*! + * \namespace ${1:Repositories} + * \class ${2:`!v expand('%:t:r')`} + * \implements ${3:BaseRepositoryInterface} + * + * \author ${4:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +use Illuminate\Database\Eloquent\Model; + +abstract class $2 implements $3 { + protected $model; + + /*! + * \fn __construct + * + * \brief Take the model + */ + + public function __construct(Model $model) { + $this->model = $model; + } + + /*! + * \fn all + * + * \return Illuminate\Database\Eloquent\Collection + */ + public function all($columns = array('*')) { + return $this->model->all()->toArray(); + } + + /*! + * \fn create + * + * \return Illuminate\Database\Eloquent\Model + */ + public function create(array $attributes) { + return $this->model->create($attributes); + } + + /*! + * \fn destroy + * + * \return int + */ + public function destroy($ids) { + return $this->model->destroy($ids); + } + + /*! + * \fn find + * + * \return mixed + */ + public function find($id, $columns = array('*')) { + return $this->model->find($id, $columns); + } +} +endsnippet + +#repository +snippet l_r "Laravel Repository" +/*! + * \namespace ${1:Repositories\\${2}} + * \class ${3:`!v expand('%:t:r')`} + * \implements ${4:BaseRepositoryInterface} + * + * \author ${5:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +class $3 extends \\$1 implements $4 { + ${6} +} +endsnippet + +#service +snippet l_s "Laravel Service" +/*! + * \namespace ${1:Services} + * \class ${2:`!v expand('%:t:r')`} + * + * \author ${3:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +use ${4:Repositories\\${5:Interface}}; + +class $2 { + protected $${6:repo}; + + /*! + * \fn __construct + */ + public function __construct($4 $repo) { + $this->$6 = $repo; + } +} +endsnippet + +#facade +snippet l_f "Laravel Facade" +/*! + * \namespace ${1:Services} + * \class ${2:`!v expand('%:t:r')`} + * + * \author ${3:`!v g:snips_author`} + * \date `!v strftime('%d-%m-%y')` + */ + +namespace $1; + +use \Illuminate\Support\Facades\Facade; + +class $2 extends Facade { + /*! + * \fn getFacadeAccessor + * + * \return string + */ + protected static function getFacadeAccessor() { return '${5:${4}Service}'; } +} +endsnippet diff --git a/snippets/laravel.snippets b/snippets/laravel.snippets new file mode 100644 index 0000000..b111e18 --- /dev/null +++ b/snippets/laravel.snippets @@ -0,0 +1,18 @@ +#resource controller +snippet doc_rsc + /*! + * \namespace ${1} + * \class ${2:$1} + * + * \author ${3:Claudio Maradonna} ${4:} + * \date `strftime('%d-%m-%y')` + */ + class $$1 { + public function index() {} + public function create() {} + public function store($id) {} + public function show($id) {} + public function edit($id) {} + public function update($id) {} + public function destroy($id) {} + } From 052d28286834b3d21f0a3703a74e69548814e9dd Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Mon, 5 Jan 2015 09:38:33 +0100 Subject: [PATCH 07/58] Corrected last commit --- snippets/laravel.snippets | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 snippets/laravel.snippets diff --git a/snippets/laravel.snippets b/snippets/laravel.snippets deleted file mode 100644 index b111e18..0000000 --- a/snippets/laravel.snippets +++ /dev/null @@ -1,18 +0,0 @@ -#resource controller -snippet doc_rsc - /*! - * \namespace ${1} - * \class ${2:$1} - * - * \author ${3:Claudio Maradonna} ${4:} - * \date `strftime('%d-%m-%y')` - */ - class $$1 { - public function index() {} - public function create() {} - public function store($id) {} - public function show($id) {} - public function edit($id) {} - public function update($id) {} - public function destroy($id) {} - } From 5023e19b965f5fedd09513074fd23322a3bd1336 Mon Sep 17 00:00:00 2001 From: Matt Rasband Date: Mon, 5 Jan 2015 09:08:36 -0500 Subject: [PATCH 08/58] updated angular snippets to auto populate params based on the param annotations --- UltiSnips/javascript_angular.snippets | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/UltiSnips/javascript_angular.snippets b/UltiSnips/javascript_angular.snippets index 61b5229..91b5931 100644 --- a/UltiSnips/javascript_angular.snippets +++ b/UltiSnips/javascript_angular.snippets @@ -19,49 +19,59 @@ config(function($1) { endsnippet snippet acont "angular controller" i -controller('${1:name}', ['${2:param_annotation}', function(${3:param}) { +controller('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet snippet aconts "angular controller with scope" i -controller('${1:name}', ['$scope', function($scope) { +controller('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet snippet adir "angular directive" i -directive('${1:name}', ['${2:param_annotation}', function(${3:param}) { - $0 +directive('${1}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { + return { + restrict: '${3:EA}', + link: function(scope, element, attrs) { + ${0} + } + }; }]); endsnippet snippet adirs "angular directive with scope" i -directive('${1:name}', ['$scope', function($scope) { - $0 +directive('${1}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { + return { + restrict: '${3:EA}', + link: function(scope, element, attrs) { + ${0} + } + }; }]); endsnippet snippet afact "angular factory" i -factory('${1:name}', ['${2:param_annotation}', function(${3:param}) { +factory('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet snippet afacts "angular factory with scope" i -factory('${1:name}', ['$scope', function($scope) { +factory('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet snippet aserv "angular service" i -service('${1:name}', ['${2:param_annotation}', function(${3:param}) { +service('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet snippet aservs "angular service" i -service('${1:name}', ['$scope', function($scope) { +service('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet From 8832cee4c23444d2c73c64c8dae5728b98113dbb Mon Sep 17 00:00:00 2001 From: Yike Lu Date: Tue, 6 Jan 2015 13:24:16 -0600 Subject: [PATCH 09/58] Add iem python snippet for embedded ipython --- snippets/python.snippets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snippets/python.snippets b/snippets/python.snippets index a93b654..860b572 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -129,6 +129,9 @@ snippet pdb # ipython debugger (ipdb) snippet ipdb import ipdb; ipdb.set_trace() +# embed ipython itself +snippet iem + import IPython; IPython.embed() # ipython debugger (pdbbb) snippet pdbbb import pdbpp; pdbpp.set_trace() From 99fe636f09c842bb3ed491f1b8b36c3ab7ecac9c Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 7 Jan 2015 11:02:18 -0800 Subject: [PATCH 10/58] Snippet for python prompt toolkit embed https://github.com/jonathanslenders/python-prompt-toolkit ```python from prompt_toolkit.contrib.repl import embed embed(globals(), locals(), vi_mode=False, history_filename=None) ``` --- snippets/python.snippets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/python.snippets b/snippets/python.snippets index 860b572..77d74e4 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -135,6 +135,10 @@ snippet iem # ipython debugger (pdbbb) snippet pdbbb import pdbpp; pdbpp.set_trace() +# python_prompt_toolkit +snippet ppt + from prompt_toolkit.contrib.repl import embed + embed(globals(), locals(), vi_mode=${1:default=False}, history_filename=${2:default=None}) # python console debugger (pudb) snippet pudb import pudb; pudb.set_trace() From 18733185c1bc2b516dc7b790069d22f0a53696f1 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 11 Jan 2015 01:41:41 +0000 Subject: [PATCH 11/58] Update Rust for to use new range syntax --- README.md | 1 + UltiSnips/rust.snippets | 2 +- snippets/rust.snippets | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cb78ca..46cc390 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ This list is kept up-to-date on a best effort basis. * PHP - [chrisyue](http://github.com/chrisyue) * Python - [honza](http://github.com/honza) * Ruby - [taq](http://github.com/taq) +* Rust - [lpil](https://github.com/lpil) * Scala - [gorodinskiy](https://github.com/gorodinskiy) License diff --git a/UltiSnips/rust.snippets b/UltiSnips/rust.snippets index 82a1abb..9722d73 100644 --- a/UltiSnips/rust.snippets +++ b/UltiSnips/rust.snippets @@ -164,7 +164,7 @@ while ${1} { endsnippet snippet for "for .. in .." b -for ${1:i} in ${2:range(0u, 10)} { +for ${1:i} in ${2:${3:0us}..${4:10}} { ${VISUAL}${0} } endsnippet diff --git a/snippets/rust.snippets b/snippets/rust.snippets index f135eb5..ad9fb34 100644 --- a/snippets/rust.snippets +++ b/snippets/rust.snippets @@ -70,7 +70,7 @@ snippet while ${0} } snippet for - for ${1:i} in ${2:range(0u, 10)} { + for ${1:i} in ${2:0u..10} { ${0} } snippet spawn From 69d3b5e02ed5707347f75eaf6b4a9fe724782d65 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 11 Jan 2015 01:57:32 +0000 Subject: [PATCH 12/58] Remove a load of duplication from Rust snippets --- UltiSnips/rust.snippets | 183 ---------------------------------------- snippets/rust.snippets | 55 ++++++++++-- 2 files changed, 46 insertions(+), 192 deletions(-) diff --git a/UltiSnips/rust.snippets b/UltiSnips/rust.snippets index 9722d73..ddb948f 100644 --- a/UltiSnips/rust.snippets +++ b/UltiSnips/rust.snippets @@ -10,43 +10,6 @@ fn ${1:function_name}(${2})${3/..*/ -> /}${3} { } endsnippet -snippet test "Test function" b -#[test] -fn ${1:test_function_name}() { - ${VISUAL}${0} -} -endsnippet - - -snippet bench "Bench function" b -#[bench] -fn ${1:bench_function_name}(b: &mut test::Bencher) { - b.iter(|| { - ${VISUAL}${0} - }) -} -endsnippet - -snippet new "A new function" b -pub fn new(${2}) -> ${1:Name} { - ${VISUAL}${0}return $1 { ${3} }; -} -endsnippet - -snippet main "The main function" b -pub fn main() { - ${VISUAL}${0} -} -endsnippet - -snippet let "A let statement" b -let ${1:name}${3} = ${VISUAL}${2}; -endsnippet - -snippet lmut "let mut = .." b -let mut ${1:name}${3} = ${VISUAL}${2}; -endsnippet - snippet pri "print!(..)" b print!("${1}"${2/..*/, /}${2}); endsnippet @@ -67,130 +30,22 @@ macro_rules! ${1:name} ( ) endsnippet -snippet ec "extern crate ..." b -extern crate ${1:sync}; -endsnippet - -snippet ecl "...extern crate log;" b -#![feature(phase)] -#[phase(plugin, link)] extern crate log; -endsnippet - snippet mod "A module" b mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} { ${VISUAL}${0} } endsnippet -snippet crate "Create header information" b -// Crate name -#![crate_name = "${1:crate_name}"] - -// Additional metadata attributes -#![desc = "${2:Descrption.}"] -#![license = "${3:BSD}"] -#![comment = "${4:Comment.}"] - -// Specify the output type -#![crate_type = "${5:lib}"] -endsnippet - -snippet allow "#[allow(..)]" b -#[allow(${1:unused_variable})] -endsnippet - -snippet feat "#![feature(..)]" b -#![feature(${1:macro_rules})] -endsnippet - -snippet der "#[deriving(..)]" b -#[deriving(${1:Show})] -endsnippet - -snippet attr "#[..]" b -#[${1:inline}] -endsnippet - -snippet opt "Option<..>" -Option<${1:int}> -endsnippet - -snippet res "Result<.., ..>" -Result<${1:int}, ${2:()}> -endsnippet - -snippet if "if .. (if)" b -if ${1} { - ${VISUAL}${0} -} -endsnippet - -snippet el "else .. (el)" -else { - ${VISUAL}${0} -} -endsnippet - -snippet eli "else if .. (eli)" -else if ${1} { - ${VISUAL}${0} -} -endsnippet - -snippet ife "if .. else (ife)" -if ${1} { - ${2} -} else { - ${3} -} -endsnippet - -snippet mat "match" -match ${1} { - ${2} => ${3}, -} -endsnippet - -snippet loop "loop {}" b -loop { - ${VISUAL}${0} -} -endsnippet - -snippet while "while .. {}" b -while ${1} { - ${VISUAL}${0} -} -endsnippet - snippet for "for .. in .." b for ${1:i} in ${2:${3:0us}..${4:10}} { ${VISUAL}${0} } endsnippet -snippet spawn "spawn(proc() { .. });" b -spawn(proc() { - ${VISUAL}${0} -}); -endsnippet - -snippet chan "A channel" b -let (${1:tx}, ${2:rx}): (Sender<${3:int}>, Receiver<${4:int}>) = channel(); -endsnippet - -snippet duplex "Duplex stream" b -let (${1:from_child}, ${2:to_child}) = sync::duplex(); -endsnippet - snippet todo "A Todo comment" // [TODO]: ${1:Description} - `!v strftime("%Y-%m-%d %I:%M%P")` endsnippet -snippet fixme "FIXME comment" -// FIXME: ${1} -endsnippet - snippet st "Struct" b struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} { ${VISUAL}${0} @@ -211,42 +66,4 @@ impl $1 { } endsnippet -snippet enum "An enum" b -enum ${1:Name} { - ${VISUAL}${0}, -} -endsnippet - -snippet type "A type" b -type ${1:NewName} = ${VISUAL}${0}; -endsnippet - -snippet imp "An impl" b -impl ${1:Name} { - ${VISUAL}${0} -} -endsnippet - -snippet drop "Drop implementation" b -impl Drop for ${1:Name} { - fn drop(&mut self) { - ${VISUAL}${0} - } -} -endsnippet - -snippet trait "Trait definition" b -trait ${1:Name} { - ${VISUAL}${0} -} -endsnippet - -snippet ss "A static string." -static ${1}: &'static str = "${VISUAL}${0}"; -endsnippet - -snippet stat "A static variable." -static ${1}: ${2:uint} = ${VISUAL}${0}; -endsnippet - # vim:ft=snippets: diff --git a/snippets/rust.snippets b/snippets/rust.snippets index ad9fb34..b6ad53c 100644 --- a/snippets/rust.snippets +++ b/snippets/rust.snippets @@ -4,11 +4,7 @@ # Functions snippet fn - fn ${1:function_name}(${2}) { - ${0} - } -snippet fn- - fn ${1:function_name}(${2}) -> ${3} { + fn ${1:function_name}(${2})${3} { ${0} } snippet test @@ -16,6 +12,13 @@ snippet test fn ${1:test_function_name}() { ${0} } +snippet bench "Bench function" b + #[bench] + fn ${1:bench_function_name}(b: &mut test::Bencher) { + b.iter(|| { + ${0} + }) + } snippet new pub fn new(${2}) -> ${1:Name} { ${0}return $1 { ${3} }; @@ -25,7 +28,9 @@ snippet main ${0} } snippet let - let ${1:name}${3} = ${2}; + let ${1:name: type} = ${2}; +snippet let + let mut ${1:name: type} = ${2}; snippet pln println!("${1}"); snippet pln, @@ -52,19 +57,42 @@ snippet allow #[allow(${1:unused_variable})] snippet feat #![feature(${1:macro_rules})] +snippet der "#[deriving(..)]" b + #[deriving(${1:Show})] +snippet attr "#[..]" b + #[${1:inline}] + # Common types snippet opt Option<${1:int}> snippet res Result<${1:~str}, ${2:()}> snippet if - if ${1:/* condition */} { + if ${1} { + ${0} + } +snippet ife + if ${1} { + ${2} + } else { + ${0} + } +snippet el + else { + ${0} + } +snippet eli + else if ${1} { ${0} } snippet mat match ${1} { ${2} => ${3}, } +snippet loop "loop {}" b + loop { + ${0} + } snippet while while ${1:condition} { ${0} @@ -83,12 +111,19 @@ snippet duplex let (${1:from_child}, ${2:to_child}) = sync::duplex(); # TODO commenting snippet todo - // [TODO]: ${1:Description} + // [TODO]: ${0:Description} +snippet fixme "FIXME comment" + // FIXME: $0 + # Struct snippet st struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} { ${0} } +snippet stn + struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} { + ${0} + } impl $1 { pub fn new(${2}) -> $1 { @@ -97,9 +132,11 @@ snippet st }; } } +snippet typ + type ${1:NewName} = $0; # Enum snippet enum - enum ${1:enum_name} { + enum ${1:Name} { ${0}, } # Impl From 0ac57c77795bdeeaa57302e74da9527781108870 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 11 Jan 2015 01:58:57 +0000 Subject: [PATCH 13/58] Rust: change from uint to new usize type --- snippets/rust.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/rust.snippets b/snippets/rust.snippets index b6ad53c..195f254 100644 --- a/snippets/rust.snippets +++ b/snippets/rust.snippets @@ -159,4 +159,4 @@ snippet trait snippet ss static ${1}: &'static str = "${0}"; snippet stat - static ${1}: ${2:uint} = ${0}; + static ${1}: ${2:usize} = ${0}; From 9bf5d0f4123183b6cb74f273576f2051c029de79 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Sun, 11 Jan 2015 12:35:37 +0100 Subject: [PATCH 14/58] Added b option to prevent snippet inline --- UltiSnips/php_laravel.snippets | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 1203862..8890637 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -1,5 +1,5 @@ #resource controller -snippet l_rsc "Laravel resource controller" +snippet l_rsc "Laravel resource controller" b /*! * \class ${1:`!v expand('%:t:r')`} * @@ -39,7 +39,7 @@ class $1 { endsnippet #service service provider -snippet l_ssp "Laravel service provider for service" +snippet l_ssp "Laravel service provider for service" b /*! * \namespace ${1:Services} * \class ${2:`!v expand('%:t:r')`} @@ -65,7 +65,7 @@ class $2 extends ServiceProvider { endsnippet #repository service provider -snippet l_rsp "Laravel service provider for repository" +snippet l_rsp "Laravel service provider for repository" b /*! * \namespace ${2:Repositories\\${1:}} * \class ${3:`!v expand('%:t:r')`} @@ -103,7 +103,7 @@ class $3 extends ServiceProvider { endsnippet #model -snippet l_md "Laravel simple model" +snippet l_md "Laravel simple model" b /*! * \namespace ${1:Entities} * \class ${2:`!v expand('%:t:r')`} @@ -126,7 +126,7 @@ class $2 extends \Eloquent { endsnippet #abstract repository -snippet l_ar "Laravel abstract Repository" +snippet l_ar "Laravel abstract Repository" b /*! * \namespace ${1:Repositories} * \class ${2:`!v expand('%:t:r')`} @@ -192,7 +192,7 @@ abstract class $2 implements $3 { endsnippet #repository -snippet l_r "Laravel Repository" +snippet l_r "Laravel Repository" b /*! * \namespace ${1:Repositories\\${2}} * \class ${3:`!v expand('%:t:r')`} @@ -210,7 +210,7 @@ class $3 extends \\$1 implements $4 { endsnippet #service -snippet l_s "Laravel Service" +snippet l_s "Laravel Service" b /*! * \namespace ${1:Services} * \class ${2:`!v expand('%:t:r')`} @@ -236,7 +236,7 @@ class $2 { endsnippet #facade -snippet l_f "Laravel Facade" +snippet l_f "Laravel Facade" b /*! * \namespace ${1:Services} * \class ${2:`!v expand('%:t:r')`} From 83be78b087f51e60eebd2e08dbac5af34874aa9f Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 14 Jan 2015 22:35:12 +0100 Subject: [PATCH 15/58] Bug fix with Laravel snippet --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 8890637..79018bc 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -74,7 +74,7 @@ snippet l_rsp "Laravel service provider for repository" b * \date `!v strftime('%d-%m-%y')` */ -namespace $4; +namespace $2; use Entities\\$1; use $2\\$1Repository; From b51b2766fdd8f901a4bc576d44c74911a3c62621 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 14 Jan 2015 22:42:30 +0100 Subject: [PATCH 16/58] Another bug fix for Laravel Snippet --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 79018bc..33df427 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -229,7 +229,7 @@ class $2 { /*! * \fn __construct */ - public function __construct($4 $repo) { + public function __construct($5 $repo) { $this->$6 = $repo; } } From 634efcfc0ab7e34c1d5131fd44ffbb03fd868a04 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Wed, 14 Jan 2015 22:44:54 +0100 Subject: [PATCH 17/58] Another bug fix for Laravel Snippet --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 33df427..9f817a8 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -57,7 +57,7 @@ class $2 extends ServiceProvider { public function register() { $this->app->bind('${4}Service', function ($app) { return new ${5}( - $app->make('Repositories\\${6}Interface'), + $app->make('Repositories\\${6}Interface') ); }); } From 2ce8ef4ddd20ef3a9d515364af2503dbb40c1f72 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 15 Jan 2015 21:28:50 +0000 Subject: [PATCH 18/58] ERB: Remove redundant ultisnips if --- UltiSnips/eruby.snippets | 4 ---- 1 file changed, 4 deletions(-) diff --git a/UltiSnips/eruby.snippets b/UltiSnips/eruby.snippets index d1a26df..171f08c 100644 --- a/UltiSnips/eruby.snippets +++ b/UltiSnips/eruby.snippets @@ -226,10 +226,6 @@ snippet else "else (ERB)" $0 endsnippet -snippet if "if (ERB)" -<% if ${1:condition} %>$0 -endsnippet - snippet lf "link_to_function" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet From e14633927092ec448a3ed647121748cc51676483 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 16 Jan 2015 11:00:18 +0100 Subject: [PATCH 19/58] Optimized Resource Controller Laravel in php_laravel snippet --- UltiSnips/php_laravel.snippets | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 9f817a8..b7c88fd 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -7,33 +7,30 @@ snippet l_rsc "Laravel resource controller" b * \date `!v strftime('%d-%m-%y')` */ -class $1 { - public function index() { - ${3} - } - - public function create() { +class $1 extends ${3: BaseController} { + function __construct() { ${4} } + public function index() { + } + + public function create() { + } + public function store($id) { - ${5} } public function show($id) { - ${6} } public function edit($id) { - ${7} } public function update($id) { - ${8} } public function destroy($id) { - ${9} } } endsnippet From 058bde6434a5d18ee97ac0dbb46916a19150aa54 Mon Sep 17 00:00:00 2001 From: m-pilia Date: Sat, 17 Jan 2015 17:10:08 +0100 Subject: [PATCH 20/58] remove duplicate license snippets --- UltiSnips/ada.snippets | 44 ------------------------------------------ snippets/ada.snippets | 38 ------------------------------------ 2 files changed, 82 deletions(-) diff --git a/UltiSnips/ada.snippets b/UltiSnips/ada.snippets index d33c777..cc35c2c 100644 --- a/UltiSnips/ada.snippets +++ b/UltiSnips/ada.snippets @@ -11,10 +11,6 @@ def ada_case(word): out = out + word[i] return out -def get_year(): - import time - return time.strftime("%Y") - endglobal snippet wi "with" @@ -281,44 +277,4 @@ snippet newline "Ada.Text_IO.New_Line" Ada.Text_IO.New_Line(${1:1});$0 endsnippet -snippet gpl "GPL license header" --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU ${1}General Public License as published by --- the Free Software Foundation; either version ${2:3} of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU $1General Public License for more details. --- --- You should have received a copy of the GNU $1General Public License --- along with this program; if not, see . --- --- Copyright (C) ${3:Author}, ${4:`!p snip.rv = get_year()`} - -$0 -endsnippet - -snippet gplf "GPL file license header" --- This file is part of ${1:Program-Name}. --- --- $1 is free software: you can redistribute it and/or modify --- it under the terms of the GNU ${2}General Public License as published by --- the Free Software Foundation, either version ${3:3} of the License, or --- (at your option) any later version. --- --- $1 is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU $2General Public License for more details. --- --- You should have received a copy of the GNU $2General Public License --- along with $1. If not, see . --- --- Copyright (C) ${4:Author}, ${5:`!p snip.rv = get_year()`} - -$0 -endsnippet - # vim:ft=snippets: diff --git a/snippets/ada.snippets b/snippets/ada.snippets index ce377b9..1039946 100644 --- a/snippets/ada.snippets +++ b/snippets/ada.snippets @@ -215,41 +215,3 @@ snippet getl Ada.Text_IO.Get_Line snippet newline Ada.Text_IO.New_Line Ada.Text_IO.New_Line(${1:1});${0} -snippet gpl GPL license header - -- This program is free software; you can redistribute it and/or modify - -- it under the terms of the GNU ${1}General Public License as published by - -- the Free Software Foundation; either version ${2:3} of the License, or - -- (at your option) any later version. - -- - -- This program is distributed in the hope that it will be useful, - -- but WITHOUT ANY WARRANTY; without even the implied warranty of - -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -- GNU $1General Public License for more details. - -- - -- You should have received a copy of the GNU $1General Public License - -- along with this program; if not, see . - -- - -- Copyright (C) ${3:Author}, ${4:`strftime("%Y")`} - - ${0} - -snippet gplf GPL file license header - -- This file is part of ${1:Program-Name}. - -- - -- $1 is free software: you can redistribute it and/or modify - -- it under the terms of the GNU ${2}General Public License as published by - -- the Free Software Foundation, either version ${3:3} of the License, or - -- (at your option) any later version. - -- - -- $1 is distributed in the hope that it will be useful, - -- but WITHOUT ANY WARRANTY; without even the implied warranty of - -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -- GNU $2General Public License for more details. - -- - -- You should have received a copy of the GNU $2General Public License - -- along with $1. If not, see . - -- - -- Copyright (C) ${4:Author}, ${5:`strftime("%Y")`} - - ${0} - From 889e833c69bf3f152168487b16f34a8e578c8cc1 Mon Sep 17 00:00:00 2001 From: m-pilia Date: Sat, 17 Jan 2015 17:10:44 +0100 Subject: [PATCH 21/58] add GMGPL linking exception --- snippets/_.snippets | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/snippets/_.snippets b/snippets/_.snippets index a403255..b556554 100644 --- a/snippets/_.snippets +++ b/snippets/_.snippets @@ -102,6 +102,15 @@ snippet AGPL3 You should have received a copy of the GNU Affero General Public License along with this program. If not, see . + ${0} +snippet GMGPL linking exception + As a special exception, if other files instantiate generics from + this unit, or you link this unit with other files to produce an + executable, this unit does not by itself cause the resulting + executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why the + executable file might be covered by the GNU Public License. + ${0} snippet BSD2 ${1:one line to give the program's name and a brief description} From 78eeb128107e626774732f713f339a3fcab728e7 Mon Sep 17 00:00:00 2001 From: m-pilia Date: Sat, 17 Jan 2015 17:11:20 +0100 Subject: [PATCH 22/58] add AWK snippets --- snippets/awk.snippets | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 snippets/awk.snippets diff --git a/snippets/awk.snippets b/snippets/awk.snippets new file mode 100644 index 0000000..32e56f2 --- /dev/null +++ b/snippets/awk.snippets @@ -0,0 +1,102 @@ +# cannot use /usr/bin/env because it does not support parameters (as -f) +snippet #! #!/usr/bin/awk -f + #!/usr/bin/awk -f + +# @include is a gawk extension +snippet inc @include + @include "${1}"${0} + +# @load is a gawk extension +snippet loa @load + @load "${1}"${0} + +snippet beg BEGIN { ... } + BEGIN { + ${0} + } + +# BEGINFILE is a gawk extension +snippet begf BEGINFILE { ... } + BEGINFILE { + ${0} + } + +snippet end END { ... } + END { + ${0} + } + +# ENDFILE is a gawk extension +snippet endf ENDFILE { ... } + ENDFILE { + ${0} + } + +snippet pri print + print ${1:"${2}"}${0} + +snippet printf printf + printf("${1:%s}\n", ${2})${0} + +snippet ign IGNORECASE + IGNORECASE = ${1:1} + +snippet if if {...} + if (${1}) { + ${0} + } + +snippet ife if ... else ... + if (${1}) { + ${2} + } else { + ${0} + } + +snippet eif else if ... + else if (${1}) { + ${0} + } + +snippet el else {...} + else { + ${0} + } + +snippet wh while + while (${1}) { + ${2} + } + +snippet do do ... while + do { + ${0} + } while (${1}) + +snippet for for + for (${2:i} = 0; i < ${1:n}; ${3:++i}) { + ${0} + } + +snippet fore for each + for (${1:i} in ${2:array}) { + ${0} + } + +# the switch is a gawk extension +snippet sw switch + switch (${1}) { + case ${2}: + ${3} + break + default: + ${0} + break + } + +# the switch is a gawk extension +snippet case case + case ${1}: + ${0} + break + From a167d4833a6e1817d7c1befdfee5b3502f16301a Mon Sep 17 00:00:00 2001 From: Sergey Lebedev Date: Sun, 18 Jan 2015 19:53:44 +0300 Subject: [PATCH 23/58] [puppet.snippet]: s/'/"/ in most of snippets, changes in 'file' snippet and some new snippets --- snippets/puppet.snippets | 121 +++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 48 deletions(-) diff --git a/snippets/puppet.snippets b/snippets/puppet.snippets index a4fdf19..8b0a410 100644 --- a/snippets/puppet.snippets +++ b/snippets/puppet.snippets @@ -90,7 +90,7 @@ snippet class ${0} } snippet node - node '${1:`vim_snippets#Filename('', 'fqdn')`}' { + node "${1:`vim_snippets#Filename('', 'fqdn')`}" { ${0} } snippet case @@ -107,13 +107,21 @@ snippet if if $${1:variable} { ${0} } +snippet ifd + if defined(${1:Resource}["${2:name}"]) { + ${0} + } +snippet ifnd + if !defined(${1:Resource}["${2:name}"]) { + ${0} + } snippet el else { ${0} } snippet ? ? { - '${1}' => ${0} + "${1}" => ${0} } # # blocks etc and general syntax sugar @@ -122,98 +130,98 @@ snippet [ snippet > ${1} => ${0} snippet p: - 'puppet://puppet/${1:module name}/${0:file name}' + "puppet://puppet/${1:module name}/${0:file name}" # # Functions snippet alert - alert('${1:message}') + alert("${1:message}") snippet crit - crit('${1:message}') + crit("${1:message}") snippet debug - debug('${1:message}') + debug("${1:message}") snippet defined - defined(${1:Resource}['${2:name}']) + defined(${1:Resource}["${2:name}"]) snippet emerg - emerg('${1:message}') + emerg("${1:message}") snippet extlookup Simple extlookup - extlookup('${1:variable}') + extlookup("${1:variable}") snippet extlookup Extlookup with defaults - extlookup('${1:variable}', '${2:default}') + extlookup("${1:variable}", "${2:default}") snippet extlookup Extlookup with defaults and custom data file - extlookup('${1:variable}', '${2:default}', '${3:data source}') + extlookup("${1:variable}", "${2:default}", "${3:data source}") snippet fail - fail('${1:message}') + fail("${1:message}") snippet info - info('${1:message}') + info("${1:message}") snippet inline_template - inline_template('<%= ${1} %>') + inline_template("<%= ${1} %>") snippet notice - notice('${1:message}') + notice("${1:message}") snippet realize realize(${1:Resource}[${2:name}]) snippet regsubst - regsubst(${1:hay stack}, ${2:needle}, '${3:replacement}') + regsubst(${1:hay stack}, ${2:needle}, "${3:replacement}") snippet inc include ${1:classname} snippet split - split(${1:hay stack}, '${2:patten}') + split(${1:hay stack}, "${2:patten}") snippet versioncmp - versioncmp('${1:version}', '${2:version}') + versioncmp("${1:version}", "${2:version}") snippet warning - warning('${1:message}') + warning("${1:message}") # # Types snippet cron - cron { '${1:name}': - command => '${2}', - user => '${3:root}', + cron { "${1:name}": + command => "${2}", + user => "${3:root}", ${4} => ${0}, } snippet exec - exec { '${1:name}': - command => '${2:$1}', - user => '${3:root}', + exec { "${1:name}": + command => "${2:$1}", + user => "${3:root}", ${4} => ${0}, } snippet user - user { '${1:user}': + user { "${1:user}": ensure => present, - comment => '${2:$1}', + comment => "${2:$1}", managehome => true, - home => '${0:/home/$1}', + home => "${0:/home/$1}", } snippet group - group { '${1:group}': + group { "${1:group}": ensure => ${0:present}, } snippet host - host { '${1:hostname}': + host { "${1:hostname}": ip => ${0:127.0.0.1}, } snippet mailalias - mailalias { '${1:localpart}': - recipient => '${0:recipient}', + mailalias { "${1:localpart}": + recipient => "${0:recipient}", } snippet mount - mount { '${1:destination path}': + mount { "${1:destination path}": ensure => ${2:mounted}, - device => '${0:device name or path}', + device => "${0:device name or path}", } snippet package - package { '${1:package name}': + package { "${1:package name}": ensure => ${0:present}, } snippet yumrepo - yumrepo { '${1:repo name}': - Descr => '${2:$1}', + yumrepo { "${1:repo name}": + Descr => "${2:$1}", enabled => ${0:1}, } @@ -223,22 +231,39 @@ snippet define } snippet service - service { '${1:service}' : + service { "${1:service}" : ensure => running, enable => true, - require => [ Package['${2:package}'], File['${3:file}'], ], - subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ], + require => [ Package["${2:package}"], File["${3:file}"], ], + subscribe => [ File["${4:configfile1}"], File["${5:configfile2}"], Package["${6:package}"], ], } snippet file - file { '${1:filename}' : + file { "${1:filename}" : ensure => ${2:present}, - owner => '${3:root}', - group => '${4:root}', - mode => '${5:0644}', - source => 'puppet:///modules/${6:module}/${7:source}', - content => template('/etc/puppet/templates/${8:template}'), - alias => '${9:alias}', - require => [ Package['${10:package}'], File['${11:file}'], ], + owner => "${3:root}", + group => "${4:root}", + mode => "${5:0644}", + source => "puppet:///modules/${6:module}/${7:source}", + content => template("${8:module}/${9:template}"), + alias => "${10:alias}", + require => [ Package["${11:package}"], File["${12:file}"], ], + } + +snippet archive + archive { "${1:filename}" : + ensure => ${2:present}, + url => "http://${3:url}", + extension => "${4:tgz}", + target => "${5:target}", + checksum => ${6:false}, + src_target => "${7:/tmp}", + } + +snippet firewall + firewall { "${1:comment}" : + proto => ${2:tcp}, + action => ${3:accept}, + port => ${4}, } From 147001fb019b63546a4f5b6c1201fc4a0bb89240 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 18 Jan 2015 22:04:00 +0000 Subject: [PATCH 24/58] Remove extra newlines from _ snippets --- snippets/_.snippets | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/snippets/_.snippets b/snippets/_.snippets index b556554..ff52c0a 100644 --- a/snippets/_.snippets +++ b/snippets/_.snippets @@ -29,7 +29,6 @@ snippet GPL2 You should have received a copy of the GNU General Public License along with this program; if not, see . - ${0} snippet LGPL2 ${1:One line to give the program's name and a brief description.} @@ -47,7 +46,6 @@ snippet LGPL2 You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . - ${0} snippet GPL3 ${1:one line to give the program's name and a brief description.} @@ -65,7 +63,6 @@ snippet GPL3 You should have received a copy of the GNU General Public License along with this program. If not, see . - ${0} snippet LGPL3 ${1:One line to give the program's name and a brief description.} @@ -83,7 +80,6 @@ snippet LGPL3 You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . - ${0} snippet AGPL3 ${1:one line to give the program's name and a brief description.} @@ -101,7 +97,6 @@ snippet AGPL3 You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - ${0} snippet GMGPL linking exception As a special exception, if other files instantiate generics from @@ -140,7 +135,6 @@ snippet BSD2 The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressedor implied, of $2. - ${0} snippet BSD3 ${1:one line to give the program's name and a brief description} @@ -168,7 +162,6 @@ snippet BSD3 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ${0} snippet BSD4 ${1:one line to give the program's name and a brief description} @@ -199,7 +192,6 @@ snippet BSD4 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ${0} snippet MIT ${1:one line to give the program's name and a brief description} @@ -222,7 +214,6 @@ snippet MIT DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ${0} snippet APACHE ${1:one line to give the program's name and a brief description} @@ -239,7 +230,6 @@ snippet APACHE WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - ${0} snippet BEERWARE ${1:one line to give the program's name and a brief description} @@ -249,7 +239,6 @@ snippet BEERWARE $2 wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer or coffee in return - ${0} snippet WTFPL DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE @@ -271,5 +260,4 @@ snippet MPL2 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - ${0} From 66079c34e877e981f1fe7c4cdc5c511c2116300b Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Tue, 20 Jan 2015 17:12:38 +0100 Subject: [PATCH 25/58] Bug fix laravel snippet --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index b7c88fd..26eda92 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -114,7 +114,7 @@ namespace $1; class $2 extends \Eloquent { protected $table = '${4:`!p snip.rv = t[2].lower()`}'; - public $timestamps = '${5:false}'; + public $timestamps = ${5:false}; protected $hidden = array(${6}); From 9e904e17df7186d5efc7efc8c44ceaf21e46f363 Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Tue, 20 Jan 2015 17:21:02 +0100 Subject: [PATCH 26/58] Another bug fix --- UltiSnips/php_laravel.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index 26eda92..d39a77b 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -193,7 +193,7 @@ snippet l_r "Laravel Repository" b /*! * \namespace ${1:Repositories\\${2}} * \class ${3:`!v expand('%:t:r')`} - * \implements ${4:BaseRepositoryInterface} + * \implements ${4:$3RepositoryInterface} * * \author ${5:`!v g:snips_author`} * \date `!v strftime('%d-%m-%y')` From d9a5607c8fac8244f7fe753c316411b699d289f9 Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Sun, 25 Jan 2015 01:12:29 +0800 Subject: [PATCH 27/58] erlang: remove spaces before parens in UltiSnips This is almost never seen in common Erlang style, and was inconsistent with the Snipmate snippets for Erlang. Adds a list comprehension snippet, as a bonus. --- UltiSnips/erlang.snippets | 52 ++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/UltiSnips/erlang.snippets b/UltiSnips/erlang.snippets index e27fbef..f317685 100644 --- a/UltiSnips/erlang.snippets +++ b/UltiSnips/erlang.snippets @@ -5,12 +5,12 @@ priority -50 snippet pat "Case:Receive:Try Clause" -${1:pattern}${2: when ${3:guard}} ->; +${1:pattern}${2: when ${3:guard}} -> ${4:body} endsnippet -snippet beh "Behaviour Directive" --behaviour (${1:behaviour}). +snippet beh "Behaviour Directive" b +-behaviour(${1:behaviour}). endsnippet snippet case "Case Expression" @@ -20,12 +20,12 @@ case ${1:expression} of end endsnippet -snippet def "Define Directive" --define (${1:macro}${2: (${3:param})}, ${4:body}). +snippet def "Define Directive" b +-define(${1:macro}${2: (${3:param})}, ${4:body}). endsnippet -snippet exp "Export Directive" --export ([${1:function}/${2:arity}]). +snippet exp "Export Directive" b +-export([${1:function}/${2:arity}]). endsnippet snippet fun "Fun Expression" @@ -36,7 +36,7 @@ end endsnippet snippet fu "Function" -${1:function} (${2:param})${3: when ${4:guard}} -> +${1:function}(${2:param})${3: when ${4:guard}} -> ${5:body} endsnippet @@ -47,24 +47,24 @@ if end endsnippet -snippet ifdef "Ifdef Directive" --ifdef (${1:macro}). +snippet ifdef "Ifdef Directive" b +-ifdef(${1:macro}). endsnippet -snippet ifndef "Ifndef Directive" --ifndef (${1:macro}). +snippet ifndef "Ifndef Directive" b +-ifndef(${1:macro}). endsnippet -snippet imp "Import Directive" --import (${1:module}, [${2:function}/${3:arity}]). +snippet imp "Import Directive" b +-import(${1:module}, [${2:function}/${3:arity}]). endsnippet -snippet inc "Include Directive" --include ("${1:file}"). +snippet inc "Include Directive" b +-include("${1:file}"). endsnippet -snippet mod "Module Directive" --module (${1:`!p snip.rv = snip.basename or "module"`}). +snippet mod "Module Directive" b +-module(${1:`!p snip.rv = snip.basename or "module"`}). endsnippet snippet rcv "Receive Expression" @@ -77,8 +77,8 @@ ${6:after end endsnippet -snippet rec "Record Directive" --record (${1:record}, {${2:field}${3: = ${4:value}}}). +snippet rec "Record Directive" b +-record(${1:record}, {${2:field}${3: = ${4:value}}}). endsnippet snippet try "Try Expression" @@ -93,8 +93,16 @@ ${13:after end endsnippet -snippet undef "Undef Directive" --undef (${1:macro}). +snippet undef "Undef Directive" b +-undef(${1:macro}). +endsnippet + +snippet || "List Comprehension" +[${1:X} || ${2:X} <- ${3:List}${4:, gen}] +endsnippet + +snippet gen "Generator Expression" +${1:X} <- ${2:List}${3:, gen} endsnippet # vim:ft=snippets: From 0966fa0b20cc5c464168bede731c9924d2343408 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sun, 25 Jan 2015 22:07:29 +0100 Subject: [PATCH 28/58] Fix false positive hyphen list item expansion. Fix #491. --- snippets/markdown.snippets | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snippets/markdown.snippets b/snippets/markdown.snippets index 08cdb45..63491e8 100644 --- a/snippets/markdown.snippets +++ b/snippets/markdown.snippets @@ -71,6 +71,8 @@ snippet === `repeat('=', strlen(getline(line(".") - 1)) - strlen(getline('.')))` ${0} +snippet - + - ${0} snippet --- `repeat('-', strlen(getline(line(".") - 1)) - strlen(getline('.')))` From e187f5a78478353284f3d954472307dbbd6db320 Mon Sep 17 00:00:00 2001 From: Andrea Giardini Date: Mon, 26 Jan 2015 15:56:29 +0100 Subject: [PATCH 29/58] Added snippet for remote python debugger (rpdb) --- snippets/python.snippets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snippets/python.snippets b/snippets/python.snippets index 77d74e4..3fa72b0 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -135,6 +135,9 @@ snippet iem # ipython debugger (pdbbb) snippet pdbbb import pdbpp; pdbpp.set_trace() +# remote python debugger (rpdb) +snippet rpdb + import rpdb; rpdb.set_trace() # python_prompt_toolkit snippet ppt from prompt_toolkit.contrib.repl import embed From 5b86f089dc149d4b1586cf980dfc90ee3d2c8f99 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Fri, 30 Jan 2015 15:25:14 +0100 Subject: [PATCH 30/58] Update PHP getter setter Add return / parameter types Set @param and @return --- UltiSnips/php.snippets | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index def2116..366346a 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -102,44 +102,54 @@ var_export(${1});${2} endsnippet snippet getter "PHP Class Getter" b -/* +/** * Getter for $1 + * + * ${2:return string} */ public function get${1/\w+\s*/\u$0/}() { - return $this->$1;$2 + return $this->$1;$3 } -$4 +$0 endsnippet snippet setter "PHP Class Setter" b -/* +/** * Setter for $1 + * + * @param ${2:string} $$1 + * @return ${3:`!p snip.rv=snip.basename`} */ -public function set${1/\w+\s*/\u$0/}($$1) +public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { - $this->$1 = $$1;$3 - ${4:return $this;} + $this->$1 = $$1;$5 + ${6:return $this;} } $0 endsnippet snippet gs "PHP Class Getter Setter" b -/* +/** * Getter for $1 + * + * return ${2:string} */ public function get${1/\w+\s*/\u$0/}() { - return $this->$1;$2 + return $this->$1;$3 } -/* +/** * Setter for $1 + * + * @param $2 $$1 + * @return ${4:`!p snip.rv=snip.basename`} */ -public function set${1/\w+\s*/\u$0/}($$1) +public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { - $this->$1 = $$1;$3 - ${4:return $this;} + $this->$1 = $$1;$6 + ${7:return $this;} } $0 endsnippet From af05269858bae78b562156810943666db24555fc Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 30 Jan 2015 18:08:12 +0100 Subject: [PATCH 31/58] Bug fix laravel snippet --- UltiSnips/php_laravel.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UltiSnips/php_laravel.snippets b/UltiSnips/php_laravel.snippets index d39a77b..30f3f36 100644 --- a/UltiSnips/php_laravel.snippets +++ b/UltiSnips/php_laravel.snippets @@ -201,8 +201,8 @@ snippet l_r "Laravel Repository" b namespace $1; -class $3 extends \\$1 implements $4 { - ${6} +class $3 extends \\${6} implements $4 { + ${7} } endsnippet From f4d267dd6365a0e1e439f4f7a5349c256e859ccc Mon Sep 17 00:00:00 2001 From: Thomas Szymanski Date: Sat, 31 Jan 2015 18:18:59 +0100 Subject: [PATCH 32/58] Add a missing closing double quote in HTML --- UltiSnips/html_minimal.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/html_minimal.snippets b/UltiSnips/html_minimal.snippets index 48ff4b7..6867e86 100644 --- a/UltiSnips/html_minimal.snippets +++ b/UltiSnips/html_minimal.snippets @@ -17,7 +17,7 @@ snippet label_and_input endsnippet snippet input -${7} endsnippet snippet submit From 23ee37a49c669e26e5f4d6ce02ad121a2e2892ba Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Tue, 3 Feb 2015 10:49:07 +0100 Subject: [PATCH 33/58] Update PHP class and interface snippets Include Date: Sat, 7 Feb 2015 09:52:48 +0100 Subject: [PATCH 34/58] Fix #435. --- UltiSnips/all.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UltiSnips/all.snippets b/UltiSnips/all.snippets index e33d2c5..7578378 100644 --- a/UltiSnips/all.snippets +++ b/UltiSnips/all.snippets @@ -29,7 +29,7 @@ def _parse_comments(s): if len(flags) == 0: rv.append((text, text, text, "")) # parse 3-part comment, but ignore those with O flag - elif flags[0] == 's' and 'O' not in flags: + elif 's' in flags and 'O' not in flags: ctriple = [] indent = "" @@ -47,7 +47,7 @@ def _parse_comments(s): ctriple.append(indent) rv.append(ctriple) - elif flags[0] == 'b': + elif 'b' in flags: if len(text) == 1: rv.insert(0, (text,text,text, "")) except StopIteration: From 3cc04ec71f05bd3b2f4aca583ad5736cfce6d945 Mon Sep 17 00:00:00 2001 From: Leonidez Acosta Date: Tue, 10 Feb 2015 16:11:08 -0600 Subject: [PATCH 35/58] fix :f snippet skipping over function body --- snippets/javascript/javascript.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/javascript/javascript.snippets b/snippets/javascript/javascript.snippets index 5012a43..3c0ed8b 100644 --- a/snippets/javascript/javascript.snippets +++ b/snippets/javascript/javascript.snippets @@ -112,8 +112,8 @@ snippet fori # Object Method snippet :f ${1:method_name}: function (${2:attribute}) { - ${0} - }${3:,} + ${3:} + }${4:,} # hasOwnProperty snippet has hasOwnProperty(${0}) From f1334d2e062f3601615ba55aa55d40179d07da50 Mon Sep 17 00:00:00 2001 From: Leonidez Acosta Date: Wed, 11 Feb 2015 15:15:14 -0600 Subject: [PATCH 36/58] remove hint from function body --- snippets/javascript/javascript.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/javascript/javascript.snippets b/snippets/javascript/javascript.snippets index 3c0ed8b..ea3c175 100644 --- a/snippets/javascript/javascript.snippets +++ b/snippets/javascript/javascript.snippets @@ -112,7 +112,7 @@ snippet fori # Object Method snippet :f ${1:method_name}: function (${2:attribute}) { - ${3:} + ${3} }${4:,} # hasOwnProperty snippet has From 051bc1a91c09d59f4f10af2adcaec3ffc6e67986 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 12 Feb 2015 11:07:46 +0100 Subject: [PATCH 37/58] Fix copy/paste bug --- UltiSnips/php.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index cd9c55b..77c11e6 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -266,7 +266,7 @@ namespace ${1:`!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: -› snip.rv = m.group().replace('/', '\\') + snip.rv = m.group().replace('/', '\\') `}; endsnippet @@ -277,7 +277,7 @@ namespace ${1:`!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: -› snip.rv = m.group().replace('/', '\\') + snip.rv = m.group().replace('/', '\\') `}; /** @@ -297,7 +297,7 @@ namespace ${1:`!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: -› snip.rv = m.group().replace('/', '\\') + snip.rv = m.group().replace('/', '\\') `}; /** @@ -306,7 +306,7 @@ if m: */ interface $1 { -› public function ${3:someFunction}();$4 + public function ${3:someFunction}();$4 } endsnippet From 01a85b1d636eeb30b3d6c4fb26b9f80d89ffcd8d Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 12 Feb 2015 11:10:28 +0100 Subject: [PATCH 38/58] remove blank lines --- UltiSnips/php.snippets | 2 -- 1 file changed, 2 deletions(-) diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index 77c11e6..83de38c 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -111,7 +111,6 @@ public function get${1/\w+\s*/\u$0/}() { return $this->$1;$3 } -$0 endsnippet snippet setter "PHP Class Setter" b @@ -287,7 +286,6 @@ if m: class $1 { } -$0 endsnippet snippet interface "Interface declaration template" b From fc7bf9748cb6c0f548cdc283b970a46315ecb01a Mon Sep 17 00:00:00 2001 From: Leonidez Acosta Date: Thu, 12 Feb 2015 09:25:51 -0600 Subject: [PATCH 39/58] remove tab at close of :f snippet --- snippets/javascript/javascript.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/javascript/javascript.snippets b/snippets/javascript/javascript.snippets index ea3c175..fa8123d 100644 --- a/snippets/javascript/javascript.snippets +++ b/snippets/javascript/javascript.snippets @@ -113,7 +113,7 @@ snippet fori snippet :f ${1:method_name}: function (${2:attribute}) { ${3} - }${4:,} + }, # hasOwnProperty snippet has hasOwnProperty(${0}) From 1831acc72f47993539399c00e5c1f38ab8d1e482 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 17 Feb 2015 21:55:27 +0000 Subject: [PATCH 40/58] Remove Elixir duplicate snippets --- UltiSnips/elixir.snippets | 168 -------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 UltiSnips/elixir.snippets diff --git a/UltiSnips/elixir.snippets b/UltiSnips/elixir.snippets deleted file mode 100644 index 1f53edf..0000000 --- a/UltiSnips/elixir.snippets +++ /dev/null @@ -1,168 +0,0 @@ -priority -50 - -snippet do -do - ${1} -end -endsnippet - -snippet if "if .. do .. end" -if ${1:condition} do - ${2:expression} -end -endsnippet - -snippet if "if .. do: .." -if ${1:condition}, do: ${2:expression} -endsnippet - -snippet ife "if .. do .. else .. end" -if ${1:condition} do - ${2:expression} -else - ${3:expression} -end -endsnippet - -snippet ife "if .. do: .. else:" -if ${1:condition}, do: ${2}, else: ${3} -endsnippet - -snippet unless "unless .. do .. end" -unless ${1} do - ${2} -end -endsnippet - -snippet unless "unless .. do: .." -unless ${1:condition}, do: ${2} -endsnippet - -snippet unlesse "unless .. do .. else .. end" -unless ${1:condition} do - ${2} -else - ${3} -end -endsnippet - -snippet unlesse "unless .. do: .. else:" -unless ${1:condition}, do: ${2}, else: ${3} -endsnippet - -snippet cond -"cond do" -${1} -> - ${2} -end -endsnippet - -snippet case -case ${1} do -${2} -> - ${3} -end -endsnippet - -snippet def -def ${1:name} do - ${2} -end -endsnippet - -snippet defin "def function(n), do: n" -def ${1:name}, do: ${2} -endsnippet - -snippet defg -def ${1:name} when ${2:guard-condition} do - ${3} -end -endsnippet - -snippet defim -defimpl ${1:protocol_name}, for: ${2:data_type} do - ${3} -end -endsnippet - -snippet defma -defmacro ${1:name} do - ${2} -end -endsnippet - -snippet defmo -defmodule ${1:module_name} do - ${2} -end -endsnippet - -snippet defp -defp ${1:name} do - ${2} -end -endsnippet - -snippet defpr -defprotocol ${1:name}, [${2:function}] -endsnippet - -snippet defr -defrecord ${1:record_name}, ${2:fields} -endsnippet - -snippet doc -@doc """ -${1} -""" -endsnippet - -snippet fn -fn(${1:args}) -> ${2} end -endsnippet - -snippet fun -function do - ${1} -end -endsnippet - -snippet mdoc -@moduledoc """ -${1} -""" -endsnippet - -snippet rec -receive do -${1} -> - ${2} -end -endsnippet - -snippet req -require ${1:module_name} -endsnippet - -snippet imp -import ${1:module_name} -endsnippet - -snippet ali "alias old-module to shorthand" -alias ${1:module_name} -endsnippet - -snippet test -test "${1:test_name}" do - ${2} -end -endsnippet - -snippet try "try .. rescue .. end" -try do - ${1} -rescue - ${2} -> ${3} -end -endsnippet From 93b4de1299916de0d93d70629f86ff0fa9735061 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 17 Feb 2015 21:56:44 +0000 Subject: [PATCH 41/58] Remove clojure + rust maintainer --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 46cc390..1d39159 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,6 @@ to maintain snippets for a language, please get in touch. Notes: People are interested in snippets - and their interest may wane again. This list is kept up-to-date on a best effort basis. -* Clojure - [lpil](https://github.com/lpil) * Elixir - [iurifq](https://github.com/iurifq) * Falcon - [steveno](https://github.com/steveno) * HTML Django - [honza](http://github.com/honza) @@ -214,7 +213,6 @@ This list is kept up-to-date on a best effort basis. * PHP - [chrisyue](http://github.com/chrisyue) * Python - [honza](http://github.com/honza) * Ruby - [taq](http://github.com/taq) -* Rust - [lpil](https://github.com/lpil) * Scala - [gorodinskiy](https://github.com/gorodinskiy) License From 24bb8a4b183b4e6d65083d2d30d6ee31e1bb9ee3 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 19 Feb 2015 18:01:49 +0000 Subject: [PATCH 42/58] Elixir: def with doc string --- snippets/elixir.snippets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index 077cf03..c13e880 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -46,6 +46,13 @@ snippet def def ${1:name} do ${0} end +snippet defd + @doc """ + ${1:doc string} + """ + def ${2:name} do + ${0} + end snippet defim defimpl ${1:protocol_name}, for: ${2:data_type} do ${0} From 06122593e59857ffc11a1a0a47926b1cdcce09fe Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 19 Feb 2015 18:02:46 +0000 Subject: [PATCH 43/58] Elixir: Remove superfluous params from fn --- snippets/elixir.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index c13e880..7e47b53 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -78,7 +78,7 @@ snippet doc ${0} """ snippet fn - fn(${1:args}) -> ${0} end + fn ${1:args} -> ${0} end snippet fun function do ${0} From 128355895b0f5ba03fe6579444fcc853dc66fcef Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 19 Feb 2015 18:39:26 +0000 Subject: [PATCH 44/58] Elixir: test with arg --- snippets/elixir.snippets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index 7e47b53..4a51ae8 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -102,6 +102,10 @@ snippet test test "${1:test_name}" do ${0} end +snippet test "A ExUnit test" b + test "${1:test_name}", %{${2:arg: arg}} do + ${0} + end snippet try try .. rescue .. end try do ${1} From 1de4299c208536bd2b9903e8f30eedc1c9f1f0f9 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 20 Feb 2015 09:27:15 +0000 Subject: [PATCH 45/58] Remove dupe name from Elixir snippets --- snippets/elixir.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index 4a51ae8..945f006 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -102,7 +102,7 @@ snippet test test "${1:test_name}" do ${0} end -snippet test "A ExUnit test" b +snippet testa test "${1:test_name}", %{${2:arg: arg}} do ${0} end From 918baf4047ba48b3b7f84e14040135a7f395bb3f Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 20 Feb 2015 16:03:05 +0000 Subject: [PATCH 46/58] Elixir: pry snippet --- snippets/elixir.snippets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index 945f006..f477cec 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -112,3 +112,6 @@ snippet try try .. rescue .. end rescue ${2} -> ${0} end +snippet pry + require IEx; IEx.pry + $0 From d52befe8bc86fd0674c3b83236763157af31f8cf Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sat, 21 Feb 2015 11:24:27 +0000 Subject: [PATCH 47/58] Elixir: Remove some name collisions --- snippets/elixir.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index f477cec..4f1afd9 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -6,7 +6,7 @@ snippet if if .. do .. end if ${1} do ${0} end -snippet if if .. do: .. +snippet if: if .. do: .. if ${1:condition}, do: ${0} snippet ife if .. do .. else .. end if ${1:condition} do @@ -14,13 +14,13 @@ snippet ife if .. do .. else .. end else ${0} end -snippet ife if .. do: .. else: +snippet ife: if .. do: .. else: if ${1:condition}, do: ${2}, else: ${0} snippet unless unless .. do .. end unless ${1} do ${0} end -snippet unless unless .. do: .. +snippet unless: unless .. do: .. unless ${1:condition}, do: ${0} snippet unlesse unless .. do .. else .. end unless ${1:condition} do @@ -28,7 +28,7 @@ snippet unlesse unless .. do .. else .. end else ${0} end -snippet unlesse unless .. do: .. else: +snippet unlesse: unless .. do: .. else: unless ${1:condition}, do: ${2}, else: ${0} snippet cond cond do From 7ce372f83d9ccea0486a1ef6a7a8f911a0b6bebb Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 24 Feb 2015 23:03:33 +0000 Subject: [PATCH 48/58] Elixir Eex snippets --- snippets/eelixir.snippets | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 snippets/eelixir.snippets diff --git a/snippets/eelixir.snippets b/snippets/eelixir.snippets new file mode 100644 index 0000000..17855b4 --- /dev/null +++ b/snippets/eelixir.snippets @@ -0,0 +1,6 @@ +snippet % + <% ${0} %> +snippet = + <%= ${1} %> +snippet end + <% end %> From 58560c62b920f2923626756b095fdf7a797fda53 Mon Sep 17 00:00:00 2001 From: Jonathan Martin Date: Tue, 24 Feb 2015 18:33:26 -0500 Subject: [PATCH 49/58] JS snippet: anonymous function variable assignment. [Closes #524] --- snippets/javascript/javascript.snippets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/javascript/javascript.snippets b/snippets/javascript/javascript.snippets index fa8123d..5fbad8f 100644 --- a/snippets/javascript/javascript.snippets +++ b/snippets/javascript/javascript.snippets @@ -15,6 +15,11 @@ snippet f function(${1}) { ${0} } +# Anonymous Function assigned to variable +snippet vaf + var ${1:function_name} = function(${2}) { + ${0} + }; # Function assigned to variable snippet vf var ${1:function_name} = function $1(${2}) { From 62dc7d6cf362a45aa2e053d23fb3d7b6cbde49dd Mon Sep 17 00:00:00 2001 From: Mickey Date: Wed, 25 Feb 2015 21:36:01 +0800 Subject: [PATCH 50/58] Update UltiSnips/eruby.snippets, replaced radio_box with radio_button --- UltiSnips/eruby.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UltiSnips/eruby.snippets b/UltiSnips/eruby.snippets index 171f08c..b626cc4 100644 --- a/UltiSnips/eruby.snippets +++ b/UltiSnips/eruby.snippets @@ -79,8 +79,8 @@ snippet f. "f.password_field" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet -snippet f. "f.radio_box" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_box :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +snippet f. "f.radio_button" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_button :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet f. "f.submit" From b11832aa686e7cc18385110398ca4e8b5688b5d9 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Fri, 27 Feb 2015 00:15:59 +0000 Subject: [PATCH 51/58] Elixir: debug pry snippet --- snippets/elixir.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index 4f1afd9..daec054 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -114,4 +114,4 @@ snippet try try .. rescue .. end end snippet pry require IEx; IEx.pry - $0 + ${0} From e1baa6d38e5b274e77711270a16adfd6d73a4f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A8switch87=C2=A8?= <¨gert@gepe-biljarts.be¨> Date: Sat, 28 Feb 2015 22:50:06 +0100 Subject: [PATCH 52/58] changed snippet getopts to work correctly --- snippets/sh.snippets | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index c9c6ebc..4c11258 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -51,15 +51,13 @@ snippet getopt #=============================================================================== function usage () { - cat <<- EOT + echo " + Usage : $${0:0} [options] [--] - Usage : $${0:0} [options] [--] + Options: + -h|help Display this message + -v|version Display script version" - Options: - -h|help Display this message - -v|version Display script version - - EOT } # ---------- end of function usage ---------- #----------------------------------------------------------------------- @@ -74,7 +72,7 @@ snippet getopt v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;; - \? ) echo -e "\n Option does not exist : $OPTARG\n" + * ) echo -e "\n Option does not exist : $OPTARG\n" usage; exit 1 ;; esac # --- end of case --- From c5b88e2b6761c439ccd989d81293fff64ea403e1 Mon Sep 17 00:00:00 2001 From: Gert Date: Sat, 28 Feb 2015 23:28:34 +0100 Subject: [PATCH 53/58] Little update in echo command --- snippets/sh.snippets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index 4c11258..910fe8b 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -51,8 +51,7 @@ snippet getopt #=============================================================================== function usage () { - echo " - Usage : $${0:0} [options] [--] + echo "Usage : $${0:0} [options] [--] Options: -h|help Display this message From 7c68c151242f839fafe554f87d9e4fa0834b11f3 Mon Sep 17 00:00:00 2001 From: Gert Date: Sun, 1 Mar 2015 18:05:34 +0100 Subject: [PATCH 54/58] repeared shebang changed shebang snippet, did not work (becous of the leading # in the snippet?) also changed the function snippet becous it was verry confusing, sh version could be placed back, but you realy had to know the source to find the bash snippet... --- snippets/sh.snippets | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index 4c11258..f545f1f 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -1,6 +1,6 @@ # Shebang. Executing bash via /usr/bin/env makes scripts more portable. -snippet #! - #!/usr/bin/env bash +snippet bash + #!/usr/bin/bash snippet if if [[ ${1:condition} ]]; then @@ -80,11 +80,8 @@ snippet getopt shift $(($OPTIND-1)) snippet root if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi + snippet fun - ${1:function_name}() { - ${0:#function_body} - } -snippet ffun function ${1:function_name}() { ${0:#function_body} } From 2b8e591c19f5fac6c352c40338f19ad33f1f6692 Mon Sep 17 00:00:00 2001 From: Gert Date: Sun, 1 Mar 2015 23:21:07 +0100 Subject: [PATCH 55/58] . --- snippets/sh.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index f545f1f..3c9a9ea 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -1,6 +1,6 @@ # Shebang. Executing bash via /usr/bin/env makes scripts more portable. snippet bash - #!/usr/bin/bash + #!/bin/bash snippet if if [[ ${1:condition} ]]; then From 8084d02b6176358862c7307c817255b7b574994d Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 2 Mar 2015 10:12:52 +0000 Subject: [PATCH 56/58] Revert "repeared shebang" --- snippets/sh.snippets | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index 230e3b7..910fe8b 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -1,6 +1,6 @@ # Shebang. Executing bash via /usr/bin/env makes scripts more portable. -snippet bash - #!/bin/bash +snippet #! + #!/usr/bin/env bash snippet if if [[ ${1:condition} ]]; then @@ -79,8 +79,11 @@ snippet getopt shift $(($OPTIND-1)) snippet root if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi - snippet fun + ${1:function_name}() { + ${0:#function_body} + } +snippet ffun function ${1:function_name}() { ${0:#function_body} } From 2dba5c5289aab6046e095b7641a511aa4d49ba65 Mon Sep 17 00:00:00 2001 From: Gert Date: Mon, 2 Mar 2015 23:40:07 +0100 Subject: [PATCH 57/58] changed shebangs end function snippet Same pull request as before, but could not resolve rebasing problem. --- snippets/sh.snippets | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/snippets/sh.snippets b/snippets/sh.snippets index 910fe8b..4d2c62b 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -1,5 +1,8 @@ # Shebang. Executing bash via /usr/bin/env makes scripts more portable. snippet #! + #!/usr/bin/env sh + +snippet bash #!/usr/bin/env bash snippet if @@ -79,11 +82,13 @@ snippet getopt shift $(($OPTIND-1)) snippet root if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi -snippet fun + +snippet fun-sh ${1:function_name}() { ${0:#function_body} } -snippet ffun + +snippet fun function ${1:function_name}() { ${0:#function_body} } From 817bb63232441b5238f30adb1bfbad8d546fe58c Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Wed, 4 Mar 2015 10:18:54 +0000 Subject: [PATCH 58/58] Elixir: Update cond and case indentation --- snippets/elixir.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/elixir.snippets b/snippets/elixir.snippets index daec054..8fc710c 100644 --- a/snippets/elixir.snippets +++ b/snippets/elixir.snippets @@ -32,13 +32,13 @@ snippet unlesse: unless .. do: .. else: unless ${1:condition}, do: ${2}, else: ${0} snippet cond cond do - ${1} -> - ${0} + ${1} -> + ${0} end snippet case case ${1} do - ${2} -> - ${0} + ${2} -> + ${0} end snippet df def ${1:name}, do: ${2}