LoginSignup
11

More than 5 years have passed since last update.

Atom の package で定義されているキーバインドを変更する方法

Posted at

TL;DR

  • キーバインドを無効にしたい時は unset! を使う。
  • キーバインドを変更したい時は無効にしてから定義する。

キーバインドを無効/変更する

新しく git-blame というパッケージを追加した。
しかし、このパッケージのキーバインドが ctrl-b になっているのが問題だ。
git-blame は便利なコマンドだけど、この一等地を使うほど重要なコマンドじゃない。
ctrl と n,p,f,b の組み合わせはカーソル移動で使いたい。そう脳と身体に刻まれてる。

なので keymap.cson を編集して git-blame のキーバインドを変更した。

keymap.cson
'.editor':
  # キーバインドを無効にする
  'ctrl-b': 'unset!'
  # キーバインドを再定義する
  'alt-cmd-b': 'git-blame:toggle'

単にキーバインドを変更するだけであれば unset! を指定すればいい。

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11