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 di wrap=content " <div id="">.</div>
  73. XSET val=Echo('')
  74. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  75. XSET content|ontype=html_cont_ontype()
  76. <div` id="`val`"^>`content^^`content^html_cont_helper()^</div>
  77. XPT div abbr wrap=cursor " <div id..>\n\n</div>\n<!-- id..
  78. XSET val=Echo('')
  79. XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
  80. <div` id="`val`"^>
  81. `cursor^
  82. </div>
  83. <!--`val^ -->
  84. XPT blockTag wrap=content hidden " <$_xSnipName >\n .. \n</$_xSnipName>
  85. <`$_xSnipName^` `att?^>
  86. `content^^
  87. </`$_xSnipName^>
  88. XPT ul abbr alias=blockTag
  89. XPT ol abbr alias=blockTag
  90. XPT li abbr " <li>..</li>...
  91. XSET content=Echo('')
  92. <li>`content^</li>`
  93. `...^
  94. <li>`content^</li>`
  95. `...^
  96. XPT lia abbr " <li><a href=...
  97. XSET href=#
  98. `:li( { 'content' : ':a:' } ):^
  99. XPT menu synonym=navigation " <ul id='menu'...
  100. XSET id=$_xSnipName
  101. <ul` id="`id`"^>
  102. `:lia:^
  103. </ul>
  104. XPT a wrap=content " <a href...
  105. XSET href=#
  106. XSET content=Echo('')
  107. <a href="`href^">`content^</a>
  108. XPT lie8 wrap=content " <!--[if lt IE 8]>...
  109. XSET content=Echo('')
  110. <!--[if lt IE 8]>
  111. `content^
  112. <![endif]-->
  113. XPT lie9 wrap=content " <!--[if lt IE 9]>...
  114. XSET content=Echo('')
  115. <!--[if lt IE 9]>
  116. `content^
  117. <![endif]-->
  118. "
  119. " HTML5 Snippets
  120. "
  121. XPT header alias=blockTag
  122. XPT section alias=blockTag
  123. XPT aside alias=blockTag
  124. XPT nav " <nav class="...
  125. <nav` `att?^>
  126. <ul>
  127. `:lia:^
  128. </ul>
  129. </nav>
  130. XPT html5shiv synonym=shiv,5shiv
  131. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>