VIM学习笔记 网页开发-输入字符实体(Input Character Entity)

字符实体(Character Entity),也称为转义字符串(Escape Sequence),主要用于在HTML代码中,输入如“<”和“>”等标签关键字,以及如“©”等在ASCII字符集中没有定义的需要转义的特殊符号。当解释程序遇到此类字符串时,将会解释并在网页中显示为真实的字符。

HTML_CharacterEntity

对于同一个字符实体,可以使用名称和数字两种引用方式。

名称引用方式为&name;,并且严格区分大小写。比如&alpha;代表小写希腊字母“α”;而&Alpha;则代表大写希腊字母“Α”。

数字引用,又可以使用十进制(decimal)和十六进制(hexadecimal)两种格式。十进制引用格式为&#number;。十六进制引用格式为&#xnumber;。例如&#169;&#xA9;均代表版权符号“©”。

关于字符实体的更多信息,请参考Character Entity Reference

HTML-Editor插件

我在Christian J Robinson开发的HTML插件的基础之上,制作了HTML-Editor插件,通过快捷键和菜单项来提高编写HTML代码的效率,并提供代码模板、色彩选择和网页预览等功能。

插入模式下,使用以&开头的快捷键,可以自动输入相对应的字符实体。例如点击&&快捷键,将自动扩展为“&”:

HTML-Editor-Kbd-CharacterEntities

通过在载入插件之前设置g:html_map_entity_leader变量,可以指定其它前缀键:

:let g:html_map_entity_leader = '\'

您也可以在HTML->Character Entities菜单中选择输入字符实体:

HTML-Editor-Menu-CharacterEntities

以下表格将列出字符实体的名称和数字代码,以及在HTML-Editor插件中定义的快捷键。请注意:

特殊实体

字符 描述 Entity Decimal Hex 快捷键
  non-breaking space &nbsp; &#160; &#xA0; &<space>
" quotation mark = APL quote &quot; &#34; &#x22; &'
& ampersand &amp; &#38; &#x26; &&
< less-than sign &lt; &#60; &#x3C; &<
> greater-than sign &gt; &#62; &#x3E; &>
trade mark sign &trade; &#8482; &#x2122; &tm
¡ inverted exclamation mark &iexcl; &#161; &#xA1; &!
¢ cent sign &cent; &#162; &#xA2; &c|
£ pound sign &pound; &#163; &#xA3; &#
¥ yen sign = yuan sign &yen; &#165; &#xA5; &Y=
euro sign &euro; &#8364; &#x20AC; &E=
¦ broken vertical bar &brvbar; &#166; &#xA6; &bb
§ section sign &sect; &#167; &#xA7; &se
¨ diaeresis = spacing diaeresis &uml; &#168; &#xA8; &_"
© copyright sign &copy; &#169; &#xA9; &cO
® registered trade mark sign &reg; &#174; &#xAE; &rO
µ micro sign &micro; &#181; &#xB5; &mi
pilcrow sign = paragraph sign &para; &#182; &#xB6; &pa
· middle dot = Georgian comma &middot; &#183; &#xB7; &.
¿ inverted/turned question mark &iquest; &#191; &#xBF; &?

箭头符号

字符 描述 Entity Decimal Hex 快捷键
leftwards single arrow &larr; &#8592; &#x2190; &la
upwards single arrow &uarr; &#8593; &#x2191; &ua
rightwards single arrow &rarr; &#8594; &#x2192; &ra
downwards single arrow &darr; &#8595; &#x2193; &da
left right single arrow &harr; &#8596; &#x2194; &ha
carriage return &crarr; &#8629; &#x21B5; &cr
leftwards double arrow &lArr; &#8656; &#x21D0; &lA
upwards double arrow &uArr; &#8657; &#x21D1; &uA
rightwards double arrow &rArr; &#8658; &#x21D2; &rA
downwards double arrow &dArr; &#8659; &#x21D3; &dA
left right double arrow &hArr; &#8660; &#x21D4; &hA

标点符号

