Skip to content

Commit

Permalink
update: tmux reorder windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wongsingfo committed Jan 4, 2024
1 parent 4e2b477 commit 40a725f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions stow-dotfiles/tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ bind j select-pane -D
bind h select-pane -L
bind l select-pane -R

# The default key-binding for 'last-window' is 'l'. We change it to '^' (which
# can swtich buffer in vim), because we have bound 'l' to 'select-pane'.
bind ^ last-window
# The default key-binding for 'last-window' is 'l'. We change it to 'o',
# because we have bound 'l' to 'select-pane'.
bind o last-window

bind -r K resize-pane -U 5
bind -r J resize-pane -D 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5

# https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
bind -r C-h swap-window -t -1\; select-window -t -1
bind -r C-l swap-window -t +1\; select-window -t +1

# Join the last active pane to the current window
bind W "join-pane -s !"
# Move current pane to a new window
Expand All @@ -49,12 +53,16 @@ bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

# quickly reload the config
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind R source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind r move-window -r \; display-message "requested renumbering"

# use vi keys to naviage in copy mode (enter `prefix+[`)
# use `enter` to copy, and `prefix+]` to paster
set-window-option -g mode-keys vi

# make the message stay longer (default is 750 ms)
set -g display-time 1000

# don't suspend-client
unbind C-z

Expand All @@ -68,7 +76,7 @@ bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'ca
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# set -g renumber-windows on

# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
Expand Down

0 comments on commit 40a725f

Please sign in to comment.