diff options
Diffstat (limited to 'subx')
-rwxr-xr-x | subx/edit | 9 | ||||
-rwxr-xr-x | subx/run | 2 | ||||
-rw-r--r-- | subx/teensy/vimrc.vim | 13 |
3 files changed, 20 insertions, 4 deletions
diff --git a/subx/edit b/subx/edit index d229c654..7d09fc17 100755 --- a/subx/edit +++ b/subx/edit @@ -3,8 +3,13 @@ if [ $# -eq 0 ] then - echo "edit <suffix>" + echo "edit <file>" exit 1 fi -eval $EDITOR ./teensy/test$1*.[cs] +if [[ $1 == 'test'* ]] +then + eval $EDITOR ./teensy/$1*.[cs] +fi + +eval $EDITOR ./$1.subx diff --git a/subx/run b/subx/run index 332d5786..b0eac8df 100755 --- a/subx/run +++ b/subx/run @@ -3,7 +3,7 @@ if [ $# -eq 0 ] then - echo "run <suffix>" + echo "run <binary>" exit 1 fi diff --git a/subx/teensy/vimrc.vim b/subx/teensy/vimrc.vim index 68b63640..e0fe2c1e 100644 --- a/subx/teensy/vimrc.vim +++ b/subx/teensy/vimrc.vim @@ -1 +1,12 @@ -command! -nargs=1 EE exec "vert split teensy/test" . <args> . "*.[cs]" +" assumes CWD is subx/ +command! -nargs=1 EE call EditSubx(<f-args>) + +function! EditSubx(arg) + " run commands silently because we may get an error loading EditSubx from a + " different directory. + if a:arg =~ "test.*" + exec "silent! vert split teensy/" . a:arg . "*.[cs]" + else + exec "silent! vert split " . a:arg . "*.subx" + endif +endfunction |