mu/edit

24 lines
535 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
LOCAL_SETTINGS='-S vimrc.vim'
fi
2018-09-21 04:50:08 +00:00
if [[ $1 == 'ex'* ]]
then
eval $EDITOR $LOCAL_SETTINGS examples/$1.subx
2018-09-21 04:50:08 +00:00
else
eval $EDITOR $LOCAL_SETTINGS apps/$1.subx
2018-09-21 04:50:08 +00:00
fi