1
0
Fork 0
mirror of synced 2024-11-10 11:18:58 -05:00
ultimate-vim/sources_non_forked/vim-snippets/UltiSnips/html.snippets

531 lines
9.1 KiB
Text
Raw Normal View History

priority -50
2012-08-16 23:41:25 -04:00
###########################################################################
# TextMate Snippets #
###########################################################################
global !p
def x(snip):
if snip.ft.startswith("x"):
snip.rv = '/'
else:
snip.rv = ""
2012-08-16 23:41:25 -04:00
endglobal
snippet doctype "HTML - 5.0 (doctype)" b
<!DOCTYPE html>
endsnippet
#############
# Shortcuts #
#############
snippet down "Down (down)"
&#x2193;
endsnippet
snippet enter "Enter (enter)"
&#x2305;
endsnippet
snippet escape "Escape (escape)"
&#x238B;
endsnippet
2017-05-26 05:30:32 -04:00
snippet left "Left (left)"
&#x2190;
2012-08-16 23:41:25 -04:00
endsnippet
snippet return "Return (return)"
&#x21A9;
endsnippet
snippet right "Right (right)"
&#x2192;
endsnippet
2017-05-26 05:30:32 -04:00
snippet shift "Shift (shift)"
&#x21E7;
endsnippet
snippet tab "Tab (tab)"
&#x21E5;
endsnippet
snippet up "Up (up)"
&#x2191;
2012-08-16 23:41:25 -04:00
endsnippet
#############
# HTML TAGS #
#############
2017-05-26 05:30:32 -04:00
snippet a "Link" w
<a href="${1:http://www.${2:url.com}}"${3: target="_blank"}>${4:Anchor Text}</a>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet abbr "<abbr>" w
<abbr title="$2">$1</abbr>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet access "accesskey global attribute"
accesskey="$1"
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet address "<address>" w
<address>$1</address>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet article "<article>"
<article>
${1:article content}
</article>
endsnippet
2017-05-26 05:30:32 -04:00
snippet aside "<aside>"
<aside>
${1:aside content}
</aside>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet b "<b>" w
<b>$1</b>
2012-08-16 23:41:25 -04:00
endsnippet
2017-02-11 08:01:38 -05:00
snippet base "HTML <base>" w
2012-08-16 23:41:25 -04:00
<base href="$1"${2: target="$3"}`!p x(snip)`>
endsnippet
2017-05-26 05:30:32 -04:00
snippet blockquote "<blockquote>"
<blockquote>$1</blockquote>
endsnippet
2015-03-14 16:02:10 -04:00
snippet body "<body>"
<body>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2012-08-16 23:41:25 -04:00
</body>
endsnippet
2017-05-26 05:30:32 -04:00
snippet br "<br>" w
<br>$1</br>
endsnippet
snippet button "<button>"
<button>$1</button>
endsnippet
snippet caption "<caption>"
<caption>$1</caption>
endsnippet
snippet cite "<cite>" w
<cite>$1</cite>
endsnippet
snippet class "class global attribute"
class="$1"
endsnippet
snippet code "<code>" w
<code>$1</code>
endsnippet
snippet data "<data>"
<data value="$2">$1</data>
endsnippet
snippet datalist "<datalist>"
<datalist id="$1" name="$2">
opt$3
</datalist>
endsnippet
snippet dd "<dd>"
<dd>$1</dd>
endsnippet
snippet del "<del>" w
<del cite="$2" datetime="${3:`date '+%Y-%m-%dT%H:%M:%S%:z'`}">$1</del>
endsnippet
snippet dfn "<dfn>" w
<dfn>$1</dfn>
endsnippet
2015-03-14 16:02:10 -04:00
snippet div "<div>" w
<div>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2015-03-14 16:02:10 -04:00
</div>
endsnippet
2017-05-26 05:30:32 -04:00
snippet div# "<div> with ID & class" w
<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`>
${0:${VISUAL}}
</div>
endsnippet
2014-10-31 17:30:24 -04:00
snippet div. "<div> with class" w
<div`!p snip.rv=' class="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2014-10-31 17:30:24 -04:00
</div>
endsnippet
2017-05-26 05:30:32 -04:00
snippet dl "<dl>"
<dl>
${1:Definition list}
</dl>
endsnippet
snippet dt "<dt>"
<dt>$1</dt>
endsnippet
snippet em "<em>" w
<em>$1</em>
endsnippet
snippet fieldset "Fieldset" w
<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}>
<legend>$1</legend>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2017-05-26 05:30:32 -04:00
</fieldset>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet fig "<figure>"
<figure>
$1
<figcaption>$2</figcaption>
</figure>
endsnippet
snippet figcaption "<figcaption>"
<figcaption>$1</figcaption>
endsnippet
snippet footer "<footer>"
<footer>
${1:footer content}
</footer>
endsnippet
snippet form "HTML <form>" w
<form action="${1:`!p
snip.rv = (snip.basename or 'unnamed') + '_submit'
`}" method="${2:get}" accept-charset="utf-8">
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
</form>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet h1 "HTML <h1>" w
2016-08-02 08:48:32 -04:00
<h1>${0:${VISUAL}}</h1>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet h2 "HTML <h2>" w
2016-08-02 08:48:32 -04:00
<h2>${0:${VISUAL}}</h2>
2015-07-13 06:22:46 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet h3 "HTML <h3>" w
2016-08-02 08:48:32 -04:00
<h3>${0:${VISUAL}}</h3>
2015-07-13 06:22:46 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet h4 "HTML <h4>" w
2016-08-02 08:48:32 -04:00
<h4>${0:${VISUAL}}</h4>
endsnippet
2017-05-26 05:30:32 -04:00
snippet h5 "HTML <h5>" w
2016-08-02 08:48:32 -04:00
<h5>${0:${VISUAL}}</h5>
endsnippet
2017-05-26 05:30:32 -04:00
snippet h6 "HTML <h6>" w
2016-08-02 08:48:32 -04:00
<h6>${0:${VISUAL}}</h6>
2015-07-13 06:22:46 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet head "HTML <head>"
2012-08-16 23:41:25 -04:00
<head>
2014-04-18 08:58:02 -04:00
<meta charset="utf-8">
2012-08-16 23:41:25 -04:00
<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2012-08-16 23:41:25 -04:00
</head>
endsnippet
2017-05-26 05:30:32 -04:00
snippet header "<header>"
<header>
${1:header content}
</header>
endsnippet
snippet hr "<hr>"
<hr>
endsnippet
snippet html "HTML basic structure" b
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>${1:`!p snip.rv = snip.basename.replace('-', ' ').capitalize()`}</title>
</head>
<body>
${0:body}
</body>
</html>
2017-05-26 05:30:32 -04:00
endsnippet
snippet htmll "HTML basic structure with the lang attribute" b
<!DOCTYPE html>
<html lang="${1:es}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>${2:`!p snip.rv = snip.basename.replace('-', ' ').capitalize()`}</title>
</head>
<body>
${0:body}
</body>
</html>
2017-05-26 05:30:32 -04:00
endsnippet
snippet i "<i>" w
<i>$1</i>
endsnippet
snippet id "id global attribute"
id="$1"
endsnippet
snippet img "<img>"
<img src="$1" alt="$2">
endsnippet
snippet input "Input with Label" w
<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p x(snip)`>
endsnippet
snippet input "HTML <input>" w
<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p x(snip)`>
endsnippet
snippet ins "<ins>" w
<ins cite="$2" datetime="${3:`date '+%Y-%m-%dT%H:%M:%S%:z'`}">$1</ins>
endsnippet
snippet kbd "<kbd>" w
<kbd>$1</kbd>
endsnippet
snippet label "<label>"
<label>$1</label>
endsnippet
snippet legend "<legend>"
<legend>$1</legend>
2017-05-26 05:30:32 -04:00
endsnippet
snippet li "list item" w
<li>${0:${VISUAL}}</li>
endsnippet
snippet link "HTML <link>" w
2012-08-16 23:41:25 -04:00
<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p x(snip)`>
endsnippet
2017-05-26 05:30:32 -04:00
snippet mailto "HTML <a mailto: >" w
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
endsnippet
snippet main "<main>"
<main>
${1:main content}
</main>
endsnippet
snippet mark "<mark>"
<mark>$1</mark>
endsnippet
snippet meta "HTML <meta>" w
2012-08-16 23:41:25 -04:00
<meta name="${1:name}" content="${2:content}"`!p x(snip)`>
endsnippet
2017-05-26 05:30:32 -04:00
snippet meter "<meter>"
<meter>$1</meter>
endsnippet
snippet nav "<nav>"
<nav>
${1:navigation links}
</nav>
endsnippet
snippet noscript "<noscript>"
<noscript>$1</noscript>
endsnippet
snippet ol "<ol>"
<ol>
<li>$1</li>
</ol>
endsnippet
snippet optgroup "<optgroup>"
<optgroup label="$1">
opt$2
</optgroup>
endsnippet
snippet output "<output>"
<output for="$1" name="$2">$3</output>
endsnippet
snippet option "Option" w
<option${1: value="${2:option}"}>${3:$2}</option>
endsnippet
snippet p "paragraph" w
<p>${0:${VISUAL}}</p>
endsnippet
snippet picture "<picture>"
<picture>
${1:image sources}
</picture>
endsnippet
snippet pre "<pre>"
<pre>$1</pre>
endsnippet
snippet progress "<progress>"
<progress>$1</progress>
endsnippet
snippet q "<q>" w
<q>$1</q>
endsnippet
snippet s "<s>" w
<s>$1</s>
endsnippet
snippet samp "<samp>" w
<samp>$1</samp>
2012-08-16 23:41:25 -04:00
endsnippet
2017-02-11 08:01:38 -05:00
snippet script "HTML <script>" w
<script charset="utf-8">
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
</script>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet scriptsrc "HTML <script src...>" w
<script src="$1" charset="${3:utf-8}"></script>
endsnippet
snippet select "Select Box" w
<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: size="${6:1}"}}>
${0:${VISUAL}}
</select>
endsnippet
snippet small "<small>" w
<small>$1</small>
endsnippet
2016-10-02 07:37:21 -04:00
snippet span "<span>" w
<span>${0:${VISUAL}}</span>
2016-10-02 07:37:21 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet span# "<span> with ID & class" w
<span`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`>${0:${VISUAL}}</span>
2017-05-26 05:30:32 -04:00
endsnippet
2016-10-02 07:37:21 -04:00
snippet span. "<span> with class" w
<span`!p snip.rv=' class="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`>${0:${VISUAL}}</span>
2016-10-02 07:37:21 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet strong "<strong>" w
<strong>$1</strong>
2016-10-02 07:37:21 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet style "HTML <style>" w
2012-08-16 23:41:25 -04:00
<style type="text/css" media="screen">
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2012-08-16 23:41:25 -04:00
</style>
endsnippet
2017-05-26 05:30:32 -04:00
snippet sub "<sub>" w
<sub>$1</sub>
endsnippet
snippet sup "<sup>" w
<sup>$1</sup>
endsnippet
snippet table "HTML <table>" w
2016-11-09 12:22:55 -05:00
<table>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
</table>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet tbody "<tbody>"
<tbody>$1</tbody>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet td "table cell" w
<td>${0:${VISUAL}}</td>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet template "<template>"
<template id="$1">
$2
</template>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet textarea "HTML <textarea>" w
<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet tfoot "<tfoot>"
<tfoot>$1</tfoot>
2012-08-16 23:41:25 -04:00
endsnippet
2014-09-27 11:32:18 -04:00
snippet th "table header" w
2016-08-02 08:48:32 -04:00
<th>${0:${VISUAL}}</th>
2014-09-27 11:32:18 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet thead "<thead>"
<thead>$1</thead>
endsnippet
snippet time "<time>" w
<time datetime="$2">$1</time>
2012-08-16 23:41:25 -04:00
endsnippet
2017-05-26 05:30:32 -04:00
snippet title "HTML <title>" w
2012-08-16 23:41:25 -04:00
<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
endsnippet
2017-05-26 05:30:32 -04:00
snippet tr "table row" w
<tr>${0:${VISUAL}}</tr>
endsnippet
snippet ul "unordered list" w
<ul>
2016-08-02 08:48:32 -04:00
${0:${VISUAL}}
2017-05-26 05:30:32 -04:00
</ul>
endsnippet
snippet var "<var>" w
<var>$1</var>
2012-08-16 23:41:25 -04:00
endsnippet
2016-11-09 12:22:55 -05:00
snippet viewport "Responsive viewport meta" w
<meta name="viewport" content="width=device-width, initial-scale=1">
endsnippet
2017-05-26 05:30:32 -04:00
snippet wbr "<wbr>" w
<wbr>$1</wbr>
endsnippet
2012-08-16 23:41:25 -04:00
# vim:ft=snippets: