Skip to content

Commit

Permalink
adds "key" to all snippets
Browse files Browse the repository at this point in the history
YASnippet no longer use filenames as triggers, see
joaotavora/yasnippet@238e46a
  • Loading branch information
fxn committed Nov 29, 2011
1 parent c16d543 commit 1f88e86
Show file tree
Hide file tree
Showing 277 changed files with 277 additions and 0 deletions.
1 change: 1 addition & 0 deletions !env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : /usr/bin/env ruby
# key: !env
# --
#!/usr/bin/env ruby
1 change: 1 addition & 0 deletions #
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : # =>
# key: #
# --
# =>
1 change: 1 addition & 0 deletions :
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : :key => "value"
# key: :
# --
:${key} => ${"value"}
1 change: 1 addition & 0 deletions Array
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : Array.new(10) { |i| ... }
#group : Arrays
# key: Array
# --
Array.new(${10}) { |${i}| $0 }
1 change: 1 addition & 0 deletions Comp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : include Comparable; def <=> ... end
# key: Comp
# --
include Comparable

Expand Down
1 change: 1 addition & 0 deletions Dir
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : Dir.glob("..") do |file| .. end
#group : Files
# key: Dir
# --
Dir.glob(${1:"dir/glob/*}") { |${2:file}| $0 }
1 change: 1 addition & 0 deletions Enum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Enumerables
# key: Enum
# --
include Enumerable

Expand Down
1 change: 1 addition & 0 deletions File
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Files
# key: File
# --
File.foreach(${1:"${2:path/to/file}"}) { |${3:line}| $0 }
1 change: 1 addition & 0 deletions File.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Files
# key: File.1
# --
File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 }
1 change: 1 addition & 0 deletions File.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Files
# key: File.2
# --
File.read(${1:"${2:path/to/file}"})
1 change: 1 addition & 0 deletions Forw-
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: Forw-
# --
extend Forwardable
1 change: 1 addition & 0 deletions Hash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Hashes
# key: Hash
# --
Hash.new { |${1:hash}, ${2:key}| ${1:hash}[${2:key}] = $0 }
1 change: 1 addition & 0 deletions Md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: Md
# --
File.open(${1:"${2:path/to/file}.dump"}, "w") { |${3:file}| Marshal.dump(${4:obj}, ${3:file}) }
1 change: 1 addition & 0 deletions Ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: Ml
# --
File.open(${1:"${2:path/to/file}.dump"}) { |${3:file}| Marshal.load(${3:file}) }
1 change: 1 addition & 0 deletions Pn-
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: Pn-
# --
PStore.new(${1:"${2:file_name.pstore}"})
1 change: 1 addition & 0 deletions Yd-
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: Yd-
# --
File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, ${3:file}) }
1 change: 1 addition & 0 deletions Yl-
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : YAML.load(file)
# key: Yl-
# --
File.open("${1:path/to/file.yaml}") { |${2:file}| YAML.load(${2:file}) }
1 change: 1 addition & 0 deletions aa
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : attr_accesor :...
# key: aa
# --
attr_accessor :$0
1 change: 1 addition & 0 deletions ae
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : assert_equal ... , ...
#group: assert
# key: ae
# --
assert_equal ${expected}, ${actual}
1 change: 1 addition & 0 deletions ako
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : assert_kind_of ... , ...
#group: assert
# key: ako
# --
assert_kind_of ${class}, ${object}
1 change: 1 addition & 0 deletions all
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : all? { |...| ... }
#group : Enumerables
# key: all
# --
all? { |${e}| $0 }
1 change: 1 addition & 0 deletions am
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : alias_method new, old
# key: am
# --
alias_method :${new_name}, :${old_name}
1 change: 1 addition & 0 deletions ann
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : assert_not_nil ...
#group: assert
# key: ann
# --
assert_not_nil ${object}
1 change: 1 addition & 0 deletions any
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : any? { |...| ... }
#group : Enumerables
# key: any
# --
any? { |${e}| $0 }
1 change: 1 addition & 0 deletions app
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : if __FILE__ == $PROGRAM_NAME ... end
# key: app
# --
if __FILE__ == $PROGRAM_NAME
$0
Expand Down
1 change: 1 addition & 0 deletions ar
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : attr_reader :...
# key: ar
# --
attr_reader :$0
1 change: 1 addition & 0 deletions ars
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : assert_response : ...
#group: assert
# key: ars
# --
assert_response :${success}
1 change: 1 addition & 0 deletions art
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : assert_redirected_to :controller => " ... "
#group: assert
# key: art
# --
assert_redirected_to :controller => "${controller}"
1 change: 1 addition & 0 deletions as
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: as
# --
assert`snippet_paren.rb`${1:test}, "${0:Failure message.}"`snippet_paren.rb end`
1 change: 1 addition & 0 deletions ase
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: ase
# --
assert_equal`snippet_paren.rb`${1:expected}, ${0:actual}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asid
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asid
# --
assert_in_delta`snippet_paren.rb`${1:expected_float}, ${2:actual_float}, ${0:2 ** -20}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asio
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asio
# --
assert_instance_of`snippet_paren.rb`${1:ExpectedClass}, ${0:actual_instance}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asko
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asko
# --
assert_kind_of`snippet_paren.rb`${1:ExpectedKind}, ${0:actual_instance}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asm
# --
assert_match`snippet_paren.rb`/${1:expected_pattern}/, ${0:actual_string}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asn
# --
assert_nil`snippet_paren.rb`${0:instance}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asne
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asne
# --
assert_not_equal`snippet_paren.rb`${1:unexpected}, ${0:actual}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asnm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asnm
# --
assert_no_match`snippet_paren.rb`/${1:unexpected_pattern}/, ${0:actual_string}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asnn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asnn
# --
assert_not_nil`snippet_paren.rb`${0:instance}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asnr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asnr
# --
assert_nothing_raised(${1:Exception}) { $0 }
1 change: 1 addition & 0 deletions asns
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asns
# --
assert_not_same`snippet_paren.rb`${1:unexpected}, ${0:actual}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asnt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asnt
# --
assert_nothing_thrown { $0 }
1 change: 1 addition & 0 deletions aso
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: aso
# --
assert_operator`snippet_paren.rb`${1:left}, :${2:operator}, ${0:right}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions asr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asr
# --
assert_raise(${1:Exception}) { $0 }
1 change: 1 addition & 0 deletions asrt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: asrt
# --
assert_respond_to`snippet_paren.rb`${1:object}, :${0:method}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions ass
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: ass
# --
assert_same`snippet_paren.rb`${1:expected}, ${0:actual}`snippet_paren.rb end`
1 change: 1 addition & 0 deletions ass.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: ass.1
# --
assert_send`snippet_paren.rb`[${1:object}, :${2:message}, ${0:args}]`snippet_paren.rb end`
1 change: 1 addition & 0 deletions ast
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : Tests
# key: ast
# --
assert_throws(:${1:expected}) { $0 }
1 change: 1 addition & 0 deletions begin
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#name : begin ... rescue ... end
#group : Blocks
# key: begin
# --
begin
$3
Expand Down
1 change: 1 addition & 0 deletions bm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : Benchmark.bmbm(...) do ... end
# key: bm
# --
Benchmark.bmbm(${1:10}) do |x|
$0
Expand Down
1 change: 1 addition & 0 deletions bm-
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This was cloned from a TextMate bundle for yasnippet.
# key: bm-
# --
TESTS = ${1:10_000}
Benchmark.bmbm do |results|
Expand Down
1 change: 1 addition & 0 deletions bt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#name : belongs_to : ...
#group: ActiveRecord
# key: bt
# --
belongs_to :${class}
1 change: 1 addition & 0 deletions case
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#name : case ... end
#group : Conditions
# key: case
# --
case ${1:object}
when ${2:condition}
Expand Down
1 change: 1 addition & 0 deletions cl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : classify { |...| ... }
# key: cl
# --
classify { |${e}| $0 }
1 change: 1 addition & 0 deletions cla
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#name : class << self ... end
#group : definitions
# key: cla
# --
class << ${self}
$0
Expand Down
1 change: 1 addition & 0 deletions cla-
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#name : class .. < DelegateClass .. initialize .. end (class)
#group : definitions
# key: cla-
# --
class ${1:ClassName} < DelegateClass(${2:ParentClass})
def initialize(${3:args})
Expand Down
1 change: 1 addition & 0 deletions cla.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : definitions
# key: cla.1
# --
${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} = Struct.new(:${2:attr_names}) do
def ${3:method_name}
Expand Down
1 change: 1 addition & 0 deletions cla.2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : definitions
# key: cla.2
# --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}}
$0
Expand Down
1 change: 1 addition & 0 deletions cla.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : definitions
# key: cla.3
# --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}}
def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/}
Expand Down
1 change: 1 addition & 0 deletions cla.4
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This was cloned from a TextMate bundle for yasnippet.
#group : definitions
# key: cla.4
# --
class ${1:BlankSlate}
instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
Expand Down
1 change: 1 addition & 0 deletions clafn
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : class_from_name()
# key: clafn
# --
split("::").inject(Object) { |par, const| par.const_get(const) }
Loading

0 comments on commit 1f88e86

Please sign in to comment.