dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/.tmux.conf

147 lines
4.5 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 -ga terminal-overrides ',xterm-256color: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 copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "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
unbind q
bind-key q 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
## 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="#212121"
set -g pane-active-border-style bold,fg="#215d9c"
setw -g pane-border-status top
setw -g pane-border-format '─'
# This kills pane borders when they're not needed
#set-hook -g 'after-new-window' 'run-shell -b "if [ \#{window_panes} -eq 1 ]; then tmux set pane-border-status; fi"'
#set-hook -g 'after-kill-pane' 'run-shell -b "if [ \#{window_panes} -eq 1 ]; then tmux set pane-border-status; fi"'
#set-hook -g 'after-split-window' 'run-shell -b "if [ \#{window_panes} -gt 1 ]; then tmux set pane-border-status; fi"'
# Window notifications; display activity on other window
set-window-option -g monitor-activity off
set-option -g visual-activity off
# Window status
set-window-option -g window-status-format '#[fg=colour7,bg=default]#{pane_current_command}'
set-window-option -g window-status-current-format '#[fg=colour11,bold][#{pane_current_command}]'
set-window-option -g window-status-separator ' '
# List windows on left side of status bar
set-option -g status-left ''
# Right side of status bar
set-option -g status-right-length 250
set-option -g status-right "#[fg=magenta]#(~/bin/tmux/wifi)#[fg=cyan]#(~/bin/tmux/batt)#[fg=blue]%d/%m/%Y %R #[fg=colour2,bold][#S]"
#######################
# Reload conf file
bind r source-file ~/.tmux.conf \; display-message ' reloaded '
# Better mouse support
set -g @prevent-scroll-for-fullscreen-alternate-buffer 'on'
set -g @scroll-speed-num-lines-per-scroll '3'
run-shell /usr/share/tmux/tmux-better-mouse-mode/scroll_copy_mode.tmux