2023-01-28 20:49:10 +00:00
|
|
|
self: with self; ''
|
2022-07-07 20:16:55 +00:00
|
|
|
#
|
2024-08-27 08:42:32 +00:00
|
|
|
# rg recursively through notes
|
2022-07-07 20:16:55 +00:00
|
|
|
#
|
2024-08-27 08:42:32 +00:00
|
|
|
# uses ripgrep: https://github.com/BurntSushi/ripgrep
|
2022-07-07 20:16:55 +00:00
|
|
|
|
|
|
|
NOTESDIR=~/pub.solar-nc/Notes
|
2024-08-27 11:31:31 +00:00
|
|
|
ACK_PREFIX="${ripgrep}/bin/rg --files-with-matches"
|
2022-07-07 20:16:55 +00:00
|
|
|
cd $NOTESDIR || exit
|
|
|
|
file="$(
|
|
|
|
FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \
|
2024-08-27 08:42:32 +00:00
|
|
|
${fzf}/bin/fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \
|
2022-07-07 20:16:55 +00:00
|
|
|
--phony -q "$1" \
|
|
|
|
--bind "change:reload:$ACK_PREFIX {q}" \
|
|
|
|
--preview-window="70%:wrap"
|
|
|
|
)" &&
|
|
|
|
echo "opening $file" &&
|
2024-08-27 08:42:32 +00:00
|
|
|
${bat}/bin/bat --theme=TwoDark "$file"
|
2022-07-07 20:16:55 +00:00
|
|
|
''
|