# iTerm2でキーボードを使った操作を設定できる環境設定の「Keys」タブ URL: https://webrandum.net/iterm2-preferences-keys/ 公開日: 2022-06-10 更新日: 2022-06-10 カテゴリー: 作業環境整備 タグ: iTerm2 出典: Webrandum(著者: サイトウ マサカズ) iTerm2は環境設定の項目がかなり多く、今回はその中でもキーボードを使った操作に関する設定の「Keys」タブについてまとめておきます。 ## Keys メニューバーの[iTerm2]→[Preferences…]から環境設定を開いて、[Keys]タブを開きます。 そこから更に4つのタブに分かれています。 - Key Bindings:アクション関連のショートカットキー設定 - Navigation Shortcuts:タブやペイン移動などのナビゲーション関連のショートカットキー設定 - Hotkey:ターミナル表示用のショートカットキー設定 - Remap Modifiers:修飾キーのリマップ設定 ### Key Bindings [Key Bindings]ではアクション関連のショートカットキーを設定できます。 ![Key Bindingsタブ](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_1-7.png) デフォルトでは下記のショートカットキーが設定されています。 | 項目 | 内容 | ショートカットキー | | --- | --- | --- | | Cycle Tabs Forward | 直前に開いていたタブへ移動する | control + tab | | --- | --- | --- | | Cycle Tabs Backward | Cycle Tabs Forwardの逆順にタブ移動する | control + shift + tab | | --- | --- | --- | | Scroll One Line Up | 1行上にスクロールする | command + ↑ | | --- | --- | --- | | Scroll One Line Down | 1行下にスクロールする | command + ↓ | | --- | --- | --- | | Previous Tab | 左のタブへ移動する | command + ← | | --- | --- | --- | | Move Tab Left | 現在のタブを1つ左に移動する | shift + command + ← | | --- | --- | --- | | Next Tab | 右のタブへ移動する | command + → | | --- | --- | --- | | Move Tab Right | 現在のタブを1つ右に移動する | shift + command + → | | --- | --- | --- | | Scroll To Top | 一番上までスクロールする | command + Home | | --- | --- | --- | | Scroll To End | 一番下までスクロールする | command + End | | --- | --- | --- | | Scroll One Page Up | 1ページ分上にスクロールする | shift + Page Up | | --- | --- | --- | | Scroll One Page Up | 1ページ分上にスクロールする | command + Page Up | | --- | --- | --- | | Scroll One Page Down | 1ページ分下にスクロールする | shift + Page Down | | --- | --- | --- | | Scroll One Page Down | 1ページ分下にスクロールする | command + Page Down | | --- | --- | --- | 1番下の「+」アイコンでモーダルが開き、ショートカットキーとアクションを選択すれば追加も可能です。 ![ショートカットキーの追加](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_2-7.png) ### Navigation Shortcuts [Navigation Shortcuts]ではタブやペイン移動など、ナビゲーション関連のショートカットキー設定ができます。 ![Navigation Shortcutsタブ](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_3-6.png) | 項目 | 内容 | デフォルトショートカットキー | | --- | --- | --- | | Shortcut to activate a window | 別ウインドウへの切り替え方法を選択する No Shortcut option + 数字 command + 数字 option + command + 数字 control + 数字 | option + command + 数字 | | --- | --- | --- | | Shortcut to select a tab | 別タブへの切り替え方法を選択する No Shortcut option + 数字 command + 数字 option + command + 数字 control + 数字 | command + 数字 | | --- | --- | --- | | Shortcut to choose a split pane | 別ペインへの切り替え方法を選択する No Shortcut option + 数字 command + 数字 option + command + 数字 control + 数字 | No Shortcut | | --- | --- | --- | | Emulate U.S. Keyboard | 数字入力のために修飾キーが必要なキーボードレイアウトを 使っている場合に、USキーボードの数字キーに対応する場所で 反応するようにしてくれる | 「AZERTY配列」を使っている場合は数字入力に修飾キーが必要で、 修飾キー + 数字のショートカットキーが使えないので、そのための回避機能 | | --- | --- | --- | ### Hotkey [Hotkey]ではターミナル表示用のショートカットキー設定ができます。 ![Hotkeyタブ](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_4-6.png) 「Create a Dedicated Hotkey Window…」をクリックすると、ウインドウが開いて、ターミナルを画面上にオーバーラップで表示させるホットキーウインドウの設定ができます。 ちなみに、ホットキーウインドウを追加すると、新たに「Hotkey Window」プロファイルが作成されます。 ![「Create a Dedicated Hotkey Window...」](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_5-6.png) | 項目 | 内容 | 備考 | | --- | --- | --- | | Hotkey | ホットキーウインドウを表示するショートカットキーを設定 |   | | --- | --- | --- | | Double-tap key | 修飾キーの2回押しでも機能するようにする | 下記から修飾キーを選択する control shift option command | | --- | --- | --- | | Pin hot key window (stays open on loss of keyboard focus) | ホットキーで表示したウインドウを固定表示する (ウインドウにフォーカスしていないときも開いたままになる) |   | | --- | --- | --- | | Automatically reopen on app reaction | アプリの再アクティブ時に自動的に再度開く |   | | --- | --- | --- | | Animate showing and hiding | 表示・非表示にアニメーションを追加する |   | | --- | --- | --- | | Floating window | フローティングウインドウ機能をオンにする (他のウインドウやアプリ、Dockと重なって表示される) |   | | --- | --- | --- | | On Dock icon click | Dockアイコンをクリックしたときの動きを下記から選択する Don’t do anything special:特になにもしない Show this Hotkey Window:ホットキーウインドウを表示する Show this Hotkey Window if no other window is open: 他のウインドウが開いていない場合はホットキーウインドウを表示する |   | | --- | --- | --- | 「Show/hide all windows with a system-wide hotkey」では、すべてのウインドウの表示・非表示を切り替えるショートカットキーの設定ができます。 ### Remap Modifiers [Remap Modifiers]では修飾キーのリマップ設定ができます。 ![Remap Modifiersタブ](https://webrandum.net/mskz/wp-content/uploads/2022/06/image_6-5.png) | 項目 | 内容 | | --- | --- | | Remap control key to | controlキーのリマップ | | --- | --- | | Remap left option key to | 左optionキーのリマップ | | --- | --- | | Remap right option key to | 右optionキーのリマップ | | --- | --- | | Remap left command key to | 左commandキーのリマップ | | --- | --- | | Remap right command key to | 右commandキーのリマップ | | --- | --- | 個人的には、キーリマップするのであれば[Karabiner-Elements](https://webrandum.net/karabiner-elements/)を使ってMac全体で共通してリマップする方がオススメです。 [Karabiner-Elementsを使ってキーボードを快適に使えるように設定する](https://webrandum.net/karabiner-elements) 特定のアプリケーションのみ修飾キーが違うというのは混乱のもとですし、わざわざiTerm2だけ修飾キーを変えるメリットもありません。