字符 描述 Entity Decimal Hex 快捷键
en dash &ndash; &#8211; &#x2013; &n-
em dash &mdash; &#8212; &#x2014; &m-
left single quotation mark &lsquo; &#8216; &#x2018;
right single quotation mark &rsquo; &#8217; &#x2019;
single low-9 quotation mark &sbquo; &#8218; &#x201A;
left double quotation mark &ldquo; &#8220; &#x201C; &ld
right double quotation mark &rdquo; &#8221; &#x201D; &rd
double low-9 quotation mark &bdquo; &#8222; &#x201E;
dagger &dagger; &#8224; &#x2020;
double dagger &Dagger; &#8225; &#x2021;
per mille sign &permil; &#8240; &#x2030;
single left angle quotation mark &lsaquo; &#8249; &#x2039;
single right angle quotation mark &rsaquo; &#8250; &#x203A;
bullet = black small circle &bull; &#8226; &#x2022; &*
horizontal ellipsis = three dot leader &hellip; &#8230; &#x2026; &3.
« left double angle quotation mark &laquo; &#171; &#xAB; &2<
» right double angle quotation mark &raquo; &#187; &#xBB; &2>
prime = minutes = feet &prime; &#8242; &#x2032;
double prime = seconds = inches &Prime; &#8243; &#x2033;
overline = spacing overscore &oline; &#8254; &#x203E;
fraction slash &frasl; &#8260; &#x2044;

希腊字母

字符 描述 Entity Decimal Hex 快捷键
Α Greek capital letter alpha &Alpha; &#913; &#x391; &Al
Β Greek capital letter beta &Beta; &#914; &#x392; &Be
Γ Greek capital letter gamma &Gamma; &#915; &#x393; &Ga
Δ Greek capital letter delta &Delta; &#916; &#x394; &De
Ε Greek capital letter epsilon &Epsilon; &#917; &#x395; &Ep
Ζ Greek capital letter zeta &Zeta; &#918; &#x396; &Ze
Η Greek capital letter eta &Eta; &#919; &#x397; &Et
Θ Greek capital letter theta &Theta; &#920; &#x398; &Th
Ι Greek capital letter iota &Iota; &#921; &#x399; &Io
Κ Greek capital letter kappa &Kappa; &#922; &#x39A; &Ka
Λ Greek capital letter lambda &Lambda; &#923; &#x39B; &Lm
Μ Greek capital letter mu &Mu; &#924; &#x39C; &Mu
Ν Greek capital letter nu &Nu; &#925; &#x39D; &Nu
Ξ Greek capital letter xi &Xi; &#926; &#x39E; &Xi
Ο Greek capital letter omicron &Omicron; &#927; &#x39F; &Oc
Π Greek capital letter pi &Pi; &#928; &#x3A0; &Pi
Ρ Greek capital letter rho &Rho; &#929; &#x3A1; &Rh
Σ Greek capital letter sigma &Sigma; &#931; &#x3A3; &Si
Τ Greek capital letter tau &Tau; &#932; &#x3A4; &Ta
Υ Greek capital letter upsilon &Upsilon; &#933; &#x3A5; &Up
Φ Greek capital letter phi &Phi; &#934; &#x3A6; &Ph
Χ Greek capital letter chi &Chi; &#935; &#x3A7; &Ch
Ψ Greek capital letter psi &Psi; &#936; &#x3A8; &Ps
Ω Greek capital letter omega &Omega; &#937; &#x3A9; &Og
α Greek small letter alpha &alpha; &#945; &#x3B1; &al
β Greek small letter beta &beta; &#946; &#x3B2; &be
γ Greek small letter gamma &gamma; &#947; &#x3B3; &ga
δ Greek small letter delta &delta; &#948; &#x3B4; &de
ε Greek small letter epsilon &epsilon; &#949; &#x3B5; &ep
ζ Greek small letter zeta &zeta; &#950; &#x3B6; &ze
η Greek small letter eta &eta; &#951; &#x3B7; &et
θ Greek small letter theta &theta; &#952; &#x3B8; &th
ι Greek small letter iota &iota; &#953; &#x3B9; &io
κ Greek small letter kappa &kappa; &#954; &#x3BA; &ka
λ Greek small letter lambda &lambda; &#955; &#x3BB; &lm
μ Greek small letter mu &mu; &#956; &#x3BC; &mu
ν Greek small letter nu &nu; &#957; &#x3BD; &nu
ξ Greek small letter xi &xi; &#958; &#x3BE; &xi
ο Greek small letter omicron &omicron; &#959; &#x3BF; &oc
π Greek small letter pi &pi; &#960; &#x3C0; &pi
ρ Greek small letter rho &rho; &#961; &#x3C1; &rh
ς Greek small letter final sigma &sigmaf; &#962; &#x3C2; &sf
σ Greek small letter sigma &sigma; &#963; &#x3C3; &si
τ Greek small letter tau &tau; &#964; &#x3C4; &ta
υ Greek small letter upsilon &upsilon; &#965; &#x3C5; &up
φ Greek small letter phi &phi; &#966; &#x3C6; &ph
χ Greek small letter chi &chi; &#967; &#x3C7; &ch
ψ Greek small letter psi &psi; &#968; &#x3C8; &ps
ω Greek small letter omega &omega; &#969; &#x3C9; &og
ϑ Greek small letter theta symbol &thetasym; &#977; &#x3D1; &ts
ϒ Greek upsilon with hook symbol &upsih; &#978; &#x3D2; &uh
ϖ Greek pi symbol &piv; &#982; &#x3D6; &pv

