Skip to content

Instantly share code, notes, and snippets.

@danbruegge
Last active December 2, 2018 12:20
Show Gist options
  • Save danbruegge/fe6bcc8e3da0d5e1f5e562203ba6ae81 to your computer and use it in GitHub Desktop.
Save danbruegge/fe6bcc8e3da0d5e1f5e562203ba6ae81 to your computer and use it in GitHub Desktop.
Simply manage your markdown notes in bash.

Usage

  • add this script to your .bashrc
  • adjust
    • $NOTES_HOME path to your preferred location of the notes
    • $NOTES_EDITOR to your preferred editor in which the notes should be edited
note () {
NOTES_HOME="$HOME/Cloud/Notes"
NOTES_EDITOR="nvim"
if [[ "ls" == *"$1"* ]]; then
tree "$NOTES_HOME";
return
fi
if [[ "rm" == "$1" ]]; then
rm -i "$NOTES_HOME/$2.md";
return
fi
$NOTES_EDITOR "$NOTES_HOME/$1.md";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment