notes: fix script, use pkgs instead of PATH
This commit is contained in:
parent
313b1faba4
commit
0e5a3fa29a
|
@ -1,19 +1,19 @@
|
||||||
self: with self; ''
|
self: with self; ''
|
||||||
#
|
#
|
||||||
# ack recursively through notes
|
# rg recursively through notes
|
||||||
#
|
#
|
||||||
# uses ack: https://beyondgrep.com
|
# uses ripgrep: https://github.com/BurntSushi/ripgrep
|
||||||
|
|
||||||
NOTESDIR=~/pub.solar-nc/Notes
|
NOTESDIR=~/pub.solar-nc/Notes
|
||||||
ACK_PREFIX="ack --files-with-matches"
|
ACK_PREFIX="${rg}/bin/rg --files-with-matches"
|
||||||
cd $NOTESDIR || exit
|
cd $NOTESDIR || exit
|
||||||
file="$(
|
file="$(
|
||||||
FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \
|
FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \
|
||||||
fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \
|
${fzf}/bin/fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \
|
||||||
--phony -q "$1" \
|
--phony -q "$1" \
|
||||||
--bind "change:reload:$ACK_PREFIX {q}" \
|
--bind "change:reload:$ACK_PREFIX {q}" \
|
||||||
--preview-window="70%:wrap"
|
--preview-window="70%:wrap"
|
||||||
)" &&
|
)" &&
|
||||||
echo "opening $file" &&
|
echo "opening $file" &&
|
||||||
bat --theme=TwoDark "$file"
|
${bat}/bin/bat --theme=TwoDark "$file"
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in a new issue