From 4de2542e906b8b964b545b574c32dc4f01b833d5 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Sat, 17 Feb 2024 16:01:00 +0200 Subject: [PATCH] Updated writer.sh to use existing nvim if defined --- writer.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/writer.sh b/writer.sh index 300e411..b86274a 100755 --- a/writer.sh +++ b/writer.sh @@ -1,5 +1,8 @@ #!/bin/bash -# writer 1.0 - @k@layer8.space - mit +# writer 1.2 - @k@layer8.space - mit + +# Use the assigned editor, if any, else use nano +[[ ${EDITOR:-"unset"} == "unset" ]] && EDITOR=nano nlog() { local ORANGE='\033[0;33m' @@ -11,5 +14,5 @@ mkdir -p notes current_date=$(date +%Y-%m-%d) nlog "opening note notes/$current_time.txt" filename="notes/${current_date}.txt" -nano "$filename" +$EDITOR "$filename" ./noter.sh