2017-03-20 07:58:44 +00:00
|
|
|
# Set the default TERM
|
2017-09-26 09:39:11 +00:00
|
|
|
set -g default-terminal tmux-256color
|
2017-02-20 22:15:15 +00:00
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Update the TERM variable of terminal emulator when creating a new session or attaching a existing session
|
2017-02-20 22:15:15 +00:00
|
|
|
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
|
|
|
|
|
2017-09-30 04:32:17 +00:00
|
|
|
set -ga terminal-overrides ',xterm-256color:Tc'
|
2017-02-27 02:52:13 +00:00
|
|
|
|
2017-11-29 23:55:29 +00:00
|
|
|
# Something about the cursor shape?
|
|
|
|
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Set Zsh as default Tmux shell
|
2017-02-20 22:15:15 +00:00
|
|
|
set-option -g default-shell /bin/zsh
|
|
|
|
|
|
|
|
unbind C-b
|
2018-01-24 19:32:47 +00:00
|
|
|
unbind space
|
|
|
|
unbind '"'
|
|
|
|
unbind %
|
|
|
|
unbind q
|
|
|
|
|
2017-02-20 22:15:15 +00:00
|
|
|
set-option -g prefix C-a
|
|
|
|
bind-key C-a send-prefix
|
2017-02-23 03:30:07 +00:00
|
|
|
set -sg escape-time 0
|
2018-01-24 19:32:47 +00:00
|
|
|
setw -g mouse on
|
|
|
|
setw -g mode-keys vi
|
2018-02-14 22:03:56 +00:00
|
|
|
set -g status-keys emacs
|
2017-02-23 03:30:07 +00:00
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Switch panes using Alt-arrow without prefix
|
2017-02-20 22:15:15 +00:00
|
|
|
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
|
2017-11-29 23:55:29 +00:00
|
|
|
bind , swap-pane -D # swap current pane with the next one
|
2017-02-20 22:15:15 +00:00
|
|
|
bind . swap-pane -U # swap current pane with the previous one
|
|
|
|
|
2017-11-29 23:55:29 +00:00
|
|
|
# Vim inside tmux
|
|
|
|
bind-key -T copy-mode-vi M-Left select-pane -L
|
|
|
|
bind-key -T copy-mode-vi M-Down select-pane -D
|
|
|
|
bind-key -T copy-mode-vi M-Up select-pane -U
|
|
|
|
bind-key -T copy-mode-vi M-Right select-pane -R
|
|
|
|
bind-key -T copy-mode-vi M-Tab select-pane -l
|
|
|
|
|
2018-01-24 19:32:47 +00:00
|
|
|
bind down new-window
|
|
|
|
bind left prev
|
|
|
|
bind right next
|
|
|
|
bind Pageup swap-window -t -1
|
|
|
|
bind Pagedown swap-window -t +1
|
2017-02-20 22:15:15 +00:00
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Pane resizing & splitting
|
2017-02-20 22:15:15 +00:00
|
|
|
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}"
|
2018-01-24 19:32:47 +00:00
|
|
|
bind-key M-| split-window -fh -c "#{pane_current_path}"
|
|
|
|
bind-key M-- split-window -fv -c "#{pane_current_path}"
|
|
|
|
bind X select-layout even-vertical
|
2017-02-20 22:15:15 +00:00
|
|
|
|
2017-11-29 23:55:29 +00:00
|
|
|
# Move to window
|
2018-01-22 05:32:55 +00:00
|
|
|
bind -n M-S-1 select-window -t :1
|
|
|
|
bind -n M-S-2 select-window -t :2
|
|
|
|
bind -n M-S-3 select-window -t :3
|
|
|
|
bind -n M-S-4 select-window -t :4
|
|
|
|
bind -n M-S-5 select-window -t :5
|
|
|
|
bind -n M-S-6 select-window -t :6
|
|
|
|
bind -n M-S-7 select-window -t :7
|
|
|
|
bind -n M-S-8 select-window -t :8
|
|
|
|
bind -n M-S-9 select-window -t :9
|
2017-11-29 23:55:29 +00:00
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Copy/paste. Selecting any text with mouse automatically copies it to the clipboard
|
2017-09-30 04:32:17 +00:00
|
|
|
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i -p -b"
|
2017-02-23 03:30:07 +00:00
|
|
|
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"
|
|
|
|
|
|
|
|
bind Escape copy-mode
|
|
|
|
set-window-option -g xterm-keys on
|
2017-09-22 01:25:09 +00:00
|
|
|
bind-key q kill-window
|
2017-03-20 07:58:44 +00:00
|
|
|
bind-key x kill-pane
|
|
|
|
|
2017-02-23 03:30:07 +00:00
|
|
|
#######################
|
|
|
|
### KEEP IT GAY ###
|
|
|
|
#######################
|
|
|
|
|
2018-01-24 19:32:47 +00:00
|
|
|
bind-key / set-option -g status
|
|
|
|
|
2017-02-23 03:30:07 +00:00
|
|
|
set -g status-interval 1
|
|
|
|
setw -g aggressive-resize on
|
2017-02-20 22:15:15 +00:00
|
|
|
set-option -g base-index 1
|
|
|
|
setw -g pane-base-index 1
|
|
|
|
set -g renumber-windows on
|
2017-11-29 23:55:29 +00:00
|
|
|
set -g set-titles off
|
|
|
|
set -g set-titles-string "#W"
|
2017-02-23 03:30:07 +00:00
|
|
|
set-window-option -g automatic-rename on
|
2017-11-29 23:55:29 +00:00
|
|
|
set -g automatic-rename-format "#{s/zsh//:pane_current_command}"
|
2017-02-20 22:15:15 +00:00
|
|
|
setw -g clock-mode-style 24
|
|
|
|
|
|
|
|
## Status bar design
|
2017-03-20 07:58:44 +00:00
|
|
|
# Status line
|
2017-02-20 22:15:15 +00:00
|
|
|
set-option -g status-position top
|
|
|
|
set -g status-bg default
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Messaging
|
2017-02-20 22:15:15 +00:00
|
|
|
set -g message-fg colour0
|
2018-01-22 05:32:55 +00:00
|
|
|
set -g message-bg colour11
|
2017-02-20 22:15:15 +00:00
|
|
|
set -g message-command-fg colour4
|
|
|
|
set -g message-command-bg colour0
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Panes
|
2017-09-19 04:24:56 +00:00
|
|
|
set -g pane-border-style bold,fg="#212121"
|
|
|
|
set -g pane-active-border-style bold,fg="#215d9c"
|
2017-09-22 01:25:09 +00:00
|
|
|
setw -g pane-border-status top
|
|
|
|
setw -g pane-border-format '─'
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Window notifications; display activity on other window
|
2017-09-19 04:24:56 +00:00
|
|
|
set-window-option -g monitor-activity off
|
2017-02-23 03:30:07 +00:00
|
|
|
set-option -g visual-activity off
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Window status
|
2017-11-29 23:55:29 +00:00
|
|
|
set -g window-status-format "#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}}"
|
2018-01-22 05:32:55 +00:00
|
|
|
set -g window-status-current-format "#[fg=yellow]#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}}"
|
2017-09-19 04:24:56 +00:00
|
|
|
set-window-option -g window-status-separator ' '
|
2017-02-23 03:30:07 +00:00
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# List windows on left side of status bar
|
2017-09-22 01:25:09 +00:00
|
|
|
set-option -g status-left ''
|
2017-02-20 22:15:15 +00:00
|
|
|
|
2017-09-19 04:24:56 +00:00
|
|
|
# Right side of status bar
|
2017-02-20 22:15:15 +00:00
|
|
|
set-option -g status-right-length 250
|
2018-02-04 16:14:51 +00:00
|
|
|
set-option -g status-right "#(txbar)#[fg=blue]%d/%m/%Y %R #[fg=colour2,bold]#S"
|
2017-02-20 22:15:15 +00:00
|
|
|
|
2017-11-29 23:55:29 +00:00
|
|
|
# default window title colors
|
|
|
|
set-window-option -g window-status-fg colour7
|
|
|
|
|
|
|
|
# active window title colors
|
|
|
|
set-window-option -g window-status-current-fg colour11
|
|
|
|
set-window-option -g window-status-current-attr bright
|
|
|
|
|
2017-02-20 22:15:15 +00:00
|
|
|
#######################
|
|
|
|
|
2017-03-20 07:58:44 +00:00
|
|
|
# Reload conf file
|
2017-09-19 04:24:56 +00:00
|
|
|
bind r source-file ~/.tmux.conf \; display-message ' reloaded '
|
2017-09-25 15:10:28 +00:00
|
|
|
|
|
|
|
# Better mouse support
|
|
|
|
set -g @prevent-scroll-for-fullscreen-alternate-buffer 'on'
|
|
|
|
set -g @scroll-speed-num-lines-per-scroll '3'
|
2018-01-24 19:32:47 +00:00
|
|
|
run-shell ~/bin/tmux-better-mouse-mode/scroll_copy_mode.tmux
|