LoginSignup
17
17

More than 5 years have passed since last update.

Atomで特定のキーバインドによる操作が遅い場合の対策

Last updated at Posted at 2015-05-27

例えばctrl-kによる行削除が遅い場合

設定画面でctrl-kのキーバインドを表示すると、term2パッケージがctrl-kをプレフィックスキーに使っていることが確認できる。
この場合該当するキーバインドをunset!で上書きしても速度は改善されない。(Version 0.204.0で修正されている)

対策1: init.coffeeでキーバインドを削除する

# 特定のパッケージのキーバインドを削除する
removeKeymaps = (name) ->
  return unless pack = atom.packages.getLoadedPackage(name)
  for [keymapPath, map] in pack.keymaps
    console.log "remove keymap: #{keymapPath}"
    atom.keymaps.removeBindingsFromSource(keymapPath)

removeKeymaps('term2')

対策2: キーバインド無効化用のパッケージを使う

その為に以下のパッケージを作った。

disable-keybindings

対策3: keymap.csonで該当するキーバインドを全てunset!で上書きする

'atom-text-editor':
  'ctrl-k t down': 'unset!'
  'ctrl-k t left': 'unset!'

関連リンク

17
17
13

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
17
17