拉丁字母

字符 描述 Entity Decimal Hex 快捷键
Š Latin capital letter S with caron &Scaron; &#352; &#x160; &Sc
Ÿ Latin capital letter Y with diaeresis &Yuml; &#376; &#x178; &Y"
À Latin capital letter A with grave &Agrave; &#192; &#xC0; &A`
Á Latin capital letter A with acute &Aacute; &#193; &#xC1; &A'
 Latin capital letter A with circumflex &Acirc; &#194; &#xC2; &A^
à Latin capital letter A with tilde &Atilde; &#195; &#xC3; &A~
Ä Latin capital letter A with diaeresis &Auml; &#196; &#xC4; &A"
Å Latin capital letter A with ring above &Aring; &#197; &#xC5; &Ao
Æ Latin capital letter AE &AElig; &#198; &#xC6; &AE
Ç Latin capital letter C with cedilla &Ccedil; &#199; &#xC7; &C,
È Latin capital letter E with grave &Egrave; &#200; &#xC8; &E`
É Latin capital letter E with acute &Eacute; &#201; &#xC9; &E'
Ê Latin capital letter E with circumflex &Ecirc; &#202; &#xCA; &E^
Ë Latin capital letter E with diaeresis &Euml; &#203; &#xCB; &E"
Ì Latin capital letter I with grave &Igrave; &#204; &#xCC; &I`
Í Latin capital letter I with acute &Iacute; &#205; &#xCD; &I'
Î Latin capital letter I with circumflex &Icirc; &#206; &#xCE; &I^
Ï Latin capital letter I with diaeresis &Iuml; &#207; &#xCF; &I"
Ð Latin capital letter ETH &ETH; &#208; &#xD0;
Ñ Latin capital letter N with tilde &Ntilde; &#209; &#xD1; &N~
Ò Latin capital letter O with grave &Ograve; &#210; &#xD2; &O`
Ó Latin capital letter O with acute &Oacute; &#211; &#xD3; &O'
Ô Latin capital letter O with circumflex &Ocirc; &#212; &#xD4; &O^
Õ Latin capital letter O with tilde &Otilde; &#213; &#xD5; &O~
Ö Latin capital letter O with diaeresis &Ouml; &#214; &#xD6; &O"
Ø Latin capital letter O with stroke &Oslash; &#216; &#xD8; &O/
Ù Latin capital letter U with grave &Ugrave; &#217; &#xD9; &U`
Ú Latin capital letter U with acute &Uacute; &#218; &#xDA; &U'
Û Latin capital letter U with circumflex &Ucirc; &#219; &#xDB; &U^
Ü Latin capital letter U with diaeresis &Uuml; &#220; &#xDC; &U"
Ý Latin capital letter Y with acute &Yacute; &#221; &#xDD; &Y'
Þ Latin capital letter THORN &THORN; &#222; &#xDE;
š Latin small letter s with caron &scaron; &#353; &#x161; &sc
ß Latin small letter sharp s = ess-zed &szlig; &#223; &#xDF; &sz
à Latin small letter a with grave &agrave; &#224; &#xE0; &a`
á Latin small letter a with acute &aacute; &#225; &#xE1; &a'
â Latin small letter a with circumflex &acirc; &#226; &#xE2; &a^
ã Latin small letter a with tilde &atilde; &#227; &#xE3; &a~
ä Latin small letter a with diaeresis &auml; &#228; &#xE4; &a"
å Latin small letter a with ring above &aring; &#229; &#xE5; &ao
æ Latin small letter ae &aelig; &#230; &#xE6; &ae
ç Latin small letter c with cedilla &ccedil; &#231; &#xE7; &c,
è Latin small letter e with grave &egrave; &#232; &#xE8; &e`
é Latin small letter e with acute &eacute; &#233; &#xE9; &e'
ê Latin small letter e with circumflex &ecirc; &#234; &#xEA; &e^
ë Latin small letter e with diaeresis &euml; &#235; &#xEB; &e"
ì Latin small letter i with grave &igrave; &#236; &#xEC; &i`
í Latin small letter i with acute &iacute; &#237; &#xED; &i'
î Latin small letter i with circumflex &icirc; &#238; &#xEE; &i^
ï Latin small letter i with diaeresis &iuml; &#239; &#xEF; &i"
ð Latin small letter eth &eth; &#240; &#xF0;
ñ Latin small letter n with tilde &ntilde; &#241; &#xF1; &n~
ò Latin small letter o with grave &ograve; &#242; &#xF2; &o`
ó Latin small letter o with acute &oacute; &#243; &#xF3; &o'
ô Latin small letter o with circumflex &ocirc; &#244; &#xF4; &o^
õ Latin small letter o with tilde &otilde; &#245; &#xF5; &o~
ö Latin small letter o with diaeresis &ouml; &#246; &#xF6; &o"
ø Latin small letter o with stroke &oslash; &#248; &#xF8; &o/
ù Latin small letter u with grave &ugrave; &#249; &#xF9; &u`
ú Latin small letter u with acute &uacute; &#250; &#xFA; &u'
û Latin small letter u with circumflex &ucirc; &#251; &#xFB; &u^
ü Latin small letter u with diaeresis &uuml; &#252; &#xFC; &u"
ý Latin small letter y with acute &yacute; &#253; &#xFD; &y'
ÿ Latin small letter y with diaeresis &yuml; &#255; &#xFF; &y"
þ Latin small letter thorn &thorn; &#254; &#xFE;

