From c74d97c65046bd9d2ee29a3b6ba82fe3bc50c0f9 Mon Sep 17 00:00:00 2001 From: Alvin Chan Date: Tue, 19 Jul 2016 16:29:56 -0700 Subject: [PATCH 1/2] By default, use VISUAL selection for HTML tag content --- UltiSnips/html.snippets | 46 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/UltiSnips/html.snippets b/UltiSnips/html.snippets index fd1aca5..973fe0e 100644 --- a/UltiSnips/html.snippets +++ b/UltiSnips/html.snippets @@ -162,25 +162,25 @@ endsnippet snippet body "" - $0 + ${0:${VISUAL}} endsnippet snippet div "
" w
- $0 + ${0:${VISUAL}}
endsnippet snippet div. "
with class" w - $0 + ${0:${VISUAL}}
endsnippet snippet div# "
with ID & class" w - $0 + ${0:${VISUAL}}
endsnippet @@ -188,33 +188,41 @@ snippet form "XHTML
" w - $0 + ${0:${VISUAL}}

endsnippet snippet h1 "XHTML

" w -

$0

+

${0:${VISUAL}}

endsnippet snippet h2 "XHTML

" w -

$0

+

${0:${VISUAL}}

endsnippet snippet h3 "XHTML

" w -

$0

+

${0:${VISUAL}}

endsnippet snippet h4 "XHTML

" w -

$0

+

${0:${VISUAL}}

+endsnippet + +snippet h5 "XHTML
" w +
${0:${VISUAL}}
+endsnippet + +snippet h6 "XHTML
" w +
${0:${VISUAL}}
endsnippet snippet head "XHTML " ${1:`!p snip.rv = snip.basename or "Page Title"`} - $0 + ${0:${VISUAL}} endsnippet @@ -232,13 +240,13 @@ endsnippet snippet script "XHTML endsnippet snippet style "XHTML endsnippet @@ -254,29 +262,29 @@ snippet a "Link" w endsnippet snippet p "paragraph" w -

$0

+

${0:${VISUAL}}

endsnippet snippet li "list item" w -
  • $0
  • +
  • ${0:${VISUAL}}
  • endsnippet snippet ul "unordered list" w endsnippet snippet td "table cell" w -$0 +${0:${VISUAL}} endsnippet snippet th "table header" w -$0 +${0:${VISUAL}} endsnippet snippet tr "table row" w -$0 +${0:${VISUAL}} endsnippet snippet title "XHTML " w @@ -286,7 +294,7 @@ endsnippet snippet fieldset "Fieldset" w <fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}> <legend>$1</legend> - $0 + ${0:${VISUAL}} </fieldset> endsnippet From fb4e3f09863b39ff49c5982b9d9dd32736baf259 Mon Sep 17 00:00:00 2001 From: Alvin Chan <aschan@gmail.com> Date: Tue, 19 Jul 2016 16:54:17 -0700 Subject: [PATCH 2/2] Clean up HTML snippets that add extraneous tags --- UltiSnips/html.snippets | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/UltiSnips/html.snippets b/UltiSnips/html.snippets index 973fe0e..4e92a96 100644 --- a/UltiSnips/html.snippets +++ b/UltiSnips/html.snippets @@ -127,7 +127,6 @@ 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 "XHTML <input>" w @@ -141,9 +140,7 @@ endsnippet snippet select "Select Box" w <select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}> - <option${9: value="${10:option1}"}>${11:$10}</option> - <option${12: value="${13:option2}"}>${14:$13}</option>${15:} - $0 + ${0:${VISUAL}} </select> endsnippet @@ -189,8 +186,6 @@ snippet form "XHTML <form>" w snip.rv = (snip.basename or 'unnamed') + '_submit' `}" method="${2:get}" accept-charset="utf-8"> ${0:${VISUAL}} - - <p><input type="submit" value="Continue →"`!p x(snip)`></p> </form> endsnippet @@ -252,8 +247,7 @@ endsnippet snippet table "XHTML <table>" w <table border="${1:0}"${2: cellspacing="${3:5}" cellpadding="${4:5}"}> - <tr><th>${5:Header}</th></tr> - <tr><td>${0:Data}</td></tr> + ${0:${VISUAL}} </table> endsnippet @@ -271,7 +265,7 @@ endsnippet snippet ul "unordered list" w <ul> -${0:${VISUAL}} + ${0:${VISUAL}} </ul> endsnippet