.tmux.conf (4323B)
1 # PREFIX Key 2 unbind C-b 3 set -g prefix C-n 4 5 bind r source-file ~/.tmux.conf\; display "config reloaded!" 6 set -g mouse on 7 8 # Bind middle-click on a window in the status bar to close it 9 bind -n MouseDown2Status kill-window 10 11 # # Window & Pane Index from 1 12 set -g base-index 1 # Windows start from 1 13 set -g pane-base-index 1 # Panes start from 1 14 set-option -g renumber-windows on # Auto renumber windows after close 15 set-option -g default-shell /usr/bin/zsh 16 17 # Smart pane switching with awareness of Vim splits. 18 # See: https://github.com/christoomey/vim-tmux-navigator 19 20 # decide whether we're in a Vim process 21 is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ 22 | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 23 24 bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' 25 bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' 26 bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' 27 bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' 28 29 tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' 30 31 if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ 32 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" 33 if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ 34 "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" 35 36 bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+' 37 38 bind-key -T copy-mode-vi 'C-h' select-pane -L 39 bind-key -T copy-mode-vi 'C-j' select-pane -D 40 bind-key -T copy-mode-vi 'C-k' select-pane -U 41 bind-key -T copy-mode-vi 'C-l' select-pane -R 42 bind-key -T copy-mode-vi 'C-\' select-pane -l 43 bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+ 44 45 # Splits 46 bind v split-window -h -p 30 47 bind w split-window -v -p 30 48 bind q killp 49 bind - select-layout -E 50 bind-key Tab last-window 51 bind-key C command-prompt -p "New session name:" "new-session -s '%%' -c ~" 52 53 # Plugins 54 set -g @plugin 'tmux-plugins/tpm' 55 set -g @tpm_plugins ' 56 tmux-plugins/tpm \ 57 catppuccin/tmux \ 58 christoomey/vim-tmux-navigator \ 59 ' 60 set -g @thm_bg default 61 set -g @thm_txt "#181818" 62 set -g @thm_fg "#d8d8d8" 63 64 # Configure Catppuccin 65 set -g @catppuccin_flavor "macchiato" 66 set -g @catppuccin_status_background "none" 67 set -g @catppuccin_window_status_style "none" 68 set -g @catppuccin_pane_status_enabled "off" 69 set -g @catppuccin_pane_border_status "off" 70 71 # status left look and feel 72 set -g status-left-length 100 73 set -g status-left "" 74 set -ga status-left "#{?client_prefix,#{#[bg=#{@thm_peach},fg=#{@thm_txt},bold] #S },#{#[bg=#{@thm_bg},fg=#{@thm_fg}] #S }}" 75 set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_fg},none]│" 76 set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_fg}] #{pane_current_command} " 77 set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_fg},none]#{?window_zoomed_flag,│,}" 78 set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag, zoom ,}" 79 set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_fg},none]│" 80 81 # status right look and feel 82 set -g status-right-length 100 83 set -g status-right "" 84 # set -ga status-right "#[fg=#{@thm_fg}] ♥ #(acpi -b | awk '{print $4}' | tr -d ',') |" 85 set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_fg}] %A %d-%m-%Y | %l:%M %p " 86 87 # Configure Tmux 88 set -g status-position top 89 set -g status-style "bg=#{@thm_bg}" 90 91 # pane border look and feel 92 setw -g pane-border-status top 93 setw -g pane-border-format "" 94 setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_fg}" 95 setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_fg}" 96 setw -g pane-border-lines single 97 98 # window look and feel 99 set-option -wg automatic-rename on 100 set-option -g automatic-rename-format ' #{b:pane_current_path}' 101 102 set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} " 103 set -g window-status-style "bg=#{@thm_bg},fg=#{@thm_fg}" 104 set -g window-status-last-style "bg=#{@thm_bg},fg=#{@thm_fg}" 105 set -g window-status-activity-style "bg=#{@thm_red},fg=#{@thm_bg}" 106 set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_bg},bold" 107 108 set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} " 109 set -g window-status-current-style "bg=#{@thm_fg},fg=#{@thm_txt},bold" 110 111 # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 112 run '~/.tmux/plugins/tpm/tpm'