-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
125 lines (99 loc) · 3.63 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
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# act like GNU screen
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
unbind -n 'C-\'
# automatically set window title
#setw -g automatic-rename off
set-option -g allow-rename off
# make mouse useful
set-option -g mouse on
# start window numbering at 1
set -g base-index 1
set -g pane-base-index 1
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
#unbind ^A
#bind ^A select-pane -t :.+
# title A
unbind A
bind A command-prompt "rename-window %%"
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
bind-key -r < resize-pane -L 4
bind-key -r > resize-pane -R 4
bind - resize-pane -D 4
bind + resize-pane -U 4
# disable repeat on cursors
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key Left select-pane -L
bind-key Right select-pane -R
# status indicators
set -g status-right '#(uptime | cut -d, -f 2-)'
#### COLOUR
# look good
set -g default-terminal "screen-256color"
# set -g default-terminal "xterm"
# # default statusbar colors
setw -g status-style "bg=colour235, fg=colour166, default"
# default window title colors
setw -g window-status-style "fg=colour244, bg=default, dim"
# active window title colors
setw -g window-status-current-style "fg=colour166, bg=default"
# set inactive/active window styles
# with help from http://www.deanbodenham.com/learn/tmux-pane-colours.html
# set -g window-style 'bg=colour233'
# set -g window-active-style 'bg=black'
#
# set -g pane-border-bg colour232
# set -g pane-border-fg colour238
# set -g pane-active-border-bg colour233
# set -g pane-active-border-fg colour166
#
# # pane border
# set-option -g pane-border-fg colour236 #base02
# set-option -g pane-active-border-fg colour240 #base01
#
# # message text
# set-option -g message-bg colour235 #base02
# set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange# force a reload of the config file
# Updated to make sure that when Chrome is launched from tmux, it works correctly
# See: https://savanne.be/804-running-karma-and-chrome-under-tmux-on-osx/
# if-shell "uname | grep -q Darwin" "set-option -g default-command \"reattach-to-user-namespace -l zsh\""
# Smart pane switching with awareness of vim splits
# is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?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"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
bind P paste-buffer
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key L last-window
# Set environment variable for SSH_AUTH_SOCK
# uncomment to allow tmux to play nicely with forwarded ssh creds
# set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock