diff --git a/.gitmodules b/.gitmodules index d2f5cbd..06e4480 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,21 +24,11 @@ url = https://github.com/tmux-plugins/tmux-continuum ignore = dirty -[submodule "tmux/tmux-sensible"] - path = config/tmux/plugins/tmux-sensible - url = https://github.com/tmux-plugins/tmux-sensible.git - ignore = dirty - [submodule "tmux/tmux-sessionist"] path = config/tmux/plugins/tmux-sessionist url = https://github.com/tmux-plugins/tmux-sessionist.git ignore = dirty -[submodule "tmux/tmux-yank"] - path = config/tmux/plugins/tmux-yank - url = https://github.com/tmux-plugins/tmux-yank.git - ignore = dirty - [submodule "dotbot-pip"] path = tools/dotbot-pip url = https://github.com/sobolevn/dotbot-pip.git @@ -49,11 +39,6 @@ url = https://github.com/MunifTanjim/tmux-suspend.git ignore = dirty -[submodule "tmux/tmux-mode-indicator"] - path = config/tmux/plugins/tmux-mode-indicator - url = https://github.com/MunifTanjim/tmux-mode-indicator.git - ignore = dirty - [submodule "tmux/tmux-current-pane-hostname"] path = config/tmux/plugins/tmux-current-pane-hostname url = https://github.com/soyuka/tmux-current-pane-hostname.git diff --git a/add-submodules.sh b/add-submodules.sh index a6bdf93..14500c9 100755 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -24,18 +24,12 @@ git submodule add --name antidote \ # tmux plugin manager and plugins 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-mode-indicator \ - -f https://github.com/MunifTanjim/tmux-mode-indicator.git config/tmux/plugins/tmux-mode-indicator git submodule add --name tmux/tmux-resurrect \ -f https://github.com/tmux-plugins/tmux-resurrect.git 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/tmux-current-pane-hostname \ -f https://github.com/soyuka/tmux-current-pane-hostname.git config/tmux/plugins/tmux-current-pane-hostname git submodule add --name tmux/tmux-dark-notify \ @@ -60,6 +54,10 @@ folders=( "tools/dotbot-crontab" "tools/dotbot-snap" "config/tmux/plugins/tmux-window-name" + "config/tmux/plugins/tmux-sensible" + "config/tmux/plugins/tmux-mode-indicator" + "config/tmux/plugins/tmux-yank" + "config/tmux/plugins/tmux-fzf-url" "config/nvim-kickstart" "local/bin/asdf" "local/asdf" diff --git a/config/tmux/plugins/tmux-fzf-url/LICENSE.txt b/config/tmux/plugins/tmux-fzf-url/LICENSE.txt deleted file mode 100644 index 19d6c5c..0000000 --- a/config/tmux/plugins/tmux-fzf-url/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -https://wfxr.mit-license.org/2018 diff --git a/config/tmux/plugins/tmux-fzf-url/fzf-url.sh b/config/tmux/plugins/tmux-fzf-url/fzf-url.sh deleted file mode 100755 index cc60e16..0000000 --- a/config/tmux/plugins/tmux-fzf-url/fzf-url.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -#=============================================================================== -# Author: Wenxuan -# Email: wenxuangm@gmail.com -# Created: 2018-04-06 12:12 -#=============================================================================== -get_fzf_options() -{ - local fzf_options - local fzf_default_options='-w 100% -h 50% --multi -0 --no-preview' - fzf_options="$(tmux show -gqv '@fzf-url-fzf-options')" - [ -n "$fzf_options" ] && echo "$fzf_options" || echo "$fzf_default_options" -} - -fzf_filter() -{ - eval "fzf-tmux $(get_fzf_options)" -} - -custom_open=$3 -open_url() -{ - if [[ -n $custom_open ]]; then - $custom_open "$@" - elif hash xdg-open &> /dev/null; then - nohup xdg-open "$@" - elif hash open &> /dev/null; then - nohup open "$@" - elif [[ -n $BROWSER ]]; then - nohup "$BROWSER" "$@" - fi -} - -limit='screen' -[[ $# -ge 2 ]] && limit=$2 - -if [[ $limit == 'screen' ]]; then - content="$(tmux capture-pane -J -p -e | sed -r 's/\x1B\[[0-9;]*[mK]//g'))" -else - content="$(tmux capture-pane -J -p -e -S -"$limit" | sed -r 's/\x1B\[[0-9;]*[mK]//g'))" -fi - -urls=$(echo "$content" | grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]') -wwws=$(echo "$content" | grep -oE '(http?s://)?www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' | grep -vE '^https?://' | sed 's/^\(.*\)$/http:\/\/\1/') -ips=$(echo "$content" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{1,5})?(/\S+)*' | sed 's/^\(.*\)$/http:\/\/\1/') -gits=$(echo "$content" | grep -oE '(ssh://)?git@\S*' | sed 's/:/\//g' | sed 's/^\(ssh\/\/\/\)\{0,1\}git@\(.*\)$/https:\/\/\2/') -gh=$(echo "$content" | grep -oE "['\"]([_A-Za-z0-9-]*/[_.A-Za-z0-9-]*)['\"]" | sed "s/['\"]//g" | sed 's#.#https://github.com/&#') - -if [[ $# -ge 1 && $1 != '' ]]; then - extras=$(echo "$content" | eval "$1") -fi - -items=$( - printf '%s\n' "${urls[@]}" "${wwws[@]}" "${gh[@]}" "${ips[@]}" "${gits[@]}" "${extras[@]}" \ - | grep -v '^$' \ - | sort -u \ - | nl -w3 -s ' ' -) -[ -z "$items" ] && tmux display 'tmux-fzf-url: no URLs found' && exit - -fzf_filter <<< "$items" | awk '{print $2}' \ - | while read -r chosen; do - open_url "$chosen" &> "/tmp/tmux-$(id -u)-fzf-url.log" - done diff --git a/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux b/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux deleted file mode 100755 index 06063e2..0000000 --- a/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -#=============================================================================== -# Author: Wenxuan -# Email: wenxuangm@gmail.com -# Created: 2018-04-06 09:30 -#=============================================================================== -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) - -# $1: option -# $2: default value -tmux_get() { - local value - value="$(tmux show -gqv "$1")" - [ -n "$value" ] && echo "$value" || echo "$2" -} - -key="$(tmux_get '@fzf-url-bind' 'u')" -history_limit="$(tmux_get '@fzf-url-history-limit' 'screen')" -extra_filter="$(tmux_get '@fzf-url-extra-filter' '')" -custom_open="$(tmux_get '@fzf-url-open' '')" -echo "$extra_filter" >/tmp/filter - -tmux bind-key "$key" run -b "$SCRIPT_DIR/fzf-url.sh '$extra_filter' $history_limit '$custom_open'" diff --git a/config/tmux/plugins/tmux-mode-indicator b/config/tmux/plugins/tmux-mode-indicator deleted file mode 160000 index 7027903..0000000 --- a/config/tmux/plugins/tmux-mode-indicator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7027903adca37c54cb8f5fa99fc113b11c23c2c4 diff --git a/config/tmux/plugins/tmux-sensible b/config/tmux/plugins/tmux-sensible deleted file mode 160000 index 2ce7679..0000000 --- a/config/tmux/plugins/tmux-sensible +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2ce7679f9dcf42dffa60abd59a3405b87cb8213b diff --git a/config/tmux/plugins/tmux-yank b/config/tmux/plugins/tmux-yank deleted file mode 160000 index fd80002..0000000 --- a/config/tmux/plugins/tmux-yank +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd8000238b324005389076486a2e6e03dba1c64f diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index b5b4b57..0f0aff4 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -112,16 +112,6 @@ set -g @suspend_suspended_options " \ set -g @dark-notify-theme-path-light "$HOME/.dotfiles/config/tmux/theme-light.conf" set -g @dark-notify-theme-path-dark "$HOME/.dotfiles/config/tmux/theme-dark.conf" -## https://github.com/MunifTanjim/tmux-mode-indicator -set -g @mode_indicator_copy_mode_style 'bg=default,fg=yellow' -set -g @mode_indicator_empty_mode_style 'bg=default,fg=#7aa2f7' -set -g @mode_indicator_prefix_mode_style 'bg=default,fg=#7aa2f7' -set -g @mode_indicator_sync_mode_style 'bg=default,fg=red' - -# https://github.com/wfxr/tmux-fzf-url -set -g @fzf-url-bind 'u' -set -g @fzf-url-history-limit '2000' - # https://github.com/tmux-plugins/tmux-continuum set -g @continuum-restore 'on' @@ -137,13 +127,9 @@ run-shell "$HOME/.dotfiles/config/tmux/theme-activate.sh" # ── Sourcing the plugins ────────────────────────────────────────────── -run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sensible/sensible.tmux" -run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-suspend/suspend.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/sessionist.tmux" -run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux" -run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux" run-shell "$HOME/.dotfiles/config/tmux/plugins/catppuccin/catppuccin.tmux"