fix(tmux.conf): change base index to 1 for consistency with other tools

feat(tmux.conf): add support for attach-session command to allow attaching to a session from any directory
refactor(tmux.conf): reorganize bindings and commands for better readability
This commit is contained in:
David Ibia
2025-01-09 01:27:56 +01:00
parent 1bbd1b3642
commit 1dbc6d4937

View File

@@ -28,6 +28,9 @@ unbind -T copy-mode-vi MouseDragEnd1Pane
unbind % unbind %
bind | split-window -h -c '#{pane_current_path}' bind | split-window -h -c '#{pane_current_path}'
# Set base index to 1
set -g base-index 1
setw -g pane-base-index 1
# Set kill pane to Shift + Option + X # Set kill pane to Shift + Option + X
bind -n M-X kill-pane bind -n M-X kill-pane
@@ -36,6 +39,9 @@ bind -n M-X kill-pane
unbind '"' unbind '"'
bind - split-window -v -c '#{pane_current_path}' bind - split-window -v -c '#{pane_current_path}'
unbind 'C'
bind C attach-session -c "#{pane_current_path}"
# Setting up window movement with leader key + Left/Right arrow # Setting up window movement with leader key + Left/Right arrow
bind Left swap-window -t -1\; select-window -t -1 bind Left swap-window -t -1\; select-window -t -1
bind Right swap-window -t +1\; select-window -t +1 bind Right swap-window -t +1\; select-window -t +1