Permalink
Browse files

vim: new and updated snippets

  • Loading branch information...
ches committed Dec 1, 2010
1 parent 85d86d6 commit f7304f858a83d8c991c08b7598e364d4a13f086f
Showing with 112 additions and 31 deletions.
  1. +1 −0 .vim/snippets/eruby-rails/%-.snippet
  2. +1 −0 .vim/snippets/eruby-rails/%=.snippet
  3. +2 −2 .vim/snippets/eruby-rails/conf.snippet
  4. +1 −1 .vim/snippets/eruby-rails/cs.snippet
  5. +1 −1 .vim/snippets/eruby-rails/ct.snippet
  6. +1 −1 .vim/snippets/eruby-rails/end.snippet
  7. +3 −3 .vim/snippets/eruby-rails/ff.snippet
  8. +2 −2 .vim/snippets/eruby-rails/fields.snippet
  9. +2 −2 .vim/snippets/eruby-rails/for.snippet
  10. +3 −3 .vim/snippets/eruby-rails/ft.snippet
  11. +1 −1 .vim/snippets/eruby-rails/jit.snippet
  12. +1 −1 .vim/snippets/eruby-rails/liai.snippet
  13. +1 −1 .vim/snippets/eruby-rails/licai.snippet
  14. +1 −1 .vim/snippets/eruby-rails/lim.snippet
  15. +1 −1 .vim/snippets/eruby-rails/linp.snippet
  16. +1 −1 .vim/snippets/eruby-rails/linpp.snippet
  17. +1 −1 .vim/snippets/eruby-rails/lip.snippet
  18. +1 −1 .vim/snippets/eruby-rails/lipp.snippet
  19. +1 −1 .vim/snippets/eruby-rails/ofcfs.snippet
  20. +6 −0 .vim/snippets/eruby-rails/sff/sff.multi.snippet
  21. +4 −0 .vim/snippets/eruby-rails/sff/sff.simple.snippet
  22. +1 −1 .vim/snippets/eruby-rails/slt.snippet
  23. +1 −1 .vim/snippets/eruby-rails/st.snippet
  24. +1 −0 .vim/snippets/html/break.snippet
  25. +3 −0 .vim/snippets/html/div.snippet
  26. +0 −1 .vim/snippets/html/doctype.snippet
  27. +2 −0 .vim/snippets/html/doctype/HTML 4.01 Strict.snippet
  28. +2 −0 .vim/snippets/html/doctype/HTML 4.01 Transitional.snippet
  29. +2 −0 .vim/snippets/html/doctype/HTML 5.snippet
  30. +2 −0 .vim/snippets/html/doctype/XHTML 1.0 Frameset.snippet
  31. +2 −0 .vim/snippets/html/doctype/XHTML 1.0 Strict.snippet
  32. +2 −0 .vim/snippets/html/doctype/XHTML 1.0 Transitional.snippet
  33. +2 −0 .vim/snippets/html/doctype/XHTML 1.1.snippet
  34. +1 −0 .vim/snippets/html/h2.snippet
  35. +1 −0 .vim/snippets/html/h3.snippet
  36. +1 −0 .vim/snippets/html/li.snippet
  37. +4 −0 .vim/snippets/html/ol.snippet
  38. +3 −0 .vim/snippets/html/p.snippet
  39. +4 −0 .vim/snippets/html/ul.snippet
  40. +28 −0 .vim/snippets/javascript-jquery/plugin.snippet
  41. +3 −0 .vim/snippets/ruby-machinist/bluep.snippet
  42. +1 −0 .vim/snippets/ruby-machinist/mm.snippet
  43. +1 −0 .vim/snippets/ruby-machinist/mmn.snippet
  44. +1 −0 .vim/snippets/ruby-machinist/mp.snippet
  45. +1 −0 .vim/snippets/ruby-machinist/mpn.snippet
  46. +3 −0 .vim/snippets/ruby-machinist/sham.snippet
  47. +1 −1 .vim/snippets/ruby-rails/fina.snippet
  48. +1 −1 .vim/snippets/ruby-rails/finf.snippet
  49. +1 −1 .vim/snippets/ruby-rails/fini.snippet
  50. +1 −1 .vim/snippets/ruby-rails/finl.snippet
