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.

196 lines
3.9 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. " Personal additions
  2. "
  3. XPTemplate priority=personal
  4. let s:f = g:XPTfuncs()
  5. XPTvar $js_dir 'javascripts'
  6. XPTvar $css_dir 'stylesheets'
  7. XPTvar $jq_ver '1.4.2'
  8. XPTvar $empty ''
  9. XPT cpy_comment hidden
  10. <!-- © Copyright `strftime("%Y") $author^. All Rights Reserved. -->
  11. XPT cpy "
  12. &copy;`strftime("%Y") $author^ &mdash; All Rights Reserved
  13. XPT meta
  14. <meta name="`$_xSnipName^" content="`meta_content^" />
  15. XPT description alias=meta " <meta name="description"...
  16. XSET meta_content=Echo('')
  17. XPT author alias=meta " <meta name="author"...
  18. XSET meta_content=$author
  19. XPT copyright alias=meta " <meta name="copyright"...
  20. XSET meta_content=Copyright `strftime("%Y")^ `$author^, All Rights Reserved
  21. XPT google-site-verification alias=meta
  22. XSET meta_content=Echo('')
  23. XPT keywords alias=meta " <meta name="keywords"...
  24. XSET meta_content=Echo('')
  25. XPT doctype " <!DOCTYPE...
  26. <!DOCTYPE html` `PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  27. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"^>
  28. XPT doctype5 synonym=doc5 " <!DOCTYPE html>
  29. <!DOCTYPE html>
  30. XPT charset " <meta charset...
  31. <meta charset="utf-8" />
  32. XPT skel synonym=html|xhtml " xhtml skeleton
  33. XSET more=Echo('')
  34. `:doctype5:^
  35. <html lang="en">
  36. <head>
  37. `:charset:^
  38. `:title:^`more^
  39. </head>
  40. <body>
  41. `cursor^
  42. </body>
  43. </html>
  44. `:cpy_comment:^
  45. XPT link " <link rel='stylesheet'...
  46. XSET dir=$css_dir/
  47. XSET src=base.css
  48. XSET media=screen
  49. <link rel="stylesheet" href="`dir^`src^"` media="`media`"^ />
  50. XPT alternate " <link rel='alternate'...
  51. XSET type=application/rss+xml
  52. XSET url=/feed/
  53. <link rel="alternate" type="`type^" title="`title^" href="`url^" />
  54. XPT icon " <link rel='shortcut icon'...
  55. XSET url=/favicon.ico
  56. <link rel="shortcut icon" href="`url^" />
  57. XPT reset synonym=fonts|base|grids|layout|screen
  58. XSET name=$_xSnipName.css
  59. `:link( { 'src' : 'name' } ):^
  60. XPT print alias=link
  61. XSET src=print.css
  62. XSET media=print
  63. XPT jquery synonym=jq " <script... src="jquery...
  64. XSET ver=$jq_ver
  65. <script src="http://ajax.googleapis.com/ajax/libs/jquery/`ver^/jquery.min.js"></script>
  66. XPT script " <script... src="...
  67. XSET dir=$js_dir/
  68. XSET src=$empty
  69. <script src="`dir^`src^.js"></script>
  70. XPT jplug synonym=jfile|jp|jf alias=script
  71. XPT jscript synonym=js
  72. <script type="text/javascript">
  73. `cursor^
  74. </script>
  75. XPT tagAttr wrap=content hidden " <$_xSnipName att?>..</$_xSnipName>
  76. XSET content|ontype=html_cont_ontype()
  77. XSET att?=Echo('')
  78. XSET att?|post=Echo(V()=~'\V\^ \$\|att?' ? '' : V())
  79. <`$_xSnipName^` `att?^>`content^^`content^html_cont_helper()^</`$_xSnipName^>
  80. XPT di wrap=cursor " <div id..>\n\n</div>\n<!-- id..
  81. XSET val=Echo('')
  82. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  83. <div` id="`val`"^>
  84. `cursor^
  85. </div>
  86. <!--`val^ -->
  87. XPT h1 abbr alias=_tag
  88. XPT h2 abbr alias=_tag
  89. XPT h3 abbr alias=_tag
  90. XPT h4 abbr alias=_tag
  91. XPT h5 abbr alias=_tag
  92. XPT h6 abbr alias=_tag
  93. XPT span alias=tagAttr
  94. XPT div alias=tagAttr
  95. XPT p alias=tagAttr
  96. XPT tr alias=tagAttr
  97. XPT td alias=tagAttr
  98. XPT ul alias=tagAttr
  99. XPT ol alias=tagAttr
  100. XPT dl alias=tagAttr
  101. XPT dt alias=tagAttr
  102. XPT dd alias=tagAttr
  103. XPT br alias=_shorttag
  104. XPT li " <li>..</li>...
  105. XSET content=Echo('')
  106. <li>`content^</li>`
  107. `...^
  108. <li>`content^</li>`
  109. `...^
  110. XPT lia " <li><a href=...
  111. XSET href=#
  112. `:li( { 'content' : ':a:' } ):^
  113. XPT menu synonym=navigation " <ul id='menu'...
  114. XSET id=$_xSnipName
  115. <ul` id="`id`"^>
  116. `:lia:^
  117. </ul>
  118. XPT a wrap=content " <a href...
  119. XSET href=#
  120. XSET content=Echo('')
  121. <a href="`href^">`content^</a>
  122. XPT lie8 wrap=content " <!--[if lt IE 8]>...
  123. XSET content=Echo('')
  124. <!--[if lt IE 8]>
  125. `content^
  126. <![endif]-->
  127. XPT lie9 wrap=content " <!--[if lt IE 9]>...
  128. XSET content=Echo('')
  129. <!--[if lt IE 9]>
  130. `content^
  131. <![endif]-->
  132. "
  133. " HTML5 Snippets
  134. "
  135. XPT header alias=tagAttr
  136. XPT section alias=tagAttr
  137. XPT aside alias=tagAttr
  138. XPT footer alias=tagAttr
  139. XPT nav alias=tagAttr
  140. XPT html5shiv synonym=shiv,5shiv
  141. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>