add termux configuration from phone

This commit is contained in:
PowerUser64 2022-01-29 22:53:29 -08:00
parent 52c490dcea
commit cd550ba6e6
5 changed files with 158 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"
}