aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/common/.zsh/lib/-ftb-fzf
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-02 12:16:38 -0500
committerCraig Jennings <c@cjennings.net>2026-06-02 12:16:38 -0500
commit8c32bbbf9fab115dc51afa17c081e0763cbee717 (patch)
tree246b46b53c956cfea07bc9d1c2b81f9f8de53d65 /dotfiles/common/.zsh/lib/-ftb-fzf
parent3f370d6c19c83430547d1771b0e6fa669dc7d5c5 (diff)
downloadarchsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.tar.gz
archsetup-8c32bbbf9fab115dc51afa17c081e0763cbee717.zip
refactor: drop in-repo dotfiles/, move stow tooling to the dotfiles repo
Since the installer clones DOTFILES_REPO into ~/.dotfiles and stows from there, the in-repo dotfiles/ tree was dead weight. Nothing reads it at install time. I removed it (831 files) now that both machines are migrated. The Makefile's stow / restow / reset / unstow / import targets and the dotfile-script unit suites moved to the dotfiles repo. They sit alongside the scripts they manage and run standalone (cd ~/.dotfiles && make ...). This Makefile keeps the VM-integration targets and the installer-helper suite (safe-rm-rf). I updated CLAUDE.md and README.md so stow operations run from ~/.dotfiles, and the dotfile-management, theme, and unit-test sections point at the standalone repo. The README was already describing the old in-repo model from before the installer switched to cloning. This brings it in line.
Diffstat (limited to 'dotfiles/common/.zsh/lib/-ftb-fzf')
-rwxr-xr-xdotfiles/common/.zsh/lib/-ftb-fzf102
1 files changed, 0 insertions, 102 deletions
diff --git a/dotfiles/common/.zsh/lib/-ftb-fzf b/dotfiles/common/.zsh/lib/-ftb-fzf
deleted file mode 100755
index 19adf04..0000000
--- a/dotfiles/common/.zsh/lib/-ftb-fzf
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/hint/zsh
-
-local tmp_dir=${TMPPREFIX:-/tmp/zsh}-fzf-tab-$USER
-[[ -d $tmp_dir ]] || command mkdir $tmp_dir
-
-local ftb_preview_init="
-zmodload zsh/mapfile
-local -a _ftb_compcap=(\"\${(@f)mapfile[$tmp_dir/compcap.$$]}\")
-local -a _ftb_groups=(\"\${(@f)mapfile[$tmp_dir/groups.$$]}\")
-local bs=\$'\2'
-# get descriptoin
-export desc=\${\${\"\$(<{f})\"%\$'\0'*}#*\$'\0'}
-# get ctxt for current completion
-local -A ctxt=(\"\${(@0)\${_ftb_compcap[(r)\${(b)desc}\$bs*]#*\$bs}}\")
-# get group
-if (( \$+ctxt[group] )); then
- export group=\$_ftb_groups[\$ctxt[group]]
-fi
-# get original word
-export word=\${(Q)ctxt[word]}
-# get real path if it is file
-if (( \$+ctxt[realdir] )); then
- export realpath=\${ctxt[realdir]}\$word
-fi
-"
-local binds=tab:down,btab:up,change:top,ctrl-space:toggle
-local fzf_command fzf_flags fzf_preview debug_command tmp switch_group fzf_pad
-local ret=0
-
--ftb-zstyle -s fzf-command fzf_command || fzf_command=fzf
--ftb-zstyle -a fzf-bindings tmp && binds+=,${(j:,:)tmp}
--ftb-zstyle -a fzf-flags fzf_flags
--ftb-zstyle -s fzf-preview fzf_preview
--ftb-zstyle -a switch-group switch_group || switch_group=(F1 F2)
--ftb-zstyle -s fzf-pad fzf_pad || fzf_pad=2
-
--ftb-zstyle -a debug-command debug_command && {
- ${(eX)debug_command} $fzf_flags
- return
-}
-
-print -rl -- $_ftb_compcap > $tmp_dir/compcap.$$
-print -rl -- $_ftb_groups > $tmp_dir/groups.$$
-print -r -- ${ftb_preview_init/{f}/\$1} > $tmp_dir/ftb_preview_init.$$
-
-binds=${binds//{_FTB_INIT_}/. $tmp_dir/ftb_preview_init.$$ {f} $'\n'}
-
-local -i header_lines=$#_ftb_headers
-local -i lines=$(( $#_ftb_compcap + fzf_pad + header_lines ))
-local reload_command="$commands[zsh] -f $FZF_TAB_HOME/lib/ftb-switch-group $$ $header_lines $tmp_dir"
-
-# detect if we will use tmux popup
-local use_tmux_popup=0
-if [[ $fzf_command == "ftb-tmux-popup" ]]; then
- use_tmux_popup=1
-fi
-
-if (( ! use_tmux_popup )); then
- # fzf will cause the current line to refresh, so move the cursor down.
- echoti cud1 >/dev/tty
- # reset cursor before call fzf
- echoti cnorm >/dev/tty 2>/dev/null
-fi
-
-cat > $tmp_dir/completions.$$
-
-local dd='gdd'
-if (( ${+commands[$dd]} == 0 )) ; then
- dd='dd'
-fi
-if (( ${+commands[$dd]} == 0 )) ; then
- dd='true' # nop if dd is not installed
-fi
-
-_ftb_query="${_ftb_query}$(command "$dd" bs=1G count=1 status=none iflag=nonblock < /dev/tty 2>/dev/null)" || true
-
-$fzf_command \
- --ansi \
- --bind=$binds \
- --bind="${switch_group[1]}:reload($reload_command -1),${switch_group[2]}:reload($reload_command 1)" \
- --color=hl:$(( header_lines == 0 ? 188 : 255 )) \
- --cycle \
- --delimiter='\x00' \
- --expect=$continuous_trigger,$print_query,$accept_line \
- --header-lines=$header_lines \
- --height=${FZF_TMUX_HEIGHT:=$(( lines > LINES / 3 * 2 ? LINES / 3 * 2 : lines ))} \
- --layout=reverse \
- --multi \
- --nth=2,3 \
- --print-query \
- --query=$_ftb_query \
- --tiebreak=begin \
- ${fzf_preview:+--preview=$ftb_preview_init$fzf_preview} \
- $fzf_flags < $tmp_dir/completions.$$ || ret=$?
-
-if (( ! use_tmux_popup )); then
- echoti civis >/dev/tty 2>/dev/null
- echoti cuu1 >/dev/tty
-fi
-
-command rm $tmp_dir/*.$$ 2>/dev/null
-return $ret