aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2023-02-05 23:33:25 -0500
committertdro <tdro@users.noreply.github.com>2023-02-05 23:33:25 -0500
commita404e1971b7355a173cc908cc16cb74577aba017 (patch)
treecc92345c0ad4c8f490b2c7b18fb22b247cdfdd27
parent282a80696b898487e675b72591b8a04f4b9f6d9a (diff)
downloaddotfiles-a404e1971b7355a173cc908cc16cb74577aba017.tar.gz
dotfiles-a404e1971b7355a173cc908cc16cb74577aba017.tar.bz2
dotfiles-a404e1971b7355a173cc908cc16cb74577aba017.zip
.local/bin/fzf-doc: Remove
-rwxr-xr-x.local/bin/fzf-doc44
1 files changed, 0 insertions, 44 deletions
diff --git a/.local/bin/fzf-doc b/.local/bin/fzf-doc
deleted file mode 100755
index 6f51c08..0000000
--- a/.local/bin/fzf-doc
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh -eu
-
-cache=$HOME/.cache/fzf-doc
-documentation=/etc/documentation
-
-fzf_doc_preview() {
- file=$1
- extension=${file##*.}
- case "$extension" in
- md) mdcat -l "$file" ;;
- html) w3m -dump "$file" ;;
- pdf) pdftotext "$file" - ;;
- *) grep -hi -B 10 -A 10 . "${file}" ;;
- esac
-}
-
-if [ ! -f "$cache" ] || test "$cache" -ot "$documentation"; then
- grep -lRi \
- --include=*.md \
- --include=*.txt \
- --include=*.pdf \
- --include=*.html \
- --include=*.yml \
- --include=*.yaml \
- . /etc/documentation > "$cache";
-fi
-
-[ "${1-}" = "--preview" ] && fzf_doc_preview "${2-}" && exit;
-
-grep -i "${1-.}" "$cache" \
- | fzf --preview "fzf-doc --preview {}" \
- | while read -r file
-
-do
- extension=${file##*.}
- case "$extension" in
- md) mdcat -cl "$file" | vim - ;;
- html) w3m -dump "$file" | vim - ;;
- pdf) pdftotext "$file" - | vim - ;;
- yml) vim "$file" ;;
- yaml) vim "$file" ;;
- *) vim "$file" ;;
- esac
-done