-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
117 lines (96 loc) · 3.67 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# General options
set -g prefix C-space
set -g mode-keys vi
set-option -g mouse on
set -sg escape-time 1
set -g default-terminal "screen-256color"
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# copy the text to your system clipboar
set-option -g set-clipboard on
set-option -g @fastcopy-action 'tmux load-buffer -w -'
# Panes and Windows#
####################
# Move windows using Shift-[left,right]
bind -n S-left prev
bind -n S-right next
# Move windows using Shift-Ctrl-[left,right]
bind -n S-C-left swap-window -t -1
bind -n S-C-right swap-window -t +1
# Start index of window/pane with 1, because we're humans, not computers
set -g base-index 1
setw -g pane-base-index 1
# Don't auto window rename
setw -g automatic-rename on
setw -g allow-rename off
# Set parent terminal title to reflect current window in tmux session
set -g set-titles on
set -g set-titles-string "#{session_name} - #{host}"
# 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
set -g history-limit 100000
# Status bar and style#
#######################
set -g mode-style "fg=default,bg=colour40"
# command line style
set -g message-style "fg=colour40,bg=colour236"
# status line style
set -g status-style "fg=colour39,bg=colour236"
set -g status-interval 5
set -g status-justify centre # center align window list
set -g status-left-length 40
set -g status-right-length 40
set -g status-left '#[fg=green] #(hostname -fs)'
set -g status-right '#[fg=white,bg=default]%a %H:%M:%S #[default] #[fg=blue]%Y-%m-%d'
set -g window-status-separator ""
setw -g window-status-format " #I:#W "
setw -g window-status-current-style "fg=white,bold,bg=colour40"
# Plugins #
###########
# tmux plugin manager: github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'abhinav/tmux-fastcopy'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# save environment automatically using tmux-continuum
set -g @continuum-restore 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
set -g @continuum-boot 'on'
# Nesting local and remote sessions #
#####################################
# Session is considered to be remote when we ssh into host
if-shell 'test -n "$SSH_CLIENT"' \
'source-file ~/.tmux.remote.conf'
# We want to have single prefix key "C-a", usable both for local and remote session
# we don't want to "C-a" + "a" approach either
# Idea is to turn off all key bindings and prefix handling on local session,
# so that all keystrokes are passed to inner/remote session
# see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
# Also, change some visual styles when window keys are off
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=colour8" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
refresh-client -S
# install tpm if not already installed
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"
run '~/.tmux/plugins/tpm/tpm'