forked from SeanThomasWilliams/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
165 lines (125 loc) · 5.44 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
159
160
161
162
163
164
165
# -- general -------------------------------------------------------------------
set -g default-terminal "xterm-256color" # colors!
setw -g xterm-keys on
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s quiet on # disable various messages
set-option -g prefix C-a
bind-key C-a last-window
# 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
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# uncomment to force vi-style key bindings
# emacs is the default unless $EDITOR or $VISUAL contain 'vi'
set -g status-keys vi
setw -g mode-keys vi
set -g status-utf8 on # expect UTF-8
setw -g utf8 on
set -g history-limit 50000 # boost history
# edit configuration
bind e new-window -n '~/.tmux.conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
# renumber windows when a window is closed
#set -g renumber-windows on
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# 24 hour clock
setw -g clock-mode-style 24
# clear both screen and history
bind -n C-l send-keys C-l \; run 'tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
# Force tmux to use ascii drawing characters vs x and p
set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
# -- navigation ----------------------------------------------------------------
# create new session
#bind C-c new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s maximize_pane'
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# window navigation
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Space last-window # move to last active window
# -- edit mode -----------------------------------------------------------------
# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
bind -ct vi-edit H start-of-line
bind -ct vi-edit L end-of-line
bind -ct vi-edit q cancel
bind -ct vi-edit Escape cancel
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
bind b list-buffers # list paster buffers
bind p paste-buffer # paste from the top pate buffer
bind P choose-buffer # choose which buffer to paste from
# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
bind -t vi-copy v begin-selection
bind -t vi-copy C-v rectangle-toggle
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
bind -t vi-copy H start-of-line
bind -t vi-copy L end-of-line
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 1 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# visual notification of activity in other windows
set -g visual-activity on
setw -g monitor-activity on
# set color for status bar
# show host name and IP address on left side of status bar
set -g status-left-length 60
set -g status-left '#[fg=green](#S) #(whoami)#[fg=brightblue]@#h#[default]'
# show session name, window & pane number, date and time on right side of status bar
set -g status-right-length 60
set -g status-right '#[fg=blue,bright]Pane: #P | #[fg=cyan]%a %m/%d/%Y %I:%M:%S%P'
set -g pane-border-bg black
set -g pane-border-fg white
set -g pane-active-border-bg green
set -g pane-active-border-fg black
setw -g window-status-current-format "|#I:#W|"
# default statusbar colors
set -g status-fg white
set -g status-bg default
set -g status-attr dim
# default window title colors
set-window-option -g window-status-fg white
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright
# command/message line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright