-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtmux.conf
More file actions
142 lines (104 loc) · 4.01 KB
/
tmux.conf
File metadata and controls
142 lines (104 loc) · 4.01 KB
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
# set zshell by default
set-option -g default-shell /bin/zsh
# split windows like vim
# vim's definitoin of a horizontal/vertical split is reversed from tmux's
bind s split-window -v -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind '%' 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}"
# 2:1 split
bind @ \
split-window -h -c "#{pane_current_path}" -l 33% \;\
select-pane -L \;\
# 3:1 split
bind \# \
split-window -h -c "#{pane_current_path}" -l 25% \;\
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
bind -r > resize-pane -R 10
bind -r < resize-pane -L 10
bind -r - resize-pane -D 10
bind -r + resize-pane -U 10
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# bind : to command-prompt like vim
bind : command-prompt
# session management
bind C new-session
bind L choose-session
bind-key R set-window-option synchronize-panes\; display-message "synchronize-panes #{?pane_synchronized,on,off}"
setw -g mode-keys vi
# set prefix to ^A like screen
unbind C-b
set -g prefix ^A
bind a send-prefix
bind A set -g prefix ^a
# set -g prefix ^Q
# bind q send-prefix
# bind Q set -g prefix ^q
bind ^a last-window # toggle last window like screen
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSHCONNECTION"
bind K confirm kill-server
bind X confirm kill-window
#longer scrollback
set -g history-limit 10000
# ignore escape time
set -sg escape-time 0
# let us use utf-8 drawing characters to make tab0like window formats
# setw -g utf8 on
# set -g status-utf8 on
set -g status-interval 1
set -g status-style fg=white,bg=default
# left side of status bar holds "(>- session name -<)"
set -g status-left-length 100
set -g status-left-style fg=black,bg=green,bold
set -g status-left ''
# set window index
set -g base-index 1
setw -g pane-base-index 1
#right side of status bar holds "[host name] (date time)"
set -g status-right-length 100
set -g status-right-style fg=black,bold
set-window-option -g window-status-format '#[fg=colour250,bg=colour236] #I|#[fg=white,bg=colour236]#W #{?window_zoomed_flag,#[fg=colour44](,}#W#{?window_zoomed_flag,#[fg=colour44]),} #[default]'
# renumber windows when a window is closed
set-option -g renumber-windows on
# make foreground window look like bright foreground tab
set-window-option -g window-status-current-style none
set-window-option -g window-status-current-format '#[fg=colour209,bg=colour239] #I|#[fg=colour255,bg=colour239]#W #{?window_zoomed_flag,#[fg=colour44](,}#W#{?window_zoomed_flag,#[fg=colour44]),} #[default]'
# active terminal yellow border, non-active white
set -g pane-border-style fg=colour238,bg=default
set -g pane-active-border-style fg=colour214,bg=default
# set a 256color $TERM variable so programs inside tmux know they can use 256 colors
set -g default-terminal screen-256color
# disable mouse mode by default
set -g mouse off
# Toggle mouse on
bind-key M \
set-option -g mouse on \;\
display-message 'Mouse: ON'
# Toggle mouse off
bind-key m \
set-option -g mouse off \;\
display-message '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 -c '#{pane_current_path}' -n '%%'"
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
# Pane Names
set -g pane-border-format " [ ###P #T ] "
bind-key Y set-window-option pane-border-status
bind-key y command-prompt -p "Pane title:" 'select-pane -T "%%"'
# set tmuxline snapshot in vim
if '[ -f ~/.tmuxline.conf ]' 'source-file ~/.tmuxline.conf'