禁断の快楽・変態キーバインドのお誘い

増井俊之氏がセミコロンにエンターをバインドしているという話が頭から離れなかった。もういっそのこと彼以上の変態キーバインドにしてしまおう。コンセプトはホームポジションから一切手を離さずに日常の動作を行うこと。使用ソフトはVista以外のWindows用窓使いの憂鬱(以下mayu)だ(Windows Server 2003 Resource Kit Toolsこのようなソフトウェアもあるらしい。thanks>infohack氏)。
まず感想。いざ慣れると、いかにいままで遠いキーに振り回されていたかが痛感できた。ホームポジション近辺だけで文章やコードが打てるのがこんなに快適だとは正直思わなかった。真似したい人は少ないかも知れないが、大げさではなく、本当に流れるように文章やコードが打てる。
エンター
まず、増井俊之氏の言うとおり思い切ってセミコロンキーをエンターにしてみた。するとこれが想像を絶する快適さ。エンターって打つ時「バン!」って感じで小指を飛ばしちゃいますが、これは本当に舐めるようにタイプできる。すばらしいの一言。病み付きになりますよ。あらためて増井俊之氏は凄い人だ。
CapsLockとControl
以下、Controlを駆使するので、不幸にもAの横にCapsLockがある人のためにCapsLockとControlを入れ替える設定も書いておいた。そうでない人はそのままで大丈夫。
セミコロン
しかしエンターキーをセミコロンにするのには抵抗があった。マウス操作から帰ってくるとセミコロンキー(エンター)は打ちにくい。それにセミコロンを打つたびにエンターキーまで小指が遠征するのはコンセプトに反している。そこでエンターキーはそのまま生かすことにした。そしてCtrl+;でセミコロンを打つようにした。同じキーなので直感的でもある。ホームポジションも崩れない。Shift+EnterやCtrl+Enterが使えない難点があるが、そういうときだけ元々のエンターキーを使えばよい。
バックスペース
次にバックスペース。遠いキーだ。これにはCtrl+hを使うようにした。バックスペースは連打することが多いのだが小指は連打に向かない。人差し指が使えるメリットは大きい。Ctrl+hには元々BSが割り当てられているのだし、viの戻るもhキーなのですぐ慣れた(*1)。なおBSキーも片手で打てる利点があるのでこれもそのまま残すことに。
なお、WindowsでもCtrl+hは元々バックスペースとして働くのだが、ショートカットが割り当てられているとそちらが優先されてしまうので(例:Firefox)改めてバインドしなおした方が良い。
エスケープ
次。エスケープキー。vi使いはエスケープキーの遠さは致命的だ。これもCtrl+hと同じ理由でCtrl+[にした。この2つはUNIXで操作する時に全く問題がでないというメリットもある。エスケープキーもマウス操作中にダイアログをキャンセルしたい時などに便利なのでそのまま生かすことに。
IME
そしてWindowsで一番ホームポジションが崩れるのがIMEのスイッチだ。この配置は嫌がらせとしか思えない。そこでAlt+スペースでIME/ON、Shift+スペースでIME/OFFになるようにした(Macintoshを意識した)(*3)。これがまたすばらしすぎる。今までAlt+~(JIS配列の人はAlt+漢字)の奴隷になっていたのが良く分かる。ONとOFFのキーを分けることで、現在のIMEの状態を気にすることもない。これで日本語のタイプ速度がぐっと上昇した。
なお日本語配列では変換キー、無変換キーをIMEのOn/Offにバインドしている人が多いようだ。日本語キーボードの変換・無変換キーは親指で押せる位置にあるので良いかも知れない。
矢印
最後は矢印だ。vi風のhjklを色々考えてみたのだが、ダメだった。しかし、よく考えてみるとtcshなどでemacsの上下左右には慣れ親しんでいることに気がついたのでemacs風バインドを追加してみた。ただし、検索のCtrl+Fとかぶるなど問題点も多く、結局あきらめた。
改めて感想
しかしホームポジションから手を離さずにプログラミングや日本語入力をするのがこんなに快適だとは思ってみなかった。頻繁に小指を伸ばしたり、ホームポジションから指を外したりするのは、想像以上にストレスになっていたようだ。
私の方法はエンターもBSもEscもそのままなので、なかなか矯正できない人はこれらのキーを一時的に殺すとすぐ慣れるようになる(*2)。これらのキーを殺す設定も併記しておく(*4)。
設定方法
以下設定。mayuをインストールして、C:\Documents and Settings\yourname\.mayuファイルに書く。注意。1行目は使っているキーボードで変えるように!これはUS配列(@マークが左上にある)用の設定である。JIS配列(@マークが右側にある)の人はinclude "109.mayu"としよう。
include "104.mayu" # 104 キーボード設定 # include "109.mayu" # JIS配列の場合はこちら # CapsLockをControlに mod control += CapsLock key *CapsLock = *LControl # 109な方はこちら #mod control += 英数 #key *英数 = *LControl # セミコロンをエンターに key *IC-SemiColon = Enter # Ctrlを押しながらだとセミコロンに key *IC-C-~S-SemiColon = SemiColon # Ctrl+hをバックスペースに key *IC-C-H = BS # Ctrl+[をエスケープに(vi仕様) key C-OpenBracket = ESC & Sync & SetImeStatus(off) key IC-C-OpenBracket = ESC ESC & Sync & SetImeStatus(off) # vi使わない人はこちらの1行でよい(直上の2つの設定はいらない) # key *IC-C-OpenBracket = ESC # Alt+スペース、Shift+スペースでIMEのON/OFF key *IC-M-Space = &Sync &SetImeStatus(on) key *IC-S-Space = &Sync &SetImeStatus(off) # 日本語キーボードの方はこちらの方が便利かも知れない # key *IC-変換 = &Sync &SetImeStatus(on) # key *IC-無変換 = &Sync &SetImeStatus(off) # emacs風矢印 key C-B = Left # ← key C-P = Up # ↑ key C-N = Down # ↓ key C-F = Right # → key S-C-B = S-Left # ←(選択) key S-C-F = S-Right # →(選択) key S-C-N = S-Down # ↓(選択) key S-C-P = S-Up # ↑(選択) # 矯正用(*4)(既存キーを殺します。コメント(#)を外すと有効に) # key BS = &Undefined # key Enter = &Undefined # key ESC = &Undefined
注釈
- (*1)そもそもviの「戻る」がhなのは、Ctrl+hがBSであることに由来するらしい(Bill Joy氏使用のターミナルが由来だということです。えりむさんありがとうございます)
- (*2)ただしIMEは殺さない方がいい。なぜか、まれにIMEのON/OFFが効かなくなることがあるからだ。こういう時はデフォルトのIME切り替えで日本語打ったり英字を打ったりするとすぐ治る。
- (*3)なお、これは当方がUS配列だからであって、JIS配列の方は「変換」「無変換」キーにそれぞれIMEのON/OFFを割り当てている方が多いようだ。
- (*4)万一書き間違えなどでエンターが打てない!などとなってもパニックにならずに、ツールバー右下のアイコンを右クリックして「一時停止」を選べば大丈夫。設定を見直して「再読み込み」させればよい。
訂正
初校でまつもとゆきひろ氏と書いてしまったが、指摘があったので読み直してみたら増井俊之氏の間違いだったので訂正した。両氏にはご迷惑をおかけしたことをお詫びすると同時に、間違いをご指摘くださった方に感謝。
2011/12/09 - 19:27:10 -
Related……
[… ]just beneath, are numerous totally possibly not related sites to our bait, however, they are absolutely worth going over[… ]……
2011/12/09 - 23:43:30 -
Informative and precise
Its hard to find informative and precise information but here I found
2011/12/10 - 00:00:58 -
Check this out
[…] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[…]…
2011/12/10 - 11:30:28 -
Check this out
[…] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[…]…
2011/12/10 - 12:16:27 -
Check this out
[…] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[…]…
2011/12/10 - 13:45:57 -
The best website……
[…]here are some links to sites that we link to because we think they are worth visiting[…]……
2011/12/10 - 15:22:59 -
Yahoo News
When checking out Yahoo News today I found this
2011/12/11 - 00:32:40 -
Sites we Like…
[…] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose […]…
2011/12/11 - 01:31:57 -
Read was interesting, stay in touch…
[…]please visit the sites we follow, including this one, as it represents our picks from the web[…]…
2011/12/11 - 05:18:41 -
Read was interesting, stay in touch…
[…]please visit the sites we follow, including this one, as it represents our picks from the web[…]…
2011/12/11 - 07:05:38 -
Skills For Life
[…]Thank you for posting this exciting facts. I’ll check your internet site inside the future.[…]
2011/12/11 - 15:55:02 -
Bing results
While searching Bing I found this page in the search results and I didn’t think it match
2011/12/11 - 18:56:19 -
abeles
Hey There. I found your blog using msn. This is a very good written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback.
2011/12/12 - 01:56:19 -
Website Trackback Link
[…]the time to read or visit the content or sites we have linked to below the[…]
2011/12/12 - 01:56:19 -
Websites You Should Visit
[…]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[…]
2011/12/12 - 02:43:10 -
Read was interesting, stay in touch…
[…]please visit the sites we follow, including this one, as it represents our picks from the web[…]…
2011/12/12 - 08:15:16 -
Websites you should visit
[…]below you’ll find the link to some sites that we think you should visit[…]…
2011/12/12 - 09:49:03 -
Yahoo results
While searching Yahoo I found this page in the results and I thought it looked interesting
2011/12/12 - 11:33:31 -
Visitor recommendations
[…]one of our visitors recently recommended the following website[…]…
2011/12/12 - 11:58:20 -
dateing
Hi! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no backup. Do you have any methods to prevent hackers?
2011/12/12 - 13:37:35 -
Interesting….
A very neat post.
2011/12/12 - 14:20:37 -
Cool sites…
[…]we came across a cool site that you might enjoy. Take a look if you want[…]……
2011/12/12 - 18:23:17 -
Read was interesting, stay in touch…
[…]please visit the sites we follow, including this one, as it represents our picks from the web[…]…
2011/12/12 - 19:49:58 -
Superb website
[…]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[…]…
2011/12/13 - 02:31:02 -
mudjacking Kansas City
[…] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose […]?
2011/12/13 - 12:59:28 -
Interesting….
A very neat post.
2011/12/13 - 14:59:35 -
Just Looking
When I was surfing today I noticed a excellent post about
2011/12/14 - 02:05:04 -
Interesting….
A very interesting post.
2011/12/14 - 02:16:29 -
Tumblr
Tumblr linked to this site
2011/12/14 - 08:01:03 -
Great website
[…]we like to honor many other internet sites on the web, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[…]…
2011/12/14 - 11:35:48 -
Bing results
While searching Bing I found this page in the search results and I didn’t think it match
2011/12/14 - 20:01:02 -
Recommeneded websites
[…]Here are some of the sites we recommend for our visitors[…]…
2011/12/15 - 03:37:37 -
News
I was reading the Yahoo news and I saw this really interesting topic
2011/12/15 - 10:59:51 -
Digg
While checking out DIGG today I found this
2011/12/15 - 13:35:33 -
Digg
While checking out DIGG today I noticed this
2011/12/15 - 13:55:44 -
Recommeneded websites
[…]Here are some of the sites we recommend for our visitors[…]…
2011/12/15 - 18:34:48 -
Check this out
[…] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[…]…
2011/12/15 - 21:19:25 -
dating site
Incredible! This blog looks just like my old one! It’s on a entirely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
2011/12/15 - 22:54:33 -
Cool sites
[…]we came across a super site that you might enjoy. Take a look if you want[…]…
2011/12/16 - 00:40:22 -
Bing results
While searching Bing I discovered this page in the search results and I didn’t think it match
2011/12/16 - 10:42:55 -
Dreary Day
It was a dreary day here today, so I just took to piddeling around on the internet and realized
2011/12/16 - 11:12:05 -
……..
I guess for now i am going to be satisfied with book-marking and including the Feed for you to my personal Yahoo consideration. I look ahead to new changes and can share this kind of website along with my personal Facebook or myspace class.
2012/01/25 - 17:40:47 -
By TNF , for example, clothes lanyard for the different clothes and different, but most are nylon, and most of the color gray, red, black, etc., some of the same material or fabric and clothing.Following the issue to a lot of pictures show the different clothes, strap structure, color, form will be very different. North Face design will be different depending on the clothes of the lanyard.