罗马数字

字符 描述 Entity Decimal Hex 快捷键
Roman Numeral One &#8544; &#x2160; &R1
Roman Numeral Two &#8545; &#x2161; &R2
Roman Numeral Three &#8546; &#x2162; &R3
Roman Numeral Four &#8547; &#x2163; &R4
Roman Numeral Five &#8548; &#x2164; &R5
Roman Numeral Six &#8549; &#x2165; &R6
Roman Numeral Seven &#8550; &#x2166; &R7
Roman Numeral Eight &#8551; &#x2167; &R8
Roman Numeral Nine &#8552; &#x2168; &R9
Roman Numeral Ten &#8553; &#x2169; &R10
Roman Numeral Eleven &#8554; &#x216a; &R11
Roman Numeral Twelve &#8555; &#x216b; &R12
Roman Numeral Fifty &#8556; &#x216c; &R50
Roman Numeral One Hundred &#8557; &#x216d; &R100
Roman Numeral Five Hundred &#8558; &#x216e; &R500
Roman Numeral One Thousand &#8559; &#x216f; &R1000
Small Roman Numeral One &#8560; &#x2170; &r1
Small Roman Numeral Two &#8561; &#x2171; &r2
Small Roman Numeral Three &#8562; &#x2172; &r3
Small Roman Numeral Four &#8563; &#x2173; &r4
Small Roman Numeral Five &#8564; &#x2174; &r5
Small Roman Numeral Six &#8565; &#x2175; &r6
Small Roman Numeral Seven &#8566; &#x2176; &r7
Small Roman Numeral Eight &#8567; &#x2177; &r8
Small Roman Numeral Nine &#8568; &#x2178; &r9
Small Roman Numeral Ten &#8569; &#x2179; &r10
Small Roman Numeral Eleven &#8570; &#x217a; &r11
Small Roman Numeral Twelve &#8571; &#x217b; &r12
Small Roman Numeral Fifty &#8572; &#x217c; &r50
Small Roman Numeral One Hundred &#8573; &#x217d; &r100
Small Roman Numeral Five Hundred &#8574; &#x217e; &r500
Small Roman Numeral OneThousand &#8575; &#x217f; &r1000

数学符号

