psoxizsh/tmux/tmux.conf
2020-07-11 14:59:08 +00:00

74 lines
2.7 KiB
Plaintext

# Plugins
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_prefix_prompt 'Pre'
set -g @prefix_highlight_fg 'yellow'
set -g @prefix_highlight_bg 'default'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
# Integration with vim-tmux-navigator & fzf
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) \
|| tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) \
|| ($is_fzf && tmux send-keys C-j) \
|| tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) \
|| ($is_fzf && tmux send-keys C-k) \
|| tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) \
|| tmux select-pane -R"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
set-option -g prefix C-a
set-option -g set-titles on
set-window-option -g automatic-rename on
bind-key C-a last-window
bind-key a send-prefix
set -g status-fg '#EEEEEE'
set -g status-bg '#333333'
set -g pane-border-status top
set -g display-panes-colour '#334400'
set -g mouse off
set -s escape-time 0
set -g visual-activity on
set -g status-left-length 200
set -g status-right-length 200
set -g status-left '#{prefix_highlight} #[fg=blue,bold]#h #S:#I.#P (#D) #[default]'
set -g status-right '#T #[fg=yellow,bold]#(uptime -p)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default] '
set -g set-titles on
setw -g aggressive-resize on
setw -g monitor-activity on
# The following three makes italics work in tmux
set -g xterm-keys on
set -g default-terminal "xterm-256color"
set -as terminal-overrides ',xterm*:sitm=\E[3m'
# Refresh status line every 5 seconds
set -g status-interval 5
# Start window and pane indices at 1.
set -g base-index 0
set -g pane-base-index 0
bind-key e set-window-option synchronize-panes on
bind-key E set-window-option synchronize-panes off
bind m set -g mouse on \; display 'Mouse: ON'
bind M set -g mouse off \; display 'Mouse: OFF'
bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom
bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
# prefix + / to search
bind-key / copy-mode \; send-key ?
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b "$TMUX_PLUGINS/tpm/tpm"