From 1d851708eb84b0ec1cf1cc24bfef6c62f81fb677 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Fri, 8 Sep 2023 00:29:32 +0300 Subject: [PATCH] chore(tmux): drop unused plugins, update config --- .gitmodules | 18 --- add-submodules.sh | 12 -- config/functions | 4 +- config/tmux/plugins/tmux-1password | 1 - config/tmux/plugins/tmux-autoreload | 1 - config/tmux/plugins/tmux-fzf | 1 - config/tmux/plugins/tmux-notify | 1 - config/tmux/plugins/tmux-suspend | 1 - config/tmux/plugins/vim-tmux-navigator | 1 - config/tmux/tmux.conf | 177 +++++++++++-------------- 10 files changed, 80 insertions(+), 137 deletions(-) delete mode 160000 config/tmux/plugins/tmux-1password delete mode 160000 config/tmux/plugins/tmux-autoreload delete mode 160000 config/tmux/plugins/tmux-fzf delete mode 160000 config/tmux/plugins/tmux-notify delete mode 160000 config/tmux/plugins/tmux-suspend delete mode 160000 config/tmux/plugins/vim-tmux-navigator diff --git a/.gitmodules b/.gitmodules index 0335ff9..5714fa9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,24 +26,12 @@ [submodule "tmux/catppuccin"] path = config/tmux/plugins/tmux url = https://github.com/catppuccin/tmux.git -[submodule "tmux/tmux-1password"] - path = config/tmux/plugins/tmux-1password - url = https://github.com/yardnsm/tmux-1password.git -[submodule "tmux/tmux-autoreload"] - path = config/tmux/plugins/tmux-autoreload - url = https://github.com/b0o/tmux-autoreload.git [submodule "tmux/tmux-continuum"] path = config/tmux/plugins/tmux-continuum url = https://github.com/tmux-plugins/tmux-continuum -[submodule "tmux/tmux-fzf"] - path = config/tmux/plugins/tmux-fzf - url = https://github.com/sainnhe/tmux-fzf.git [submodule "tmux/tmux-menus"] path = config/tmux/plugins/tmux-menus url = https://github.com/jaclu/tmux-menus.git -[submodule "tmux/tmux-notify"] - path = config/tmux/plugins/tmux-notify - url = https://github.com/ChanderG/tmux-notify.git [submodule "tmux/tmux-resurrect"] path = config/tmux/plugins/tmux-resurrect url = https://github.com/tmux-plugins/tmux-resurrect @@ -53,12 +41,6 @@ [submodule "tmux/tmux-sessionist"] path = config/tmux/plugins/tmux-sessionist url = https://github.com/tmux-plugins/tmux-sessionist.git -[submodule "tmux/tmux-suspend"] - path = config/tmux/plugins/tmux-suspend - url = https://github.com/MunifTanjim/tmux-suspend.git [submodule "tmux/tmux-yank"] path = config/tmux/plugins/tmux-yank url = https://github.com/tmux-plugins/tmux-yank.git -[submodule "tmux/vim-tmux-navigator"] - path = config/tmux/plugins/vim-tmux-navigator - url = https://github.com/christoomey/vim-tmux-navigator.git diff --git a/add-submodules.sh b/add-submodules.sh index bc483fa..d6f0afd 100755 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -10,27 +10,15 @@ git submodule add --name tmux/tpm \ -f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm git submodule add --name tmux/catppuccin \ -f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux -git submodule add --name tmux/tmux-1password \ - -f https://github.com/yardnsm/tmux-1password.git config/tmux/plugins/tmux-1password -git submodule add --name tmux/tmux-autoreload \ - -f https://github.com/b0o/tmux-autoreload.git config/tmux/plugins/tmux-autoreload git submodule add --name tmux/tmux-continuum \ -f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum -git submodule add --name tmux/tmux-fzf \ - -f https://github.com/sainnhe/tmux-fzf.git config/tmux/plugins/tmux-fzf git submodule add --name tmux/tmux-menus \ -f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus -git submodule add --name tmux/tmux-notify \ - -f https://github.com/ChanderG/tmux-notify.git config/tmux/plugins/tmux-notify git submodule add --name tmux/tmux-resurrect \ -f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect git submodule add --name tmux/tmux-sensible \ -f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible git submodule add --name tmux/tmux-sessionist \ -f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist -git submodule add --name tmux/tmux-suspend \ - -f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend git submodule add --name tmux/tmux-yank \ -f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank -git submodule add --name tmux/vim-tmux-navigator \ - -f https://github.com/christoomey/vim-tmux-navigator.git config/tmux/plugins/vim-tmux-navigator diff --git a/config/functions b/config/functions index 3da5af6..a513008 100755 --- a/config/functions +++ b/config/functions @@ -61,9 +61,11 @@ scheduler() # Defines default antigen bundles x-default-antigen-bundles() { - export ZSH_TMUX_AUTOSTART=true + export ZSH_TMUX_AUTOSTART=false export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf" export ZSH_TMUX_UNICODE=true + export ZSH_TMUX_AUTOQUIT=false + export ZSH_TMUX_DEFAULT_SESSION_NAME=main # these should be always available antigen bundle tmux diff --git a/config/tmux/plugins/tmux-1password b/config/tmux/plugins/tmux-1password deleted file mode 160000 index bb1bbd2..0000000 --- a/config/tmux/plugins/tmux-1password +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bb1bbd2acfe1b4d5dcf917f6ddf3b0f634a13362 diff --git a/config/tmux/plugins/tmux-autoreload b/config/tmux/plugins/tmux-autoreload deleted file mode 160000 index f8a8318..0000000 --- a/config/tmux/plugins/tmux-autoreload +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f8a831884443f39698b8336bde0867ebf0e717d0 diff --git a/config/tmux/plugins/tmux-fzf b/config/tmux/plugins/tmux-fzf deleted file mode 160000 index 2397bd6..0000000 --- a/config/tmux/plugins/tmux-fzf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2397bd699e9eca8cb62e67c9f79257e9bc4d7556 diff --git a/config/tmux/plugins/tmux-notify b/config/tmux/plugins/tmux-notify deleted file mode 160000 index 9abae51..0000000 --- a/config/tmux/plugins/tmux-notify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9abae514be353e04d35f4595fb05d94b80dc3532 diff --git a/config/tmux/plugins/tmux-suspend b/config/tmux/plugins/tmux-suspend deleted file mode 160000 index 1a2f806..0000000 --- a/config/tmux/plugins/tmux-suspend +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1a2f806666e0bfed37535372279fa00d27d50d14 diff --git a/config/tmux/plugins/vim-tmux-navigator b/config/tmux/plugins/vim-tmux-navigator deleted file mode 160000 index 85b8e5f..0000000 --- a/config/tmux/plugins/vim-tmux-navigator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85b8e5f60c1690cde57dbb66467ce39cd1b63343 diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index 7d58cd7..f7c13f0 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -4,34 +4,9 @@ # - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html # - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf -# Set plugins install dir -set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins' - -## Install plugins, starting with plugin manager -set -g @tpm_plugins ' \ - tmux-plugins/tpm \ - b0o/tmux-autoreload \ - catppuccin/tmux \ - ChanderG/tmux-notify \ - christoomey/vim-tmux-navigator \ - yardnsm/tmux-1password \ - jaclu/tmux-menus \ - sainnhe/tmux-fzf \ - MunifTanjim/tmux-suspend \ - tmux-plugins/tmux-continuum \ - tmux-plugins/tmux-resurrect \ - tmux-plugins/tmux-sensible \ - tmux-plugins/tmux-sessionist \ - tmux-plugins/tmux-yank \ -' - -set-option -sa terminal-overrides ",xterm*:Tc" - -# Mouse support -set -g mouse on - -# Make delay shorter -set -sg escape-time 0 +# ╭──────────────────────────────────────────────────────────╮ +# │ Bindings │ +# ╰──────────────────────────────────────────────────────────╯ # Set to Control + Space unbind C-b @@ -44,92 +19,27 @@ bind j select-pane -D bind k select-pane -U bind l select-pane -R -# Start windows and panes at 1, not 0 -set -g base-index 1 -set -g pane-base-index 1 -set-window-option -g pane-base-index 1 -set-option -g renumber-windows on - # Use Alt-arrow keys without prefix key to switch panes -bind -n M-Left select-pane -L +bind -n M-Left select-pane -L bind -n M-Right select-pane -R -bind -n M-Up select-pane -U -bind -n M-Down select-pane -D +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D # Control-Tab & Control-Shift-Tab to switch windows bind -n C-Tab previous-window bind -n C-S-Tab next-window -# Shift Alt vim keys to switch windows -bind -n M-H previous-window -bind -n M-L next-window - # Reload tmux config with + r bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!" # Open a new window with + N bind N new-window -# Plugins related configurations +# Set default directory for new windows in this session to current directory: +bind M-c attach-session -c "#{pane_current_path}" -## https://github.com/jaclu/tmux-menus -set -g @menus_trigger 'm' - -## https://github.com/jaclu/tmux-1password -set -g @1password-key 'x' - -## https://github.com/catppuccin/tmux -set -g @catppuccin_flavour 'mocha' # latte/frappe/macchiato/mocha -set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs -set -g @catppuccin_window_status_enable "yes" - -set -g @catppuccin_window_right_separator "█ " -set -g @catppuccin_window_number_position "right" -set -g @catppuccin_window_middle_separator " | " -set -g @catppuccin_window_default_fill "none" -set -g @catppuccin_window_current_fill "all" -set -g @catppuccin_status_modules "application session date_time" -set -g @catppuccin_status_left_separator "█" -set -g @catppuccin_status_right_separator "█" -set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M" - -## https://github.com/MunifTanjim/tmux-mode-indicator -set -g status-right '%Y-%m-%d %H:%M #{tmux_mode_indicator}' -set -g @mode_indicator_prefix_prompt ' WAIT ' -set -g @mode_indicator_copy_prompt ' COPY ' -set -g @mode_indicator_sync_prompt ' SYNC ' -set -g @mode_indicator_empty_prompt ' TMUX ' -set -g @mode_indicator_prefix_mode_style 'bg=blue,fg=black' -set -g @mode_indicator_copy_mode_style 'bg=yellow,fg=black' -set -g @mode_indicator_sync_mode_style 'bg=red,fg=black' -set -g @mode_indicator_empty_mode_style 'bg=cyan,fg=black' - -## https://github.com/MunifTanjim/tmux-suspend -set -g @suspend_key 'F12' -set -g @suspend_suspended_options " \ - @mode_indicator_custom_prompt:: ---- , \ - @mode_indicator_custom_mode_style::bg=brightblack\\,fg=black, \ -" - -## https://github.com/tmux-plugins/tmux-continuum -set -g @continuum-restore 'on' -set -g @continuum-boot 'on' -set -g @continuum-boot-options 'iterm' - -## https://github.com/tmux-plugins/tmux-resurrect -set -g @resurrect-strategy-nvim 'session' - -## https://github.com/b0o/tmux-autoreload -set-option -g @tmux-autoreload-configs '~/.dotfiles/config/tmux/tmux.conf' - -## https://github.com/sainnhe/tmux-fzf -TMUX_FZF_LAUNCH_KEY="l" - -## https://github.com/ChanderG/tmux-notify -set -g @tnotify-verbose 'on' - -# set vi-mode -set-window-option -g mode-keys vi +# Open a new window in the current directory +bind C new-window -c "#{pane_current_path}" # keybindings bind-key -T copy-mode-vi v send-keys -X begin-selection @@ -153,5 +63,72 @@ bind Escape copy-mode unbind p bind p paste-buffer +# ╭──────────────────────────────────────────────────────────╮ +# │ Settings │ +# ╰──────────────────────────────────────────────────────────╯ + +# Mouse support +set -g mouse on + +# Make delay shorter +set -sg escape-time 0 + +# Start windows and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# set vi-mode +set-window-option -g mode-keys vi + +# ╭──────────────────────────────────────────────────────────╮ +# │ Plugins │ +# ╰──────────────────────────────────────────────────────────╯ + +# Set plugins install dir +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins' + +## Install plugins, starting with plugin manager +set -g @tpm_plugins ' \ + catppuccin/tmux \ + tmux-plugins/tmux-continuum \ + jaclu/tmux-menus \ + tmux-plugins/tmux-resurrect \ + tmux-plugins/tmux-sensible \ + tmux-plugins/tmux-sessionist \ + tmux-plugins/tmux-yank \ + tmux-plugins/tpm \ +' + +# ╭──────────────────────────────────────────────────────────╮ +# │ Plugins related configurations │ +# ╰──────────────────────────────────────────────────────────╯ + +## https://github.com/jaclu/tmux-menus +set -g @menus_trigger 'm' + +## https://github.com/catppuccin/tmux +set -g @catppuccin_flavour "mocha" # latte/frappe/macchiato/mocha +set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs +set -g @catppuccin_window_status_enable "yes" + +## set -g @catppuccin_window_right_separator "█" +set -g @catppuccin_window_number_position "left" +set -g @catppuccin_window_middle_separator ": " +set -g @catppuccin_window_default_fill "none" +set -g @catppuccin_window_current_fill "all" +set -g @catppuccin_status_modules "application session date_time" +set -g @catppuccin_status_left_separator "█" +set -g @catppuccin_status_right_separator "█" +set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M" + +## https://github.com/tmux-plugins/tmux-continuum +set -g @continuum-restore 'on' +set -g @continuum-boot 'on' + +## https://github.com/tmux-plugins/tmux-resurrect +set -g @resurrect-strategy-nvim 'session' + # Finally run the tmux plugin manager run '~/.dotfiles/config/tmux/plugins/tpm/tpm'