fuzbat() { #!/usr/bin/env bash # fuzbat # Note-taking app alternative # Originally written by Casey Brant # Adapted by Armand Philippot # Adapted again by T0MuX to keep it simply working as a bash function # - added FZPATH to chose the notes' path FZPATH=$HOME/Sync/Notes set -e main() { previous_file="$1" file_to_edit=`select_file $previous_file` if [ -n "$file_to_edit" ] ; then "$EDITOR" "$file_to_edit" main "$file_to_edit" fi } select_file() { given_file="$1" fzf --tac --preview="bat --style=numbers --color=always {}" --preview-window=right:70%:wrap --query="$given_file" } OLDPWD=$PWD cd $FZPATH main "" cd $OLDPWD }