-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
100 lines (82 loc) · 3.51 KB
/
.tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# start fish in new panes using exec, so all the bash/zsh
# specific env setup (especially for space-commander)
# is inherited
# set-option -g default-command "exec /usr/local/bin/fish"
set-option -g default-command "exec /opt/homebrew/bin/fish"
set -g default-terminal "screen-256color"
set -g history-limit 100000
# set a lower esc timeout, to prevent lag when say,
# switching from insert mode to normal mode in [neo]vim.
set -sg escape-time 10
# Copy these environment variables from the main shell to any shells opened
# within tmux, which then allows ssh-agent to work properly within those
# tmux shells.
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# Reload key
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# more intuitive bindings for split window keys
bind | split-window -h
bind _ split-window -v
# Use Ctrl-arrow keys (w/o prefix key) to switch panes
bind -n C-Left select-pane -L
bind -n C-Down select-pane -D
bind -n C-Up select-pane -U
bind -n C-Right select-pane -R
# status bar options/colors
set -g status-interval 1
set -g status-justify left # left-align window list
set -g status-left ' #[fg=colour39]#[fg=black]#[default]'
set -g status-right "#(tmux-mem-cpu-load --interval 1 --mem-mode 0) #[fg=colour39] %d-%h %H:%M:%S :: #(TZ=Etc/UTC gdate --utc +%%H:%%M) UTC#[default] "
set -g status-left-length 52
set -g status-right-length 100
set -g status-style "bright fg=white bg=colour237"
set -g pane-border-style "fg=colour245"
set -g pane-active-border-style "fg=colour39" # colour46 (bright greenish)
set -g message-style "bg=colour221 fg=colour16 bold"
set -g window-status-activity-style "bold"
set -g window-status-format "#I:#W #{?window_zoomed_flag,Z,}"
set -g window-status-current-format "#[fg=colour234,bg=colour39] #[fg=colour25, \
bg=colour39,noreverse,bold]#I:#W #{?window_zoomed_flag,Z,} #[fg=colour39,bg=colour234,nobold]"
set-window-option -g window-status-style "fg=white bg=colour237"
# Start window numbering at 0, renumber when one is closed
set -g base-index 0
set -g renumber-windows on
# turn off auto window rename, so the names I set stay put
set-window-option -g automatic-rename off
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
setw -g mouse on
# Vim bindings
set -g status-keys vi
# Use vim keybindings in copy mode
setw -g mode-keys vi
# The copy/paste on OSX saga:
# http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
# unbind p
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# vim key pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# vim key pane resizing
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key H resize-pane -L 10
bind-key L resize-pane -R 10
# easily toggle synchronization (mnemonic: e is for echo)
bind e setw synchronize-panes on \; display-message "Synchronization ON!"
bind E setw synchronize-panes off \; display-message "Synchronization OFF!"
# clock
setw -g clock-mode-colour colour39
setw -g clock-mode-style 24 # 24-hour clock
# set up the tmux-resurrect plugin
run-shell ~/src/tmux-resurrect/resurrect.tmux