1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MacOSでのbyobuのキーバインドの変更の仕方(コマンドの変更)

Last updated at Posted at 2025-10-08

はじめに

今回byobuというものを使用するにあたり、片手でコマンドを使いたいという人が変更できるような助けになればと思いきました。
個人的に、F2は片手で押すのが大変なため、キーバインドを変更した。

設定ファイルを作成する

~/.byobu/keybindings.tmux が存在しない場合は作成をする
基本的にkeybindings.tmux の中に新しいキーバインドを記述する

mkdir -p ~/.byobu
touch ~/.byobu/keybindings.tmux

キーバインドを記述する

基本文

unbind-key [元のキー] 
bind-key [新しいキー] [実行するコマンド]
  • unbind-key: 既存のキーバインドを無効
  • bind-key: 新しいキーバインドを割り当て
    • -n オプションを付けると、プレフィックスキー(デフォルトは Ctrl-a)なしで直接キーを割り当てらる
    • -r オプションを付けると、そのキーを連続して入力できるようになります(ウィンドウ移動などに便利)。

実際にキーバインドを記述する

主に、縦画面分割と横画面分割と新規ウィンド追加のキーバインドを記述する

# 元のキーバインドを解除
unbind-key S-F2 #縦画面分割
unbind-key C-F2 #横画面分割
unbind-key -n F2 #新規ウィンドウ


# Prefixなしで動作させたい場合
bind-key -n C-z split-window -h #縦画面分割
bind-key -n C-x split-window -v #横画面分割
bind-key -n M-w new-window #新規ウィンドウ

CCtrl
MOption
Optionキーは「Metaキー(M)」

設定の反映

ターミナルをexitしてセッションを終了させて、再度立ち上げる

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?