about summary refs log tree commit diff stats
path: root/subx/edit
blob: 517e1f757f51ed87edfb9a528c9bb6994239d192 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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