about summary refs log blame commit diff stats
path: root/subx/edit
blob: ef20d85f98443d25270e8ff314bb7a403701c73a (plain) (tree)
1
2
3
4
5
6
7
8
9
                  
                                   






                    




                               

                    
                                               
    
                                           
  
#!/usr/bin/env zsh
# Open commonly-used SubX programs.

if [ $# -eq 0 ]
then
  echo "edit <file>"
  exit 1
fi

if [[ $EDITOR == *'vim'* ]]
then
  LOCAL_SETTINGS='-S vimrc.vim'
fi

if [[ $1 == 'ex'* ]]
then
  eval $EDITOR $LOCAL_SETTINGS examples/$1.subx
else
  eval $EDITOR $LOCAL_SETTINGS apps/$1.subx
fi