Completion/templating snippets for XPTemplate vim plugin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

131 lines
2.7 KiB

  1. "
  2. "
  3. XPTemplate priority=personal+
  4. XPTvar $img_path 'images'
  5. XPT each " <% object.each do |arg, arg|...
  6. XSET cursor=Echo('')
  7. <% `obj^.each do |`arg*^| -%>
  8. `cursor^
  9. `:end:^
  10. XPT end " <% end -%>
  11. <% end -%>
  12. XPT else " <% else -%>
  13. <% else -%>
  14. ` `cursor^
  15. XPT content_for synonym=cf|cof " <% content_for :head ...
  16. <% content_for :`head^ do -%>
  17. `cursor^
  18. `:end:^
  19. XPT for " <% for item in items...
  20. <% for `item^ in `@items^ -%>
  21. `cursor^
  22. `:end:^
  23. XPT if synonym=unless " <% $_xSnipName cond...
  24. XSET action=Echo('')
  25. XSET other=Echo('')
  26. <% `$_xSnipName^ `cond^ -%>
  27. ` `action^
  28. ``else..`
  29. {{^<% else -%>
  30. ` `other^
  31. `}}^`:end:^
  32. XPT ifl " <% if flash[...
  33. <% if flash[:`notice^] -%>
  34. <div id="`notice^"><%= flash[:`notice^] %></div>
  35. `:end:^
  36. XPT ifn " <% if notice...
  37. <% if `notice^ -%>
  38. <p id="`notice^"><%= `notice^ %></p>
  39. <% end -%>
  40. XPT flash.each synonym=flea " <% flash.each do |args...
  41. XSET cursor=Echo('')
  42. <% flash.each do |key, value| -%>
  43. <div class="flash <%= key %>"><%= value %></div>
  44. `:end:^
  45. XPT it hidden " embed-able image tag
  46. image_tag(`image_path^`, `opt?^)
  47. XPT image_tag synonym=imt " <%= image_tag...
  48. <%= `:it:^ %>
  49. XPT link_to synonym=lt|lit " <%= link_to...
  50. XSET target=Echo('')
  51. <%= link_to `link^, `target^ %>
  52. XPT link_to_img synonym=ltim " <%= link_to image...
  53. `:link_to({ 'link' : ':it:' }):^
  54. XPT lta
  55. `:li({ 'content' : ':link_to:' }):^
  56. XPT enav synonym=nave,nav5
  57. `:nav({ ':lia:' : ':lta:' }):^
  58. XPT form_for synonym=ff " <% form_for @model do...
  59. <%= form_for `@obj^ do |`f^| %>
  60. ` `cursor^
  61. `:end:^
  62. XPT flabel " <%= f.label...
  63. <%= `f^.label `object^`, '`label`'^ %>
  64. XPT ftxt " <%= f.text_field...
  65. <%= `f^.text_field `object^ %>
  66. XPT ftxa " <%= f.text_area...
  67. <%= `f^.text_area `object^ %>
  68. XPT fhidden " <%= f.hidden_field...
  69. <%= `f^.hidden_field `object^ %>
  70. XPT fpassword " <%= f.password_field...
  71. <%= `f^.password_field `object^ %>
  72. XPT ferror " <%= f.error_messages...
  73. <%= `f^.error_messages `object^ %>
  74. XPT fcheck " <%= f.check_box...
  75. <%= `f^.check_box `object^ %>
  76. XPT fradio " <%= f.radio_button
  77. <%= `f^.radio_button `object^ %>
  78. XPT ffile " <% f.file_field...
  79. <%= `f^.file_field `:object^ %>
  80. XPT fsubmit " <%= f.submit...
  81. <%= `f^.submit '`label^' %>
  82. XPT render " <%= render ...
  83. XSET name=Echo('')
  84. <%= render '`name^' -%>
  85. XPT render_partial synonym=rp,partial " <%= render :partial...
  86. XSET name=Echo('')
  87. <%= render :partial => '`name^' -%>
  88. XPT submit_tag " <%= submit_tag...
  89. <%= submit_tag '`label^' %>
  90. XPT stylesheet_link_tag synonym=slt " <%= stylesheet_link_tag...
  91. <%= stylesheet_link_tag `^ %>
  92. XPT javascript_include_tag synonym=jit " <%= javascript_include_tag...
  93. <%= javascript_include_tag `^ %>
  94. XPT csrf_meta " <%= scrf_meta_tag %>
  95. <%= csrf_meta_tag %>
  96. XPT yield " <%= yield -%>
  97. <%= yield -%>