Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pull request for snipmate-snippets: added some ruby snippets #15

Closed
wants to merge 17 commits into from
Commits on Mar 21, 2011
  1. @lateau

    add Array#new to ruby

    lateau authored
  2. @lateau
  3. @lateau

    add Enumerable#find

    lateau authored
Commits on Mar 22, 2011
  1. add java foreach loop

    lateau authored
  2. @lateau
  3. @lateau
Commits on Mar 28, 2011
  1. @lateau

    add some perl syntax

    lateau authored
  2. @lateau
Commits on Mar 30, 2011
  1. @lateau
Commits on Apr 4, 2011
  1. add sub

    Daehyub Kim authored
Commits on Apr 6, 2011
  1. @lateau

    add map

    lateau authored
Commits on Apr 19, 2011
  1. @lateau

    modify form_tag

    lateau authored
Commits on Apr 28, 2011
  1. @lateau

    change syntax

    lateau authored
Commits on Feb 4, 2012
  1. @lateau

    remove&add some snippets

    lateau authored
  2. @lateau

    add some snippets

    lateau authored
  3. @lateau

    add & rename

    lateau authored
  4. @lateau

    ifdef

    lateau authored
This page is out of date. Refresh to see the latest.
Showing with 86 additions and 5 deletions.
  1. +1 −0  c/def/define.snippet
  2. +3 −0  c/def/ifdef.snippet
  3. 0  c/{def.snippet → def/ifndef.snippet}
  4. +4 −0 c/ife.snippet
  5. +2 −0  c/ifo.snippet
  6. +1 −0  c/todo.snippet
  7. +3 −3 eruby-rails/ft.snippet
  8. +3 −0  java/foreach.snippet
  9. +3 −0  perl/for.snippet
  10. +3 −0  perl/if.snippet
  11. +4 −0 perl/ife.snippet
  12. +1 −0  perl/join.snippet
  13. +1 −0  perl/map.snippet
  14. +1 −0  perl/open.snippet
  15. +1 −0  perl/shift.snippet
  16. +3 −0  perl/sub.snippet
  17. +3 −0  perl/unless.snippet
  18. +3 −0  perl/until.snippet
  19. +1 −0  perl/us.snippet
  20. +1 −0  perl/ushift.snippet
  21. +1 −0  perl/uw.snippet
  22. +3 −0  perl/while.snippet
  23. +3 −0  pg/rule.snippet
  24. +1 −0  pg/token.snippet
  25. +1 −0  pir/local.snippet
  26. +3 −0  pir/main.snippet
  27. +1 −0  pir/nparam.snippet
  28. +1 −0  pir/param.snippet
  29. +3 −0  pir/sub.snippet
  30. +3 −0  ruby/ce.snippet
  31. +3 −0  ruby/class/class.snippet
  32. +5 −0 ruby/class/class_init.snippet
  33. +1 −1  ruby/dglob.snippet
  34. +1 −1  ruby/fileeach.snippet
  35. +1 −0  ruby/find.snippet
  36. +3 −0  ruby/findo.snippet
  37. +3 −0  ruby/ie.snippet
  38. +3 −0  ruby/me.snippet
  39. +3 −0  ruby/sm.snippet
  40. +1 −0  ruby/todo.snippet
