mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-16 10:24:18 +00:00
Add explicit "# key" directive to legacy snippet collection before deprecating filenames-as-triggers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#name : all? { |...| ... }
|
||||
# key: collectionsall
|
||||
# --
|
||||
all? { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : any? { |...| ... }
|
||||
# key: collectionsany
|
||||
# --
|
||||
any? { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : classify { |...| ... }
|
||||
# key: ruby-modecollectionsclassify
|
||||
# --
|
||||
classify { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : collect { |...| ... }
|
||||
# key: collectionscollect
|
||||
# --
|
||||
collect { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : delete_if { |...| ... }
|
||||
# key: collectionsdeli
|
||||
# --
|
||||
delete_if { |${e} $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : detect { |...| ... }
|
||||
# key: collectionsdet
|
||||
# --
|
||||
detect { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : each { |...| ... }
|
||||
# key: collectionsea
|
||||
# --
|
||||
each { |${e}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : each_cons(...) { |...| ... }
|
||||
# key: collectionseac
|
||||
# --
|
||||
each_cons(${1:2}) { |${group}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : each_index { |i| ... }
|
||||
# key: collectionseai
|
||||
# --
|
||||
each_index { |${i}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : each_value { |val| ... }
|
||||
# key: collectionseav
|
||||
# --
|
||||
each_value { |${val}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : each_with_index { |e, i| ... }
|
||||
# key: collectionseawi
|
||||
# --
|
||||
each_with_index { |${e}, ${i}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : inject(...) { |...| ... }
|
||||
# key: collectionsinject
|
||||
# --
|
||||
inject(${1:0}) { |${2:injection}, ${3:element}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : reject { |...| ... }
|
||||
# key: collectionsreject
|
||||
# --
|
||||
reject { |${1:element}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : select { |...| ... }
|
||||
# key: collectionsselect
|
||||
# --
|
||||
select { |${1:element}| $0 }
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : zip(...) { |...| ... }
|
||||
# key: collectionszip
|
||||
# --
|
||||
zip(${enums}) { |${row}| $0 }
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : for ... in ...; ... end
|
||||
# key: forin
|
||||
# --
|
||||
for ${1:element} in ${2:collection}
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : if ... end
|
||||
# key: if
|
||||
# --
|
||||
if ${1:condition}
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : if ... else ... end
|
||||
# key: ife
|
||||
# --
|
||||
if ${1:condition}
|
||||
$2
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : times { |n| ... }
|
||||
# key: tim
|
||||
# --
|
||||
times { |${n}| $0 }
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : until ... end
|
||||
# key: until
|
||||
# --
|
||||
until ${condition}
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : upto(...) { |n| ... }
|
||||
# key: upt
|
||||
# --
|
||||
upto(${n}) { |${i}|
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : when ... end
|
||||
# key: when
|
||||
# --
|
||||
when ${condition}
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : while ... end
|
||||
# key: while
|
||||
# --
|
||||
while ${condition}
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : include Comparable; def <=> ... end
|
||||
# key: definitionsComp
|
||||
# --
|
||||
include Comparable
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : alias_method new, old
|
||||
# key: definitionsam
|
||||
# --
|
||||
alias_method :${new_name}, :${old_name}
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : class << self ... end
|
||||
# key: definitionscla
|
||||
# --
|
||||
class << ${self}
|
||||
$0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#name : class ... end
|
||||
#contributor : hitesh <hitesh.jasani@gmail.com>
|
||||
# key: definitionscls
|
||||
# --
|
||||
class ${1:`(let ((fn (capitalize (file-name-nondirectory
|
||||
(file-name-sans-extension
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : def method_missing ... end
|
||||
# key: definitionsmm
|
||||
# --
|
||||
def method_missing(method, *args)
|
||||
$0
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : attr_reader ...
|
||||
# key: definitionsr
|
||||
# --
|
||||
attr_reader :
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : attr_accessor ...
|
||||
# key: definitionsrw
|
||||
# --
|
||||
attr_accessor :
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : attr_writer ...
|
||||
# key: definitionsw
|
||||
# --
|
||||
attr_writer :
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : # =>
|
||||
# key: general#
|
||||
# --
|
||||
# =>
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : =begin rdoc ... =end
|
||||
# key: general=b
|
||||
# --
|
||||
=begin rdoc
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : if __FILE__ == $PROGRAM_NAME ... end
|
||||
# key: generalapp
|
||||
# --
|
||||
if __FILE__ == $PROGRAM_NAME
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : Benchmark.bmbm(...) do ... end
|
||||
# key: generalbm
|
||||
# --
|
||||
Benchmark.bmbm(${1:10}) do |x|
|
||||
$0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#name : case ... end
|
||||
# key: generalcase
|
||||
# --
|
||||
case ${1:object}
|
||||
when ${2:condition}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : deep_copy(...)
|
||||
# key: generaldee
|
||||
# --
|
||||
Marshal.load(Marshal.dump($0))
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : /usr/bin/ruby -wKU
|
||||
# key: generalrb
|
||||
# --
|
||||
#!/usr/bin/ruby -wKU
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : require "..."
|
||||
# key: generalreq
|
||||
# --
|
||||
require "$0"
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : require File.join(File.dirname(__FILE__), ...)
|
||||
# key: generalrreq
|
||||
# --
|
||||
require File.join(File.dirname(__FILE__), $0)
|
||||
@@ -1,3 +1,4 @@
|
||||
#name : :yields: arguments (rdoc)
|
||||
# key: generaly
|
||||
# --
|
||||
:yields: $0
|
||||
Reference in New Issue
Block a user