Browse Source

Update html snippets

- use of XPT vars
  - smarter meta tags
  - include javascript tags
  - rework of div and list tags
  - addition of nav menu, using ul tag
master
jimi 15 years ago
parent
commit
1cb82728db
  1. 97
      ftplugin/html/html.xpt.vim

97
ftplugin/html/html.xpt.vim

@ -2,21 +2,30 @@
" "
XPTemplate priority=personal XPTemplate priority=personal
XPTvar $blank ' '
let s:f = g:XPTfuncs()
XPTvar $blank ' '
XPTvar $js_dir 'scripts'
XPTvar $css_dir 'styles'
XPTvar $jq_ver '1.4.2.min'
XPTvar $empty ''
XPT copy_comment hidden XPT copy_comment hidden
<!-- © Copyright `strftime("%Y") $author^. All Rights Reserved. --> <!-- © Copyright `strftime("%Y") $author^. All Rights Reserved. -->
XPT aut abbr alias=meta " <meta name="description"...
XSET meta_name=author
XPT copyright "
&copy;`strftime("%Y") $author^ &mdash; All Rights Reserved
XPT meta
<meta name="`$_xSnipName^" content="`meta_content^" />
XPT author alias=meta " <meta name="author"...
XSET meta_content=$author XSET meta_content=$author
XPT desc abbr alias=meta " <meta name="description"...
XSET meta_name=description
XPT description alias=meta " <meta name="description"...
XSET meta_content=Echo('') XSET meta_content=Echo('')
XPT key abbr alias=meta " <meta name="keywords"...
XSET meta_name=keywords
XPT keywords alias=meta " <meta name="keywords"...
XSET meta_content=Echo('') XSET meta_content=Echo('')
XPT skel abbr synonym=html|xhtml " xhtml skeleton XPT skel abbr synonym=html|xhtml " xhtml skeleton
@ -26,7 +35,7 @@ XPT skel abbr synonym=html|xhtml " xhtml skeleton
<head> <head>
`:title:^ `:title:^
`:contenttype:^` `:contenttype:^`
`more^ ^
`more^.^
</head> </head>
<body> <body>
`cursor^ `cursor^
@ -35,35 +44,71 @@ XPT skel abbr synonym=html|xhtml " xhtml skeleton
`:copy_comment:^ `:copy_comment:^
XPT link " <link rel="stylesheet" ..> XPT link " <link rel="stylesheet" ..>
<link rel="stylesheet" type="text/css" href="`stylesheets/^`base.css^" />
XSET dir=$css_dir/
XSET src=base.css
<link rel="stylesheet" type="text/css" href="`dir^`src^" />
XPT reset synonym=fonts|base|grids|layout
XSET name=$_xSnipName.css
`:link( { 'src' : 'name' } ):^
XPT jquery abbr synonym=jq " <script... src="jquery...
XSET dir=$js_dir/
XSET ver=$jq_ver
<script type="text/javascript" src="`dir^jquery`-`ver^.js"></script>
XPT jquery " jquery script link
XSET dir=ChooseStr( 'scripts/', 'javascripts/' )
<script language="javascript" type="text/javascript" src="`dir^jquery`^.js"></script>
XPT script " <script... src="...
XSET dir=$js_dir/
XSET src=$empty
<script type="text/javascript" src="`dir^`src^.js"></script>
XPT di abbr wrap=content " <div id="">.</div>
XSET val=$blank
XSET content=$blank
<div` id="`val`"^>`content^</div>
XPT jplug abbr synonym=jfile|jp|jf alias=script
XPT div abbr wrap=content " <div id..>\n\n</div>\n<!-- id..
XPT jscript synonym=js
<script type="text/javascript">
`cursor^
</script>
XPT di wrap=content " <div id="">.</div>
XSET val=Echo('')
XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
XSET content|ontype=html_cont_ontype()
<div` id="`val`"^>`content^^`content^html_cont_helper()^</div>
XPT div abbr wrap=cursor " <div id..>\n\n</div>\n<!-- id..
XSET val=Echo('') XSET val=Echo('')
XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V()) XSET val|post=Echo(V()=~'\V\^ id=""\$\|val' ? '' : V())
XSET content=Echo('')
XSET content|post=Echo(V()=~'\V\^ \$\|val' ? '' : V())
<div` id="`val`"^> <div` id="`val`"^>
` `content^`cursor^
`cursor^
</div> </div>
<!--`val^ --> <!--`val^ -->
XPT ol abbr
<ol` `att?^>`
XPT list "
XSET type=ul
<`type^` `att?^>`
`...{{^ `...{{^
<li>`^</li>`
<li` `att?^>`^</li>`
`...^`}}^ `...^`}}^
</ol>
</`type^>
XPT ul abbr alias=_tagAttr XPT ul abbr alias=_tagAttr
XPT diva " tips
`:div( { 'content' : ':a:' } ):^
XPT ol abbr alias=_tagAttr
XPT li abbr
XSET content=Echo('')
<li>`content^</li>`
`...{{^
<li>`content^</li>`
`...^`}}^
XPT lia abbr
XSET href=#
`:li( { 'content' : ':a:' } ):^
XPT nav synonym=menu "
XSET nav=$_xSnipName
<ul` id="`nav`"^>
`:lia:^
</ul>