161 lines
4.7 KiB
Plaintext
161 lines
4.7 KiB
Plaintext
# Set the default TERM
|
|
set -g default-terminal tmux-256color
|
|
|
|
# Update the TERM variable of terminal emulator when creating a new session or attaching a existing session
|
|
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
|
|
|
|
# Truecolor
|
|
set -ga terminal-overrides ",xterm-termite:Tc"
|
|
|
|
# Set Zsh as default Tmux shell
|
|
set-option -g default-shell /bin/zsh
|
|
|
|
# Tmux uses a 'control key', let's set it to 'Ctrl-a'
|
|
# Reason: 'Ctrl-a' is easier to reach than 'Ctrl-b'
|
|
unbind C-b
|
|
set-option -g prefix C-a
|
|
bind-key C-a send-prefix
|
|
|
|
# No delay for escape key press
|
|
set -sg escape-time 0
|
|
|
|
# Pane navigation
|
|
# Switch panes using Alt-arrow without prefix
|
|
bind -n M-Left select-pane -L
|
|
bind -n M-Right select-pane -R
|
|
bind -n M-Up select-pane -U
|
|
bind -n M-Down select-pane -D
|
|
bind , swap-pane -D # swap current pane with the next one
|
|
bind . swap-pane -U # swap current pane with the previous one
|
|
|
|
# Urxvt tab like window switching (-n: no prior escape seq)
|
|
bind -n S-down new-window
|
|
bind -n S-left prev
|
|
bind -n S-right next
|
|
bind -n C-left swap-window -t -1
|
|
bind -n C-right swap-window -t +1
|
|
|
|
# Pane resizing & splitting
|
|
bind -r H resize-pane -L 2
|
|
bind -r J resize-pane -D 2
|
|
bind -r K resize-pane -U 2
|
|
bind -r L resize-pane -R 2
|
|
|
|
bind-key | split-window -h -c "#{pane_current_path}"
|
|
bind-key - split-window -v -c "#{pane_current_path}"
|
|
unbind '"'
|
|
unbind %
|
|
|
|
# Split full window
|
|
bind-key M-| split-window -fh -c "#{pane_current_path}"
|
|
bind-key M-- split-window -fv -c "#{pane_current_path}"
|
|
|
|
# Equalize splits with x
|
|
unbind space
|
|
bind X select-layout even-vertical
|
|
|
|
# Mouse support
|
|
setw -g mouse on
|
|
|
|
setw -g mode-keys vi
|
|
|
|
# Copy/paste. Selecting any text with mouse automatically copies it to the clipboard
|
|
#bind-key -t vi-copy y copy-pipe "xsel -i -p -b"
|
|
#bind-key -t vi-copy C-S-c copy-pipe "xsel -i -p -b"
|
|
#bind-key -t vi-copy MouseDragEnd1Pane copy-pipe "xsel -i -p -b"
|
|
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
|
|
bind -n C-S-v run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
|
|
bind-key C-S-v run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
|
|
|
|
# Toggle copymode
|
|
bind Escape copy-mode
|
|
|
|
# Use Ctrl-arrows to navigate text
|
|
set-window-option -g xterm-keys on
|
|
|
|
# No more confirmation dialogs
|
|
bind-key & kill-window
|
|
bind-key x kill-pane
|
|
|
|
#######################
|
|
### KEEP IT GAY ###
|
|
#######################
|
|
|
|
set -g status-interval 1
|
|
|
|
setw -g aggressive-resize on
|
|
|
|
# Set the numbering of windows to go from 1
|
|
set-option -g base-index 1
|
|
setw -g pane-base-index 1
|
|
set -g renumber-windows on
|
|
|
|
# Auto-set terminal title to current window pane's title
|
|
set-option -g set-titles on
|
|
set-option -g set-titles-string '#{pane_current_command}'
|
|
set-window-option -g automatic-rename on
|
|
|
|
# 24 hour clock
|
|
setw -g clock-mode-style 24
|
|
|
|
# Download and search torrent
|
|
bind-key M-t new-window -n torrent -c ~/Downloads/torrent \; \
|
|
send-keys 'trz' 'Enter' \; \
|
|
split-window -v -p 50 -t 1 \; \
|
|
send-keys 'transmission-remote-cli' 'Enter' \; \
|
|
select-pane -t 1
|
|
|
|
## Status bar design
|
|
# Status line
|
|
set-option -g status-position top
|
|
set -g status-bg default
|
|
|
|
# Messaging
|
|
set -g message-fg colour0
|
|
set -g message-bg colour3
|
|
set -g message-command-fg colour4
|
|
set -g message-command-bg colour0
|
|
|
|
# Panes
|
|
#set -g pane-border-style bold,fg=colour0
|
|
#set -g pane-active-border-style bold,fg=colour11
|
|
|
|
set -g pane-border-style bold,fg="#121212"
|
|
set -g pane-active-border-style bold,fg="#00bcd4"
|
|
|
|
set -g pane-border-status off
|
|
#set -g pane-border-format #{?pane_active,#[fg=white],#[fg=black]} #{pane_index} #{pane_current_command}
|
|
|
|
|
|
# Window notifications; display activity on other window
|
|
set-window-option -g monitor-activity on
|
|
set-option -g visual-activity off
|
|
|
|
# Window status
|
|
set-window-option -g window-status-format '#[fg=colour7] #{pane_current_command} '
|
|
set-window-option -g window-status-current-format '#[fg=colour11,bold] #{pane_current_command} '
|
|
set-window-option -g window-status-separator ''
|
|
|
|
##[fg=colour11,bg=colour8,bold] #I:#P #
|
|
|
|
setw -g window-status-activity-fg colour0
|
|
|
|
# List windows on left side of status bar
|
|
set-option -g status-justify centre
|
|
set-option -g status-left-length 18
|
|
set-option -g status-left "#[fg=colour11,bold]S #[fg=colour2,bold]#S #(test -n "$SSH_TTY" && echo "#[<%= status_login_style %>] #H ")"
|
|
#set-option -g status-left \
|
|
# '#(test -n "$SSH_TTY" && echo "#[<%= status_login_style %>] #H ")'
|
|
|
|
# Show pane title, pane identifier, and hostname on right side of status bar
|
|
set-option -g status-right-length 250
|
|
#set-option -g status-right \
|
|
#' #[fg=colour15,bg=default,bold] #{pane_title} '
|
|
|
|
set-option -g status-right "#[fg=blue]#(~/bin/statusbar/batt) #[fg=blue]%a %d %b %R"
|
|
|
|
#######################
|
|
|
|
# Reload conf file
|
|
bind r source-file ~/.tmux.conf \; display-message ' config reloaded! '
|