# Plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' # reattach-to-user-namespace set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-battery' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'jamesoff/tmux-loadavg' set -g @plugin 'chriszarate/tmux-docker' set -g @plugin 'azat-archive/tmux-ccache' set -g @plugin 'Morantron/tmux-fingers' set -g @plugin 'laktak/extrakto' # prefix key set-option -g prefix C-a unbind C-b bind C-a last-window bind a send-prefix # lock if-shell "command -v vlock" \ "set-option -g lock-command vlock" bind C-X locks bind x locks # displays unbind * bind * list-clients # common set-option -g exit-empty off # tmuxinator set-option -g visual-bell off set-option -g visual-activity off set-option -g status-keys vi set-window-option -g monitor-activity on set-window-option -g mode-keys vi set-window-option -g xterm-keys on set-window-option -g aggressive-resize on #if-shell "test $(uname --operating-system) != FreeBSD" \ # "set-option -g default-terminal 'xterm-256color'" set-window-option -g alternate-screen off set-window-option -g clock-mode-colour cyan set-window-option -g clock-mode-style 24 bind c new-window -c "#{pane_current_path}" bind r source-file ~/.tmux.conf \; display "User configuration Reloaded!" bind R source-file /etc/tmux.conf \; display "Configuration Reloaded!" # if uncomment next line: window title is not changed #set-option -g terminal-overrides 'xterm*:smcup@:rmcup@' # buffer set-option -g history-limit 10000 set-option -g buffer-limit 100 # http://stackoverflow.com/questions/11042920/how-to-copy-and-paste-between-different-tmux-panes-running-vim-instances bind [ copy-mode bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send -X copy-selection bind -T copy-mode-vi V send -X rectangle-toggle bind ] paste-buffer bind Space choose-buffer unbind l bind l clear-history bind C-p pipe-pane -o 'cat >> /tmp/tmux-output.#S-#W-#P' bind C-o pipe-pane 'cat >> /dev/null' # split/move pane unbind % unbind '"' bind + split-window -h -c "#{pane_current_path}" # horizontal split bind _ split-window -v -c "#{pane_current_path}" # vertical split bind C-j previous-window bind C-k next-window # title set-option -g set-titles on set-option -g set-titles-string '[tmux #S:#I #P #W]' set-window-option -g automatic-rename on set-option -g automatic-rename-format '#{?#{==:#{b:pane_current_command},bash},#{b:pane_current_path},#{b:pane_current_command}}' # status panel set-option -g status-justify left # If running inside tmux ($TMUX is set), then change the status line to red %if #{TMUX} set-option -g status-bg red %else set-option -g status-bg black %endif set-option -g status-fg cyan set-option -g status-interval 5 set-option -g status-left-length 30 set-option -g status-left '' set-option -g status-right-length 80 set-window-option -g window-status-current-style fg=white # status-right: desktop with tpm if-shell 'test -s /etc/tpm/tpm -o -s ~/.tmux/plugins/tpm/tpm -a \! -e /sys/class/power_supply/*BAT*' "set-option -g status-right '#{prefix_highlight} | #{load_short} #[fg=cyan]|#{docker_status}#[fg=cyan]| #[fg=blue,bold]###S #[fg=cyan]#[default]'" # status-right: laptop with tpm if-shell 'test -s /etc/tpm/tpm -o -s ~/.tmux/plugins/tpm/tpm -a -e /sys/class/power_supply/*BAT*' "set-option -g status-right '#{prefix_highlight} | #{battery_color_status_fg}#{battery_percentage} #[fg=cyan]| #{load_short} #[fg=cyan]|#{docker_status}#[fg=cyan]| #[fg=blue,bold]###S #[fg=cyan]#[default]'" # status-right: no tpm if-shell 'test ! -s /etc/tpm/tpm -a ! -s ~/.tmux/plugins/tpm/tpm' "set-option -g status-right '| avg: #(cat /proc/loadavg | cut -d\" \" -f-4) #[fg=cyan]| #[fg=blue,bold]###S #[fg=cyan]| #[fg=magenta]%R %b-%d %a#[default]'" if-shell 'test -s /etc/tpm/tpm' "run -b '/etc/tpm/tpm'" if-shell 'test -s ~/.tmux/plugins/tpm/tpm' "run -b '~/.tmux/plugins/tpm/tpm'"