-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
181 lines (139 loc) · 5.75 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Some stuff taken from http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/
# See http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
##########################################
# BASIC CONFIG
set -g mouse on
# vi Style Editing in copy-mode
setw -g mode-keys vi
###########################################################################
## General options
# Default termtype. If the rcfile sets $TERM, that overrides this value.
#set -g default-terminal screen-256color
set -g default-terminal tmux-256color
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
setw -g monitor-activity on
# scrollback size
set -g history-limit 10000
# set first window to index 1 (not 0) to map more to the keyboard layout
set -g base-index 1
setw -g pane-base-index 1
# pass through xterm keys
set -g xterm-keys on
###########################################################################
## Window management / navigation
# move between windows
bind-key C-h previous-window
bind-key C-l next-window
# C-\ (no prefix) to skip to last window we were in before this one
bind -n "C-\\" last-window
# C-Space (no prefix) to tab to next window
bind -n C-Space next-window
###########################################################################
# Pane management / navigation
#
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S - ; save-buffer %1 ; delete-buffer'
# Horizontal splits with s or C-s
#unbind s
#unbind C-s
#bind-key s split-window
#bind-key C-s split-window
#
# Vertical split with v or C-v
#unbind v
#unbind C-v
#bind-key v split-window -h
#bind-key C-v split-window -h
# navigation with C-{h,j,k,l} -- NO PREFIX
# https://gist.github.com/mislav/5189704
bind -n C-k run-shell 'tmux-vim-select-pane -U'
bind -n C-j run-shell 'tmux-vim-select-pane -D'
bind -n C-h run-shell 'tmux-vim-select-pane -L'
bind -n C-l run-shell 'tmux-vim-select-pane -R'
#bind -n C-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-k" "select-pane -U"
#bind -n C-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-j" "select-pane -D"
#bind -n C-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-h" "select-pane -L"
#bind -n C-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-l" "select-pane -R"
# C-b C-k to passthrough a C-k
# C-k is consumed for pane navigation but we want it for kill-to-eol
unbind-key C-k
bind-key C-k send-key C-k
# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to Cmd-Opt-<h,j,k,l> in iTerm2.
# http://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/
# Note on a few prefix options: C-a = 0x01, C-b = 0x02, C-g = 0x06
bind-key -n M-J resize-pane -D
bind-key -n M-K resize-pane -U
bind-key -n M-H resize-pane -L
bind-key -n M-L resize-pane -R
bind-key J resize-pane -D
bind-key K resize-pane -U
bind-key H resize-pane -L
bind-key L resize-pane -R
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
########################################
# SSH Environment Agent settings
# See: http://stackoverflow.com/a/23187030/119603
# and: https://gist.github.com/admackin/4507371 <-- if hostname issues presents themselves
#
# This 'update-environment' only works for new windows/panes, not for existing
# ones
set -g update-environment "DISPLAY SSH_AUTH_SOCK SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
# fix ssh agent when tmux is detached
#setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
###########################################################################
# General keymap
# Keep your finger on ctrl, or don't, same result
bind-key C-d detach-client
bind-key C-p paste-buffer
# Redraw the client (if interrupted by wall, etc)
bind R refresh-client
# reload tmux config
unbind r
bind r \
source-file ~/.tmux.conf \;\
display-message 'Reloaded tmux config.'
###########################################################################
# Color scheme (Cobalt)
# default statusbar colors
set-option -g status-fg black
set-option -g status-bg cyan
# pane number display
set-option -g display-panes-active-colour red
set-option -g display-panes-colour cyan
###########################################################################
# Not compatible with iterm2 integration
setw -g aggressive-resize off
###########################################################################
# Set Window titles in PuTTY
set -g set-titles on
source ~/.tmux/themes/tomorrow-night-bright.tmux
# List of plugins
# Press C-b I to install plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'RTBHOUSE/tmux-picker'
set -g @plugin 'wfxr/tmux-fzf-url'
#set -g @plugin 'tmux-plugins/tmux-cpu'
#set -g @plugin 'omad/tmux-net-speed'
#set -g @plugin 'dastergon/tmux-load-avg'
set -g @plugin 'christoomey/vim-tmux-navigator'
run '~/.tmux/plugins/tpm/tpm'
#set -g @net_speed_interfaces "eth0"
#set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
#set -g status-right "Net: #{net_speed} CPU: #{cpu_percentage} Load:#{load_average} | %a %h-%d %H:%M "
#set -g status-right-length 95
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'