Ruby: Remove lots of placeholder text
This commit is contained in:
parent
c46251515f
commit
1d9afe253b
@ -20,79 +20,79 @@ endsnippet
|
||||
|
||||
snippet if "if <condition> ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ife "if <condition> ... else ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
$2
|
||||
else
|
||||
${3:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ifee "if <condition> ... elseif <condition> ... else ... end"
|
||||
if ${1:condition}
|
||||
${2:# TODO}
|
||||
$2
|
||||
elsif ${3:condition}
|
||||
${4:# TODO}
|
||||
$4
|
||||
else
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet unless "unless <condition> ... end"
|
||||
unless ${1:condition}
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet unlesse "unless <condition> ... else ... end"
|
||||
unless ${1:condition}
|
||||
${2:# TODO}
|
||||
$2
|
||||
else
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet unlesee "unless <condition> ... elseif <condition> ... 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 <name>..." 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 <name> ... rescue ..."
|
||||
def ${1:function_name}${2:(${3:*args})}
|
||||
${4:# TODO}
|
||||
$4
|
||||
rescue
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet For "(<from>..<to>).each { |<i>| <block> }"
|
||||
(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} }
|
||||
(${1:from}..${2:to}).each { |${3:i}| $0 }
|
||||
endsnippet
|
||||
|
||||
snippet for "(<from>..<to>).each do |<i>| <block> 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 { |<key>,<value>| <block> }" 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 |<key>,<value>| <block> 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 { |<key>,<value>| <block> }" 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 <key>,<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}|
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet "(\S+)\.Reject" ".reject { |<key>,<value>| <block> }" 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 <key>,<value>| <block> 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 { |<a>,<b>| <block> }" 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 |<a>,<b>| <block> 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 { |<key>| <block> }" 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| <block> 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 { |<value>| <block> }" 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 |<value>| <block> end" r
|
||||
`!p snip.rv=match.group(1)`.each_value do |${1:value}|
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet Each "<elements>.each { |<element>| <block> }"
|
||||
${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} }
|
||||
${1:elements}.each { |${2:${1/s$//}}| $0 }
|
||||
endsnippet
|
||||
|
||||
snippet each "<elements>.each do |<element>| <block> end"
|
||||
${1:elements}.each do |${2:${1/s$//}}|
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet "each_?s(lice)?" "<array>.each_slice(n) do |slice| <block> end" r
|
||||
${1:elements}.each_slice(${2:2}) do |${3:slice}|
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet "Each_?s(lice)?" "<array>.each_slice(n) { |slice| <block> }" 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 { |<element>| <block> }" 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 |<element>| <block> 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 |<element>| <block> 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 |<element>| <block> 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 |<element>,<i>| <block> 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 { |<key>,<value>| <block> }" 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 |<key>,<value>| <block> 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 <expression> ... end"
|
||||
until ${1:expression}
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet Until "begin ... end until <expression>"
|
||||
begin
|
||||
${0:# TODO}
|
||||
$0
|
||||
end until ${1:expression}
|
||||
endsnippet
|
||||
|
||||
snippet while "while <expression> ... end"
|
||||
while ${1:expression}
|
||||
${0:# TODO}
|
||||
$0
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet While "begin ... end while <expression>"
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user