2018-09-21 04:50:08 +00:00
|
|
|
#!/usr/bin/env zsh
|
2019-02-15 23:48:16 +00:00
|
|
|
# Helper to more conveniently open commonly-used SubX programs.
|
2018-09-21 04:50:08 +00:00
|
|
|
|
|
|
|
if [ $# -eq 0 ]
|
|
|
|
then
|
2019-02-15 23:48:16 +00:00
|
|
|
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
|
|
|
|
|
2018-09-21 20:51:43 +00:00
|
|
|
if [[ $EDITOR == *'vim'* ]]
|
|
|
|
then
|
|
|
|
LOCAL_SETTINGS='-S vimrc.vim'
|
|
|
|
fi
|
|
|
|
|
2018-09-21 04:50:08 +00:00
|
|
|
if [[ $1 == 'ex'* ]]
|
|
|
|
then
|
2018-09-21 20:51:43 +00:00
|
|
|
eval $EDITOR $LOCAL_SETTINGS examples/$1.subx
|
2018-09-21 04:50:08 +00:00
|
|
|
else
|
2018-09-21 20:51:43 +00:00
|
|
|
eval $EDITOR $LOCAL_SETTINGS apps/$1.subx
|
2018-09-21 04:50:08 +00:00
|
|
|
fi
|