-
Notifications
You must be signed in to change notification settings - Fork 4
/
tmux.conf
70 lines (53 loc) · 2.2 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
# Set default terminal emulation to xterm
set -g default-terminal 'xterm-256color'
# Set the default terminal and copy-paste behavior
set -g default-shell $SHELL
# Be explicit about the reattaching of user namespace
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# 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 :+
# Act like GNU screen
unbind C-b
set -g prefix C-a
# Cycle through panes using C-aa
unbind ^A
bind ^A select-pane -t :.+
# Reload config using 'r'
unbind r
bind r source-file ~/.tmux.conf
# Open a new pane on the right, 32% width
unbind C-w
bind C-w split-window -h -p 32
# Windows renumbered if one closes
set-option -g renumber-windows on
# Count window numbers starting with 1
set-option -g base-index 1
# Status bar colors (can take a hex value)
set -g status-bg '#333333'
set -g status-fg '#aaaaaa'
# Refresh status bar every second
set -g status-interval 1
# Set left-side status bar content
set -g status-left '#[default][#S]'
# Set right-side status bar content
set -g status-right "#(TZ=America/Los_Angeles date +%%I:%%M) %p %h %d %Y "
# Increase scrollback lines
set -g history-limit 10000
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n 'C-\' run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Create new windows with the same path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Needed to fix tmuxinator bug
set-window-option -g pane-base-index 1