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.

183 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 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 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 abbr 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 span alias=tagAttr
  84. XPT div alias=tagAttr
  85. XPT p alias=tagAttr
  86. XPT tr abbr alias=tagAttr
  87. XPT td abbr alias=tagAttr
  88. XPT ul abbr alias=tagAttr
  89. XPT ol abbr alias=tagAttr
  90. XPT dl abbr alias=tagAttr
  91. XPT dt abbr alias=tagAttr
  92. XPT dd abbr alias=tagAttr
  93. XPT br abbr alias=_shorttag
  94. XPT li abbr " <li>..</li>...
  95. XSET content=Echo('')
  96. <li>`content^</li>`
  97. `...^
  98. <li>`content^</li>`
  99. `...^
  100. XPT lia abbr " <li><a href=...
  101. XSET href=#
  102. `:li( { 'content' : ':a:' } ):^
  103. XPT menu synonym=navigation " <ul id='menu'...
  104. XSET id=$_xSnipName
  105. <ul` id="`id`"^>
  106. `:lia:^
  107. </ul>
  108. XPT a wrap=content " <a href...
  109. XSET href=#
  110. XSET content=Echo('')
  111. <a href="`href^">`content^</a>
  112. XPT lie8 wrap=content " <!--[if lt IE 8]>...
  113. XSET content=Echo('')
  114. <!--[if lt IE 8]>
  115. `content^
  116. <![endif]-->
  117. XPT lie9 wrap=content " <!--[if lt IE 9]>...
  118. XSET content=Echo('')
  119. <!--[if lt IE 9]>
  120. `content^
  121. <![endif]-->
  122. "
  123. " HTML5 Snippets
  124. "
  125. XPT header alias=tagAttr
  126. XPT section alias=tagAttr
  127. XPT aside alias=tagAttr
  128. XPT footer alias=tagAttr
  129. XPT nav " <nav class="...
  130. <nav` `att?^>
  131. <ul>
  132. `:lia:^
  133. </ul>
  134. </nav>
  135. XPT html5shiv synonym=shiv,5shiv
  136. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>