-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux
151 lines (112 loc) · 3.88 KB
/
tmux
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
# tmux display things in 256 colors
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g history-limit 20000
# automatically renumber tmux windows
set -g renumber-windows on
# unbind default prefix and set it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# for nested tmux sessions
bind-key a send-prefix
# Activity Monitoring
setw -g monitor-activity off
set -g visual-activity 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
# make delay shorter
set -sg escape-time 0
# tile all windows
unbind =
bind = select-layout tiled
# cycle through panes
# unbind C-a
# unbind o # this is the default key for cycling panes
# bind ^A select-pane -t:.+
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
# set-option -g set-titles on
# set-option -g set-titles-string "#T - #W"
# set-window-option -g automatic-rename on
######################
#### Key Bindings ####
######################
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# quickly open a new window
bind N new-window
# split window and fix path for tmux 1.9
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# synchronize all panes in a window
bind y setw synchronize-panes
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# maximizing and restoring windows
unbind Up
bind Up new-window -d -n fullscreen \; swap-pane -s fullscreen.1 \; select-window -t fullscreen
unbind Down
bind Down last-window \; swap-pane -s fullscreen.1 \; kill-window -t fullscreen
# set vi mode for copy mode
setw -g mode-keys vi
# more settings to make copy-mode more vim-like
# unbind [
# bind Escape copy-mode
# unbind p
# bind p paste-buffer
# bind -t vi-copy 'v' begin-selection
# bind -t vi-copy 'y' copy-selection
# Buffers to/from Mac clipboard, yay tmux book from pragprog
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
#### COLOUR
tm_color_active=colour4
tm_color_inactive=colour241
tm_color_feature=colour4
tm_color_music=colour4
# separators
tm_separator_left_bold="◀"
tm_separator_left_thin="❮"
tm_separator_right_bold="▶"
tm_separator_right_thin="❯"
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
# default statusbar colors
set-option -g status-style fg=$tm_color_active,bg=default,default
# default window title colors
set-window-option -g window-status-style fg=$tm_color_inactive,bg=default
set -g window-status-format "#I #W"
# active window title colors
set-window-option -g window-status-current-style fg=$tm_color_active,bg=default
set-window-option -g window-status-current-format "#[bold]#I #W"
# pane border
set-option -g pane-border-style fg=$tm_color_inactive
set-option -g pane-active-border-style fg=$tm_color_active
# message text
set-option -g message-style fg=$tm_color_active,bg=default
# pane number display
set-option -g display-panes-active-colour $tm_color_active
set-option -g display-panes-colour $tm_color_inactive
# clock
set-window-option -g clock-mode-colour $tm_color_active
tm_spotify="#[fg=$tm_color_music]#(osascript ~/.spotify.scpt)"
tm_date="#[fg=$tm_color_inactive] %R %d %b"
tm_session_name="#[fg=$tm_color_feature,bold]"
set -g status-left $tm_session_name
set -g status-right $tm_spotify' '$tm_date