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








                          




                               

                    
                                               
    
                                           
  
#!/usr/bin/env zsh
# Open a specific example.

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