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.

103 lines
2.1 KiB

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