Vimium

Vomnibar

按键:

  • oO

Search Engine

参考:Search Engines - philc/vimium Wiki

触发模式:

  • Shortcutkeyword<空格>搜索词

常用 Engines

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
b: https://www.baidu.com/s?wd=%s 百度
gh: https://github.com/search?q=%s GitHub
hn:  https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=%s&sort=byPopularity&type=story HackerNews
s: https://stackoverflow.com/search?q=%s StackOverflow

dh: https://hub.docker.com/search?q=%s DockerHubw: https://en.wikipedia.org/wiki/Special:Search?search=%s Wikipedig: https://www.google.com/search?q=%s Google
gi: https://www.google.com/search?tbm=isch&q=%s Google Images
gm: https://www.google.com/maps?q=%s Google Maps
recent: https://www.google.com/search?hl=en&tbo=1&tbs=qdr:y&q=%s Google (last year only)
gt: https://translate.google.com/?source=osdd#auto|auto|%s Google Translate
d: https://duckduckgo.com/?q=%s DuckDuckGo
a: https://www.amazon.com/exec/obidos/external-search/?field-keywords=%s&mode=blended Amazon
e: https://www.ebay.com/sch/?_nkw=%s eBay
by: https://www.bing.com/search?setmkt=en-GB&q=%s Bing
so: https://stackoverflow.com/search?q=%s StackOverflow
su: https://superuser.com/search?q=%s SuperUser
sh: http://symbolhound.com/?q=%s SymbolHound
ud: https://www.urbandictionary.com/define.php?term=%s UrbanDictionary
wa: https://www.wolframalpha.com/input/?i=%s Wolfram|Alpha
qw: https://www.qwant.com/?q=%s&t=all
yt: https://www.youtube.com/results?search_query=%s YouTube
imdb: https://www.imdb.com/find?s=all&q=%s IMDB
trello: https://trello.com/search?q=%s Trello
search.creativecommons.org: https://ccsearch.creativecommons.org/?search_fields=title&search_fields=creator&search_fields=tags&search=%s
search.yahoo.com: https://search.yahoo.com/search?p=%s&ei=UTF-8
w: https://en.wikipedia.org/w/index.php?title=Special:Search&search=%s

# Find your way from your home to places using Google Maps
home: https://www.google.com/maps/dir/home/%s

# Use google to search the current site you're on
site: javascript:location='https://www.google.com/search?num=100&q=site:'+escape(location.hostname)+'+%s'


# Use google
g: https://www.google.com/search?q=%s

caret mode

用途: 在 visual mode 内部使用,调节 cursor 起始位置

Python2

string 类型

参考: A Guide to Unicode, UTF-8 and Strings in Python | by Sanket Gupta | Towards D…

python2 有两种 string 类型

  • str
  • unicode

转换关系: str — decode –> unicode

unicode –> encode –> str

str 类型

  • 默认使用 ascii 编码
  • 类似 c/c++, 本身实际上无编码, string literal 编码类型由代码文件的编码决定

str.decode

  • 语法: str.decode('coding-name')
  • 返回值类型: <type 'unicode'>

str.encode

  • 返回值类型: <type 'str'>

unicode 类型

  • 默认使用 unicode 解码格式

unicode.encode()

  • 返回值类型: <type 'str'>

FAQ

打印输出和 string literal 不一致问题

确保 console (terminal) 的编码和 python source code 编码一致