about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsubx/edit9
-rw-r--r--vimrc.vim6
2 files changed, 12 insertions, 3 deletions
diff --git a/subx/edit b/subx/edit
index 03a2c284..517e1f75 100755
--- a/subx/edit
+++ b/subx/edit
@@ -7,9 +7,14 @@ then
   exit 1
 fi
 
+if [[ $EDITOR == *'vim'* ]]
+then
+  LOCAL_SETTINGS='-S vimrc.vim'
+fi
+
 if [[ $1 == 'ex'* ]]
 then
-  eval $EDITOR examples/$1.subx
+  eval $EDITOR $LOCAL_SETTINGS examples/$1.subx
 else
-  eval $EDITOR apps/$1.subx
+  eval $EDITOR $LOCAL_SETTINGS apps/$1.subx
 fi
diff --git a/vimrc.vim b/vimrc.vim
index 8e2c9aeb..8334692b 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -55,5 +55,9 @@ augroup END
 " assumes CWD is subx/
 command! -nargs=1 EE call EditSubx(<f-args>)
 function! EditSubx(arg)
-  exec "silent! vert split " . a:arg . "*.subx"
+  if a:arg =~ "^ex"
+    exec "silent! vert split examples/" . a:arg . "*.subx"
+  else
+    exec "silent! vert split apps/" . a:arg . "*.subx"
+  endif
 endfunction