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.

51 lines
929 B

  1. "
  2. "
  3. XPTemplate priority=personal+
  4. XPT def " def .. end
  5. XSET action=Echo(' ')
  6. def `method^`
  7. `action^
  8. end
  9. " eRuby attribute snippets
  10. XPT key hidden " $_xSnipName => val
  11. XSET val=Echo('')
  12. `$_xSnipName^ => `val^
  13. XPT :cols synonym=:rows|:size|:maxsize|:null|:url " $_xSnipName => val
  14. `:key:^
  15. XPT :object synonym=:collection|:locals|:layout|:method " $_xSnipName => val
  16. `:key:^
  17. XPT :id synonym=:class|:alt|:title|:action|:controller " $_xSnipName => 'val'
  18. XSET str='`val^'
  19. `:key({ 'val' : 'str' }):^
  20. XPT :selected synonym=:multipart " $_xSnipName => true
  21. XSET bool=true`^
  22. `:key({ 'val' : 'bool' }):^
  23. XPT :html alias=key
  24. XSET val={ `html^ }
  25. " RSpec snippets
  26. XPT loop " loop do .. end
  27. `loop^` `arg^ do
  28. `cursor^
  29. end
  30. XPT describe " describe .. do
  31. XSET name=describe
  32. `:loop({ 'loop' : 'name' }):^
  33. XPT it " it .. do
  34. XSET name=it
  35. `:loop({ 'loop' : 'name' }):^
  36. XPT :content " $_xSnipName => "val"
  37. XSET val="`str^"
  38. `:key:^