2021年1月20日水曜日

Windows Terminal すべてのキー割り当てを解除するためのKeybindingsデータ

 Widnows Terminalでは、デフォルトのキー割り当てがあるのだが、機能が多い分、多数のキー割り当てが使われている。しかし、キー割り当ては、Windows Terminal内部でのデフォルト値として設定されているため、解除するには、個々にunbindコマンドで割り当てを解除する方法しかない。そこで、すべてのキー割り当てを解除するsetings.jsonの“Keybindings”セクションを作った。

 これをsettings.jsonにある、"Keybindings"に置き換えると、Ctrl+Shift+P以外のキー割り当てがすべて解除される。デフォルトのキー設定が必要な場合には、その行を「//」を使って注釈行とすることで、デフォルト設定が有効になり、キー割り当てが有効になる。

 たとえば、クリップボードのコピー("action": "copy")は、デフォルトではCtrl+Cに割り当ててあるが、それは、

{ "command": "unbind", "keys": "ctrl+c" }, // {"action": "copy", "singleLine": false }  = ctrl+c

としてある。この行の先頭に「//」を付ければ、注釈になり、デフォルトのCtrl+Cが有効になる。

 Keybindingsセクションはキーコード順に並べてある。これは、キーから探すことが多いと考えられるからだ。元の機能は同じ行にCommand:やActionを注釈でつけているので、機能から探すときには、JSONエディタ側の検索機能を使う。

 全部unbindしてしまうと困るだろうからコマンドパレット(commandPalette)の割り当てであるCtrl+Shift+pだけは有効にしてある。なお、Windows Terminalのキー割り当てなどについては、以下の記事を参考にしてほしい。

【Windows Terminal完全マスター】プロファイルにキーボードショートカットを設定する:Windows 10 The Latest - @IT

Windows Terminalの設定に関しては、以下の記事がある。

【Windows Terminal完全マスター】プロファイルをカスタマイズして使いやすくしよう


