diff --git a/UltiSnips/ruby.snippets b/UltiSnips/ruby.snippets index 306c7e1..0b6836c 100644 --- a/UltiSnips/ruby.snippets +++ b/UltiSnips/ruby.snippets @@ -432,8 +432,8 @@ end endsnippet snippet dov "do || ... end" i -do |${0:v}| - $1 +do |${1:v}| + $2 end endsnippet diff --git a/snippets/php.snippets b/snippets/php.snippets index b85d96e..29b1b45 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -405,3 +405,10 @@ snippet aw array_walk($${1:foo}, function(&$${2:v}, $${3:k}) { $$2 = ${4}; }); + +# static var assign once +snippet static_var + static $${1} = null; + if (is_null($$1)){ + $$1 = ${2}; + } diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 73db366..0135882 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -422,8 +422,8 @@ snippet do # not be worth adding another snippet. should 0/1 placeholders change order? # its a good idea to think about the var name, so use it first snippet dov - do |${0:v}| - ${1} + do |${1:v}| + ${2} end snippet : :${1:key} => ${2:"value"}${3}