chrome vim按键绑定

传送门

插件安装地址

Navigating the current page:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
?       show the help dialog for a list of all available keys
h       scroll left
j       scroll down
k       scroll up
l       scroll right
gg      scroll to top of the page
G       scroll to bottom of the page
d       scroll down half a page
u       scroll up half a page
f       open a link in the current tab
F       open a link in a new tab
r       reload
gs      view source
i       enter insert mode -- all commands will be ignored until
        you hit esc to exit
yy      copy the current url to the clipboard
yf      copy a link url to the clipboard
gf      cycle forward to the next frame

Using find:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
?       show the help dialog for a list of all available keys
h       scroll left
j       scroll down
k       scroll up
l       scroll right
gg      scroll to top of the page
G       scroll to bottom of the page
d       scroll down half a page
u       scroll up half a page
f       open a link in the current tab
F       open a link in a new tab
r       reload
gs      view source
i       enter insert mode -- all commands will be ignored until
        you hit esc to exit
yy      copy the current url to the clipboard
yf      copy a link url to the clipboard
gf      cycle forward to the next frame

Navigating your history:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
?       show the help dialog for a list of all available keys
h       scroll left
j       scroll down
k       scroll up
l       scroll right
gg      scroll to top of the page
G       scroll to bottom of the page
d       scroll down half a page
u       scroll up half a page
f       open a link in the current tab
F       open a link in a new tab
r       reload
gs      view source
i       enter insert mode -- all commands will be ignored until
        you hit esc to exit
yy      copy the current url to the clipboard
yf      copy a link url to the clipboard
gf      cycle forward to the next frame

Manipulating tabs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
?       show the help dialog for a list of all available keys
h       scroll left
j       scroll down
k       scroll up
l       scroll right
gg      scroll to top of the page
G       scroll to bottom of the page
d       scroll down half a page
u       scroll up half a page
f       open a link in the current tab
F       open a link in a new tab
r       reload
gs      view source
i       enter insert mode -- all commands will be ignored until
        you hit esc to exit
yy      copy the current url to the clipboard
yf      copy a link url to the clipboard
gf      cycle forward to the next frame

Additional advanced browsing commands:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
?       show the help dialog for a list of all available keys
h       scroll left
j       scroll down
k       scroll up
l       scroll right
gg      scroll to top of the page
G       scroll to bottom of the page
d       scroll down half a page
u       scroll up half a page
f       open a link in the current tab
F       open a link in a new tab
r       reload
gs      view source
i       enter insert mode -- all commands will be ignored until
        you hit esc to exit
yy      copy the current url to the clipboard
yf      copy a link url to the clipboard
gf      cycle forward to the next frame

Vimium supports command repetition so, for example, hitting ‘5t’ will open 5 tabs in rapid succession. ESC (or <c-[>) will clear any partial commands in the queue and will also exit insert and find modes.

自定义快捷键详情请自行阅读readme

mount –bind

我想应该大家都会用版本管理来处理配置文件吧。本人一般用git来管理自己的配置(emacs, vim, ssh, zshrc, svn, git, hg…),我将这写配置文件放到了一个git repo中。但是很多时候需要对这些文件进行修改,我想大家也不会把文件在repo中修改好之后然后手动copy到相应的目录中。这里一般有两种方法来避免手动拷贝,一种是通过Makefile的方式,另外一种就是建立文件的软链接。我原来一直采用的是后者,因为我不想没一次修改都make一下。对于建立软链接的方式,一般的软件都能很好的处理。 我的git repo放在windows分区(这样windows和linux都能使用),用virtualbox安装了archlinux,通过mount vboxsf的方式mount windows分区到linux下。这里mount vboxsf的时候需要注意权限问题,然后像.ssh/config文件会出现访问权限问题。我的 =/etc/fstab= 文件如下:

1
2
3
# /etc/fstab
sharename mountpoint vboxsf \
rw,fmode=0644,dmode=0755,uid=1000,gid=1000,exec 0 0

对于symlink模式,绝大部分软件都能满足了,但是这里有个意外, Oraclegethostbyname对于/etc/hosts symlinks是不认的,比如我创建一个软链接到/etc/hosts,启动oracle会出现

1
ORA-00600 arguments: [keltnfy-ldmInit], [46], [1]

既然软链接不行,这个时候就需要mount –bind的帮助了。 mount –bind是将一个目录中的内容挂载到另一个目录上,用法是:

1
2
mount --bind olddir newdir
mount --bind olddir/file newdir/file

如果想将mount –bind写入/etc/fstab,则用法是:

1
olddir newdir none bind 0 0

这里又有一个问题了,我如果想把/etc/fstab也放到git repo中进行管理怎么办呢?由于不可能为/etc/fstab创建symlink,也不能为其使用mount –bind的方式到/etc/fstab。那就只能在git repo中想办法了。可是git是不会follow symlink的,如果我将/etc/fstab软链接到git repo中,git并不会将该文件加入到repo,加入的只是一个symlink而已。 解决办法就是反过来bind, 将/etc/fstab bind到git repo中的目录:)

常用软件的代理设置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# http_proxy
export http_proxy=host:port

# https_proxy
export https_proxy=host:port

# ftp_proxy
export ftp_proxy=host:port

# rsync proxy
export RSYNC_PROXY=host:port
1
2
3
4
5
6
7
8
9
# ssh over http_proxy depends on your tools used.
# Modify .ssh/config file for host configuration:
# Following are connect.c and corkscrew example.
# For connect.c, -h option means use http_proxy
# environment. 
Host *
  ProxyCommand corkscrew http-proxy.example.com 8080 %h %p
  ProxyCommand connect -h %h %p
  ProxyCommand connect -H proxy-host:proxy-port %h %p
1
2
# git over http_proxy
export GIT_PROXY_COMMAND="connect -h $@"

git合并多个repositories到子目录

在每个repo都很小的情况下,维护多个repo是很麻烦的事情。如何在保留原来版本信息的情况下将repo合并到另外一个repo的子目录下呢?有很多的方法,比如在不删除原来的repo,使用submodule。或者使用subtree的方式。但是我不想用submodule保留原来的repo,而且感觉subtree也是一个比较麻烦的东东。这里要介绍git的read-tree(可以参考这里)。 网上讲了很多,我总结一下并写了一个脚本repomerge.sh。先把脚本贴出来

1
2
3
4
5
6
#!/bin/sh

git remote add -f $1 $2
git merge -s ours --no-commit $1/master
git read-tree --prefix=$1/ -u $1/master
git commit -m "merging $1 into subdirectory"

使用的方法是$1为子目录名字,$2为repo的路径。

这里有一个问题需要注意,合并到的repo(即目标repo)不能为空(至少要有一个commit)。

比如要合并一个repo A 到A目录,repo B到B目录

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cd dest-repo-dir
git init .

# add one file and commit
touch just-test-file
git add just-test-file
git commit -am "init"

/path/to/repomerge.sh A /path/to/repo/A
/path/to/repomerge.sh B /path/to/repo/B

这样repo A和repo B就分别被合并到了A、B目录了。