Merge branch 'master' of git.blakenorth.net/home/git/dotfiles

This commit is contained in:
PowerUser64 2022-01-30 17:17:48 -08:00
commit 7bc0ad8dd5
6 changed files with 159 additions and 4 deletions

View file

@ -29,12 +29,15 @@ usage() {
edit() {
check_setup
NOTE_PATH="$(fd -at f "$2" "$NOTES_DIR")"
# if there was more than one result
if [ "$(echo "$NOTE_PATH" | wc -l)" -gt 1 ]; then
NOTE_PATH="$(echo "$NOTE_PATH" | fzy)"
# set search term
if [ -z "$2" ]; then
echo "Error: no search term provided" >&2
exit 1
fi
SEARCH_TERM="$2"
NOTE_PATH="$(cd "$NOTES_DIR" && fzf -1 -q "$SEARCH_TERM" --layout=reverse --info=inline --height=10%)"
$EDITOR_CMD "$NOTE_PATH"
}