Thunderbirdのキーバインドカスタマイズ


Thunderbird for MacOS XのキーバインドをEmacs風にカスタマイズ。なかなか快適!

 ThunderbirdMozillaのキーバインドのカスタマイズ方法はもじら和訳プロジェクト に紹介されている通りだが、メール編集画面(Mozillaではeditor)の設定例がない。いろいろ試してみたらうまく行ったのでご紹介。これでMail.appとほぼ同じくらいの快適性となった。
 Thunderbirdのユーザキーバインド設定はuserHTMLBindings.xmlに書き込んで、Thunderbird.appパッケージ本体の${Thunderbird}/Contents/MacOS/res/builtinに保存し、再起動すれば反映される。本来、ユーザカスタマイズ・ファイルは個人用プロファイルディレクトリの中に入れるのがMozillaの流儀なのだが、バグのために動作しないらしい。
 さて肝心のuserHTMLBindings.xmlの中身だが、例えばCTRL-HでBackspace動作をさせるためには、次のように書く。
---- cut here ---- cut here ----
<?xml version="1.0"?>

<!-- In order to work correctly, this file must live in the -->
<!-- res/builtin directory of the mozilla tree. -->

<bindings id="htmlBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <binding id="editorUser">
      <handlers>
        <handler event="keypress" key="h" modifiers="control" command="cmd_deleteCharBackward"/>
      </handlers>
  </binding>
</bindings>
---- cut here ---- cut here ----

 これだけでもずいぶん編集作業が楽になるはずである。あとはhandler eventの行をどんどん増やして行けばCTRL-FとかCTRL-Dなども定義できる。editorで使えるコマンドは、もじらの和訳プロジェクト のドキュメントを参考にすればほとんどの設定が可能であろう。
 MacOS Xは、デフォルトの修飾キーがCommandキーなのでこんな風にControlキーに簡単に追加できるのだが、Windows版ではもうひとひねり必要ではないかな?

Posted: 2004年07月03日 (土) at 12:43