aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/common/.bashrc.d/fzf.sh
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
commitb10cba594db836c0747066addad48bda4d30cd02 (patch)
tree063119a623fa3f7139feda4ef302896d8f5f934c /dotfiles/common/.bashrc.d/fzf.sh
parent49c2ba9c4510bf6e1acd306687473bc8ba9ad8dd (diff)
downloadarchsetup-b10cba594db836c0747066addad48bda4d30cd02.tar.gz
archsetup-b10cba594db836c0747066addad48bda4d30cd02.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/.bashrc.d/fzf.sh')
-rw-r--r--dotfiles/common/.bashrc.d/fzf.sh122
1 files changed, 0 insertions, 122 deletions
diff --git a/dotfiles/common/.bashrc.d/fzf.sh b/dotfiles/common/.bashrc.d/fzf.sh
deleted file mode 100644
index 9a5a9bd..0000000
--- a/dotfiles/common/.bashrc.d/fzf.sh
+++ /dev/null
@@ -1,122 +0,0 @@
-# fzf.sh
-# Craig Jennings <c@cjennings.net>
-# FZF settings and utility functions
-
-# =============================================================================
-# Settings
-# =============================================================================
-export FZF_DEFAULT_OPTS='--height=70%'
-export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden'
-export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
-
-# Directory paths for convenience functions
-IF_GAMES_DIR="$HOME/sync/org/text.games"
-BOOKS_DIR="$HOME/sync/books"
-
-# =============================================================================
-# Navigation
-# =============================================================================
-
-# cdff - change directory to where a file resides
-cdff() {
- file=$(fzf +m -q "$1")
- dir=$(dirname "$file")
- cd "$dir" || return 1
-}
-
-# cdd - cd to directory with fzf
-cdd() {
- destdir=$(find "${1:-.}" -path '*/\.*' -prune \
- -o -type d -print 2>/dev/null | fzf +m) &&
- cd "$destdir"
-}
-
-# =============================================================================
-# System Admin
-# =============================================================================
-
-# Kill process with fzf
-kp() {
- pid=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[kill:process]'" | awk '{print $2}')
- if [ -n "$pid" ]; then
- echo "$pid" | xargs kill -"${1:-9}"
- kp
- fi
-}
-
-# Install packages with fzf preview
-yinstall() {
- yay -Slq | fzf --multi --preview 'yay -Si {1}' | xargs -ro yay -S --noconfirm
-}
-
-yinstall-skipverify() {
- yay -Slq | fzf --multi --preview 'yay -Si {1}' | xargs -ro yay -S --noconfirm --mflags --skipinteg
-}
-
-# Remove packages with fzf preview
-yrm() {
- yay -Qq | fzf --multi --preview 'yay -Qi {1}' | xargs -ro yay -Rns
-}
-
-# Find in file with fzf
-fif() {
- if [ "$#" -eq 0 ]; then
- echo "Need a string to search for!"
- return 1
- fi
- rg --files-with-matches --no-messages "$1" | \
- fzf --preview "highlight -O ansi -l {} 2>/dev/null | \
- rg --colors 'match:bg:yellow' --ignore-case --pretty --context 10 '$1' || \
- rg --ignore-case --pretty --context 10 '$1' {}"
-}
-
-# =============================================================================
-# Convenience
-# =============================================================================
-
-# Find and read epub book in terminal
-bk() {
- bkfile=$(find "$BOOKS_DIR" -iname "*.epub" -print | fzf)
- if [ -n "$bkfile" ]; then
- epr "$bkfile"
- fi
-}
-
-# Find and play interactive fiction game
-tg() {
- gamefile=$(find "$IF_GAMES_DIR" -type f \( -iname "*.z[1-8]" -o -iname "*.zblorb" -o -iname "*.blorb" \) -print | fzf)
- if [ -n "$gamefile" ]; then
- frotz "$gamefile"
- fi
-}
-
-# =============================================================================
-# WireGuard
-# =============================================================================
-
-wgup() {
- # Shutdown existing connections first
- output=$(sudo wg 2>/dev/null)
- if [ -n "$output" ]; then
- for iface in $(sudo wg show interfaces); do
- sudo wg-quick down "${iface}"
- done
- fi
- # Select and start new connection
- wgfile=$(sudo find /etc/wireguard/ -iname "*.conf" -exec basename -s .conf {} \; | fzf)
- if [ -n "$wgfile" ]; then
- sudo wg-quick up "$wgfile"
- sudo wg
- fi
-}
-
-wgdown() {
- output=$(sudo wg 2>/dev/null)
- if [ -n "$output" ]; then
- for iface in $(sudo wg show interfaces); do
- sudo wg-quick down "${iface}"
- done
- fi
-}
-
-alias wg=wgup