neosnippet.vim/autoload/neosnippet/snippets/ruby.snip

61 lines
928 B
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet if
2012-10-28 09:49:19 +00:00
abbr if ... end
2012-02-02 04:33:35 +00:00
if ${1:condition}
${2}
end
snippet def
2012-10-28 09:49:19 +00:00
abbr def ... end
2012-09-23 05:55:13 +00:00
def ${1:method_name}
2012-02-02 04:33:35 +00:00
${2}
end
2012-10-28 05:25:52 +00:00
snippet defrescue
alias defr
abbr def ... rescue ... end
def ${1:method_name}
${2}
rescue ${3:StandardError} => ${4:error}
${5}
end
2012-02-02 04:33:35 +00:00
snippet do
2012-10-28 05:25:52 +00:00
abbr do ... end
2012-02-02 04:33:35 +00:00
do
${1}
end
snippet dovar
2012-10-28 09:49:19 +00:00
abbr do |var| ... end
2012-02-02 04:33:35 +00:00
do |${1:var}|
${2}
end
snippet block
2012-10-28 09:49:19 +00:00
abbr { ... }
2012-02-02 04:33:35 +00:00
{
${1}
}
snippet blockvar
2012-10-28 09:49:19 +00:00
abbr {|var| ... }
2012-09-23 05:55:13 +00:00
{|${1:var}|
2012-02-02 04:33:35 +00:00
${2}
}
2012-09-23 05:55:13 +00:00
snippet fileopen
2012-10-28 09:49:19 +00:00
abbr File.open(filename) do ... end
2012-09-23 05:55:13 +00:00
File.open(${1:filename}, '${2:w}') do |${3:io}|
${0}
end
2012-02-02 04:33:35 +00:00
snippet edn
abbr => end?
end
snippet urlencode
# coding: utf-8
require 'erb'
puts ERB::Util.url_encode '${1}'
2012-10-28 09:49:19 +00:00