2023-01-28 20:49:10 +00:00
|
|
|
self:
|
|
|
|
with self; ''
|
2022-07-07 20:16:55 +00:00
|
|
|
#
|
|
|
|
# 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"
|
|
|
|
''
|