You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

118 lines
4.1 KiB

## Prefix like in screen
set -g prefix 'C-a'
## Use xterm keys (makes eg. Ctrl+Arrow navigate words)
set-window-option -g xterm-keys on
## List of plugins
# For this to work you need to install https://github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'knakayama/tmux-man'
set -g @plugin 'knakayama/tmux-newline-detector'
set -g @plugin 'anghootys/tmux-ip-address'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
## Plugin configuration
set -g @continuum-restore 'on'
set -g @continuum-save-interval '5'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'su'
set -g @yank_selection 'primary'
set -g @yank_selection_mouse 'clipboard'
set -g @man-size '40%'
set -g @man-orientation 'h'
set -g @man-shell-interactive 'off'
# Tmux system configuration
set-option -gq display-time "2600"
set -g default-terminal "xterm-256color"
# --- START colours superhero ---
# not suppoerted option
#setw -g utf8 on
# Update Interval
set -g status-interval 1
# Status bar
# not suppoerted option
#set -g status-utf8 on
set -g status-bg black
set -g status-fg white
# Status bar - left side
set -g status-left-length 50
set -g status-left-style fg=white,bold,bg=blue
set -g status-left '#(if [ "#S" -ge 0 ]; then echo " "; else echo " #S "; fi)'
# Status bar - right side
set -g status-right-length 100
set -g status-right-style fg=black,bold
set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P '
# Window status - not the current window
set -g window-status-style bg=default,fg=white,none
set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Window status - current window
set -g window-status-current-style none
set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Pane borders
set -g pane-border-style bg=default,fg=colour235
set -g pane-active-border-style bg=default,fg=colour214
# Pane number display
set-option -g display-panes-active-colour colour214
set-option -g display-panes-colour colour240
# --- END colours superhero ---
# Use zsh regardless of default settings
#if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
# 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
## Mouse On by default
set -g mouse on
## Scoll for vim
bind -n WheelUpPane if "echo #{pane_current_command} | grep vim" "select-pane -t =; send-keys -N 4 Up" "select-pane -t =; copy-mode -e; send-keys -M"
bind -n WheelDownPane if "echo #{pane_current_command} | grep vim" "select-pane -t =; send-keys -N 4 Down" "select-pane -t =; send-keys -M"
# And additional scrolling things for tmux copy-mode
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# Tmux config reload
bind r source-file ~/.tmux.conf
# Toggle prefix on/off with F12 (for nested remote sessions)
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
refresh-client -S
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if-shell "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'; run '~/.tmux/plugins/tpm/tpm'; run '~/.tmux/plugins/tpm/bin/install_plugins'; run '~/.tmux/plugins/tpm/tpm'" \
"run '~/.tmux/plugins/tpm/tpm'"
# vim: se ft=tmux :