mirror of
https://github.com/amix/vimrc
synced 2025-07-19 18:14:59 +08:00
merge
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
# encoding for Ruby 1.9
|
||||
snippet enc
|
||||
# encoding: utf-8
|
||||
|
||||
# #!/usr/bin/env ruby
|
||||
snippet frozen
|
||||
# frozen_string_literal: true
|
||||
snippet #!
|
||||
#!/usr/bin/env ruby
|
||||
# encoding: utf-8
|
||||
|
||||
# New Block
|
||||
snippet =b
|
||||
=begin rdoc
|
||||
@ -29,15 +26,12 @@ snippet beg
|
||||
${0}
|
||||
rescue ${1:Exception} => ${2:e}
|
||||
end
|
||||
|
||||
snippet req require
|
||||
require '${1}'
|
||||
snippet reqr
|
||||
require_relative '${1}'
|
||||
snippet #
|
||||
# =>
|
||||
snippet end
|
||||
__END__
|
||||
snippet case
|
||||
case ${1:object}
|
||||
when ${2:condition}
|
||||
@ -45,7 +39,7 @@ snippet case
|
||||
end
|
||||
snippet when
|
||||
when ${1:condition}
|
||||
${0}
|
||||
${0:${VISUAL}}
|
||||
snippet def
|
||||
def ${1:method_name}
|
||||
${0}
|
||||
@ -62,24 +56,46 @@ snippet descendants
|
||||
end
|
||||
snippet if
|
||||
if ${1:condition}
|
||||
${0}
|
||||
${0:${VISUAL}}
|
||||
end
|
||||
snippet ife
|
||||
if ${1:condition}
|
||||
${2}
|
||||
${2:${VISUAL}}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
snippet eif
|
||||
elsif ${1:condition}
|
||||
${0}
|
||||
${0:${VISUAL}}
|
||||
snippet ifee
|
||||
if ${1:condition}
|
||||
$2
|
||||
elsif ${3:condition}
|
||||
$4
|
||||
else
|
||||
$0
|
||||
end
|
||||
snippet unless
|
||||
unless ${1:condition}
|
||||
${0}
|
||||
${0:${VISUAL}}
|
||||
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}
|
||||
${0:${VISUAL}}
|
||||
end
|
||||
snippet for
|
||||
for ${1:e} in ${2:c}
|
||||
@ -87,35 +103,29 @@ snippet for
|
||||
end
|
||||
snippet until
|
||||
until ${1:condition}
|
||||
${0}
|
||||
${0:${VISUAL}}
|
||||
end
|
||||
snippet cla class .. end
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${0}
|
||||
end
|
||||
snippet cla class .. initialize .. end
|
||||
snippet clai class .. initialize .. end
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
def initialize(${2:args})
|
||||
${0}
|
||||
end
|
||||
end
|
||||
snippet cla class .. < ParentClass .. initialize .. end
|
||||
snippet cla< class .. < ParentClass .. initialize .. end
|
||||
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < ${2:ParentClass}
|
||||
def initialize(${3:args})
|
||||
${0}
|
||||
end
|
||||
end
|
||||
snippet cla ClassName = Struct .. do .. end
|
||||
${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} = Struct.new(:${2:attr_names}) do
|
||||
def ${3:method_name}
|
||||
${0}
|
||||
end
|
||||
end
|
||||
snippet cla class BlankSlate .. initialize .. end
|
||||
snippet blankslate class BlankSlate .. initialize .. end
|
||||
class ${0:BlankSlate}
|
||||
instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
|
||||
end
|
||||
snippet cla class << self .. end
|
||||
snippet claself class << self .. end
|
||||
class << ${1:self}
|
||||
${0}
|
||||
end
|
||||
@ -132,27 +142,6 @@ snippet mod module .. end
|
||||
module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${0}
|
||||
end
|
||||
snippet mod module .. module_function .. end
|
||||
module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
module_function
|
||||
|
||||
${0}
|
||||
end
|
||||
snippet mod module .. ClassMethods .. end
|
||||
module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
module ClassMethods
|
||||
${0}
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
|
||||
end
|
||||
|
||||
def self.included(receiver)
|
||||
receiver.extend ClassMethods
|
||||
receiver.send :include, InstanceMethods
|
||||
end
|
||||
end
|
||||
# attr_reader
|
||||
snippet r
|
||||
attr_reader :${0:attr_names}
|
||||
@ -713,3 +702,15 @@ snippet is
|
||||
it { should ${0} }
|
||||
snippet isn
|
||||
it { should_not ${0} }
|
||||
snippet iexp
|
||||
it { expect(${1:object}).${1} ${0} }
|
||||
snippet iexpb
|
||||
it { expect { ${1:object} }.${1} ${0} }
|
||||
snippet iiexp
|
||||
it { is_expected.to ${0} }
|
||||
snippet iiexpn
|
||||
it { is_expected.not_to ${0} }
|
||||
snippet agg
|
||||
aggregate_failures '${1:message}' do
|
||||
${0}
|
||||
end
|
||||
|
Reference in New Issue
Block a user