-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
139 lines (103 loc) · 3.88 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
# TODO: use prefix ^z and ^zz send prefix like tpope
# or ^\ maybe?
# https://github.com/briandoll/dotfiles/blob/master/tmux.conf
# initially cribbed from the awesome book on tmux by the prags
# http://pragprog.com/book/bhtmux/tmux
# create new window
bind c new-window -c "#{pane_current_path}"
# splitting panes
bind - split-window -v -c "#{pane_current_path}"
bind \ split-window -h -c "#{pane_current_path}"
# moving between panes
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# Pane resizing
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# Quick pane selection
bind -r h select-window -t :-
bind -r l select-window -t :+
# bind C-b select-pane -t :.+ # was 'select next pane', bet I like send-prefix instead for nested remote tmuxes
#setting the delay between prefix and command
set -sg escape-time 0
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf
# window movement http://superuser.com/a/367041
bind-key m command-prompt -p "move window to:" "swap-window -t '%%'"
# mouse support
# http://stackoverflow.com/a/30186508
# set -g mouse-utf8 on # fails on 2.2
set -g mouse on
# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"
set -g default-shell /usr/local/bin/zsh
# enable activity alerts
setw -g monitor-activity off
set -g visual-activity off
# set the status line's colors
set -g status-position bottom
set -g status-style bg=blue,fg='#ffffff'
# active and last window title colors
set-window-option -g window-status-current-style bg='#ffffff',fg=black
set-window-option -g window-status-last-style underscore
# pane border colors
set -g pane-border-style fg=blue
set -g pane-active-border-style fg=blue
# pane number display
# set -g display-panes-active-colour blue
# set -g display-panes-colour brightred
# Command / message line
# set -g message-bg default
# set -g message-fg yellow
# clock
# set-window-option -g clock-mode-colour green
# Status line left side
set -g status-left-length 40
set -g status-left "#S "
# set -g status-utf8 on # fails on 2.2
# Status line right side
set -g status-right-length 150
set -g status-right " %R"
# Left align the window list
set -g status-justify left
# enable vi keys.
setw -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
# use <esc> to enter copy mode, p to paste
# https://news.ycombinator.com/item?id=6740643
unbind [
unbind p
bind Escape copy-mode
bind p paste-buffer
# # copy/paste with system clipboard
# if-shell "[ -x \"$(which reattach-to-user-namespace)\" ]" "set -g default-command 'reattach-to-user-namespace -l zsh'"
# 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"
# Log output to a text file on demand
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# my additions
unbind C-z # don't suspend client when I miss <C-b>z
bind C-b send-prefix
set -g display-time 1000
set -g history-limit 100000
# set -g status-interval 0 # disable auto refresh to avoid freezes https://github.com/tmux/tmux/issues/108#issuecomment-145608072
# set -g status off # https://github.com/tmux/tmux/issues/108#issuecomment-145741135
# switch to last window or session
bind C-a last-window # switch to last used window in current session
bind a switch-client -l # switch to last used session
bind C-e send-keys -R # clear screen, mnemonic empty
# TODO: use fzf for fuzzy session selection
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-copycat \
'
if-shell "[ -x '~/.tmux/plugins/tpm/tpm' ]" "run-shell '~/.tmux/plugins/tpm/tpm'"