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

148 lines
4.5 KiB
Plaintext
Raw Normal View History

2017-03-20 07:58:44 +00:00
# Set the default TERM
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'
set -ga terminal-overrides ',xterm-256color:Tc'
# 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
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
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
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
# 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
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}"
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
# Move to window
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-03-20 07:58:44 +00:00
# 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"
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
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 ###
#######################
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
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
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
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"
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
set -g window-status-format "#{=-15:?window_name,#{window_name},#{s/deadguy/home/:?pane_current_path,#{b:pane_current_path},}}"
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
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
# 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 '
# Better mouse support
set -g @prevent-scroll-for-fullscreen-alternate-buffer 'on'
set -g @scroll-speed-num-lines-per-scroll '3'
run-shell ~/bin/tmux-better-mouse-mode/scroll_copy_mode.tmux