heyheytower

日々のメモです。誰かのお役に立てれば幸いです。

vimium のキーバインドを vimperator ライクな設定にする


【目的】

メイン端末を ubuntu12.04.3 に変更したことに合わせて、ブラウザを firefox から chrome へ乗り換えた。
vimperator を使っていたため代替拡張機能を探し、インストール後に vimperator ライクな設定を行う。

ブラウザ乗り換えの理由の一つは下記です。

Flash 11.2 以降では、Google による協力の下、利用するプラグイン API を PPAPI "Pepper" に切り替える予定で、このため LinuxFlash Player は Google Chrome の一部としてのみ提供されることになります。Chrome 以外の従来版 Flash Player は、バージョン 11.2 をベースに今後5年間サポート(だけ)が行われる予定。LinuxFirefoxFlash な方はピンチです。なお Linux 以外のプラットフォームでは、従来どおり Chrome 以外でも Flash Player が提供されます。

http://japanese.engadget.com/2012/02/23/flash-linux-chrome/

【方法】

Vichrome : vim風インタフェースを実現するChrome Extensionの vichrome も同時にテスト中ですが、
必須機能がそろっていることと、他ユーザ利用実績から今回はVimium - Chrome Web Store の vimium を vimperator ライクに使うことにしました。

インストール後、Custom key mappings を下記のように設定を行いました。

map scrollPageDown
map scrollPageUp

unmap
unmap

unmap K
map nextTab

unmap J
map previousTab

unmap x
unmap d
map d removeTab
unmap X
unmap u
map u restoreTab

unmap gs
map gf toggleViewSource

unmap L
map L goForward
umap H
map H goBack

unmap yy
map y copyCurrentUrl

Vimium Help Navigating the page

j : Scroll down
k : Scroll up
h : Scroll left
l : Scroll right
gg : Scroll to the top of the page
G : Scroll to the bottom of the page
: Scroll a page down
: Scroll a page up
r : Reload the page
gf : View page source
y : Copy the current URL to the clipboard
yf : Copy a link URL to the clipboard
p : Open the clipboard's URL in the current tab
P : Open the clipboard's URL in a new tab
i : Enter insert mode
f : Open a link in the current tab
F : Open a link in a new tab
o : Open URL, bookmark, or history entry
O : Open URL, bookmark, history entry, in a new tab
T : Search through your open tabs
b : Open a bookmark
B : Open a bookmark in a new tab
Using find
/ : Enter find mode
n : Cycle forward to the next find match
N : Cycle backward to the previous find match
Navigating history
L : Go back in history
H : Go forward in history
Manipulating tabs
gt, : Go one tab right
gT, : Go one tab left
g0 : Go to the first tab
g$ : Go to the last tab
t : Create new tab
yt : Duplicate current tab
d : Close current tab
u : Restore closed tab
Miscellaneous
? : Show help

しかしながら、「Ctrl + n」は chrome では、「新しいウインドウを開く」ショートカットに割り当てられているため、
タブ移動は「Ctrl + Tab」「Ctrl + Shift + Tab」を利用する必要があります。

※キーコンフィグ拡張機能で、「Ctrl + n」を無効にすることも有効かもしれません。(私は使っていませんが)


【所感】

vichrome と並行して使ってみていますが、vimium だけでは日本語検索ができないのが効率が悪く、このような記事を書いて
おきながらあれですが、デフォルトキー設定もどうせならと思い vichrome を覚えてしまい、vimium 劣勢なこの頃です。



以上。