Merge remote-tracking branch 'original/master'
This commit is contained in:
commit
65d7b17c76
@ -5,8 +5,8 @@ Snipmate & UltiSnip Snippets
|
|||||||
|
|
||||||
This repository contains snippets files for various programming languages.
|
This repository contains snippets files for various programming languages.
|
||||||
|
|
||||||
It is community-maintained and many people have contributed snippet files and other
|
It is community-maintained and many people have contributed snippet files and
|
||||||
improvements already.
|
other improvements already.
|
||||||
|
|
||||||
Contents
|
Contents
|
||||||
========
|
========
|
||||||
@ -82,6 +82,7 @@ to maintain snippets for a language, please get in touch.
|
|||||||
* Markdown - [honza](http://github.com/honza)
|
* Markdown - [honza](http://github.com/honza)
|
||||||
* Ruby - [taq](http://github.com/taq)
|
* Ruby - [taq](http://github.com/taq)
|
||||||
* PHP - [chrisyue](http://github.com/chrisyue)
|
* PHP - [chrisyue](http://github.com/chrisyue)
|
||||||
|
* Scala - [gorodinskiy](https://github.com/gorodinskiy)
|
||||||
|
|
||||||
Contributing notes
|
Contributing notes
|
||||||
------------------
|
------------------
|
||||||
|
@ -6,33 +6,33 @@ snippet forindo
|
|||||||
# Array comprehension
|
# Array comprehension
|
||||||
snippet fora
|
snippet fora
|
||||||
for ${1:name} in ${2:array}
|
for ${1:name} in ${2:array}
|
||||||
${3:// body...}
|
${3:# body...}
|
||||||
# Object comprehension
|
# Object comprehension
|
||||||
snippet foro
|
snippet foro
|
||||||
for ${1:key}, ${2:value} of ${3:object}
|
for ${1:key}, ${2:value} of ${3:object}
|
||||||
${4:// body...}
|
${4:# body...}
|
||||||
# Range comprehension (inclusive)
|
# Range comprehension (inclusive)
|
||||||
snippet forr
|
snippet forr
|
||||||
for ${1:name} in [${2:start}..${3:finish}]
|
for ${1:name} in [${2:start}..${3:finish}]
|
||||||
${4:// body...}
|
${4:# body...}
|
||||||
snippet forrb
|
snippet forrb
|
||||||
for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
|
for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
|
||||||
${5:// body...}
|
${5:# body...}
|
||||||
# Range comprehension (exclusive)
|
# Range comprehension (exclusive)
|
||||||
snippet forrex
|
snippet forrex
|
||||||
for ${1:name} in [${2:start}...${3:finish}]
|
for ${1:name} in [${2:start}...${3:finish}]
|
||||||
${4:// body...}
|
${4:# body...}
|
||||||
snippet forrexb
|
snippet forrexb
|
||||||
for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
|
for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
|
||||||
${5:// body...}
|
${5:# body...}
|
||||||
# Function
|
# Function
|
||||||
snippet fun
|
snippet fun
|
||||||
(${1:args}) ->
|
(${1:args}) ->
|
||||||
${2:// body...}
|
${2:# body...}
|
||||||
# Function (bound)
|
# Function (bound)
|
||||||
snippet bfun
|
snippet bfun
|
||||||
(${1:args}) =>
|
(${1:args}) =>
|
||||||
${2:// body...}
|
${2:# body...}
|
||||||
# Class
|
# Class
|
||||||
snippet cla class ..
|
snippet cla class ..
|
||||||
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||||
@ -55,17 +55,17 @@ snippet cla class .. extends .. constructor: ..
|
|||||||
# If
|
# If
|
||||||
snippet if
|
snippet if
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
${2:// body...}
|
${2:# body...}
|
||||||
# If __ Else
|
# If __ Else
|
||||||
snippet ife
|
snippet ife
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
${2:// body...}
|
${2:# body...}
|
||||||
else
|
else
|
||||||
${3:// body...}
|
${3:# body...}
|
||||||
# Else if
|
# Else if
|
||||||
snippet elif
|
snippet elif
|
||||||
else if ${1:condition}
|
else if ${1:condition}
|
||||||
${2:// body...}
|
${2:# body...}
|
||||||
# Ternary If
|
# Ternary If
|
||||||
snippet ifte
|
snippet ifte
|
||||||
if ${1:condition} then ${2:value} else ${3:other}
|
if ${1:condition} then ${2:value} else ${3:other}
|
||||||
@ -76,7 +76,7 @@ snippet unl
|
|||||||
snippet swi
|
snippet swi
|
||||||
switch ${1:object}
|
switch ${1:object}
|
||||||
when ${2:value}
|
when ${2:value}
|
||||||
${3:// body...}
|
${3:# body...}
|
||||||
|
|
||||||
# Log
|
# Log
|
||||||
snippet log
|
snippet log
|
||||||
|
@ -50,7 +50,7 @@ snippet cs
|
|||||||
snippet ct
|
snippet ct
|
||||||
<%= content_tag '${1:DIV}', ${2:content}${3:,options} %>
|
<%= content_tag '${1:DIV}', ${2:content}${3:,options} %>
|
||||||
snippet ff
|
snippet ff
|
||||||
<% form_for @${1:model} do |f| %>
|
<%= form_for @${1:model} do |f| %>
|
||||||
${2}
|
${2}
|
||||||
<% end %>
|
<% end %>
|
||||||
snippet ffcb
|
snippet ffcb
|
||||||
@ -58,7 +58,7 @@ snippet ffcb
|
|||||||
snippet ffe
|
snippet ffe
|
||||||
<% error_messages_for :${1:model} %>
|
<% error_messages_for :${1:model} %>
|
||||||
|
|
||||||
<% form_for @${2:model} do |f| %>
|
<%= form_for @${2:model} do |f| %>
|
||||||
${3}
|
${3}
|
||||||
<% end %>
|
<% end %>
|
||||||
snippet ffff
|
snippet ffff
|
||||||
@ -78,7 +78,7 @@ snippet ffta
|
|||||||
snippet fftf
|
snippet fftf
|
||||||
<%= ${1:f}.text_field :${2:attribute} %>
|
<%= ${1:f}.text_field :${2:attribute} %>
|
||||||
snippet fields
|
snippet fields
|
||||||
<% fields_for :${1:model}, @$1 do |${2:f}| %>
|
<%= fields_for :${1:model}, @$1 do |${2:f}| %>
|
||||||
${3}
|
${3}
|
||||||
<% end %>
|
<% end %>
|
||||||
snippet i18
|
snippet i18
|
||||||
|
@ -890,22 +890,27 @@ snippet mrnc
|
|||||||
rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name}
|
rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name}
|
||||||
snippet mcc
|
snippet mcc
|
||||||
change_column :${1:table}, :${2:column}, :${3:type}
|
change_column :${1:table}, :${2:column}, :${3:type}
|
||||||
snippet mccc
|
snippet mnc
|
||||||
t.column :${1:title}, :${2:string}
|
t.${1:string} :${2:title}${3:, null: false}${4}
|
||||||
snippet mct
|
snippet mct
|
||||||
create_table :${1:table_name} do |t|
|
create_table :${1:table_name} do |t|
|
||||||
t.column :${2:name}, :${3:type}
|
${2}
|
||||||
end
|
end
|
||||||
snippet migration
|
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
|
||||||
class ${1:class_name} < ActiveRecord::Migration
|
class ${1:class_name} < ActiveRecord::Migration
|
||||||
def self.up
|
def up
|
||||||
${2}
|
${2}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def down
|
||||||
|
end
|
||||||
|
end
|
||||||
|
snippet migration class .. < ActiveRecord::Migration .. def change .. end
|
||||||
|
class ${1:class_name} < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
${2}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
snippet trc
|
snippet trc
|
||||||
t.remove :${1:column}
|
t.remove :${1:column}
|
||||||
snippet tre
|
snippet tre
|
||||||
@ -913,7 +918,6 @@ snippet tre
|
|||||||
${3}
|
${3}
|
||||||
snippet tref
|
snippet tref
|
||||||
t.references :${1:model}
|
t.references :${1:model}
|
||||||
|
|
||||||
#rspec
|
#rspec
|
||||||
snippet it
|
snippet it
|
||||||
it "${1:spec_name}" do
|
it "${1:spec_name}" do
|
||||||
|
Loading…
Reference in New Issue
Block a user