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.

128 lines
2.8 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 doctype " <!DOCTYPE...
  23. <!DOCTYPE html` `PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  24. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"^>
  25. XPT doctype5 " <!DOCTYPE html>
  26. <!DOCTYPE html>
  27. XPT charset " <meta charset...
  28. <meta charset="utf-8" />
  29. XPT skel abbr synonym=html|xhtml " xhtml skeleton
  30. `:doctype5:^
  31. <html>
  32. <head>
  33. `:title:^
  34. `:charset:^`
  35. `author^
  36. </head>
  37. <body>
  38. `cursor^
  39. </body>
  40. </html>
  41. `:copy_comment:^
  42. XPT link " <link rel='stylesheet'...
  43. XSET dir=$css_dir/
  44. XSET src=base.css
  45. <link rel="stylesheet" type="text/css" href="`dir^`src^" />
  46. XPT alternate " <link rel='alternate'...
  47. XSET type=application/rss+xml
  48. XSET url=/feed/
  49. <link rel="alternate" type="`type^" title="`title^" href="`url^" />
  50. XPT icon " <link rel='shortcut icon'...
  51. XSET url=/favicon.ico
  52. <link rel="shortcut icon" href="`url^" />
  53. XPT reset synonym=fonts|base|grids|layout
  54. XSET name=$_xSnipName.css
  55. `:link( { 'src' : 'name' } ):^
  56. XPT jquery abbr synonym=jq " <script... src="jquery...
  57. XSET dir=$js_dir/
  58. XSET ver=$jq_ver
  59. <script type="text/javascript" src="`dir^jquery`-`ver^.js"></script>
  60. XPT script " <script... src="...
  61. XSET dir=$js_dir/
  62. XSET src=$empty
  63. <script type="text/javascript" src="`dir^`src^.js"></script>
  64. XPT jplug abbr synonym=jfile|jp|jf alias=script
  65. XPT jscript synonym=js
  66. <script type="text/javascript">
  67. `cursor^
  68. </script>
  69. XPT di wrap=content " <div id="">.</div>
  70. XSET val=Echo('')
  71. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  72. XSET content|ontype=html_cont_ontype()
  73. <div` id="`val`"^>`content^^`content^html_cont_helper()^</div>
  74. XPT div abbr wrap=cursor " <div id..>\n\n</div>\n<!-- id..
  75. XSET val=Echo('')
  76. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  77. <div` id="`val`"^>
  78. `cursor^
  79. </div>
  80. <!--`val^ -->
  81. XPT ul abbr alias=_tagAttr " <ul att?...
  82. XPT ol abbr alias=_tagAttr " <ol att?...
  83. XPT li abbr " <li>..</li>...
  84. XSET content=Echo('')
  85. <li>`content^</li>
  86. XPT lia abbr " <li><a href=...
  87. XSET href=#
  88. `:li( { 'content' : ':a:' } ):^
  89. XPT nav synonym=menu " <ul id='nav'...
  90. XSET nav=$_xSnipName
  91. <ul` id="`nav`"^>
  92. `:lia:^`
  93. `...^
  94. `:lia:^`
  95. `...^
  96. </ul>
  97. XPT a wrap=content " <a href...
  98. XSET href=#
  99. XSET content=Echo('')
  100. <a href="`href^">`content^</a>