X-Git-Url: https://apps.delaporte.us/gitweb/minion.git/blobdiff_plain/3cb071d4349ce044d5e2d2a9207b25f1c419ab37..0e2a4e9b8181f9c59ca86671f9aaae626eace4d5:/bin/mo diff --git a/bin/mo b/bin/mo index 2ebc8db..7d0e7cd 100755 --- a/bin/mo +++ b/bin/mo @@ -1,3 +1,14 @@ -#!/usr/bin/fish -set year (date +%Y) -vim $(find $HOME/Journal/$year -type f -iname "*$argv*\.md") +#!/bin/bash +# mo - minion open +# Like `ml / minion list`, but opens all matches in your $EDITOR +# Optionally search a second term - to quickly open differently named files +year=`date +%Y` +files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") +if [ -n "$2" ]; then + more_files=$(find $HOME/Journal/$year -type f -iname "*$2*\.md") +fi +if [ -z ${EDITOR} ]; then + echo "EDITOR unset, defaulting to Nano" + export EDITOR=nano +fi +$EDITOR $files $more_files