#!/usr/bin/env bash # Read notes files from ~/.configs_pointer/notes if [[ $1 =~ '-h' ]]; then printf 'Open notes files from ~/.configs_pointer/notes\n' exit 0 elif ! [[ -h ~/.configs_pointer ]]; then cat </dev/null; then printf 'Requires fzf\n' exit 1 fi # Fzf for notes file if command -v fd &> /dev/null; then notes_file=~/.configs_pointer/notes/"$(fd '.md' ~/.configs_pointer/notes -x basename | fzf)" else notes_file="$(find ~/.configs_pointer/notes -type f | fzf)" fi # Use best available pagenator if command -v nvim &>/dev/null; then nvim -R "${notes_file}" elif command -v vim &>/dev/null; then vim -R "${notes_files}" elif command -v bat &>/dev/null; then bat --paging=always "${notes_file}" else less "${notes_file}" fi