-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
195 lines (160 loc) · 6.69 KB
/
dot_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
193
194
195
# OSX Fix
# set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
# TPM
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'catppuccin/tmux' # Has to be before everything
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @treemux-tree-nvim-init-file '~/.tmux/plugins/treemux/configs/treemux_init.lua'
set -g @plugin 'kiyoon/treemux'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tassaron/tmux-df'
set -g @plugin 'anghootys/tmux-ip-address'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'xamut/tmux-weather'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'robhurring/tmux-uptime'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'sainnhe/tmux-fzf'
# set -g @plugin 'lljbash/tmux-update-display'
# set -g @plugin 'aaronpowell/tmux-weather' # Alternative
# set -g @plugin 'ofirgall/tmux-window-name'
# Reload config file
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
#--- STATUS ---##
# Status Globals
set -g status-interval 1
set -g status-position top
# set status-justify left
# Status Right
# set -g status-right '#{online_status} #{ip_address} | #{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} #{ram_bg_color} MEM: #{ram_icon} #{ram_percentage} DSK: #{df_percent} | #{forecast} | %a %d/%m/%Y %H:%M'
set -g status-right-length 200
# Status Left
# set -g status-left '#{prefix_highlight}'
##--- PLUGIN CONFIG ---##
# Prefix Highlight
# set -g @prefix_highlight_show_copy_mode 'on'
# set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=yellow,bold' # default is 'fg=default,bg=yellow'
# set -g @prefix_highlight_show_sync_mode 'on'
# set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=green' # default is 'fg=default,bg=yellow'
# set -g @prefix_highlight_prefix_prompt 'Wait'
# set -g @prefix_highlight_copy_prompt 'Copy'
# set -g @prefix_highlight_sync_prompt 'Sync'
# set -g @prefix_highlight_empty_prompt ' ' # default is '' (empty char)
# set -g @prefix_highlight_empty_attr 'fg=default,bg=green' # default is 'fg=default,bg=default'
# set -g @prefix_highlight_empty_has_affixes 'on'
# set -g @prefix_highlight_empty_prompt '#H'
# set -g @prefix_highlight_output_prefix '<'
# set -g @prefix_highlight_output_suffix '>'
# Online status
# set -g @online_icon "[online]"
# set -g @offline_icon "[offline]"
# aaronpowell/tmux-weather
# set -g @forecast-location Berlin
# set -g @forecast-format +'%m'+'%C'+'%t'+'%l'
# tmux-yank
set -g @yank_with_mouse on
# xamut/tmux-weather
set -g @tmux-weather-units "c"
set -g @tmux-weather-location "Berlin"
set -g @tmux-weather-format "+%m+%t"
# Catppuccin
set -g @catppuccin_flavour 'macchiato'
set -g @catppuccin_window_status_icon_enable "yes"
set -g @catppuccin_window_left_separator "█"
set -g @catppuccin_window_right_separator "█"
set -g @catppuccin_window_middle_separator " █"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules_right "session host cpu weather date_time"
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_right_separator_inverse "yes"
set -g @catppuccin_status_fill "all"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_date_time_text "%a %d/%m %H:%M"
set -g @catppuccin_icon_window_last ""
set -g @catppuccin_icon_window_current ""
set -g @catppuccin_icon_window_zoom ""
set -g @catppuccin_icon_window_mark ""
set -g @catppuccin_icon_window_silent ""
set -g @catppuccin_icon_window_activity ""
set -g @catppuccin_icon_window_bell ""
set -g @catppuccin_window_default_color "white"
set -g @catppuccin_window_current_color "red"
set -g @catppuccin_pane_border_style "fg=blue"
set -g @catppuccin_pane_active_border_style "fg=red"
set -g @catppuccin_user_color "blue"
set -g @catppuccin_host_color "red"
set -g @catppuccin_application_color "blue"
set -g @catppuccin_cpu_color "blue"
set -g @catppuccin_weather_color "blue"
set -g @catppuccin_date_time_color "blue"
##--- GLOBALS ---#
# Set prefix to Ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Resize everywhere
set -g aggressive-resize on
set -sg escape-time 0
set -g mouse on
set -g history-limit 100000
##--- BINDS ---##
bind-key / copy-mode \; send-key ? # Copy mode with /
bind y setw synchronize-panes # Sync panes
bind \` switch-client -t'{marked}' # Switch to marked
# Paste using 'p'
unbind p
bind p paste-buffer
##--- WINDOWS ---##
set -g base-index 1
set -g renumber-windows on
set-window-option -g pane-base-index 1
set-window-option -g mode-keys vi
set-window-option -g automatic-rename
unbind n
unbind w
bind n command-prompt "rename-window '%%'"
bind w new-window -c "#{pane_current_path}"
bind -n M-j previous-window
bind -n M-k next-window
bind Space last-window
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind x kill-pane
##-- TMUX-VIM --#
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# decide whether we're in a Vim process
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-Left' if-shell "$is_vim" 'send-keys M-Left' 'select-pane -L'
bind-key -n 'M-Down' if-shell "$is_vim" 'send-keys M-Down' 'select-pane -D'
bind-key -n 'M-Up' if-shell "$is_vim" 'send-keys M-Up' 'select-pane -U'
bind-key -n 'M-Right' if-shell "$is_vim" 'send-keys M-Right' '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 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'"
#bind-key -n 'A-Space' if-shell "$is_vim" 'send-keys A-Space' 'select-pane -t:.+'
bind-key -T copy-mode-vi 'M-Left' select-pane -L
bind-key -T copy-mode-vi 'M-Down' select-pane -D
bind-key -T copy-mode-vi 'M-Up' select-pane -U
bind-key -T copy-mode-vi 'M-Right' select-pane -R
# bind-key -T copy-mode-vi 'A-\\' select-pane -l
# bind-key -T copy-mode-vi 'A-space' select-pane -t:.+
# Cheat Sheet
# bind-key -r i run-shell "tmux neww tmux-cht.sh"
# tmux-fzf
TMUX_FZF_LAUNCH_KEY="C-f"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '$HOME/.tmux/plugins/tpm/tpm'
# Set autoreload
set-option -g @plugin 'b0o/tmux-autoreload'