Updated writer.sh to use existing nvim if defined

This commit is contained in:
Siina Mashek 2024-02-17 16:01:00 +02:00
parent cbbf2340e4
commit 4de2542e90

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/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() { nlog() {
local ORANGE='\033[0;33m' local ORANGE='\033[0;33m'
@ -11,5 +14,5 @@ mkdir -p notes
current_date=$(date +%Y-%m-%d) current_date=$(date +%Y-%m-%d)
nlog "opening note notes/$current_time.txt" nlog "opening note notes/$current_time.txt"
filename="notes/${current_date}.txt" filename="notes/${current_date}.txt"
nano "$filename" $EDITOR "$filename"
./noter.sh ./noter.sh