Keybindingsのリスト

  1. "keybindings":
  2. [
  3. //{ "command": "unbind", "keys": "ctrl+shift+p" }, // commandPalette = ctrl+shift+p
  4. { "command": "unbind", "keys": "ctrl+," }, // openSettings = ctrl+,
  5. //
  6. { "command": "unbind", "keys": "ctrl+c" }, // {"action": "copy", "singleLine": false } = ctrl+c
  7. { "command": "unbind", "keys": "ctrl+v" }, // paste = ctrl+v
  8. //
  9. { "command": "unbind", "keys": "alt+down" }, // { "action": "moveFocus", "direction": "down" } = alt+down
  10. { "command": "unbind", "keys": "alt+enter" }, // toggleFullscreen = alt+enter
  11. { "command": "unbind", "keys": "alt+f4" }, // closeWindow = alt+f4
  12. { "command": "unbind", "keys": "alt+left" }, // { "action": "moveFocus", "direction": "left" } = alt+left
  13. { "command": "unbind", "keys": "alt+right" }, // { "action": "moveFocus", "direction": "right" } = alt+right
  14. { "command": "unbind", "keys": "alt+shift+-" }, // { "action": "splitPane", "split": "horizontal" } = alt+shift+-
  15. { "command": "unbind", "keys": "alt+shift+d" }, // { "action": "splitPane", "split": "auto", "splitMode": "duplicate" } = alt+shift+d
  16. { "command": "unbind", "keys": "alt+shift+down" }, // { "action": "resizePane", "direction": "down" } = alt+shift+down
  17. { "command": "unbind", "keys": "alt+shift+home" }, // {"command":"togglePaneZoom","keys":"alt+shift+home"},
  18. { "command": "unbind", "keys": "alt+shift+left" }, // { "action": "resizePane", "direction": "left" } = alt+shift+left
  19. { "command": "unbind", "keys": "alt+shift+plus" }, // { "action": "splitPane", "split": "vertical" } = alt+shift+plus
  20. { "command": "unbind", "keys": "alt+shift+right" }, // { "action": "resizePane", "direction": "right" } = alt+shift+right
  21. { "command": "unbind", "keys": "alt+shift+up" }, // { "action": "resizePane", "direction": "up" } = alt+shift+up
  22. { "command": "unbind", "keys": "alt+up" }, // { "action": "moveFocus", "direction": "up" } = alt+up
  23. { "command": "unbind", "keys": "ctrl+-" }, // { "action": "adjustFontSize", "delta": -1 } = ctrl+-
  24. { "command": "unbind", "keys": "ctrl+0" }, // resetFontSize = ctrl+0
  25. { "command": "unbind", "keys": "ctrl+=" }, // { "action": "adjustFontSize", "delta": 1 } = ctrl+=
  26. { "command": "unbind", "keys": "ctrl+alt+," }, // { "action": "openSettings", "target": "defaultsFile" } = ctrl+alt+,
  27. { "command": "unbind", "keys": "ctrl+alt+1" }, // { "action": "switchToTab", "index": 0 } = ctrl+alt+1
  28. { "command": "unbind", "keys": "ctrl+alt+2" }, // { "action": "switchToTab", "index": 1 } = ctrl+alt+2
  29. { "command": "unbind", "keys": "ctrl+alt+3" }, // { "action": "switchToTab", "index": 2 } = ctrl+alt+3
  30. { "command": "unbind", "keys": "ctrl+alt+4" }, // { "action": "switchToTab", "index": 3 } = ctrl+alt+4
  31. { "command": "unbind", "keys": "ctrl+alt+5" }, // { "action": "switchToTab", "index": 4 } = ctrl+alt+5
  32. { "command": "unbind", "keys": "ctrl+alt+6" }, // { "action": "switchToTab", "index": 5 } = ctrl+alt+6
  33. { "command": "unbind", "keys": "ctrl+alt+7" }, // { "action": "switchToTab", "index": 6 } = ctrl+alt+7
  34. { "command": "unbind", "keys": "ctrl+alt+8" }, // { "action": "switchToTab", "index": 7 } = ctrl+alt+8
  35. { "command": "unbind", "keys": "ctrl+alt+9" }, // { "action": "switchToTab", "index": 8 } = ctrl+alt+9
  36. { "command": "unbind", "keys": "ctrl+insert" }, // { "action": "copy", "singleLine": false } = ctrl+insert
  37. { "command": "unbind", "keys": "ctrl+shift+1" }, // { "action": "newTab", "index": 0 } = ctrl+shift+1
  38. { "command": "unbind", "keys": "ctrl+shift+2" }, // { "action": "newTab", "index": 1 } = ctrl+shift+2
  39. { "command": "unbind", "keys": "ctrl+shift+3" }, // { "action": "newTab", "index": 2 } = ctrl+shift+3
  40. { "command": "unbind", "keys": "ctrl+shift+4" }, // { "action": "newTab", "index": 3 } = ctrl+shift+4
  41. { "command": "unbind", "keys": "ctrl+shift+5" }, // { "action": "newTab", "index": 4 } = ctrl+shift+5
  42. { "command": "unbind", "keys": "ctrl+shift+6" }, // { "action": "newTab", "index": 5 } = ctrl+shift+6
  43. { "command": "unbind", "keys": "ctrl+shift+7" }, // { "action": "newTab", "index": 6 } = ctrl+shift+7
  44. { "command": "unbind", "keys": "ctrl+shift+8" }, // { "action": "newTab", "index": 7 } = ctrl+shift+8
  45. { "command": "unbind", "keys": "ctrl+shift+9" }, // { "action": "newTab", "index": 8 } = ctrl+shift+9
  46. { "command": "unbind", "keys": "ctrl+shift+c" }, // { "action": "copy", "singleLine": false } = ctrl+shift+c
  47. { "command": "unbind", "keys": "ctrl+shift+d" }, // duplicateTab = ctrl+shift+d
  48. { "command": "unbind", "keys": "ctrl+shift+down" }, // scrollDown = ctrl+shift+down
  49. { "command": "unbind", "keys": "ctrl+shift+f" }, // find = ctrl+shift+f
  50. { "command": "unbind", "keys": "ctrl+shift+pgdn" }, // scrollDownPage = ctrl+shift+pgdn
  51. { "command": "unbind", "keys": "ctrl+shift+pgup" }, // scrollUpPage = ctrl+shift+pgup
  52. { "command": "unbind", "keys": "ctrl+shift+space" }, // openNewTabDropdown = ctrl+shift+space
  53. { "command": "unbind", "keys": "ctrl+shift+t" }, // newTab = ctrl+shift+t
  54. { "command": "unbind", "keys": "ctrl+shift+tab" }, // prevTab = ctrl+shift+tab
  55. { "command": "unbind", "keys": "ctrl+shift+up" }, // scrollUp = ctrl+shift+up
  56. { "command": "unbind", "keys": "ctrl+shift+v" }, // paste = ctrl+shift+v
  57. { "command": "unbind", "keys": "ctrl+shift+w" }, // closePane ctrl+shift+w
  58. { "command": "unbind", "keys": "ctrl+tab" }, // nextTab = ctrl+tab
  59. { "command": "unbind", "keys": "f11" }, // toggleFullscreen = f11
  60. { "command": "unbind", "keys": "shift+insert" }, // paste = shift+insert
  61. { "command": "unbind"}
  62. ]

0 件のコメント:

コメントを投稿