4 ms·
Here's a poor man's version of dnote in my .bashrc. It's the only thing I've used consistently: notes() { local fpath=$HOME/notes.md if [ "$1" == "gvim
by lwerdna 9y ago
Here's a poor man's version of dnote in my .bashrc. It's the only thing I've used consistently:
notes() {
local fpath=$HOME/notes.md
if [ "$1" == "gvim" ]; then
gvim + $fpath
elif [ "$1" == "vim" ]; then
gvim + $fpath
elif [ "$1" == "date" ]; then
echo '' >> $fpath
echo '# '`date +"%m-%d-%Y-%T"` >> $fpath
echo '---------------------' >> $fpath
elif [ "$1" == "" ]; then
less +G $fpath
else
echo '' >> $fpath
echo $@ >> $fpath
fi
}
Insert the current date with `notes date`. Store a note with `notes the earth is about 25k miles around` or `notes dentist appointment Thursday` or `notes purfunctory - carried out with a minimum of effort or reflection #vocab`. Look up recent notes with `notes` or read/search the entire notes database with `notes vim`.
- dgritsko 9y agoI really appreciate the minimalism of this approach. Going to give this a try, thanks for sharing!
- demilicious 9y agoYeah, this is really useful. I think it'll break on single quotes: `notes we'll need oranges tomorrow`, but otherwise, it's a very low-friction method, to me.
- dgritsko 9y agoYeah, had a similar issue with parentheses while using it today (but escaping them with '\' worked just fine).
- Froyoh 9y agoCan this be used with nano as well?
- guessmyname 9y agoYes, if you change all references of "gvim" to "nano".
- askafriend 9y agoWhy not just use Notes.app?
- guessmyname 9y ago> Why not just use Notes.app? Because not everyone uses macOS. This shell script works on most Unix-like systems unlike Notes.app
- tangue 9y agoNotes will try to insert smart quotes in your code and other silent changes (made to improve text notes but catastrophic for code.)