-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
172 lines (144 loc) · 6.24 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
set -g activity-action other
set -g assume-paste-time 1
set -g base-index 1
setw -g pane-base-index 1
set -g bell-action any
set -g default-command ""
set -g default-shell $SHELL
set -g destroy-unattached off
set -g detach-on-destroy on
set -g display-panes-active-colour red
set -g display-panes-colour blue
set -g display-panes-time 1000
set -g display-time 750
set -g history-limit 2000
set -g key-table "root"
set -g lock-after-time 0
set -g lock-command "lock -np"
set -g message-command-style fg=yellow,bg=black
set -g message-style fg=black,bg=yellow
set -g mouse off
set -g prefix C-b
set -g prefix2 None
set -g renumber-windows off
set -g repeat-time 500
set -g set-titles off
set -g set-titles-string "#S:#I:#W - \"#T\" #{session_alerts}"
set -g silence-action other
set -g status on
set -g status-interval 15
set -g status-justify left
set -g status-keys emacs
set -g status-left-style default
set -g status-position bottom
set -g update-environment[0] "DISPLAY"
set -g update-environment[1] "KRB5CCNAME"
set -g update-environment[2] "SSH_ASKPASS"
set -g update-environment[3] "SSH_AUTH_SOCK"
set -g update-environment[4] "SSH_AGENT_PID"
set -g update-environment[5] "SSH_CONNECTION"
set -g update-environment[6] "WINDOWID"
set -g update-environment[7] "XAUTHORITY"
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g word-separators " -_@"
set -g allow-rename off
set-option -g renumber-windows on
set-option -sa terminal-features ',xterm-kitty:RGB'
setw -g mode-keys vi
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
unbind-key v
bind-key v copy-mode
set -g default-terminal 'tmux-256color'
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 scrollback buffer to 10000
set -g history-limit 10000
#rename window with current path
set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format "#{?#{==:#{pane_current_command},binfmt-bypass},nvim,#{pane_current_command}}"
set -sg escape-time 0
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# reload
bind r source-file ~/.tmux.conf
# split current window horizontally
bind - split-window -v
# split current window vertically
bind | split-window -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|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "if-shell 'expr #{pane_left}' 'select-pane -L'"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "if-shell 'expr #{window_height} - #{pane_bottom} - 1' 'select-pane -D'"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "if-shell 'expr #{pane_top}' 'select-pane -U'"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "if-shell 'expr #{window_width} - #{pane_right} - 1' 'select-pane -R'"
bind-key -T copy-mode-vi C-h if-shell 'expr #{pane_left}' 'select-pane -L'
bind-key -T copy-mode-vi C-j if-shell 'expr #{window_height} - #{pane_bottom} - 1' 'select-pane -D'
bind-key -T copy-mode-vi C-k if-shell 'expr #{pane_top}' 'select-pane -U'
bind-key -T copy-mode-vi C-l if-shell 'expr #{window_width} - #{pane_right} - 1' 'select-pane -R'
# without prefix change window (ignore errors)
bind-key -n M-1 if-shell 'tmux select-window -t :1' ''
bind-key -n M-2 if-shell 'tmux select-window -t :2' ''
bind-key -n M-3 if-shell 'tmux select-window -t :3' ''
bind-key -n M-4 if-shell 'tmux select-window -t :4' ''
bind-key -n M-5 if-shell 'tmux select-window -t :5' ''
bind-key -n M-6 if-shell 'tmux select-window -t :6' ''
bind-key -n M-7 if-shell 'tmux select-window -t :7' ''
bind-key -n M-8 if-shell 'tmux select-window -t :8' ''
bind-key -n M-9 if-shell 'tmux select-window -t :9' ''
bind-key -n M-0 if-shell 'tmux select-window -t :10' ''
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
bind Space switch-client -l # move to last active session
bind BSpace last-window # move to last active window
# bind BSpace switch-client -l # move to last active session
bind p new-window "~/Scripts/tmux/sessionizer-improved"
bind . new-window "~/Scripts/tmux/dotfile-edit"
bind tab new-window "~/Scripts/tmux/cheat"
bind u if-shell '~/Scripts/tmux/db-session' ''
bind n new-window '~/Scripts/tmux/tree-session'
bind Q if-shell '~/Scripts/tmux/cli-toggle' ''
bind q if-shell '~/Scripts/tmux/cli-toggle right' ''
# Plugins
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'Morantron/tmux-fingers'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @fingers-key f
set -g @fingers-highlight-format "#[fg=yellow,nobold,bright]%s"
set -g @fingers-hint-format "#[fg=black,bg=yellow,bold,bright]%s"
set-option -g message-command-style 'bg=#282c34,fg=#bbc2cf'
set-option -g message-style 'bg=#282c34,fg=#bbc2cf'
set-option -g mode-style 'reverse'
set-option -wg mode-style 'bg=#1793d0,fg=#f8f8f0,bold' # Session/window selection selected line color
set-option -g status-justify left
set-option -g status-left ' #S '
set-option -g status-left-length 32
set-option -g status-left "#[bg=#1793d0,fg=#f7f8ff,bold] #S #[bg=default,fg=default,bold] "
set-option -g status-right ''
set-option -g status-style ''
set-option -g window-status-current-format ' #I:#W '
set-option -g window-status-current-style 'bg=#1793d0,bold,fg=#f6f8ff'
set-option -g window-status-format ' #I:#W '
set-option -g window-status-separator ' '
set-option -g window-status-style ''
set -g message-style bg=default,fg=#f8f8f0
set -g message-command-style bg=default,fg=#f8f8f0
set -g pane-border-style bg=default,fg=#505050
set -g pane-active-border-style bg=default,fg=#1793d0
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'