-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
137 lines (106 loc) · 4.13 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
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c '#{pane_current_path}'
bind ^s split-window -v -c "#{pane_current_path}"
bind ^v split-window -h -c "#{pane_current_path}"
# open panes in same path when using canonical tmux splits
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Provide command to generate a 2:1 ratio layout
bind @ \
split-window -h -c "#{pane_current_path}" -p 33 \;\
select-pane -L \;\
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind ^h select-pane -L
bind ^j select-pane -D
bind ^k select-pane -U
bind ^l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind -r < resize-pane -L 10
bind -r > resize-pane -R 10
bind -r - resize-pane -D 10
bind -r + resize-pane -U 10
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# session management
bind C new-session
bind L choose-session
# vi-style controls for copy mode
setw -g mode-keys vi
# Set the prefix to ^A, like screen
unbind C-b
set -g prefix ^A
bind a send-prefix
# Start numbering windows at 1
set -g base-index 1
# automatically renumber remaining windows when closing a window
set-option -g renumber-windows on
bind ^a last-window # toggle last window like screen
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
bind K confirm kill-server
bind X confirm kill-window
# longer scrollback
set -g history-limit 10000
# pane settings
set -g pane-border-fg "colour0"
set -g pane-border-bg "default"
set -g pane-active-border-fg "colour6"
set -g pane-active-border-bg "default"
# message pane settings
set -g message-fg "colour0"
set -g message-bg "colour4"
set -g message-command-fg "colour0"
set -g message-command-bg "colour4"
# status line settings
set -g status "on"
set -g status-justify "left"
set -g status-attr "none"
set -g status-fg "default"
set -g status-bg "colour08"
set -g status-left-length "100"
set -g status-left-attr "none"
set -g status-right-length "100"
set -g status-right-attr "none"
set -g status-left "#[fg=colour0,bg=colour6] #S #[fg=colour6,bg=colour8,nobold,nounderscore,noitalics] "
set -g status-right "#[fg=colour4,bg=colour8,nobold,nounderscore,noitalics]#[fg=colour0,bg=colour4] %Y-%m-%d | %H:%M #[fg=colour6,bg=colour4,nobold,nounderscore,noitalics]#[fg=colour0,bg=colour6] #h "
setw -g window-status-separator ""
setw -g window-status-fg "default"
setw -g window-status-bg "colour8"
setw -g window-status-attr "bold"
setw -g window-status-activity-bg "colour8"
setw -g window-status-activity-fg "colour6"
setw -g window-status-activity-attr "bold"
setw -g window-status-format "#[fg=default,bg=colour8] #I |#[fg=default,bg=colour8] #W "
setw -g window-status-current-format "#[fg=colour8,bg=colour4,bold,nounderscore,noitalics]#[fg=colour0,bg=colour4] #I |#[fg=colour0,bg=colour4] #W #[fg=colour4,bg=colour8,nobold,nounderscore,noitalics]"
# Update the status bar every sixty seconds
set-option -g status-interval 60
# disable mouse mode by default
set -g mouse off
# Toggle mouse on with m
bind m set -g mouse on \; display 'Mouse: ON'
# Toggle mouse off with M
bind M set -g mouse off \; display 'Mouse: OFF'
# reload tmux config file with C-a r
bind r source ~/.tmux.conf
# Create a new window and prompt for name
bind N command-prompt "new-window -n '%%' -c '#{pane_current_path}'"
bind c new-window -c '#{pane_current_path}'
# Rebind prefix to b
bind B set -g prefix ^b
bind A set -g prefix ^a
# Works with ~/.ssh/rc to allow re-attaching to tmuxes after ssh reconnect
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
# Toggle synchronize-panes with C-a y
bind y set synchronize-panes
set -g default-terminal "tmux-256color" # use 'tmux' instead of 'screen-*' to enable italics support per tmux FAQ
set-option -ga terminal-overrides ",*256col*:Tc"
# Don't wait for escape characters
set -s escape-time 0