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