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
|
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
|