0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ghosttyでウィンドウ切り替えのキーバインドを設定する

0
Posted at

Ghosttyで複数ウィンドウを開いて作業しているとき、ウィンドウ間の切り替えをキーバインドで行う方法です。

goto_windowアクション

Ghostty 1.3.0で goto_window:nextgoto_window:previous というアクションが追加されました。同一アプリ内のウィンドウを順番に切り替えることができます。

まず、現在のキーバインドにこのアクションが割り当てられているか確認します。

ghostty +list-keybinds | grep goto_window

何も出力されなければ未設定なので、設定ファイルに追加します。

設定方法

~/.config/ghostty/config に以下を追記します。

keybind = super+alt+n=goto_window:next
keybind = super+alt+shift+n=goto_window:previous

この例では ⌘⌥N で次のウィンドウ、⌘⌥⇧N で前のウィンドウに切り替わります。キーは好みに合わせて変更してください。

設定を保存したらGhosttyを再起動し、複数ウィンドウを開いた状態で動作を確認してください。

バージョン確認

goto_window は1.3.0以降の機能です。バージョンは以下で確認できます。

ghostty +version

おまけ:その他の画面切り替え系キーバインド(macOS)

ウィンドウ切り替え以外にも、タブや分割画面のフォーカス切り替えはデフォルトで割り当てられています。

タブ切り替え

操作 キーバインド
前のタブ ⌘⇧[
次のタブ ⌘⇧]
タブ1〜8に移動 ⌘1⌘8
最後のタブに移動 ⌘9

分割画面(Split)のフォーカス切り替え

操作 キーバインド
前のSplitへ ⌘⌃[
次のSplitへ ⌘⌃]
上のSplitへ ⌘⌥↑
下のSplitへ ⌘⌥↓
左のSplitへ ⌘⌥←
右のSplitへ ⌘⌥→
Splitのズームトグル ⌘⇧Enter

現在のキーバインドは以下のコマンドで一覧できます。

ghostty +list-keybinds --default
0
2
0

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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?