about summary refs log tree commit diff stats
path: root/subx/edit
blob: ef20d85f98443d25270e8ff314bb7a403701c73a (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 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