diff --git a/UltiSnips/ruby.snippets b/UltiSnips/ruby.snippets index 604b18c..6114cfa 100644 --- a/UltiSnips/ruby.snippets +++ b/UltiSnips/ruby.snippets @@ -10,54 +10,6 @@ snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r $0 endsnippet -snippet if "if ... end" -if ${1:condition} - $0 -end -endsnippet - -snippet ife "if ... else ... end" -if ${1:condition} - $2 -else - $0 -end -endsnippet - -snippet ifee "if ... elseif ... else ... end" -if ${1:condition} - $2 -elsif ${3:condition} - $4 -else - $0 -end -endsnippet - -snippet unless "unless ... end" -unless ${1:condition} - $0 -end -endsnippet - -snippet unlesse "unless ... else ... end" -unless ${1:condition} - $2 -else - $0 -end -endsnippet - -snippet unlesee "unless ... elseif ... else ... end" -unless ${1:condition} - $2 -elsif ${3:condition} - $4 -else - $0 -end -endsnippet - snippet "\b(de)?f" "def ..." r def ${1:function_name}${2:(${3:*args})} $0 @@ -82,12 +34,6 @@ snippet For "(..).each { || }" (${1:from}..${2:to}).each { |${3:i}| $0 } endsnippet -snippet for "(..).each do || end" -(${1:from}..${2:to}).each do |${3:i}| - $0 -end -endsnippet - snippet "(\S+)\.Merge!" ".merge!() { |,,| }" r `!p snip.rv=match.group(1)`.merge!(${1:other_hash}) { |${2:key},${3:oldval},${4:newval}| ${5:block} } endsnippet @@ -168,12 +114,12 @@ snippet "(\S+)\.each_?val(ue)?" ".each_value do || end" r end endsnippet -snippet Each ".each { || }" -${1:elements}.each { |${2:${1/s$//}}| $0 } +snippet "(\S+)\.ea" ".each do || end" r +`!p snip.rv=match.group(1)`.each { |${1:e}| $0 } endsnippet -snippet each ".each do || end" -${1:elements}.each do |${2:${1/s$//}}| +snippet "(\S+)\.ead" ".each do || end" r +`!p snip.rv=match.group(1)`.each do |${1:e}| $0 end endsnippet diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 7097c6d..c4bcc43 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -73,10 +73,32 @@ snippet ife snippet eif elsif ${1:condition} ${0} +snippet ifee + if ${1:condition} + $2 + elsif ${3:condition} + $4 + else + $0 + end snippet unless unless ${1:condition} ${0} end +snippet unlesse + unless ${1:condition} + $2 + else + $0 + end +snippet unlesee + unless ${1:condition} + $2 + elsif ${3:condition} + $4 + else + $0 + end snippet wh while ${1:condition} ${0}