-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
142 lines (111 loc) · 4.1 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
# remap prefix to Control + a
set -g prefix C-a
# tmux prefix
unbind C-b
bind C-a send-prefix
# Keys
bind k confirm kill-window
bind K confirm kill-server
bind % split-window -h
# bind : split-window -v
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
bind . command-prompt
bind a last-window
bind space command-prompt -p index 'select-window'
bind r source-file ~/.tmux.conf
# start window index at 1
set -g base-index 1
# Enable mouse movements
set -g mouse on
# Enable xterm CTRL keys
set-window-option -g xterm-keys on
# start pane index at 1
setw -g pane-base-index 1
set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash...
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Window options
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
setw -g automatic-rename off
set-option -g allow-rename off
# re-number windows when one is closed
set -g renumber-windows on
# add some programs to tmux resurrect list to be persisted
set -g @resurrect-processes 'ssh psql mysql sqlite3'
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-save-bash-history 'on'
set -g @resurrect-capture-pane-contents 'on'
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
# set-option -g default-command 'reattach-to-user-namespace -l zsh'
###########################
## Status Bar
############################
# enable UTF-8 support in status bar
set -g status-utf8 on
# set refresh interval for status bar
set -g status-interval 30
# center the status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S#[fg=blue] #I:#P#[default]'
# show hostname, date, time, and battery in right status bar
set-option -g status-right '#[fg=green]#H#[default] %m/%d/%y %I:%M\
#[fg=red]#(battery discharging)#[default]#(battery charging)']
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# tmux resurrect
run-shell ~/Sources/tmux/resurrect.tmux
# set vi for PREFIX [ navigation
setw -g mode-keys vi
###########################
# Colors
###########################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg black
# color scheme (styled as vim-powerline)
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=colour235,bg=colour252,bold] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=black,bg=colour39,noreverse,bold] #I: #W #[fg=colour39,bg=colour234,nobold]∆"
# PLUGINS # add powerline-config to path
run "powerline-config tmux setup"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# status
set -g status-right 'CPU: #{cpu_icon} #{cpu_percentage} | Online: #{online_status} | Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M '
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'