字符 描述 Entity Decimal Hex 快捷键
° degree sign &deg; &#176; &#xB0; &dg
± plus-minus sign &plusmn; &#177; &#xB1; &+-
× multiplication sign &times; &#215; &#xD7; &x
÷ division sign &divide; &#247; &#xF7; &/
tilde = varies with = similar to &sim; &#8764; &#x223C;
approximately equal to &cong; &#8773; &#x2245;
almost equal to = asymptotic to &asymp; &#8776; &#x2248;
not equal to &ne; &#8800; &#x2260;
identical to &equiv; &#8801; &#x2261;
less-than or equal to &le; &#8804; &#x2264;
greater-than or equal to &ge; &#8805; &#x2265;
subset of &sub; &#8834; &#x2282;
superset of &sup; &#8835; &#x2283;
not a subset of &nsub; &#8836; &#x2284;
subset of or equal to &sube; &#8838; &#x2286;
superset of or equal to &supe; &#8839; &#x2287;
circled plus = direct sum &oplus; &#8853; &#x2295;
circled times = vector product &otimes; &#8855; &#x2297;
up tack = orthogonal/perpendicular &perp; &#8869; &#x22A5;
dot operator &sdot; &#8901; &#x22C5;
for all &forall; &#8704; &#x2200;
partial differential &part; &#8706; &#x2202;
there exists &exist; &#8707; &#x2203;
empty set = null set = diameter &empty; &#8709; &#x2205;
nabla = backward difference &nabla; &#8711; &#x2207;
element of &isin; &#8712; &#x2208;
not an element of &notin; &#8713; &#x2209;
contains as member &ni; &#8715; &#x220B;
n-ary product = product sign &prod; &#8719; &#x220F;
n-ary sumation &sum; &#8721; &#x2211;
minus sign &minus; &#8722; &#x2212;
asterisk operator &lowast; &#8727; &#x2217;
square root = radical sign &radic; &#8730; &#x221A;
proportional to &prop; &#8733; &#x221D;
infinity &infin; &#8734; &#x221E;
angle &ang; &#8736; &#x2220;
logical and = wedge &and; &#8743; &#x2227;
logical or = vee &or; &#8744; &#x2228;
intersection = cap &cap; &#8745; &#x2229;
union = cup &cup; &#8746; &#x222A;
integral &int; &#8747; &#x222B;
therefore &there4; &#8756; &#x2234;
¹ superscript digit one &sup1; &#185; &#xB9; &1^
² superscript digit two = squared &sup2; &#178; &#xB2; &2^
³ superscript digit three = cubed &sup3; &#179; &#xB3; &3^
ƒ Latin small f with hook = function &fnof; &#402; &#x192; &fn
¼ vulgar fraction one quarter &frac14; &#188; &#xBC; &14
½ vulgar fraction one half &frac12; &#189; &#xBD; &12
¾ vulgar fraction three quarters &frac34; &#190; &#xBE; &34
vulgar fraction one third (HTML5) &frac13; &#8531; &#x02153; &13
vulgar fraction two thirds (HTML5) &frac23; &#8532; &#x02154; &23
vulgar fraction one fifth (HTML5) &frac15; &#8533; &#x02155; &15
vulgar fraction two fifths (HTML5) &frac25; &#8534; &#x02156; &25
vulgar fraction three fifths (HTML5) &frac35; &#8535; &#x02157; &35
vulgar fraction four fifths (HTML5) &frac45; &#8536; &#x02158; &45
vulgar fraction one sixth (HTML5) &frac16; &#8537; &#x02159; &16
vulgar fraction five sixths (HTML5) &frac56; &#8538; &#x0215A; &56
vulgar fraction one eigth (HTML5) &frac18; &#8539; &#x0215B; &18
vulgar fraction three eigths (HTML5) &frac38; &#8540; &#x0215C; &38
vulgar fraction five eigths (HTML5) &frac58; &#8541; &#x0215D; &58
vulgar fraction seven eigths (HTML5) &frac78; &#8542; &#x0215E; &78

其它符号

字符 描述 Entity Decimal Hex 快捷键
en space &ensp; &#8194; &#x2002;
em space &emsp; &#8195; &#x2003;
thin space &thinsp; &#8201; &#x2009;
zero width non-joiner &zwnj; &#8204; &#x200C;
zero width joiner &zwj; &#8205; &#x200D;
left-to-right mark &lrm; &#8206; &#x200E;
right-to-left mark &rlm; &#8207; &#x200F;
ˆ modifier letter circumflex accent &circ; &#710; &#x2C6;
˜ small tilde &tilde; &#732; &#x2DC;
script capital P = Weierstrass p &weierp; &#8472; &#x2118;
blackletter capital I = imaginary part &image; &#8465; &#x2111;
blackletter capital R = real part &real; &#8476; &#x211C;
alef symbol = first transfinite cardinal &alefsym; &#8501; &#x2135;
left ceiling = APL upstile &lceil; &#8968; &#x2308;
right ceiling &rceil; &#8969; &#x2309;
left floor = APL downstile &lfloor; &#8970; &#x230A;
right floor &rfloor; &#8971; &#x230B;
left-pointing angle bracket = bra &lang; &#9001; &#x2329;
right-pointing angle bracket = ket &rang; &#9002; &#x232A;
lozenge &loz; &#9674; &#x25CA;
black spade suit &spades; &#9824; &#x2660;
black club suit = shamrock &clubs; &#9827; &#x2663;
black heart suit = valentine &hearts; &#9829; &#x2665;
black diamond suit &diams; &#9830; &#x2666;

Ver: 2.0 | YYQ<上一篇 | 目录 下一篇>