diff --git a/UltiSnips/ruby.snippets b/UltiSnips/ruby.snippets index e3cc1b2..7fdcafd 100644 --- a/UltiSnips/ruby.snippets +++ b/UltiSnips/ruby.snippets @@ -20,79 +20,79 @@ endsnippet snippet if "if ... end" if ${1:condition} - ${2:# TODO} + $0 end endsnippet snippet ife "if ... else ... end" if ${1:condition} - ${2:# TODO} + $2 else - ${3:# TODO} + $0 end endsnippet snippet ifee "if ... elseif ... else ... end" if ${1:condition} - ${2:# TODO} + $2 elsif ${3:condition} - ${4:# TODO} + $4 else - ${0:# TODO} + $0 end endsnippet snippet unless "unless ... end" unless ${1:condition} - ${0:# TODO} + $0 end endsnippet snippet unlesse "unless ... else ... end" unless ${1:condition} - ${2:# TODO} + $2 else - ${0:# TODO} + $0 end endsnippet snippet unlesee "unless ... elseif ... else ... end" unless ${1:condition} - ${2:# TODO} + $2 elsif ${3:condition} - ${4:# TODO} + $4 else - ${0:# TODO} + $0 end endsnippet snippet "\b(de)?f" "def ..." r def ${1:function_name}${2:(${3:*args})} - ${0:# TODO} + $0 end endsnippet snippet defi "def initialize ..." def initialize${1:(${2:*args})} - ${0:# TODO} + $0 end endsnippet snippet defr "def ... rescue ..." def ${1:function_name}${2:(${3:*args})} - ${4:# TODO} + $4 rescue - ${0:# TODO} + $0 end endsnippet snippet For "(..).each { || }" -(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} } +(${1:from}..${2:to}).each { |${3:i}| $0 } endsnippet snippet for "(..).each do || end" (${1:from}..${2:to}).each do |${3:i}| - ${0:# TODO} + $0 end endsnippet @@ -107,32 +107,32 @@ end endsnippet snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |,| }" r -`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3:# TODO} } +`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| $0 } endsnippet snippet "(\S+)\.del(ete)?_?if" ".delete_if do |,| end" r `!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}| - ${0:# TODO} + $0 end endsnippet snippet "(\S+)\.Keep_?if" ".keep_if { |,| }" r -`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3:# TODO} } +`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| $0 } endsnippet snippet "(\S+)\.keep_?if" ".keep_if do ,| end" r `!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}| - ${0:# TODO} + $0 end endsnippet snippet "(\S+)\.Reject" ".reject { |,| }" r -`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3:# TODO} } +`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| $0 } endsnippet snippet "(\S+)\.reject" ".reject do ,| end" r `!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}| - ${0:# TODO} + $0 end endsnippet @@ -147,53 +147,53 @@ end endsnippet snippet "(\S+)\.Sort" ".sort { |,| }" r -`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3:# TODO} } +`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| $0 } endsnippet snippet "(\S+)\.sort" ".sort do |,| end" r `!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}| - ${0:# TODO} + $0 end endsnippet snippet "(\S+)\.Each_?k(ey)?" ".each_key { || }" r -`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2:# TODO} } +`!p snip.rv=match.group(1)`.each_key { |${1:key}| $0 } endsnippet snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| end" r `!p snip.rv=match.group(1)`.each_key do |${1:key}| - ${0:# TODO} + $0 end endsnippet snippet "(\S+)\.Each_?val(ue)?" ".each_value { || }" r -`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2:# TODO} } +`!p snip.rv=match.group(1)`.each_value { |${1:value}| $0 } endsnippet snippet "(\S+)\.each_?val(ue)?" ".each_value do || end" r `!p snip.rv=match.group(1)`.each_value do |${1:value}| - ${0:# TODO} + $0 end endsnippet snippet Each ".each { || }" -${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} } +${1:elements}.each { |${2:${1/s$//}}| $0 } endsnippet snippet each ".each do || end" ${1:elements}.each do |${2:${1/s$//}}| - ${0:# TODO} + $0 end endsnippet snippet "each_?s(lice)?" ".each_slice(n) do |slice| end" r ${1:elements}.each_slice(${2:2}) do |${3:slice}| - ${0:# TODO} + $0 end endsnippet snippet "Each_?s(lice)?" ".each_slice(n) { |slice| }" r -${1:elements}.each_slice(${2:2}) { |${3:slice}| ${0:# TODO} } +${1:elements}.each_slice(${2:2}) { |${3:slice}| $0 } endsnippet snippet "(\S+)\.Map" ".map { || }" r @@ -205,7 +205,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2:# TODO} } +`}| $0 } endsnippet snippet "(\S+)\.map" ".map do || end" r @@ -218,7 +218,7 @@ try: except: snip.rv = 'element' `}| - ${0:# TODO} + $0 end endsnippet @@ -231,7 +231,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2:# TODO} } +`}| $0 } endsnippet snippet "(\S+)\.rev(erse)?_?each" ".reverse_each do || end" r @@ -244,7 +244,7 @@ try: except: snip.rv = 'element' `}| - ${0:# TODO} + $0 end endsnippet @@ -257,7 +257,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2:# TODO} } +`}| $0 } endsnippet snippet "(\S+)\.each" ".each do || end" r @@ -270,7 +270,7 @@ try: except: snip.rv = 'element' `}| - ${0:# TODO} + $0 end endsnippet @@ -283,7 +283,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`},${2:i}| ${3:# TODO} }$0 +`},${2:i}| $0 } endsnippet snippet "(\S+)\.each_?w(ith)?_?i(ndex)?" ".each_with_index do |,| end" r @@ -296,17 +296,17 @@ try: except: snip.rv = 'element' `},${2:i}| - ${0:# TODO} + $0 end endsnippet snippet "(\S+)\.Each_?p(air)?" ".each_pair { |,| }" r -`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3:# TODO} } +`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| $0 } endsnippet snippet "(\S+)\.each_?p(air)?" ".each_pair do |,| end" r `!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}| - ${0:# TODO} + $0 end endsnippet @@ -342,25 +342,25 @@ endsnippet snippet until "until ... end" until ${1:expression} - ${0:# TODO} + $0 end endsnippet snippet Until "begin ... end until " begin - ${0:# TODO} + $0 end until ${1:expression} endsnippet snippet while "while ... end" while ${1:expression} - ${0:# TODO} + $0 end endsnippet snippet While "begin ... end while " begin - ${0:# TODO} + $0 end while ${1:expression} endsnippet @@ -378,9 +378,9 @@ endsnippet snippet begin "begin ... rescue ... end" begin - ${1:# TODO} + $1 rescue - ${0:# TODO} + $0 end endsnippet