-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
94 lines (70 loc) · 3.26 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
# Some options from practical tmux: https://mutelight.org/practical-tmux
set -g mouse on
# Setup vi bindings for tmux
setw -g mode-keys vi
# C-b is not acceptable -- Vim uses it
unbind C-b
set -g prefix C-a
# Start Window Numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# Faster Command Sequences, allows for faster key repetition
set -s escape-time 0
# 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.
# Commented out for iterm2
#setw -g aggressive-resize on
# Support modern terminal
set -g default-terminal "screen-256color"
# C-a C-a for the Last Active Window
bind a send-keys C-a
bind C-a last-window
# Clear pane
bind C-l send-keys C-l
# Highlight active window
# set-window-option -g window-status-current-bg red
# Setup the new pane, new window binds
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
# Use up and down arrows for temporary "maximize"
unbind Up; bind Up resize-pane -Z; unbind Down; bind Down resize-pane -Z
# Reload tmux configuration
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Allow vim navigation for panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind ` select-window -t 0
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# No idea what this does
set-option -g terminal-overrides 'xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
# Better project name in status bar
set -g status-left-length 18
set -g status-left '#[fg=colour235,bg=colour76,bold] #S '
# Cosmetics
set -g status-utf8 on
set -g status-justify centre
set -g status-bg black
set -g status-left "#[fg=green]#S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-right "#[fg=cyan]%b %d #[fg=yellow]|#[fg=cyan]%l:%M %p"
setw -g window-status-bell-attr default
setw -g window-status-bell-fg red
setw -g window-status-activity-attr bold
setw -g window-status-format "#[fg=cyan]• #[fg=white]#I#[fg=cyan] #[fg=white]#12W"
setw -g window-status-current-format "#[fg=red]▶ #[fg=white]#I#[fg=red,bold] #[fg=white]#W"
set -g pane-border-fg colour238
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg black
set -g message-fg white
set -g message-bg black
set -g message-attr bright
if-shell '[[ -e ~/.tmux.conf.local ]]' 'source-file ~/.tmux.conf.local'