From 4918b844bbe5b183907c8cfa0f9a3dabf8401352 Mon Sep 17 00:00:00 2001 From: indi <1334@shadowproject.net> Date: Tue, 22 Jan 2013 18:20:04 +0100 Subject: [PATCH 1/7] add reqr to expand to require_relative --- snippets/ruby.snippets | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 0500aaa..b091488 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -28,6 +28,8 @@ snippet beg snippet req require require "${1}"${2} +snippet reqr + require_relative "${1}"${2} snippet # # => snippet end From 5525e94d09e7b3a6344de356ed3f8591ba10edc2 Mon Sep 17 00:00:00 2001 From: Honza Pokorny Date: Tue, 23 Apr 2013 09:57:09 -0300 Subject: [PATCH 2/7] Add @gorodinskiy as the scala maintainer --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17a7373..6846edb 100644 --- a/README.md +++ b/README.md @@ -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 ------------------ From 4e4c7f48cf35a9e3f9c2a30a0ffe28e8f06b50c0 Mon Sep 17 00:00:00 2001 From: Iuri Fernandes Date: Thu, 25 Apr 2013 14:30:58 -0300 Subject: [PATCH 3/7] Fix missing = on some eruby snippets. --- snippets/eruby.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/eruby.snippets b/snippets/eruby.snippets index f96ca84..592e490 100644 --- a/snippets/eruby.snippets +++ b/snippets/eruby.snippets @@ -50,15 +50,15 @@ 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 <%= ${1:f}.check_box :${2:attribute} %> 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 From f81901d027d56455fea6b4bdb72f1c81b1496f7d Mon Sep 17 00:00:00 2001 From: Konstantin Gorodinskiy Date: Thu, 25 Apr 2013 22:59:03 +0400 Subject: [PATCH 4/7] fix for comments in coffeescript snippets for snipmate --- snippets/coffee.snippets | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/snippets/coffee.snippets b/snippets/coffee.snippets index 83b77eb..11c82e7 100644 --- a/snippets/coffee.snippets +++ b/snippets/coffee.snippets @@ -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 From 339128057027bb7595beb9971d4e335b92df1fa8 Mon Sep 17 00:00:00 2001 From: Iuri Fernandes Date: Sun, 28 Apr 2013 15:47:48 -0300 Subject: [PATCH 5/7] Refactor snippet to create new collumn in a migration(mccc -> mnc) --- snippets/ruby.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index a9b45ad..802b6ed 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -890,8 +890,8 @@ 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} From 76f2ff8337577bb8ffa2698769e96b0dc45be328 Mon Sep 17 00:00:00 2001 From: Iuri Fernandes Date: Sun, 28 Apr 2013 15:50:34 -0300 Subject: [PATCH 6/7] Remove empty column in mct snippet --- snippets/ruby.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 802b6ed..efb7075 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -894,7 +894,7 @@ 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 class ${1:class_name} < ActiveRecord::Migration From 0312e12c29ba6946b9c203b758824ce071a6b0d2 Mon Sep 17 00:00:00 2001 From: Iuri Fernandes Date: Sun, 28 Apr 2013 15:51:55 -0300 Subject: [PATCH 7/7] Refactor old migration creation snippet and an alternative one --- snippets/ruby.snippets | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index efb7075..fdf479a 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -896,16 +896,21 @@ snippet mct create_table :${1:table_name} do |t| ${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