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.

190 lines
3.7 KiB

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