-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
118 lines (97 loc) · 3.33 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
#
# Tureba's tmux.conf
#
# To use it, either:
# a) link ~/.tmux.conf to it; or
# b) create a ~/.tmux.conf that sources it.
#
# who: Arthur Nascimento <[email protected]>
# where: github.com/tureba/myconfigfiles
#
# defaults
set -g default-shell /bin/zsh
set -g default-command zsh
# tmux sets screen/screen-256, but has no codes for italics
set -g default-terminal tmux-256color
# linux terminal doesn't need this, but xterm does
set -g terminal-overrides 'xterm*:smcup@:rmcup@,*256col*:colors=256,xterm*:XT'
# xterm-style function key sequences
setw -g xterm-keys on
# 1, 2 and 3 are closer together than 0, 1 and 2
set -g base-index 1
set -g pane-base-index 1
# easier to type than C-b
set -g prefix C-a
set -g prefix2 C-b
unbind C-b
bind C-a send-prefix
# for repeatable keys
set -g repeat-time 170
# status bar
set -g status-style fg=green,bg=colour234
set -g status-right-style bg=colour236
set -g status-right "#[bold,fg=blue][#[fg=default]#T#[fg=blue]]#[nobold,fg=default] | #[fg=yellow]%F %R"
set -g status-right-length 120
set -g status-left-style bg=colour236,bright
set -g status-left "#[fg=blue][#[fg=default]#h#[fg=cyan]:#[fg=default]#S#[fg=blue]]"
set -g status-left-length 30
setw -g window-status-style fg=green
setw -g window-status-format " #I#[nobold]:#W "
setw -g window-status-current-style fg=green,bright
setw -g window-status-current-format "#[fg=red][#[fg=default]#I:#W#[fg=red]]"
setw -g window-status-separator "|"
setw -g window-status-activity-style blink
setw -g window-status-bell-style blink
setw -g window-status-last-style bright
# enable wm window titles
set -g set-titles on
# auto window rename
setw -g automatic-rename on
# auto window resize
setw -g aggressive-resize on
# mouse settings
set -g mouse on
# var|bind \ cmd | vim | less | copy | zsh
# pane_in_mode | 0 | 0 | 1 | 0
# mouse_any_flag | 1 | 0 | 0 | 0
# alternate_on | 1 | 1 | 0 | 0
# WheelUpPane | send -M | send Up | * | send Up (** or copy-mode -e)
# WheelDownPane | send -M | send Down | * | send Down
# * panes in copy mode have scroll handled by different bindings
# ** cycle over shell history
#bind -T root WheelUpPane if -Ft= '#{mouse_any_flag}' 'send -Mt=' 'send -t= Up'
# ** enter copy mode
bind -T root WheelUpPane if -Ft= '#{mouse_any_flag}' 'send -Mt=' 'if -Ft= "#{alternate_on}" "send -t= Up" "copy-mode -et="'
bind -T root WheelDownPane if -Ft= '#{mouse_any_flag}' 'send -Mt=' 'send -t= Down'
# sensible v/h splits
unbind %
unbind '"'
bind | split-window -h
bind - split-window -v
# hjkl pane traversal
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# window navigation
unbind p
bind -r [ previous-window
unbind n
bind -r ] next-window
# Vi copypaste mode
setw -g mode-keys vi
bind C-c copy-mode
bind p paste-buffer
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi V send-keys -X rectangle-toggle
# toggle window activity monitoring
bind m setw monitor-activity
# reload the configuration
bind r source-file ~/.tmux.conf
# toggle synchronize-panes
bind S setw synchronize-panes
# create a new window with exactly this command
bind C command-prompt "new-window 'exec %%'"
# (toggle) mark this pane for easier joins and swaps
bind . select-pane -m