diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
| commit | 07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch) | |
| tree | a6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/tmux/tmux.conf | |
| parent | 6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff) | |
updates
Diffstat (limited to 'mac/.config/tmux/tmux.conf')
| -rw-r--r-- | mac/.config/tmux/tmux.conf | 341 |
1 files changed, 341 insertions, 0 deletions
diff --git a/mac/.config/tmux/tmux.conf b/mac/.config/tmux/tmux.conf new file mode 100644 index 0000000..069a7cd --- /dev/null +++ b/mac/.config/tmux/tmux.conf @@ -0,0 +1,341 @@ +### --- TPM --- ### +set-environment -gF TMUX_PLUGIN_MANAGER_PATH '#{HOME}/.local/bin/tmux/' + +if 'test ! -d "${TMUX_PLUGIN_MANAGER_PATH}/tpm"' { + run 'mkdir -p "${TMUX_PLUGIN_MANAGER_PATH}" && + git clone https://github.com/tmux-plugins/tpm "${TMUX_PLUGIN_MANAGER_PATH}/tpm" && + ${TMUX_PLUGIN_MANAGER_PATH}/tpm/bin/install_plugins' +} + + +### --- Settings --- ### +# general +set -as terminal-features 'xterm*:extkeys' +set -g base-index 1 +set -g pane-base-index 1 +set -g default-shell /usr/bin/zsh +set -g detach-on-destroy off +set -s extended-keys on +set -g focus-events on +set -g history-limit 1000000 +set -g mouse on +set -g renumber-windows on +set -g set-clipboard on +set -g xterm-keys on +set -gq allow-passthrough on +set -sg escape-time 0 +setw -g mode-keys vi +setw -g aggressive-resize on + +# activity +set -g monitor-activity on +set -g visual-activity off + +# color +set -g default-terminal "xterm-256color" +# set -g default-terminal 'screen-256color' +set -ga terminal-overrides ',xterm-256color:Tc' +set -sa terminal-features ',xterm-256color:RGB' + +# status +set -g status-interval 1 +set -g status-justify absolute-centre +set -g status-left "" +set -g status-left-length 10 +set -g status-position top +set -g status-right "" +set -g status-style "bg=default" + + +### --- Key Bindings --- ### +# clear +bind 'l' "send-keys C-l; send-keys -R; clear-history" + +# copy-mode +bind 'v' copy-mode + +# lazygit +bind -n 'M-g' popup -d "#{pane_current_path}" -E -h 95% -w 95% -x 100% "EDITOR=nvim lazygit" + +# pane +bind '%' split-window -h -c '#{pane_current_path}' +bind '"' split-window -v -c '#{pane_current_path}' +bind '|' split-window -h +bind '-' split-window -v +bind -r 'C-down' resize-pane -D 5 +bind -r 'C-up' resize-pane -U 5 +bind -r 'C-left' resize-pane -L 5 +bind -r 'C-right' resize-pane -R 5 +bind '@' choose-window 'join-pane -h -s "%%"' +bind '#' choose-window 'join-pane -s "%%"' +bind 'x' kill-pane +bind 'a' kill-pane -a +bind 'X' kill-window +bind 'A' kill-window -a +bind -n 'M-k' move-pane -h -t '.{up-of}' +bind -n 'M-l' move-pane -t '.{right-of}' +bind -n 'M-h' move-pane -t '.{left-of}' +bind -n 'M-j' move-pane -h -t '.{down-of}' + +# prefix +unbind 'C-b' +set -g prefix 'C-Space' +bind 'C-Space' send-prefix + +# reload +unbind 'r' +bind 'r' source-file "~/.config/tmux/tmux.conf" + +# scripts +bind 'h' run-shell -b "~/.local/bin/tmuxtogglebar" +bind 'b' run-shell -b "~/.local/bin/tmuxcycleborder" +bind -T copy-mode M-\\ run-shell -b "~/.local/bin/tmuxtoggleterm" +bind -T copy-mode-vi M-\\ run-shell -b "~/.local/bin/tmuxtoggleterm" +bind -n 'C-t' run-shell "~/.local/bin/sessionizer" +bind -n 'M-t' run-shell "~/.local/bin/sessionizer" +bind -T copy-mode M-t run-shell "~/.local/bin/sessionizer" +bind -T copy-mode-vi M-t run-shell "~/.local/bin/sessionizer" + +# sesh +bind -N "last-session (via sesh)" -n "M-'" run-shell 'sesh last' +bind -N "switch to root session (via sesh)" 9 run-shell 'sesh connect --root "$(pwd)"' + +# session +bind -r '(' switch-client -p \; refresh-client -S +bind -nr 'M-P' switch-client -p \; refresh-client -S +bind -r ')' switch-client -n \; refresh-client -S +bind -nr 'M-N' switch-client -n \; refresh-client -S +bind "'" switch-client -t'{marked}' +bind -r 'BSpace' switch-client -l + +# window +bind -r '<' swap-window -d -t -1 +bind -r '>' swap-window -d -t +1 +bind -nr 'M-H' previous-window \; refresh-client -S +bind -nr 'M-L' next-window \; refresh-client -S +bind 'c' new-window -c "#{pane_current_path}" +bind -nr 'M-BSpace' last-window + + +### --- Plugins --- ### +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'alexwforsythe/tmux-which-key' +set -g @plugin 'aserowy/tmux.nvim' +set -g @plugin 'catppuccin/tmux#v2.1.2' +set -g @plugin 'lost-melody/tmux-command-palette' +set -g @plugin 'Morantron/tmux-fingers' +set -g @plugin 'olimorris/tmux-pomodoro-plus' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'tmux-plugins/tmux-copycat' +set -g @plugin 'tmux-plugins/tmux-cpu' +set -g @plugin 'tmux-plugins/tmux-online-status' +set -g @plugin 'tmux-plugins/tmux-open' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-sidebar' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'trevarj/tmux-open-nvim' +set -g @plugin 'wfxr/tmux-fzf-url' +set -g @plugin 'xamut/tmux-weather' + + +### --- Plugins Settings --- ### +# command palette +set -g @cmdpalette-key-prefix 'prefix ?' +set -g @cmdpalette-key-root 'prefix C-b' +set -g @cmdpalette-key-copy-mode-vi 'copy-mode-vi C-_' +set -g @cmdpalette-cmdlists 'commands' +set -g @cmdpalette-cmd-commands 'prefix C-c' + +# continuum +# set -g @continuum-boot 'on' +# set -g @continuum-boot-options 'kitty' +# set -g @continuum-restore 'on' +set -g @continuum-save-interval '1' # min, 0 for disable + +# copycat +bind -T copy-mode-vi 'v' send-keys -X begin-selection +bind -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle +bind -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel + +# finger +set -g @fingers-key 'f' +set -g @fingers-enabled-builtin-patterns 'ip,uuid,url,path,hex,kubernate,git-status,git-status-branch,diff' +set -g @fingers-pattern-sha "[^-][0-9a-f]{7,128}" +set -g @fingers-pattern-0 "(([.\\w\\-~\\$@]+)(\\/?[\\w\\-@]+)+\\/?)\\.([\\w]+)(:\\d*:\\d*)?" +set -g @fingers-pattern-1 'git rebase --(abort|continue)' +set -g @fingers-pattern-2 "(\\+[0-9]{1,3}\\)?)?\\s?(\\s[0-9]{2,3}\\s[0-9]{3,4}\\s[0-9]{4}|\\-?[0-9]{2,3}\\-[0-9]{3,4}\\-[0-9]{4})" +set -g @fingers-ctrl-action "xargs -I {} tmux run-shell 'cd #{pane_current_path}; ton {}'" + +# navigation +set -g @tmux-nvim-navigation true +set -g @tmux-nvim-navigation-cycle false +set -g @tmux-nvim-navigation-keybinding-left 'C-h' +set -g @tmux-nvim-navigation-keybinding-down 'C-j' +set -g @tmux-nvim-navigation-keybinding-up 'C-k' +set -g @tmux-nvim-navigation-keybinding-right 'C-l' +set -g @tmux-nvim-resize true +set -g @tmux-nvim-resize-step-x 2 +set -g @tmux-nvim-resize-step-y 2 +set -g @tmux-nvim-resize-keybinding-left 'C-left' +set -g @tmux-nvim-resize-keybinding-down 'C-down' +set -g @tmux-nvim-resize-keybinding-up 'C-up' +set -g @tmux-nvim-resize-keybinding-right 'C-right' +set -g @tmux-nvim-swap true +set -g @tmux-nvim-swap-cycle false +set -g @tmux-nvim-swap-keybinding-left 'C-M-h' +set -g @tmux-nvim-swap-keybinding-down 'C-M-j' +set -g @tmux-nvim-swap-keybinding-up 'C-M-k' +set -g @tmux-nvim-swap-keybinding-right 'C-M-l' + +# open +set -g @open 'O' +set -g @open-editor 'C-e' +set -g @open-o 'https://www.searx.thesiah.xyz/?q=' + +# open-nvim +set -g @ton-prioritize-window false + +# pomodoro +set -g @pomodoro_toggle 'p' # Start/pause a Pomodoro/break +set -g @pomodoro_cancel 'P' # Cancel the current session +set -g @pomodoro_menu 'C-a' # Pomodoro menu +set -g @pomodoro_restart 'R' # Restart +set -g @pomodoro_skip 'B' # Skip a Pomodoro/break +set -g @pomodoro_custom '' # Custom menu +set -g @pomodoro_mins 25 # The duration of the Pomodoro +set -g @pomodoro_break_mins 5 # The duration of the break after the Pomodoro completes +set -g @pomodoro_intervals 4 # The number of intervals before a longer break is started +set -g @pomodoro_interval_display "[%s/%s]" +set -g @pomodoro_long_break_mins 25 # The duration of the long break +set -g @pomodoro_repeat 'off' # Automatically repeat the Pomodoros? +set -g @pomodoro_disable_breaks 'off' # Turn off breaks +set -g @pomodoro_on "#[fg=#{@thm_red}] " +set -g @pomodoro_complete "#[fg=#{@thm_red}] " +set -g @pomodoro_pause "#[fg=#{@thm_yellow}] " +set -g @pomodoro_prompt_break "#[fg=#{@thm_mauve}] " +set -g @pomodoro_prompt_pomodoro "#[fg=#{@thm_green}] " +set -g @pomodoro_sound 'on' # Sound for desktop notifications (Run `ls /System/Library/Sounds` for a list of sounds to use on Mac) +set -g @pomodoro_notifications 'off' +set -g @pomodoro_granularity 'on' + +# resurrect +set -g @resurrect-save 'S' +set -g @resurrect-restore 'C-r' +set -g @resurrect-strategy-vim 'session' +set -g @resurrect-strategy-nvim 'session' +set -g @resurrect-capture-pane-contents 'on' +set -g @resurrect-processes 'neomutt newsboat psql mysql sqlite3 ssh' + +# side-bar +set -g @sidebar-tree 'e' +set -g @sidebar-tree-focus 'E' +set -g @sidebar-tree-command 'tree -C' +set -g @sidebar-tree-position 'right' +set -g @sidebar-tree-width '50' + +# tpm +set -g @tpm-clean 'C-x' + +# url +set -g @fzf-url-history-limit '2000' + +# weather +set -g @tmux-weather-interval 60 # in minutes +set -g @tmux-weather-location "Seoul,KR" +set -g @tmux-weather-format "%c+%t+%w" +set -g @tmux-weather-units "m" # u for USCS, m for metric system + +### --- Theme --- ### +# catppuccin +set -g @catppuccin_flavor "mocha" +set -g @catppuccin_pane_border_status "off" +set -g @catppuccin_pane_status_enabled "off" +set -g @catppuccin_window_number_position "left" +set -g @catppuccin_window_status_style "none" # basic or none +set -g @catppuccin_status_background "none" +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_middle_separator "" +set -g @catppuccin_window_right_separator "" +set -g @catppuccin_window_current_middle_separator "" +set -ogq @catppuccin_status_left_separator "" +set -ogq @catppuccin_status_middle_separator "" +set -ogq @catppuccin_status_right_separator "" +set -ogq @catppuccin_status_connect_separator "yes" # yes, no +set -ogq @catppuccin_status_module_bg_color "none" + +# online +set -g @online_icon "ok" +set -g @offline_icon "nok" + +# status left style +set -ogq @thm_bg "default" # transparent background +set -g status-left "" +set -g status-left-length 90 +set -ga status-left "#[bg=default,fg=#{@thm_red}] #(tmux list-sessions | nl | grep -w \"$(tmux display-message -p '#S')\" | awk '{print \$1}')/#(tmux list-sessions | wc -l) " +set -ga status-left "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-left "#{?client_prefix,#{#[bg=#{@thm_surface_2},fg=#{@thm_green},bold,italics] #S },#{#[bg=default,fg=#{@thm_green}] #S }}" +set -ga status-left "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-left "#[bg=default,fg=#{@thm_subtext_0}] #{pane_current_command} " +set -ga status-left "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-left "#[bg=default,fg=#{@thm_blue}] #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}} " +set -ga status-left "#[bg=default,fg=#{@thm_overlay_0},none]#{?#(gitmux -cfg $HOME/.config/gitmux/gitmux.conf '#{pane_current_path}'),│,}" +set -ga status-left "#{?#(gitmux -cfg $HOME/.config/gitmux/gitmux.conf '#{pane_current_path}'),#{#[bg=default,fg=#{@thm_subtext_0}] #(gitmux -cfg $HOME/.config/gitmux/gitmux.conf '#{pane_current_path}') }, }" +set -ga status-left "#[bg=default,fg=#{@thm_overlay_0},none]#{?window_zoomed_flag,│,}" +set -ga status-left "#[bg=default,fg=#{@thm_subtext_0}]#{?window_zoomed_flag, zoom ,}" + +# status right style +set -ogq @batt_icon_charge_tier8 "" +set -ogq @batt_icon_charge_tier7 "" +set -ogq @batt_icon_charge_tier6 "" +set -ogq @batt_icon_charge_tier5 "" +set -ogq @batt_icon_charge_tier4 "" +set -ogq @batt_icon_charge_tier3 "" +set -ogq @batt_icon_charge_tier2 "" +set -ogq @batt_icon_charge_tier1 "" +set -ogq @batt_icon_status_charged "" +set -ogq @batt_icon_status_charging "" +set -ogq @batt_icon_status_discharging "" +set -ogq @batt_icon_status_unknown "" +set -ogq @batt_icon_status_attached "" +set -g status-right "" +set -g status-right-length 90 +set -ga status-right "#{?#{pomodoro_status},#{pomodoro_status},#{#[bg=default,fg=#{@thm_peach}] }}" +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-right "#[bg=default,fg=#{@thm_mauve}] #{continuum_status} " +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +# TODO: configure when the battery is available +set -ga status-right "#{?#{<=:#{battery_percentage},0},#{#[bg=default,fg=#{@thm_red}] #{battery_icon} },#{#[bg=default,fg=#{@thm_green}]} #{battery_icon} #{battery_percentage} }" +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-right "#[bg=default]#{?#{==:#{online_status},ok},#[fg=#{@thm_pink}] ,#[fg=#{@thm_red},bold]#[reverse] }" +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +# set -ga status-right "#[bg=default,fg=#{@thm_red}] #{weather} " +# set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-right "#[bg=default,fg=#{@thm_rosewater}] #(uptime | awk -F 'up ' '{print $2}' | awk -F ',' '{print $1}' | sed 's/:/h /;s/$/m/;s/^ //') " +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" +set -ga status-right "#[bg=default,fg=#{@thm_blue}] %a,%d %H:%M " +set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none] " + +# pane border style +setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_overlay_0}" +setw -g pane-border-format "" +setw -g pane-border-lines single +setw -g pane-border-status top # top or off +setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_surface_0}" + +# window style +set -wg automatic-rename on +set -g automatic-rename-format "Window" # Window or "" +set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} " +set -g window-status-style "bg=default,fg=#{@thm_rosewater}" +set -g window-status-last-style "bg=#{@thm_surface_2},fg=#{@thm_peach}" +set -g window-status-activity-style "bg=#{@thm_red},fg=#{@thm_surface_0}" +set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_surface_0},bold" +set -g window-status-separator '|' +set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} " +set -g window-status-current-style "bg=#{@thm_peach},fg=#{@thm_surface_0},bold" + + +### --- RUN TPM --- ### +run '${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm' |
