星期一, 一月 27, 2020

VIM学习笔记 网页开发-转义字符实体(Escape Character Entity)

输入字符实体(Input Character Entity)章节中,已经介绍了利用HTML-Editor插件来快速输入HTML字符实体。本节将介绍,如何在字符实体和实际文本之间相互转换。

vimrc配置文件中,定义以下函数:

function! HtmlEntities(line1, line2, action)
let search = @/
let range = 'silent ' . a:line1 . ',' . a:line2
if a:action == 0 " must convert & last
 execute range . 'sno/&lt;/</eg'
 execute range . 'sno/&gt;/>/eg'
 execute range . 'sno/&amp;/&/eg'else " must convert & first
 execute range . 'sno/&/&amp;/eg'
 execute range . 'sno/</&lt;/eg'
 execute range . 'sno/>/&gt;/eg'
endif
nohl
let @/ = search
endfunction

映射以下自定义命令

command! -range -nargs=1 HEntities call HtmlEntities(<line1>, <line2>, <args>)

转义(Escape)字符实体

定义以下快捷键,用于将当前行中的特殊字符转义为字符实体代码:

noremap <silent> <Leader>he :HEntities 1<CR>

CharacterEntity_Escape

您也可以在HTML Escape网页上,实现相同的功能。

反转义(Unescape)字符实体

定义以下快捷键,用于将当前行中的字符实体代码反转义为特殊字符:

noremap <silent> <Leader>hu :HEntities 0<CR>

CharacterEntity_Unescape

您也可以在HTML un-escape网页上,实现相同的功能。

以上快捷键和命令,均可在可视化模式和选择模式下使用。例如进入可视化模式或者用鼠标选中多行代码之后,点击<Leader>he快捷键,可以转义已选中的多行文本。

我们也可以在命令中,指定进行转义的文本范围。例如使用以下命令,针对当前行及之后3行进行反转义:

:.,.+3HEntities 0

使用以下命令,则可以针对整个文件进行字符转义:

:%Entities 1

请注意,以上代码只是实现了<>&三个常用字符实体的转义。您可以自行扩展代码,以实现更多字符实体的转义功能。

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

星期三, 一月 22, 2020

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插件中定义的快捷键。请注意:

  • 除非在描述中指明HTML5,否则均是在HTML4中的定义;
  • 如果快捷键列为空,则说明插件中并没有定义相应的快捷键;
  • 如果Entity列为空,则说明该字符并没有名称,而只能使用数字引用格式。

特殊实体

字符 描述 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<上一篇 | 目录 下一篇>

星期二, 一月 07, 2020

VIM学习笔记 工具箱-Qutebrowser浏览器

如果您正在寻找一款使用Vim风格的键盘操作的浏览器,那么开源的Qutebrowser将会是个不错的选择。

Qutebrowser使用QtWebEngine展现引擎,而QtWebEngine则是基于Google's Chromium的。使用:version命令,可以查看Qutebrowser的版本信息,以及其依赖的相关组件。

Tools_Qutebrowser_version

浏览操作

对于Qutebrowser的第一印象,必然是其极简风格的图形界面。除了顶部的标签页和底部的状态栏,甚至没有菜单栏、工具栏和地址栏。所以,您将拥有最大化的屏幕空间以聚焦于网页内容本身。

Tools_Qutebrowser_Main

您可以使用键盘来完成通常的浏览操作。比如使用f键,将在链接上显示快捷键,点击相应快捷键即可打开链接:如果点击Ctrl+r键再点击快捷键,则会在后台新建标签页并打开链接。假设您正在通过搜索引擎查找信息,那么则可以在后台打开多个搜索结果,而在当前页面不受打扰地继续搜索。

Tools_Qutebrowser_f

你将会发现大部分快捷键,都是与Vim像类似的。比如使用jk键,上下滚动屏幕;使用HL键,返回前一页或后一页;使用/键,查找文本;使用:bind命令,可以查看快捷键列表。

Tools_Qutebrowser_bind

命令行模式

像Vim一样,点击:键将进入命令行模式,可以使用命令来下载文件(:download)、查看历史纪录(:history)、管理收藏夹(:bookmark-add)和缩放屏幕(:zoom)等。

Tools_Qutebrowser_download

您可以在命令列表中,查看各种命令的使用方法。

系统配置

使用:set命令,可以修改Qutebrowser的配置选项。

Tools_Qutebrowser_set

例如可以将速查表设置为首页,然后使用:save命令来保存设置。

Tools_Qutebrowser_cheatsheet

帮助信息

使用:help命令,可以查看帮助信息。

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

星期一, 一月 06, 2020

VIM学习笔记 网页开发-Firefox浏览器

在编写VIM学习笔记的过程中,我需要在Firefox中不断预览并验证手工编写的网页;同时也用于预览Markdown格式的Readme文档。

以下将介绍我常用的几款Firefox扩展。

Firefox Screenshots

使用内置的Firefox Screenshots,可以很方便地截取网页。通过鼠标拖拽,就能够滚动屏幕以截取超过当前屏显的较长网页。

Firefox_Screenshots

Hides scrollbars

窗口的纵向和横向滚动条,除了占用屏幕空间之外,实在想不出还有什么用处?安装Hides scrollbars之后,将自动隐藏滚动条。当然你也可以点击工具栏上的按钮,来重新显示滚动条。

Firefox_extension_HidesScrollbars

Scroll Progress New

在隐藏滚动条之后,如果你希望了解当前所处的网页位置,那么可以使用Scroll Progress New扩展,在滚动屏幕时显示相对于完整网页的百分比。

相对于冰冷无趣的滚动条,数字化的标识显然更加清晰直观。而且你还可以自定义百分比的显示效果:比如屏幕位置、字体大小、字体颜色和透明度等。

Firefox_extension_ScrollProgress_Options

Web Developer

Web Developer可以说是网页开发的瑞士军刀,其提供的辅助工具可以大大提高网页开发和调试的效率。其功能非常丰富,比如检视网页元素、调试CSS、清理Cookie和调整窗口尺寸等等。关于更多功能的介绍,请查看chrispederick.com

Firefox_extension_WebDeveloper

Html Validator

符合标准的网页开发,可谓是不作恶的底线了。通过生产具有可读性的高质量代码,促成在不同浏览器中达成一致的显示效果,并且关照不同用户群体的可访问性(accessibility)。

Html Validator是基于TidyOpenSP开发的,用于在本地验证网页是否符合W3C标准

使用CTRL+SHIFT+I快捷键打开“Developer Tools”面板,然后点击“HTML Validator”页,将检查当前网页并显示存在的错误及原因。

GitLab Markdown Viewer

我不是Markdown的fans,我也不太明白:为什么有了HTML这样完整的标签体系,还需要再发明一个类似功能的子集。但是为了编写Readme文档,我还是需要利用GitLab Markdown Viewer来预览Markdown格式的文档。

Firefox_extension_gitlab_markdown_viewer

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