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.

123 lines
2.5 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 flash.each synonym=flea " <% flash.each do |args...
  37. XSET cursor=Echo('')
  38. <% flash.each do |key, value| -%>
  39. <div class="flash <%= key %>"><%= value %></div>
  40. `:end:^
  41. XPT it hidden " embed-able image tag
  42. image_tag(`image_path^`, `opt?^)
  43. XPT image_tag synonym=imt " <%= image_tag...
  44. <%= `:it:^ %>
  45. XPT link_to synonym=lt|lit " <%= link_to...
  46. XSET target=Echo('')
  47. <%= link_to `link^, `target^ %>
  48. XPT link_to_img synonym=ltim " <%= link_to image...
  49. `:link_to({ 'link' : ':it:' }):^
  50. XPT lta
  51. `:li({ 'content' : ':link_to:' }):^
  52. XPT enav synonym=nave,nav5
  53. `:nav({ ':lia:' : ':lta:' }):^
  54. XPT form_for synonym=ff " <% form_for @model do...
  55. <%= form_for `@obj^ do |`f^| %>
  56. ` `cursor^
  57. `:end:^
  58. XPT flabel " <%= f.label...
  59. <%= `f^.label `object^`, '`label`'^ %>
  60. XPT ftxt " <%= f.text_field...
  61. <%= `f^.text_field `object^ %>
  62. XPT ftxa " <%= f.text_area...
  63. <%= `f^.text_area `object^ %>
  64. XPT fhidden " <%= f.hidden_field...
  65. <%= `f^.hidden_field `object^ %>
  66. XPT fpassword " <%= f.password_field...
  67. <%= `f^.password_field `object^ %>
  68. XPT ferror " <%= f.error_messages...
  69. <%= `f^.error_messages `object^ %>
  70. XPT fcheck " <%= f.check_box...
  71. <%= `f^.check_box `object^ %>
  72. XPT fradio " <%= f.radio_button
  73. <%= `f^.radio_button `object^ %>
  74. XPT ffile " <% f.file_field...
  75. <%= `f^.file_field `:object^ %>
  76. XPT fsubmit " <%= f.submit...
  77. <%= `f^.submit '`label^' %>
  78. XPT render " <%= render ...
  79. XSET name=Echo('')
  80. <%= render '`name^' -%>
  81. XPT render_partial synonym=rp,partial " <%= render :partial...
  82. XSET name=Echo('')
  83. <%= render :partial => '`name^' -%>
  84. XPT submit_tag " <%= submit_tag...
  85. <%= submit_tag '`label^' %>
  86. XPT stylesheet_link_tag synonym=slt " <%= stylesheet_link_tag...
  87. <%= stylesheet_link_tag `^ %>
  88. XPT javascript_include_tag synonym=jit " <%= javascript_include_tag...
  89. <%= javascript_include_tag `^ %>
  90. XPT csrf_meta " <%= scrf_meta_tag %>
  91. <%= csrf_meta_tag %>