From: Edward Date: Tue, 2 Jun 2026 15:49:32 +0000 (-0500) Subject: Bring in existing scripts from dotfiles X-Git-Url: https://apps.delaporte.us/gitweb/minion.git/commitdiff_plain/3cb071d4349ce044d5e2d2a9207b25f1c419ab37?ds=sidebyside Bring in existing scripts from dotfiles --- diff --git a/bin/mh b/bin/mh new file mode 100755 index 0000000..df48f4c --- /dev/null +++ b/bin/mh @@ -0,0 +1,19 @@ +#!/usr/bin/fish +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 "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 "In vi - :r!ml 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" diff --git a/bin/ml b/bin/ml new file mode 100755 index 0000000..4acb211 --- /dev/null +++ b/bin/ml @@ -0,0 +1,3 @@ +#!/usr/bin/fish +set year (date +%Y) +find $HOME/Journal/$year -type f -iname "*$argv*\.md" diff --git a/bin/mla b/bin/mla new file mode 100755 index 0000000..38103ea --- /dev/null +++ b/bin/mla @@ -0,0 +1,2 @@ +#!/usr/bin/fish +find $HOME/Journal -type f -iname "*$argv*\.md" diff --git a/bin/mn b/bin/mn new file mode 100755 index 0000000..48f98af --- /dev/null +++ b/bin/mn @@ -0,0 +1,5 @@ +#!/usr/bin/fish +set year (date +%Y) +set input $(string join '-' $argv) +set topic $(string replace -a ' ' '-' $input) +vim $(printf "$HOME/Journal/$year/%02d-$topic.md" (date +%m)) diff --git a/bin/mo b/bin/mo new file mode 100755 index 0000000..2ebc8db --- /dev/null +++ b/bin/mo @@ -0,0 +1,3 @@ +#!/usr/bin/fish +set year (date +%Y) +vim $(find $HOME/Journal/$year -type f -iname "*$argv*\.md") diff --git a/bin/moa b/bin/moa new file mode 100755 index 0000000..f11065e --- /dev/null +++ b/bin/moa @@ -0,0 +1,2 @@ +#!/usr/bin/fish +vim $(find $HOME/Journal -type f -iname "*$argv*\.md") diff --git a/bin/mp b/bin/mp new file mode 100755 index 0000000..45291cb --- /dev/null +++ b/bin/mp @@ -0,0 +1,14 @@ +#!/usr/bin/fish +set year (date +%Y) +set files $(find $HOME/Journal/$year -type f -iname "*$argv*\.md") + +if test (count $files) -lt 5; + for file in $files + mdtohtml $file > $file.html + firefox $file.html + end; +else + echo "More than 5 files found." +end + + diff --git a/bin/ms b/bin/ms new file mode 100755 index 0000000..76e9dfd --- /dev/null +++ b/bin/ms @@ -0,0 +1,2 @@ +#!/usr/bin/fish +aspell check "$(ml $argv)"