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.

169 lines
3.5 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.min'
  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 abbr synonym=html|xhtml " xhtml skeleton
  29. `:doctype5:^
  30. <html>
  31. <head>
  32. `:title:^
  33. `:charset:^`
  34. `author^
  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 abbr synonym=jq " <script... src="jquery...
  60. XSET dir=$js_dir/
  61. XSET ver=$jq_ver
  62. <script type="text/javascript" src="`dir^jquery`-`ver^.js"></script>
  63. XPT script " <script... src="...
  64. XSET dir=$js_dir/
  65. XSET src=$empty
  66. <script type="text/javascript" src="`dir^`src^.js"></script>
  67. XPT jplug abbr synonym=jfile|jp|jf alias=script
  68. XPT jscript synonym=js
  69. <script type="text/javascript">
  70. `cursor^
  71. </script>
  72. XPT div wrap=content synonym=span " <$_xSnipName att?>..</$_xSnipName>
  73. XSET content|ontype=html_cont_ontype()
  74. <`$_xSnipName^` `att?^>`content^^`content^html_cont_helper()^</`$_xSnipName^>
  75. XPT di wrap=cursor " <div id..>\n\n</div>\n<!-- id..
  76. XSET val=Echo('')
  77. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  78. <div` id="`val`"^>
  79. `cursor^
  80. </div>
  81. <!--`val^ -->
  82. XPT blockTag wrap=content hidden " <$_xSnipName >\n .. \n</$_xSnipName>
  83. <`$_xSnipName^` `att?^>
  84. `content^^
  85. </`$_xSnipName^>
  86. XPT ul abbr alias=blockTag
  87. XPT ol abbr alias=blockTag
  88. XPT li abbr " <li>..</li>...
  89. XSET content=Echo('')
  90. <li>`content^</li>`
  91. `...^
  92. <li>`content^</li>`
  93. `...^
  94. XPT lia abbr " <li><a href=...
  95. XSET href=#
  96. `:li( { 'content' : ':a:' } ):^
  97. XPT menu synonym=navigation " <ul id='menu'...
  98. XSET id=$_xSnipName
  99. <ul` id="`id`"^>
  100. `:lia:^
  101. </ul>
  102. XPT a wrap=content " <a href...
  103. XSET href=#
  104. XSET content=Echo('')
  105. <a href="`href^">`content^</a>
  106. XPT lie8 wrap=content " <!--[if lt IE 8]>...
  107. XSET content=Echo('')
  108. <!--[if lt IE 8]>
  109. `content^
  110. <![endif]-->
  111. XPT lie9 wrap=content " <!--[if lt IE 9]>...
  112. XSET content=Echo('')
  113. <!--[if lt IE 9]>
  114. `content^
  115. <![endif]-->
  116. "
  117. " HTML5 Snippets
  118. "
  119. XPT header alias=blockTag
  120. XPT section alias=blockTag
  121. XPT aside alias=blockTag
  122. XPT footer alias=blockTag
  123. XPT nav " <nav class="...
  124. <nav` `att?^>
  125. <ul>
  126. `:lia:^
  127. </ul>
  128. </nav>
  129. XPT html5shiv synonym=shiv,5shiv
  130. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>