-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
158 lines (121 loc) · 5.53 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Rename the terminals
set -g set-titles on
set -g set-titles-string '#(whoami)::#h::#(curl ipecho.net/plain;echo)'
# Use ^A as the magic keybinding
set-option -g prefix C-a
unbind-key C-b
# Also use ^P as the magic keybinding
set-option -g prefix2 C-p
# Start numbering windows at 1, not 0
set-option -g base-index 1
# Automatically renumber remaining windows when a window is closed
set-option -g renumber-windows on
# 256 Color
#set-option -g default-terminal screen-256color
set -g default-terminal "xterm-256color"
#set -g status-bg '#666666'
#set -g status-fg '#aaaaaa'
set -g pane-border-style fg=green
set -g pane-active-border-style fg=green
set -g pane-active-border-style bg=green
set -g pane-border-fg cyan
set -g pane-border-status top
# set color for status bar
set-option -g status-bg colour235 #base02
set-option -g status-fg yellow #yellow
set-option -g status-attr bright
# set window list colors - red for active and cyan for inactive
set-window-option -g window-status-bg colour236
set-window-option -g window-status-attr dim
set-window-option -g window-status-current-bg colour236
set-window-option -g window-status-current-attr bright
setw -g window-status-current-fg white
setw -g window-status-current-bg cyan
setw -g window-status-current-attr bright
setw -g window-status-attr bright
#setw -g window-status-fg white
#setw -g window-status-bg yellow
#setw -g window-status-current-fg white
#setw -g window-status-current-bg cyan
#setw -g window-status-current-attr bright
#
#set -g message-fg white
#set -g message-bg yellow
#set -g message-attr bright
# Make ctrl-arrow etc work
set-window-option -g xterm-keys on
# Make mouse work
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
# (commented out because it disables cursor navigation in vim)
#set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
# Or, for newer versions of tmux (e.g. 2.1)
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Cute mnemonics for horizontal and veritcal window splits
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind C-\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind C-_ split-window -v -c "#{pane_current_path}"
# shortcut for reloading the tmux config file
unbind r
bind r source-file ~/.tmux.conf \; display 'Config reloaded!'
bind C-r source-file ~/.tmux.conf \; display 'Config reloaded!'
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# show host name and IP address on left side of status bar
set -g status-left-length 70
set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(curl icanhazip.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #(ifconfig eth0 | grep 'inet ' | awk '{print \"eth0 \" $2}')#(ifconfig en3 | grep 'inet ' | awk '{print \"en3 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "
# show session name, window & pane number, date and time on right side of
# status bar
set -g status-right-length 60
set-option -g status-right '#(/usr/local/bin/tmux-mem --format ":currentBytes [#[fg=:color]:spark#[default]] #[fg=:color]:percent#[default]") #(/usr/local/bin/tmux-cpu --format ":load [#[fg=:color]:spark#[default]] #[fg=:color]:percent#[default]") %H:%M %d-%b-%y'
# Get vim-like bindings for pane resizing
bind C-j resize-pane -D 10
bind C-k resize-pane -U 10
bind C-l resize-pane -R 10
bind C-h resize-pane -L 10
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind h select-pane -L
# Swap window orders
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Vim bindings (should be the default but good to be explicit)
setw -g mode-keys vi
# Make tmux yank go to the clients clipboard
# This works with iTerm2 so long as you have enabled the "Applications in terminal may access clipboard"
set -s set-clipboard on
# Copy / Paste in keyboard mode
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
# Use this on a mac to make tmux yanks go right to your clipboard
# No need for reattach-to-user-namespace etc
#bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel pbcopy
# Scroll History
set -g history-limit 30000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# Go back to the last active window
#bind-key l last-window
bind Escape copy-mode
bind [ copy-mode
bind C-u copy-mode
bind-key F run-shell "tmux show-buffer | fpb" \; display 'Copied TMUX buffer to a fluffy pastebin link!'
# Shortcut to break the currently focused pane into a new window at the tail of the windows list
bind-key ! break-pane
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other custom plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'