zsh: add ned
This commit is contained in:
parent
8dd1d47e9d
commit
86ce2abd6e
1 changed files with 23 additions and 0 deletions
23
.config/shell/bin/ned
Executable file
23
.config/shell/bin/ned
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
# NEd: Note Editor (and your best friend!)
|
||||
# Ned can edit and create notes in a folder you tell him to!
|
||||
|
||||
NOTES_DIR="$HOME/Documents/college/2y/2q/"
|
||||
|
||||
[ -d "$NOTES_DIR"/misc ] && mkdir "$NOTES_DIR/misc"
|
||||
|
||||
# Create misc note if blank
|
||||
if [ -z "$1" ]; then
|
||||
"$EDITOR" "$NOTES_DIR/unsorted/$(date)"
|
||||
zsh
|
||||
fi
|
||||
|
||||
# Parse arguments
|
||||
case "$1" in
|
||||
# create and edit new note
|
||||
'new'|'n') "$EDITOR" "$NOTES_DIR"/*"$2"*/notes/"$3";;
|
||||
# edit ned
|
||||
'e') "$EDITOR" "$(realpath "$0")";;
|
||||
*) echo "no such option";;
|
||||
esac
|
||||
|
Loading…
Add table
Reference in a new issue