-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
192 lines (148 loc) · 5.88 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Tmux Configuration
# Must not overide with neovim and terminal emulator keys
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
#Reduce time to wait for Escape key. For Neovim
set -g escape-time 10
#Enable Mouse
set -g mouse on
#Clipboard
set -g set-clipboard on
set -s command-alias[99] 'load-buffer=load-buffer -w'
# https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
#Enable colours enable neovim termguicolors and check shell with "echo $TERM"
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ',xterm-256color:Tc'
#Set base index 1
set -g base-index 1 # index of tabs starts at 1
set -g pane-base-index 1 # inex of pane must also start at 1
set-window-option -g pane-base-index 1 # Base window number?
set-option -g renumber-windows on # Renumber windows on remove
#History Limit 50k lines
set -g history-limit 100000
#Set Refresh every Second
set-option -g status-interval 1
# Disable automatic renaming
# set-option -g automatic-rename off
# set titles
# set-option -g set-titles on
set -g allow-rename off
# Set center
# set -g status-justify 'absolute-centre'
#dont exit from tmux when closing session
set -g detach-on-destroy off
# Key bind section all key assignments below must use Prefix-key
# Prefix key is default <C-a>
#Vim style pane selection <Prefix-key>
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# <Prefix-x>
bind-key x kill-pane
# <Prefix-Ctrl+w>
bind C-w kill-window
# <Prefix-Ctrl+q>
bind-key C-q run-shell "tmux detach-client -a; tmux kill-session; clear"
# <Prefix-\>
bind \\ split-window -v -c "#{pane_current_path}" #split to current path
# <Prefix-minus>
bind = split-window -h -c "#{pane_current_path}" #split to current path
bind -n C-S-Left { swap-window -t -1; previous-window }
bind -n C-S-Right { swap-window -t +1; next-window }
# Look for links
# <Prefix-l>
bind-key l run-shell -b "tmux capture-pane -J -p | rg -o 'https?://[[:alnum:]_?=/.%-]+' | fzf-tmux -d20 --multi --bind alt-a:select-all,alt-d:deselect-all | xargs xdg-open"
#Prefix key + r reload config
bind R source-file ~/.tmux.conf \; display "TMUX Configuration Reloaded!"
# Non prefixed key
# Shift Alt vim keys to switch windows
# bind -n M-H previous-window
# bind -n M-L next-window
# Prefix key + T
bind T clock-mode
# Set vi-mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
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
unbind-key -n M-0
unbind-key -n M-1
unbind-key -n M-2
unbind-key -n M-3
unbind-key -n M-4
unbind-key -n M-5
unbind-key -n M-6
unbind-key -n M-7
unbind-key -n M-8
unbind-key -n M-9
bind-key -n C-Tab select-window -t :+
bind-key -n C-` select-window -t :-
bind-key -n C-, select-window -t -1
bind-key -n C-. select-window -t +1
# bind-key -n C-h select-window -t -1
# bind-key -n C-l select-window -t +1
bind-key -T root C-1 select-window -t 1
bind-key -T root C-2 select-window -t 2
bind-key -T root C-3 select-window -t 3
bind-key -T root C-4 select-window -t 4
bind-key -T root C-5 select-window -t 5
bind-key -T root C-6 select-window -t 6
bind-key -T root C-7 select-window -t 7
bind-key -T root C-8 select-window -t 8
bind-key -T root C-9 select-window -t 9
# Undercurl
set -g default-terminal "${TERM}"
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
#Plugins Install <Prefix-I> to Install
# set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-sensible' #sensible commands
set -g @plugin 'tmux-plugins/tmux-resurrect' # resurrect sessions
set -g @resurrect-save 'S'
set -g @resurrect-restore 'r'
set -g @plugin 'tmux-plugins/tmux-continuum' #works with resurrreect
set -g @continuum-restore 'on'
set -g @plugin 'tmux-plugins/tmux-open' #open links and files in copy mode
set -g @plugin 'tmux-plugins/tmux-pain-control' # manage panes and windowsss
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
set -g @plugin 'alexwforsythe/tmux-which-key'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @fzf-url-open "zen-browser"
set -g @fzf-url-bind 'o'
set -g @plugin 'jimeh/tmuxifier' #tmux persistent layouts
set -g @plugin '27medkamal/tmux-session-wizard'
set -g @session-wizard 't'
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavor 'mocha' # latte,frappe, macchiato or mocha
set -g @catppuccin_window_status_style "basic"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M:%S"
set -g @catppuccin_status_background "none"
### Plugin: https://github.com/catppuccin/tmux
set-option -g @catppuccin_window_number_position 'left'
set-option -g @catppuccin_window_flags 'no'
set-option -g @catppuccin_window_text ' #W'
set-option -g @catppuccin_window_current_text ' #W'
# set-option -g @catppuccin_status_middle_separator '▐'
set-option -g @catppuccin_status_middle_separator ''
run '~/.tmux/plugins/tmux/catppuccin.tmux'
set -g status-left ""
set -g status-right-length 100
set -g status-right "#{E:@catppuccin_status_directory}"
# set -ag status-right "#{E:@catppuccin_status_user}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
# tmux-plugins/tmux-prefix-highlight support
# set -g @prefix_highlight_output_prefix "#[fg=#7aa2f7]#[bg=#1f2335]#[fg=#1f2335]#[bg=#7aa2f7]"
# set -g @prefix_highlight_output_suffix ""
# Resource TMUX Plugins
# run '/usr/share/tmux-plugin-manager/tpm'" >> ~/.tmux.conf
run '~/.tmux/plugins/tpm/tpm'