-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
130 lines (105 loc) · 3.43 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
# vim: sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldmethod=marker
# Bindings {
# Set Ctrl-Space as the default prefix key combination.
# And unbind C-b to free it up.
set -g prefix C-Space
unbind C-b
# Use send-prefix to pass C-Space through to application
bind Space send-prefix
# Reload tmux.conf using PREFIX r
unbind r
bind r \
display "Reloading, hold on..." \;\
source-file ~/.config/tmux/tmux.conf \;\
display "Reloaded!"
# Mouse mode on by default
set -g mouse on
# Toggle mouse mode
unbind m
bind m \
set -g mouse \;\
display 'Mouse: #{mouse}'
# Toggle keep panes
unbind k
bind k \
set -g remain-on-exit \;\
display 'Remain On Exit: #{remain-on-exit}'
# Use PR when switching sessions
unbind s
bind s new-window 'pr'
# Go to the last session.
# Similar in spirit to cd -
unbind -
bind - switch-client -l
# Toggle pane sync on
unbind z
bind z \
set-window-option synchronize-panes \;\
display 'Sync: #{pane-synchronized}'
# Rebind pane tiling
unbind %
bind % display 'Use <leader>v'
bind v split-window -h
bind h split-window
# Bind reset the session base directory to current path
unbind o
bind o attach-session -t . -c '#{pane_current_path}'
# }
# Vim Navigator {
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key -n 'C-Left' if-shell "$is_vim" 'send-keys C-Left' 'select-pane -L'
bind-key -n 'C-Down' if-shell "$is_vim" 'send-keys C-Down' 'select-pane -D'
bind-key -n 'C-Up' if-shell "$is_vim" 'send-keys C-Up' 'select-pane -U'
bind-key -n 'C-Right' if-shell "$is_vim" 'send-keys C-Right' 'select-pane -R'
bind-key -n 'C-G' next-window
bind-key -n 'C-P' previous-window
# }
# Misc {
set -g history-limit 10000
set -g status-keys emacs
set -g bell-action any
set -g focus-events on
# Fix vim mode switching: http://superuser.com/a/252717/65504
set -s escape-time 0
set -g display-time 5000
set -g status-interval 30
set -g automatic-rename on
# Setup 'v' to begin selection as in Vim
set-option -s set-clipboard external
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'pbcopy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'pbcopy'
# }
# Colors {
# Clock {
set -g clock-mode-colour color7
set -g clock-mode-style 24
# }
# Set terminal color
set -g default-terminal "xterm-kitty"
# Status Bar {
# Set color for status bar
set -g status-style bg=default,fg=color7
# Center the status
set -g status-justify centre
# Status Bar Left is only the user name
set -g status-left-length 100
set -g status-left "#{session_name}#{?pane_synchronized, #[bg=color1#,fg=color0]!! Panes are Synced !!#[default],}"
# Status Bar Right is: Session name / Battery / Time
set -g status-right-length 60
set -g status-right "#(battery_percent) "
set -ga status-right "#(date +'%m/%d %H:%M') "
set -g window-status-style fg=color15
set -g window-status-current-style fg=color0,bg=color7
set -g window-style fg=color7
# }
set -g pane-border-style "#{?pane_synchronized, fg=color1, fg=color7}"
set -g pane-active-border-style "#{?pane_synchronized, fg=color1, fg=color7}"
set -g message-style fg=color7,bg=color0
set -g message-command-style fg=color7,bg=color0
set -g copy-mode-match-style bg=color3,fg=color0
set -g copy-mode-mark-style bg=color3,fg=color0
set -g copy-mode-current-match-style bg=color3,fg=color0
# }