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.

53 lines
954 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. XPT :media alias=key
  26. XSET val='`screen^'
  27. " RSpec snippets
  28. XPT loop " loop do .. end
  29. `loop^` `arg^ do
  30. `cursor^
  31. end
  32. XPT describe " describe .. do
  33. XSET name=describe
  34. `:loop({ 'loop' : 'name' }):^
  35. XPT it " it .. do
  36. XSET name=it
  37. `:loop({ 'loop' : 'name' }):^
  38. XPT :content " $_xSnipName => "val"
  39. `:key:^