@@ -0,0 +1 @@
+<% ${1} -%>
@@ -0,0 +1 @@
+<%= ${1} %>
@@ -1,3 +1,3 @@
-<% content_for :${1:yield_label_in_layout} do -%>
+<% content_for :${1:yield_label_in_layout} do %>
${2}
-<% end -%>
+<% end %>
@@ -1 +1 @@
-<%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
+<%= collection_select ${1:object}, ${2:method}, ${3:collection}, ${4:value_method}, ${5:text_method}${6:, {options}} %>
@@ -1 +1 @@
-<%= content_tag '${1:DIV}', ${2:content}${3:,options} -%>
+<%= content_tag '${1:DIV}', ${2:content}${3:,options} %>
@@ -1 +1 @@
-<% end -%>
+<% end %>
@@ -1,3 +1,3 @@
-<% form_for @${1:model} do |f| -%>
- ${2}
-<% end -%>
+<%= form_for @${1:model} do |${2:f}| %>
+ ${3}
+<% end %>
@@ -1,3 +1,3 @@
-<% fields_for :${1:model}, @$1 do |${2:f}| -%>
+<%= fields_for :${1:model}, @$1 do |${2:f}| %>
${3}
-<% end -%>
+<% end %>
@@ -1,3 +1,3 @@
-<% for ${2:item} in ${1:list} -%>
+<% for ${2:item} in ${1:list} %>
${3}
-<% end -%>
+<% end %>
@@ -1,3 +1,3 @@
-<% form_tag(<+:action => "<+update+>"+><+, {:<+class+> => "<+form+>"}+>) do -%>
- <++>
-<% end -%>
+<%= form_tag(${1:'url'}${2:, :method => :put}) do %>
+ ${2}
+<% end %>
@@ -1 +1 @@
-<%= javascript_include_tag <+:all+><+, :cache => <+true+>+> %>
+<%= javascript_include_tag ${1::all}${2:, :cache => true} %>
@@ -1 +1 @@
-<%= link_to "<+link text+>", :action => "<+edit+>", :id => <+@<+item+>+> %>
+<%= link_to "${1:link text}", :action => "${2:edit}", :id => ${3:@item} %>
@@ -1 +1 @@
-<%= link_to "<+link text+>", :controller => "<+items+>", :action => "<+edit+>", :id => <+@<+item+>+> %>
+<%= link_to "${1:name}", :controller => "${2:items}", :action => "${3:edit}", :id => ${4:@item} %>
@@ -1 +1 @@
-<%= link_to <+model+>.<+name+>, <+<+model+>_path(<+model+>)+> %>
+<%= link_to ${1:model}.${2:name}, ${3:model}_path($3) %>
@@ -1 +1 @@
-<%= link_to <+"<+link text+>"+>, <+<+parent+>_<+child+>_path(<+@+><+parent+>, <+@+><+child+>)+> %>
+<%= link_to "${1:link text}", ${2:parent}_${3:child}_path(@$2, @$3) %>
@@ -1 +1 @@
-<%= link_to <+"<+link text+>"+>, <+<+parent+>_<+child+>_path(<+@+><+parent+>)+> %>
+<%= link_to "${1:link text}", ${2:parent}_${3:child}_path(@$2) %>
@@ -1 +1 @@
-<%= link_to <+"<+link text+>"+>, <+<+model+>_path(<+@+><+instance+>)+> %>
+<%= link_to "${1:link text}", ${2:model}_path(@$2) %>
@@ -1 +1 @@
-<%= link_to <+"<+link text+>"+>, <+<+model+>s_path+> %>
+<%= link_to "${1:link text}", ${2:model}s_path %>
@@ -1 +1 @@
-<%= options_from_collection_for_select <+collection+>, <+value_method+>, <+text_method+><+, <+[selected_value]+>+> %>
+<%= options_from_collection_for_select ${1:collection}, ${2:value_method}, ${3:text_method}${4:, selected = nil} %>
@@ -0,0 +1,6 @@
+<% semantic_form_for @${1:object} do |f| -%>
+ <% f.inputs ${2:do} -%>
+ <%= f.input :${3:name} -%>
+ <% end -%>
+ <%= f.buttons %>
+<% end -%>
@@ -0,0 +1,4 @@
+<% semantic_form_for @${1:object} do |f| -%>
+ <%= f.inputs %>${2:}
+ <%= f.buttons %>
+<% end -%>
@@ -1 +1 @@
-<%= stylesheet_link_tag <+:all+><+, :cache => <+true+>+> %>
+<%= stylesheet_link_tag ${1:all}${2:, :cache => true} %>
@@ -1 +1 @@
-<%= submit_tag "<+Save changes+>"<+, :id => "<+submit+>"+><+, :name => "<+submit+>"+><+, :class => "<+form_name+>"+><+, :disabled => <+false+>+><+, :disable_with => "<+Please wait+>"+> %>
+<%= submit_tag "${1:Save Changes}"${2:, :id => "submit", :name => "submit", :class => "form_name", :disabled => false, :disable_with => "Please wait"} %>
@@ -0,0 +1 @@
+<!--break-->
@@ -0,0 +1,3 @@
+<div${1}>
+ ${2}
+</div>${3}
@@ -1 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">${1}
@@ -0,0 +1,2 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
+"http://www.w3.org/TR/html4/strict.dtd">
@@ -0,0 +1,2 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
+"http://www.w3.org/TR/html4/loose.dtd">
@@ -0,0 +1,2 @@
+<!DOCTYPE HTML>
+
@@ -0,0 +1,2 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -0,0 +1,2 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -0,0 +1,2 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -0,0 +1,2 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -0,0 +1 @@
+<h2${1}>${2}</h2>${3}
@@ -0,0 +1 @@
+<h3${1}>${2}</h3>${3}
@@ -0,0 +1 @@
+<li${1}>${2}</li>${3}
@@ -0,0 +1,4 @@
+<ol${1}>
+ <li>${2}</li>
+ ${3}
+</ol>${4}
@@ -0,0 +1,3 @@
+<p${1}>
+ ${2}
+</p>${3}
@@ -0,0 +1,4 @@
+<ul${1}>
+ <li>${2}</li>
+ ${3}
+</ul>${4}
@@ -0,0 +1,28 @@
+// Create Closure
+(function($) {
+ $.fn.${1} = function(options) {
+ // Extend the defaults, over-writing them with anything passed by the caller
+ var opts = $.extend({}, $.fn.$1.defaults, options);
+
+ // Iterate over each element
+ return this.each(function() {
+ $this = $(this);
+
+ // Allow for use of the Metadata plugin
+ var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
+
+ ${2:YOUR CODE GOES HERE}
+
+ });
+ };
+
+ // Additional methods follow the format:
+ // $.fn.$1.format = function(txt) {
+ // FUNCTION STUFF GOES HERE
+ // };
+
+ // Plugin Defaults
+ $.fn.$1.defaults = {
+
+ };
+})(jQuery); // Closure Closed
@@ -0,0 +1,3 @@
+${1:Model}.blueprint do
+ ${2}
+end
@@ -0,0 +1 @@
+${1:Model}.make
@@ -0,0 +1 @@
+${1:Model}.make(${2::symbol})
@@ -0,0 +1 @@
+${1:Model}.plan
@@ -0,0 +1 @@
+${1:Model}.plan(${2::symbol})
@@ -0,0 +1,3 @@
+Sham.define do
+ ${1}
+end
@@ -1 +1 @@
-find(:all<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
+find(:all, :conditions => ['${1:field} = ?', ${2:true}])${3}
@@ -1 +1 @@
-find(:first<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
+find(:first, :conditions => ['${1:field} = ?', ${2:true}])${3}
@@ -1 +1 @@
-find(<+id+>)
+find(${1:id})${2}
@@ -1 +1 @@
-find(:last<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
+find(:last, :conditions => ['${1:field} = ?', ${2:true}])${3}

0 comments on commit f7304f8

Please sign in to comment.