aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-02-01 11:30:36 +0000
committerMatthew Lemon <y@yulqen.org>2024-02-01 11:30:36 +0000
commit0148eeb1d647dc9ce5eb122e62388fc8f8e37208 (patch)
treee237df265cbce6b61280a58d870b843675289425
parentd5bb061c65466229ebc268ab2b65eaf78bc7fb94 (diff)
Gone with bat for batnote
-rwxr-xr-xbatnote15
1 files changed, 9 insertions, 6 deletions
diff --git a/batnote b/batnote
index 110d7c7..3e5502e 100755
--- a/batnote
+++ b/batnote
@@ -6,17 +6,20 @@
NOTES=/home/$USER/Documents/Notes
FZF_BIN=/usr/bin/fzf
BAT=/usr/bin/bat
-LESS=/usr/bin/less
+CAT=/usr/bin/cat
+#LESS=/usr/bin/less
VIM=/usr/bin/vim
-CMD=$LESS
+set -e
+
+CMD="$BAT"
-# instead of viewing with less, we want to edit in Vim
if ! [[ -x $FZF_BIN ]]; then
echo "You need to have FZF installed for this to work."
exit 1
fi
+# instead of viewing with less, we want to edit in Vim
if [[ $1 = "-v" ]]
then
echo "Using vim..."
@@ -34,9 +37,9 @@ fi
# fi
-if [[ -x $BAT ]]; then
- CMD=$BAT
-fi
+# if [[ -x $BAT ]]; then
+# CMD=$CAT
+# fi
# Thanks to https://stackoverflow.com/a/1489405 for the find command to omit .git
clear; $CMD "$(find $NOTES -name '.git*' -type d -prune -o -type f -print|$FZF_BIN)"