tmux customization - no more edge wrapping

I’m beginning to like it less that tmux will wrap around when you hit the last pane in some direction when switching panes. I found a [stack exchange answer] for a related issue that inspired the following configuration change:

bind h if -F '#{pane_at_left}'   '' 'select-pane -L'
bind j if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind k if -F '#{pane_at_top}'    '' 'select-pane -U'
bind l if -F '#{pane_at_right}'  '' 'select-pane -R'

Binds hjkl and to move in the corresponding vim direction, but it does nothing if sitting on that particular screen edge.

It’s a small thing, but lessens cognitive load when I’m too focused on some logic about the task at hand and not looking to see which pane I start in or land in when I’m trying to get things done.

Tags

#tmux

#cli

Navigation

index

tags

updated: 2024-01-23 06:33:02

generated: 2024-05-25