GMailとLocationChange

Gmail用に

  autocommands.add(
    'LocationChange',
    /mail\.google\.com\/(mail|a)\//,
    function () {
      liberator.log('meow');
      plugins.feedKey.setup(
        "c / y j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc".split(/ +/).map(function(i) [i, "4" + i])
      )
    }
  );

こういうのを書くと、違うメールに移動するたびに実行されちゃう。
特に問題もないけど、ちょっと気になる。
ex_autocmd.js の TabLeave / TabSelect の方が良いかな。

  autocommands.add(
    'TabLeave',
    /.*/,
    function () {
      liberator.plugins.feedKey.reset();
    }
  )
  // GMail
  autocommands.add(
    'TabSelect',
    /mail\.google\.com\/(mail|a)\//,
    function () {
      plugins.feedKey.setup(
        "c / y j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc".split(/ +/).map(function(i) [i, "4" + i])
      )
    }
  );

これで良いかと思っていたら

Fx再起動直後は、:fmap されないようだ。
タブを選んだ訳じゃないので当然かもしれないが、うああ。

:topen

でもだめか。
もどそ。

feedSomeKeys.js

以前書いた仮想キーコードのパッチのやつを、

liberator.plugins.feedKey.setup(...., true)
:fmap! ...

とすれば、仮想キーコードを使うようになる。
という感じにしてみて、勝手にコミットした。

Google Reader なら下のような感じになる。
第二引数に true を指定するのがポイント。

  liberator.plugins.feedKey.setup(
    "n p v O N P x j k s S A J K = - gh gt gd".split(/ +/).map(function(i) [i, "4" + i]),
    true
  );

コマンドでやる場合は、

  :fmap! j

とかでOK。