tmux: replace extrakto plugin with ,tmux-grab script
Only used word-grab-and-insert; a small fzf/grep script covers that
without the vendored plugin.
Assisted-by: Claude Sonnet 5 via Claude Code
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 177cb811..a0d6ac6a 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -89,6 +89,11 @@ bind s split-window -v -c '#{pane_current_path}';
# (it's current after creation, so no -t target is needed).
bind g new-pane -x 80% -y 60% -X 10% -Y 20% -e IN_TMUX_FLOAT=1 -- ~/.dotfiles/bin/,z \; select-pane -T 'zoxide';
+# ,tmux-grab in the same floating pane as above. It looks up the triggering
+# pane itself via {last} — new-pane doesn't expand #{pane_id} in a
+# shell-command argument, so passing it here isn't an option.
+bind Tab new-pane -x 80% -y 60% -X 10% -Y 20% -e IN_TMUX_FLOAT=1 -- "~/.dotfiles/bin/,tmux-grab" \; select-pane -T 'grab';
+
## fzf-git (disabled — fzf-git.sh is no longer sourced in zsh)
# bind -Tfzf-git C-f send-keys C-g f
@@ -105,6 +110,5 @@ set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'christoomey/vim-tmux-navigator'
-set -g @plugin 'laktak/extrakto'
run '~/.config/tmux/plugins/tpm/tpm'
diff --git a/bin/,tmux-grab b/bin/,tmux-grab
new file mode 100755
index 00000000..70426462
--- /dev/null
+++ b/bin/,tmux-grab
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+if [[ "${TRACE-0}" == "1" ]]; then
+ set -o xtrace
+fi
+
+main() {
+ # tmux doesn't expand #{pane_id} in a new-pane shell-command argument, so
+ # the triggering pane is looked up here instead: {last} is the pane that
+ # was active in this window right before the new floating pane took over.
+ local pane_id
+ pane_id=$(tmux display-message -p -t '{last}' '#{pane_id}')
+
+ # tac reverses line order so the most recent scrollback surfaces first in
+ # the fzf list, while keeping left-to-right token order within each line.
+ local pane_text
+ pane_text=$(tmux capture-pane -p -S - -t "$pane_id" | tac)
+ [[ -n "$pane_text" ]] || exit 0
+
+ # Two passes: whitespace-delimited tokens first (so "foo/bar:baz" is a
+ # candidate), then punctuation-split sub-tokens (so "foo", "bar", "baz"
+ # are too). Dedup preserves first-seen order, so exact repeats collapse.
+ local tokens
+ tokens=$(
+ {
+ printf '%s\n' "$pane_text" | grep --only-matching --extended-regexp '\S+' || true
+ printf '%s\n' "$pane_text" | grep --only-matching --extended-regexp '[[:alnum:]_]+' || true
+ } | awk '!seen[$0]++'
+ )
+ [[ -n "$tokens" ]] || exit 0
+
+ # Float via fzf's own tmux popup, unless the caller already gave us a
+ # floating container (e.g. a tmux binding running this in a floating
+ # pane), where --tmux would open a redundant, conflicting nested popup.
+ # FZF_DEFAULT_OPTS (.zshrc) carries its own --tmux default too, so it's
+ # cleared here — otherwise it fires regardless of our own --tmux flag.
+ local tmux_opts=(--tmux "80%,60%")
+ [[ -n "${IN_TMUX_FLOAT:-}" ]] && tmux_opts=()
+
+ local selection
+ selection=$(printf '%s\n' "$tokens" | FZF_DEFAULT_OPTS='' fzf --no-multi --select-1 --no-margin --no-padding \
+ "${tmux_opts[@]}" \
+ --layout reverse \
+ --height 100% \
+ --highlight-line --info inline-right \
+ --border-label ' grab ') || exit 0
+ [[ -n "$selection" ]] || exit 0
+
+ tmux send-keys -l -t "$pane_id" -- "$selection"
+}
+
+main "$@"