分割Tmuxウィンドウは、vimのnosplitbelowとnosplitrightの動作をシミュレートします。

分割Tmuxウィンドウは、vimのnosplitbelowとnosplitrightの動作をシミュレートします。

Tmuxには、端末を水平方向と垂直方向に分割する一般的なキーバインディングがあります。ただし、現在アクティブなウィンドウの右下に分かれています。現在アクティブなウィンドウを分割して、新しいウィンドウを現在アクティブなウィンドウの左上に作成する方法はありますか?

ベストアンサー1

からman tmux

     split-window [-bdfhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane]
             [shell-command] [-F format]
                   (alias: splitw)
             Create a new pane by splitting target-pane: -h does a horizontal split and -v a
             vertical split; if neither is specified, -v is assumed.  The -l and -p options
             specify the size of the new pane in lines (for vertical split) or in cells (for
             horizontal split), or as a percentage, respectively.  The -b option causes the
             new pane to be created to the left of or above target-pane.  The -f option cre‐
             ates a new pane spanning the full window height (with -h) or full window width
             (with -v), instead of splitting the active pane.  All other options have the
             same meaning as for the new-window command.

したがって、次の行を入力し~/.tmux.confてそれを取得すると、目的のアクションが生成されます。この-bオプションに注意してください。

# pane splitting
bind -r v split-window -bh
bind -r b split-window -bv

おすすめ記事