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.

114 lines
2.3 KiB

  1. " Personal additions
  2. "
  3. XPTemplate priority=personal
  4. let s:f = g:XPTfuncs()
  5. XPTvar $blank ' '
  6. XPTvar $js_dir 'scripts'
  7. XPTvar $css_dir 'styles'
  8. XPTvar $jq_ver '1.4.2.min'
  9. XPTvar $empty ''
  10. XPT copy_comment hidden
  11. <!-- © Copyright `strftime("%Y") $author^. All Rights Reserved. -->
  12. XPT copyright "
  13. &copy;`strftime("%Y") $author^ &mdash; All Rights Reserved
  14. XPT meta
  15. <meta name="`$_xSnipName^" content="`meta_content^" />
  16. XPT author alias=meta " <meta name="author"...
  17. XSET meta_content=$author
  18. XPT description alias=meta " <meta name="description"...
  19. XSET meta_content=Echo('')
  20. XPT keywords alias=meta " <meta name="keywords"...
  21. XSET meta_content=Echo('')
  22. XPT skel abbr synonym=html|xhtml " xhtml skeleton
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  24. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html>
  26. <head>
  27. `:title:^
  28. `:contenttype:^`
  29. `more^.^
  30. </head>
  31. <body>
  32. `cursor^
  33. </body>
  34. </html>
  35. `:copy_comment:^
  36. XPT link " <link rel="stylesheet" ..>
  37. XSET dir=$css_dir/
  38. XSET src=base.css
  39. <link rel="stylesheet" type="text/css" href="`dir^`src^" />
  40. XPT reset synonym=fonts|base|grids|layout
  41. XSET name=$_xSnipName.css
  42. `:link( { 'src' : 'name' } ):^
  43. XPT jquery abbr synonym=jq " <script... src="jquery...
  44. XSET dir=$js_dir/
  45. XSET ver=$jq_ver
  46. <script type="text/javascript" src="`dir^jquery`-`ver^.js"></script>
  47. XPT script " <script... src="...
  48. XSET dir=$js_dir/
  49. XSET src=$empty
  50. <script type="text/javascript" src="`dir^`src^.js"></script>
  51. XPT jplug abbr synonym=jfile|jp|jf alias=script
  52. XPT jscript synonym=js
  53. <script type="text/javascript">
  54. `cursor^
  55. </script>
  56. XPT di wrap=content " <div id="">.</div>
  57. XSET val=Echo('')
  58. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  59. XSET content|ontype=html_cont_ontype()
  60. <div` id="`val`"^>`content^^`content^html_cont_helper()^</div>
  61. XPT div abbr wrap=cursor " <div id..>\n\n</div>\n<!-- id..
  62. XSET val=Echo('')
  63. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  64. <div` id="`val`"^>
  65. `cursor^
  66. </div>
  67. <!--`val^ -->
  68. XPT list "
  69. XSET type=ul
  70. <`type^` `att?^>`
  71. `...{{^
  72. <li` `att?^>`^</li>`
  73. `...^`}}^
  74. </`type^>
  75. XPT ul abbr alias=_tagAttr
  76. XPT ol abbr alias=_tagAttr
  77. XPT li abbr
  78. XSET content=Echo('')
  79. <li>`content^</li>`
  80. `...{{^
  81. <li>`content^</li>`
  82. `...^`}}^
  83. XPT lia abbr
  84. XSET href=#
  85. `:li( { 'content' : ':a:' } ):^
  86. XPT nav synonym=menu "
  87. XSET nav=$_xSnipName
  88. <ul` id="`nav`"^>
  89. `:lia:^
  90. </ul>