[もう不要] LightTable で emacsキーバインディングの ctrl-f が検索になってしまう件の対処方法

Posted by YpsilonTAKAI On 2014年1月27日月曜日 0 コメント

いきさつ

emacs中毒患者としては、LightTableでもemacsと同じキーバインディングを使いたいですよね。 バージョン0.6では、emacsのキーバインディングがプラグインとして提供されているので、使ってみたのですが、なんと、ctrl-fがもともとのバインディングである検索のままになってしまうという、致命的な問題があります。

さっきに検索してたら、google.groupsに同じ問題を質問している人がいて、解決してました。

(2014/4/16)
新しいPCにLightTable入れてみたところ、emacsモードでctrl-fが使えない問題は解決してました。
詳細はまだ調べてませんけど、少なくとも、0.6.5ではこの対処は不要です。

LightTableでemacsのキーバインディング

LightTableでemacsのキーバインディングを使うには、user.behaviors ファイルの:editorのところに
:lt.plugins.emacs/activate-emacs を追加しします。

こんな感じです。

{:+ {
     ;; The app tag is kind of like global scope. You assign behaviors that affect
     ;; all of Light Table here
     :app [(:lt.objs.style/set-skin "dark")]
     ;; The editor tag is applied to all editors
     :editor [:lt.objs.editor/no-wrap
              (:lt.objs.style/set-theme "twilight")
              :lt.plugins.emacs/activate-emacs    ;; enable emacs key binding
              (:lt.objs.style/font-settings "M+ 1mn regular" 12 1.2)]
     ;; Here we can add behaviors to just clojure editors
     :editor.clojure [(:lt.objs.langs.clj/print-length 1000)]}
 ;; You can use the subtract key to remove behavior that may get added by
 ;; another diff
 :- {:app []}}


ctrl-fが使えるようにする

このままでは、ctrl-f としたときに、検索窓が開いてしまいますが、google.groupsのLightTableのグループにこの件の投稿があって、作者のChrisさんが返信しています

ただし、0.6.1以前のものにはバグがあって、以下の変更では動きません。
0.6.2 以降にアップデートしてから実施します。

方法は、user.keymapファイルの :editor.keys.normal から pmeta-f の設定を削除します。具体的には、以下のようなエントリを作成します。

user.keymap ファイル

{:+ {:app {}
     :editor {"alt-w" [:editor.watch.watch-selection]
              "alt-shift-w" [:editor.watch.unwatch]
              "shift-space" [:show-commandbar]}}
 :- {:editor.keys.normal ["pmeta-f"]}}  ;; to work ctrl-f on emacs mode
READ MORE