-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.tmux.conf
150 lines (138 loc) · 4.83 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
138
139
140
141
142
143
144
145
146
147
148
149
150
set -g default-shell $SHELL
set -g default-terminal 'xterm-256color'
# set -as terminal-overrides ',xterm*:sitm=\E[3m' # this probably only needs to happen in OS X
# set -as terminal-overrides ',xterm*:RGB' # this probably only needs to happen in OS X
# set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
# set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# set -ag update-environment ' ITERM_PROFILE'
set -g prefix C-a
set -g status-keys vi
set -g escape-time 1
set -g repeat-time 100
set -g history-limit 10000
set -g mouse on
set -g focus-events on
set -s set-clipboard on
set -g allow-passthrough on
set -gw mode-keys vi
# set -gw aggressive-resize on
# panes
set -g base-index 1
set -g pane-active-border-style bg=black,fg="#383838"
set -g pane-border-style bg=black,fg="#282828"
set -gw pane-base-index 1
# status bar
set -gw automatic-rename on
set -gw display-time 5000
set -gw message-style bg=default,fg=default
set -gw monitor-activity on
set -gw set-titles off # tmux window titling for X
set -gw visual-activity off
set -g status on
set -g status-interval 1
set -g status-position 'top'
set -g status-style bg=default,fg=white
set -g status-left " #S "
set -g status-left-length 80
set -ag status-left-style fg=default,bold
set -g status-right ""
# set -ag status-right " BTC #(btc-watch) "
set -ag status-right " #[fg=red]%l:%M#[fg=white] %m|%d"
# set -ag status-right " #(TZ=UTC date +%%H:%%M)"
# set -ag status-right " "
# set -ag status-right "#(airpod_battery)"
set -ag status-right " #[fg=green]#(battery)#[fg=white]"
set -ag status-right " "
set -g status-right-length 80
set -gw window-status-current-style bg=green,fg=brightwhite
set -gw window-status-current-format " #W "
set -gw window-status-style fg=white
set -gw window-status-format " #W "
# keybindings
unbind-key "'"
unbind-key %
unbind-key &
unbind-key '"'
unbind-key ,
unbind-key .
unbind-key C-a
unbind-key C-b
unbind-key E
unbind-key H
unbind-key J
unbind-key K
unbind-key L
unbind-key [
unbind-key h
unbind-key j
unbind-key k
unbind-key l
unbind-key l
unbind-key n
unbind-key p
unbind-key r
unbind-key u
unbind-key y
# unbind-key Up
# unbind-key Right
# unbind-key Down
# unbind-key Left
# bind-key -r Left swap-window -t -1
# bind-key -r Right swap-window -t +1
bind-key + resize-pane -Z
bind-key , previous-window
bind-key - split-window -c "#{pane_current_path}" -v
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi y send -X copy-pipe "[[ ! -z $SSH_CONNECTION ]] && ssh $(echo $SSH_CONNECTION | cut -d' ' -f1) pbcopy || pbcopy"
bind-key . next-window
bind-key / set-option status
bind-key < swap-window -t :-
bind-key > swap-window -t :+
bind-key C-a last-window
bind-key C-h select-window -t :-
bind-key C-l select-window -t :+
bind-key Escape copy-mode
bind-key E send-keys 'eval "$(tmux show-environment -s)"' Enter
bind-key H resize-pane -L 10
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key L resize-pane -R 10
bind-key N command-prompt 'rename-session %%'
bind-key Q confirm-before kill-server
bind-key R source-file $HOME/.tmux.conf \; display ' Reloaded configuration'
bind-key S set status
bind-key T send-keys 'eval "$(tmux show-environment -s)"'
bind-key X kill-window
bind-key \\ split-window -c "#{pane_current_path}" -h
bind-key _ run-shell 'tmux-ssh-split -v'
bind-key a send-key C-a
bind-key c new-window -c "#{pane_current_path}"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key n command-prompt 'rename-window %%'
bind-key p paste-buffer
bind-key q confirm-before kill-session
bind-key r send-keys C-c Up Enter
bind-key u refresh-client
bind-key x kill-pane
bind-key | run-shell 'tmux-ssh-split -h'
# Smart pane switching with awareness of Vim splits.
# 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-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l