-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
125 lines (91 loc) · 3.94 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
# ===== general =====
set -g default-command "${SHELL}"
setw -g extended-keys on
set -s escape-time 10
set -sg repeat-time 600
set -s focus-events on
set -g history-limit 50000
# remap prefix from 'C-b' to 'C-a'
set-option -g prefix C-a
unbind C-b
bind C-a send-prefix
# edit configuration
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf'"
# reload configuration
bind r source-file ~/.tmux.conf \; display-message '~/.tmux.conf sourced'
# ===== display =====
set -g status-position top
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1500 # slightly longer status messages display time
set -g status-interval 5 # redraw status line every 10 seconds
# activity
set -g monitor-activity on
set -g visual-activity off
# ===== navigation =====
bind -T prefix c new-window -c '#{pane_current_path}'
bind '\' split-window -h -c '#{pane_current_path}' # split vertically
bind '|' split-window -fh -c '#{pane_current_path}' # split full-height vertically
bind '-' split-window -v -c '#{pane_current_path}' # split horizontally
bind '_' split-window -fv -c '#{pane_current_path}' # split full-width horizontally
if-shell 'command -v htop' \
"bind '%' split-window -fh 'htop'"
unbind '"'
set -g mouse on
# make scrolling with wheels work
# https://gist.github.com/rodricels/7951c3bd505d343b07309b76188af9b3
# https://stackoverflow.com/a/33461197/6719067
# bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if-shell -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
# bind -n WheelDownPane select-pane -t= \; send-keys -M
# make arrows do not repetitive
bind-key -T prefix Up select-pane -U
bind-key -T prefix Down select-pane -D
bind-key -T prefix Right select-pane -R
bind-key -T prefix Left select-pane -L
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# maximize current pane
bind Enter resize-pane -Z
unbind z
# window navigation
unbind n
unbind p
bind Tab next-window
bind S-Tab previous-window
# ===== custom key bindings =====
bind / command-prompt -I "man " "split-window -fh 'exec %%'"
bind S command-prompt -I "ssh " "new-window -n '%1' '%%'"
# ===== theme =====
set -g status-style "bg=black,fg=white"
set -g pane-border-style "fg=brightblack,bg=default"
set -g pane-active-border-style "fg=cyan,bg=default"
set -g mode-style "fg=black,bg=cyan"
set -g message-command-style "fg=cyan,bg=brightblack"
set -g message-style "fg=cyan,bg=brightblack"
set -g status-left "#[fg=white,bold] #S "
set -g status-right "#{prefix_highlight}#[fg=white,bg=brightblack]"
set -g window-status-format " #I #W #F "
set -g window-status-style "fg=white"
set -g window-status-bell-style "fg=white,bg=brightblack"
set -g window-status-activity-style "fg=white,bg=brightblack"
set -g window-status-current-format " #I #W #F "
set -g window-status-current-style "fg=black,bg=white"
set -g window-status-separator ""
#####################
###### Plugins ######
#####################
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_fg 'black'
set -g @prefix_highlight_bg 'cyan'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=cyan'
set -g @prefix_highlight_show_sync_mode 'on'
set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=cyan'
if-shell "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run -b '~/.tmux/plugins/tpm/tpm'