- Improved ruby snippets.

This commit is contained in:
Shougo Matsushita 2012-10-28 18:49:19 +09:00
parent f1a6401519
commit a0cae1175e

View File

@ -1,11 +1,11 @@
snippet if snippet if
abbr if end abbr if ... end
if ${1:condition} if ${1:condition}
${2} ${2}
end end
snippet def snippet def
abbr def end abbr def ... end
def ${1:method_name} def ${1:method_name}
${2} ${2}
end end
@ -26,25 +26,25 @@ abbr do ... end
end end
snippet dovar snippet dovar
abbr do |var| end abbr do |var| ... end
do |${1:var}| do |${1:var}|
${2} ${2}
end end
snippet block snippet block
abbr { } abbr { ... }
{ {
${1} ${1}
} }
snippet blockvar snippet blockvar
abbr {|var| } abbr {|var| ... }
{|${1:var}| {|${1:var}|
${2} ${2}
} }
snippet fileopen snippet fileopen
abbr File.open(filename) do end abbr File.open(filename) do ... end
File.open(${1:filename}, '${2:w}') do |${3:io}| File.open(${1:filename}, '${2:w}') do |${3:io}|
${0} ${0}
end end
@ -57,3 +57,4 @@ snippet urlencode
# coding: utf-8 # coding: utf-8
require 'erb' require 'erb'
puts ERB::Util.url_encode '${1}' puts ERB::Util.url_encode '${1}'