-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
131 lines (103 loc) · 3.76 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
# increase scroll back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
set-option -g default-terminal "xterm-256color"
set-option -g set-titles on
set-option -g set-titles-string "#S / #W"
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
# **** MAKE SURE TO brew install reattach-to-user-namespace ****
set-option -g default-command "reattach-to-user-namespace -l zsh"
# enable mouse
set-option -g mouse on
# decrease command delay (increases vim responsiveness)
set -sg escape-time 0
# start pane index at 1
setw -g pane-base-index 1
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
set -g renumber-windows on
###########################
## Key Bindings
############################
#
## tmux prefix
unbind C-b
set -g prefix C-a
#quickly switch between windows 1-4
bind C-a last-window #ctrl+a, ctrl+a will switch to the last window
# VI style pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
#
#smart pane switching with awareness of vim splits
# http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
#quickly switch between windows 1-4
bind-key C-a last-window #ctrl+a, ctrl+a will switch to the last window
bind-key h select-window -t 1 # ctrl+a, h will select window 1
bind-key j select-window -t 2 # ctrl+a, h will select window 2
bind-key k select-window -t 3 # ctrl+a, h will select window 3
bind-key l select-window -t 4 # ctrl+a, h will select window 4
# start window index at 1
set -g base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind-key -n -r M-Left resize-pane -L 1
bind-key -n -r M-Right resize-pane -R 1
bind-key -n -r M-Up resize-pane -U 1
bind-key -n -r M-Down resize-pane -D 1
#
###########################
# 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 centre
setw -g automatic-rename on
# 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]'
#12 hour clock
set-window-option -g clock-mode-style 12
# show timein right status bar
set-option -g status-right '#[default] %I:%M\
#[fg=red]#(battery discharging)#[default]#(battery charging)'
###########################
# Colors
###########################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-style fg=black,bg=green
# set color of active pane
set -g pane-border-style fg=colour235,bg=black
set -g pane-active-border-style fg=green,bg=black
bind-key S choose-window 'join-pane -v -s "%%"'
bind-key V choose-window 'join-pane -h -s "%%"'
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-resurrect \
nhdaly/tmux-scroll-copy-mode \
jlipps/tmux-safekill \
'
set -g @resurrect-strategy-vim 'session'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'