-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
182 lines (143 loc) · 6.03 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
182
# -----------------------------------------------------------------------------
# FILE: .tmux.conf
# DESCRIPTION: tmux configuration file based off Sorin Ionescu's.
# AUTHOR: Jonathan Sokolowski (github.com/jsok)
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# General Options
# ------------------------------------------------------------------------------
# Inform programs of 256 colour support.
set-option -g default-terminal "screen-256color"
# Increase keyboard repeat rate (down from 500)
set-option -g repeat-time 100
# Turn the mouse on, but without copy mode dragging
set -g mouse on
unbind -n MouseDrag1Pane
unbind -Tcopy-mode MouseDrag1Pane
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# Disable faux scrolling
set -ga terminal-overrides ',*256color*:smcup@:rmcup@'
# Disable visual notifications.
set-option -g visual-activity off
# Disable bell notifications.
set-option -g bell-action none
# Disable window activity notifications.
set-window-option -g monitor-activity off
# Scroll back buffer n lines.
set-option -g history-limit 100000
# Enable terminal window titles.
set-option -g set-titles on
# Make C-left, C-right work.
set-window-option -g xterm-keys on
# Disable rename window title, done by a zsh-hook
set-window-option -g allow-rename off
# Set terminal title format (uses status bar variables).
set-option -g set-titles-string "tmux.#I.#W"
# Start window indexing at one instead of zero.
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Reduce esc time.
set-option -s escape-time 10
# ------------------------------------------------------------------------------
# General Key Bindings
# ------------------------------------------------------------------------------
set-option -gw xterm-keys on
# Use C-y instead.
set-option -g prefix C-y
# Open new windows in the cwd
bind c new-window -c "#{pane_current_path}"
# More intuitive copy paste mode
set-window-option -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
# bind-key -t vi-copy 'y' copy-pipe 'echo "OS Specific clipboard done in tmux.local.conf"'
# Rebind split
unbind %
# Split vertical and create new pane to the *right* of the current one
bind v split-window -h -c "#{pane_current_path}" -b
# Split vertical and create new pane to the *left* of the current one
bind V split-window -h -c "#{pane_current_path}"
# Split horizontal and create new pane *above* current one
bind h split-window -v -c "#{pane_current_path}" -b
# Split horizontal and create new pane *below* current one
bind H split-window -v -c "#{pane_current_path}"
# Make vertical splits all the same width analogous to vim's C-W =
bind = select-layout even-horizontal
# Use vim keys for moving around panes, arrows for tabs
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# Swap window position/index
bind -r < swap-window -t :- \; previous-window
bind -r > swap-window -t :+ \; next-window
# Move between windows
bind-key -n 'S-left' previous-window
bind-key -n 'S-right' next-window
# Break pane into own window
bind K break-pane
# ------------------------------------------------------------------------------
# Status Bar
#
# base16-default color scheme
# base00 = #151515
# base01 = #202020
# base02 = #303030
# base03 = #505050
# base04 = #b0b0b0
# base05 = #d0d0d0
# base06 = #e0e0e0
# base07 = #f5f5f5
# base08 = #ac4142
# base09 = #d28445
# base0a = #f4bf75
# base0b = #90a959
# base0c = #75b5aa
# base0d = #6a9fb5
# base0e = #aa759f
# base0f = #8f5536
# ------------------------------------------------------------------------------
# Move status bar to top
set-option -g status-position top
set-option -g status-keys vi
set-option -g status-interval 1
# Default status bar colours.
set-option -g status-style fg=white
set-option -g status-style bg="#202020"
set-window-option -g window-status-current-style fg="#90a959" # base0a Active window
set-window-option -g window-status-style fg="#505050" # base0e Inactive window
set-window-option -g window-status-activity-style fg="#8f5536" # base0f
set-window-option -g window-status-bell-style fg="#8f5536"
set-window-option -g window-status-activity-style underscore
set-window-option -g window-status-bell-style underscore
# Command/message line colours.
set-option -g message-style fg="#90a959" # base0b
set-option -g message-style bg="#505050" # base08
# ------------------------------------------------------------------------------
# Panes
# ------------------------------------------------------------------------------
set-option -g display-time 2000
set-option -g display-panes-time 2000
# Pane borders
set-option -g pane-border-style fg=blue
set-option -g pane-active-border-style fg=blue
# ------------------------------------------------------------------------------
# Clock
# ------------------------------------------------------------------------------
set-window-option -g clock-mode-colour "#90a959"
set-window-option -g clock-mode-style 12
# Source tmux.conf
unbind R
bind R source-file ~/.tmux.conf \; display "Reloaded config ~/.tmux.conf"
# OS Specific
source ~/.tmux.local.conf