Files
dotfiles/tmux/.tmux.conf

80 lines
3.3 KiB
Bash

unbind C-b
set -g prefix C-a
bind C-a send-prefix
# More friendly split pane
bind-key h split-window -h
bind-key v split-window -v
bind - split-window -h
bind _ split-window -v
# Pane navigation
bind j select-pane -D \; display-panes
bind k select-pane -U \; display-panes
bind l select-pane -R \; display-panes
bind h select-pane -L \; display-panes
bind C-l last-pane \; display-panes
bind L last-pane \; display-panes
bind s swap-pane
# Window navigation
bind Tab last-window
bind Enter copy-mode
bind Escape copy-mode
# Switch windows or sessions
bind a choose-tree -sG
# Copy mode
set -g mode-keys vi # set vim keys
bind C-v paste-buffer
bind -T copy-mode-vi Enter send -X copy-selection-no-clear \; send -X copy-pipe-and-cancel "xclip -i -sel c" \; display " [tmux] copied!"
bind -T copy-mode-vi C-c send -X copy-selection-no-clear \; send -X copy-pipe-and-cancel "xclip -i -sel c" \; display " [tmux] copied!"
bind -T copy-mode-vi y send -X copy-selection-no-clear \; send -X copy-pipe "xclip -i -sel c" \; display " [tmux] copied!"
bind -T copy-mode-vi c send -X clear-selection \; display " [tmux] Selection cleared"
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi f send -X search-backward
# Window actions
# bind y rename-window
bind r source-file ~/.tmux.conf #; display " [tmux] ♦ Configuration reloaded from .tmux.conf"
# Colors
set -g display-panes-active-colour colour71
set -g display-panes-colour colour244
# Set text modes
#set -g utf8 on
#set-option -g status-utf8 on
set -g default-terminal "xterm-256color"
# Scrollback buffer
set -g history-limit 64000
# Enable mouse integration
set -g mouse on
set -g status-bg colour235
set -g status-fg colour255
set -g status-left '#(sh ~/.tmux/health-indicator.sh #{client_prefix})#(~/.tmux/segment.sh end 29) ▣ #{session_windows} #{?session_group_many_attached,#(~/.tmux/subsegment.sh end) 🖥 #{session_group_attached},}#(~/.tmux/segment.sh end 29 71) #[fg=colour235]#H #(~/.tmux/segment.sh end 71 65) #[fg=colour235]#(whoami) #(~/.tmux/segment.sh end 65 235)'
set -g status-left-length 80
set -g status-right-length 120
set -g status-justify centre
set -g status-interval 1
set -g window-status-format '#(~/.tmux/segment.sh start 235 237 round)#I#(~/.tmux/subsegment.sh end 234) #W #(~/.tmux/segment.sh end 237 235 round)'
set -g window-status-current-format '#(~/.tmux/segment.sh start 235 71 round)#[fg=colour235]#I#(~/.tmux/subsegment.sh end 234)#[fg=colour235] #W #(~/.tmux/segment.sh end 71 235 round)'
set -g window-status-current-format '#(~/.tmux/segment.sh start 235 71 round)#[fg=colour235]#I#(~/.tmux/subsegment.sh end 234)#[fg=colour235] #W #(~/.tmux/segment.sh end 71 235 round)'
set -g status-right '#{?#(~/.tmux/mediaplaying.sh test),#(~/.tmux/segment.sh start 235 65)#[fg=colour235] ♫ #(~/.tmux/mediaplaying.sh) #(~/.tmux/segment.sh start 65 71),#(~/.tmux/segment.sh start 235 71)}#[fg=colour235] %H:%M:%S #(~/.tmux/subsegment.sh start) %d %b '
set -g pane-active-border-style fg=colour76
# Pane titles
set -g pane-border-status top
set -g pane-border-format "#(~/.tmux/segment.sh start)#[reverse] #{pane_index} - #{pane_title} #[default]#(~/.tmux/segment.sh end)"