about summary refs log tree commit diff stats
path: root/edit
blob: 57c665c999cbc12cdf9c031c7423b8d459178b55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env zsh
# Helper to more conveniently open commonly-used SubX programs.

if [ $# -eq 0 ]
then
  echo "Usage: $0 <file root without apps/ subdirectory or .subx extension>"
  exit 1
fi

TARGET=apps/$1.mu
if [[ -e apps/$1.subx  &&  ! -e apps/$1.mu ]]
then
  TARGET=apps/$1.subx
fi

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