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.

109 lines
2.3 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 lta
  43. `:li({ 'content' : ':link_to:' }):^
  44. XPT enav synonym=nave,nav5
  45. `:nav({ ':lia:' : ':lta:' }):^
  46. XPT form_for synonym=ff " <% form_for @model do...
  47. <% form_for `@obj^ do |`f^| -%>
  48. ` `cursor^
  49. `:end:^
  50. XPT flabel " <%= f.label...
  51. <%= `f^.label `:object^, '`label^' %>
  52. XPT ftxt " <%= f.text_field...
  53. <%= `f^.text_field `:object^ %>
  54. XPT ftxa " <%= f.text_area...
  55. <%= `f^.text_area `object^ %>
  56. XPT fhidden " <%= f.hidden_field...
  57. <%= `f^.hidden_field `object^ %>
  58. XPT fpassword " <%= f.password_field...
  59. <%= `f^.password_field `object^ %>
  60. XPT ferror " <%= f.error_messages...
  61. <%= `f^.error_messages `object^ %>
  62. XPT fcheck " <%= f.check_box...
  63. <%= `f^.check_box `object^ %>
  64. XPT fradio " <%= f.radio_button
  65. <%= `f^.radio_button `object^ %>
  66. XPT ffile " <% f.file_field...
  67. <%= `f^.file_field `:object^ %>
  68. XPT fsubmit " <%= f.submit...
  69. <%= `f^.submit '`label^' %>
  70. XPT render_partial synonym=rp " <%= render :partial...
  71. XSET name=Echo('')
  72. <%= render :partial => "`name^" %>
  73. XPT submit_tag " <%= submit_tag...
  74. <%= submit_tag "`label^" %>
  75. XPT stylesheet_link_tag synonym=slt " <%= stylesheet_link_tag...
  76. <%= stylesheet_link_tag `^ %>
  77. XPT javascript_include_tag synonym=jit " <%= javascript_include_tag...
  78. <%= javascript_include_tag `^ %>
  79. XPT csrf_meta " <%= scrf_meta_tag %>
  80. <%= csrf_meta_tag %>