mu/edit

19 lines
453 B
Plaintext
Raw Normal View History

2018-09-21 04:50:08 +00:00
#!/usr/bin/env zsh
# Helper to more conveniently open commonly-used SubX programs.
2018-09-21 04:50:08 +00:00
if [ $# -eq 0 ]
then
echo "Usage: $0 <file root without subdirectory or .subx extension>"
echo
echo "Naming convention: Files starting with 'ex' will be assumed to live in examples/"
echo "Other files will be assumed to live in apps/"
2018-09-21 04:50:08 +00:00
exit 1
fi
if [[ $EDITOR == *'vim'* ]]
then
2020-01-02 01:23:29 +00:00
$EDITOR -S vimrc.vim apps/$1.subx
2018-09-21 04:50:08 +00:00
else
2020-01-02 01:23:29 +00:00
$EDITOR apps/$1.subx
2018-09-21 04:50:08 +00:00
fi