-#!/usr/bin/fish
+#!/usr/bin/bash
echo "Usage:"
echo ""
echo "mn - minion new - edit a new file with the year and month in the name"
echo "mh - minion help - print this help"
echo "ml - minion list - list all files that match"
-echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)"
echo "mo - minion open - open all files that match"
-echo "ms - minion spell - open the matching file with `aspell`"
echo ""
echo "Examples:"
echo ""
-echo "mn meeting topic - open a file Journal/2026/04-meeting-topic.md"
+echo "mn meeting topic - open a (new) file Journal/2026/04-meeting-topic.md"
echo "ml 04 - list files created in April"
echo "mo manager - open files named with 'manager' to edit"
echo ""
-echo "mla, moa - minion X all - act as `ml` and `mo`, but include all previous years of Journal entries"
+echo "Advanced Usage:"
+echo ""
+echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)"
+echo "ms - minion spell - open the matching file with 'aspell'"
+echo "mla, moa - minion X all - act as 'ml' and 'mo', but include all previous years of Journal entries"
+echo ""
+echo "On vi integration:"
+echo ""
echo "In vi - :r!ml <term> will add list of files to the current buffer"
echo "In vi - gf - opens the file name under the cursor - as long as it has no spaces"
-#!/usr/bin/fish
-set year (date +%Y)
-set input $(string join '-' $argv)
-set topic $(string replace -a ' ' '-' $input)
+#!/usr/bin/bash
+year=`date +%Y`
+input=$@
+topic=${input// /-}
mkdir -p "$HOME/Journal/$year"
-vim $(printf "$HOME/Journal/$year/%02d-$topic.md" (date +%m))
+if [ !x"${EDITOR}" ]; then
+ export EDITOR=nano
+fi
+fname=$(printf "$HOME/Journal/$year/%02d-$topic.md" $(date +%m))
+$EDITOR $fname
-#!/usr/bin/fish
-set year (date +%Y)
-vim $(find $HOME/Journal/$year -type f -iname "*$argv*\.md")
+#!/usr/bin/bash
+year=`date +%Y`
+files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
+if [ !x"${EDITOR}" ]; then
+ export EDITOR=nano
+fi
+$EDITOR $files
-#!/usr/bin/fish
-vim $(find $HOME/Journal -type f -iname "*$argv*\.md")
+#!/usr/bin/bash
+files=$(find $HOME/Journal -type f -iname "*$1*\.md")
+if [ !x"${EDITOR}" ]; then
+ export EDITOR=nano
+fi
+$EDITOR $files