os/pkgs/notes.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
517 B
Nix
Raw Normal View History

2024-08-19 10:38:46 +00:00
self: with self; ''
#
# ack recursively through notes
#
# uses ack: https://beyondgrep.com
NOTESDIR=~/pub.solar-nc/Notes
ACK_PREFIX="ack --files-with-matches"
cd $NOTESDIR || exit
file="$(
FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \
fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \
--phony -q "$1" \
--bind "change:reload:$ACK_PREFIX {q}" \
--preview-window="70%:wrap"
)" &&
echo "opening $file" &&
bat --theme=TwoDark "$file"
''