View
1  c/def/define.snippet
@@ -0,0 +1 @@
+#define ${1}
View
3  c/def/ifdef.snippet
@@ -0,0 +1,3 @@
+#ifdef ${1}
+#define ${2}
+#endif
View
0  c/def.snippet → c/def/ifndef.snippet
File renamed without changes
View
4 c/ife.snippet
@@ -0,0 +1,4 @@
+if (${1:/* condition */}) {
+ ${2:/* code */}
+} else {
+}
View
2  c/ifo.snippet
@@ -0,0 +1,2 @@
+if (${1:/* condition */})
+ ${2:/* code */}
View
1  c/todo.snippet
@@ -0,0 +1 @@
+// TODO: ${1}
View
6 eruby-rails/ft.snippet
@@ -1,3 +1,3 @@
-<% form_tag(<+:action => "<+update+>"+><+, {:<+class+> => "<+form+>"}+>) do -%>
- <++>
-<% end -%>
+<% form_tag(${1::action => }${2:"update"}${3:, :class => }${4:"form"}) do %>
+ ${5}
+<% end %>
View
3  java/foreach.snippet
@@ -0,0 +1,3 @@
+for(${1:type var} : ${2:array}) {
+ ${3}
+}
View
3  perl/for.snippet
@@ -0,0 +1,3 @@
+for (${1}) {
+ ${2}
+}
View
3  perl/if.snippet
@@ -0,0 +1,3 @@
+if (${1}) {
+ ${2}
+}
View
4 perl/ife.snippet
@@ -0,0 +1,4 @@
+if (${1}) {
+ ${2}
+} else {
+}
View
1  perl/join.snippet
@@ -0,0 +1 @@
+join "${1:, }", @${2:ary};
View
1  perl/map.snippet
@@ -0,0 +1 @@
+map {${1}} @${2:array};
View
1  perl/open.snippet
@@ -0,0 +1 @@
+open (${1:HANDLE}, "${2:mode}", "${3:expr}") or die $!;
View
1  perl/shift.snippet
@@ -0,0 +1 @@
+shift @${1:ary};${2}
View
3  perl/sub.snippet
@@ -0,0 +1,3 @@
+sub ${1} {
+ ${2}
+}
View
3  perl/unless.snippet
@@ -0,0 +1,3 @@
+unless (${1}) {
+ ${2}
+}
View
3  perl/until.snippet
@@ -0,0 +1,3 @@
+until (${1}) {
+ ${2}
+}
View
1  perl/us.snippet
@@ -0,0 +1 @@
+use strict;
View
1  perl/ushift.snippet
@@ -0,0 +1 @@
+unshift @{1:ary}, ${2:val};${3}
View
1  perl/uw.snippet
@@ -0,0 +1 @@
+use warnings;
View
3  perl/while.snippet
@@ -0,0 +1,3 @@
+while (${1}) {
+ ${2}
+}
View
3  pg/rule.snippet
@@ -0,0 +1,3 @@
+rule ${1:name} {
+ ${2:body}
+}
View
1  pg/token.snippet
@@ -0,0 +1 @@
+token ${1:name} { ${2:body} }
View
1  pir/local.snippet
@@ -0,0 +1 @@
+.local ${1:type} ${2:name}
View
3  pir/main.snippet
@@ -0,0 +1,3 @@
+.sub 'main' :main
+ ${1}
+.end
View
1  pir/nparam.snippet
@@ -0,0 +1 @@
+.param ${1:type} ${2:name} :named("${3:name}")${4}
View
1  pir/param.snippet
@@ -0,0 +1 @@
+.param ${1:type} ${2:name}
View
3  pir/sub.snippet
@@ -0,0 +1,3 @@
+.sub '${1:name}'${2}
+ ${3:body}
+.end
View
3  ruby/ce.snippet
@@ -0,0 +1,3 @@
+class_eval do
+ ${1}
+end
View
3  ruby/class/class.snippet
@@ -0,0 +1,3 @@
+class ${1:`Snippet_RubyClassNameFromFilename()`}${2}
+ ${3}
+end
View
5 ruby/class/class_init.snippet
@@ -0,0 +1,5 @@
+class ${1:`Snippet_RubyClassNameFromFilename()`}${2}
+ def initializer(args)
+ ${3}
+ end
+end
View
2  ruby/dglob.snippet
@@ -1 +1 @@
-Dir.glob(${1:"<+dir}"+>) { |${2:file}| ${3} }
+Dir.glob(${1:dir}) { |${2:file}| ${3} }
View
2  ruby/fileeach.snippet
@@ -1 +1 @@
-File.foreach(${1:"<+path}"+>) { |${2:line}| ${3} }
+File.foreach(${1:path}) { |${2:line}| ${3} }
View
1  ruby/find.snippet
@@ -0,0 +1 @@
+find {|${1:element}| ${2:body}}${3}
View
3  ruby/findo.snippet
@@ -0,0 +1,3 @@
+find do |${1:element}|
+ ${2:body}
+end
View
3  ruby/ie.snippet
@@ -0,0 +1,3 @@
+instance_eval do
+ ${1}
+end
View
3  ruby/me.snippet
@@ -0,0 +1,3 @@
+module_eval do
+ ${1}
+end
View
3  ruby/sm.snippet
@@ -0,0 +1,3 @@
+class << self
+ ${1:some_singletone_methods}
+end
View
1  ruby/todo.snippet
@@ -0,0 +1 @@
+# TODO: ${1:comment}
Something went wrong with that request. Please try again.