diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-05-29 00:35:21 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-05-29 00:35:21 -0700 |
commit | 3fe43bca71bdc74c36e83fab6c0105c910a990e4 (patch) | |
tree | a6fececaf739099b0fe87c66ff9e18a2a2d21ec1 /vimrc.vim | |
parent | aee83e27521d0d3ba9723837bb9df6fcd2b73751 (diff) | |
download | mu-3fe43bca71bdc74c36e83fab6c0105c910a990e4.tar.gz |
6427
Diffstat (limited to 'vimrc.vim')
-rw-r--r-- | vimrc.vim | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/vimrc.vim b/vimrc.vim index b852e9df..ad95a63e 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -34,17 +34,23 @@ augroup END " opening a second file in a new or existing window (shouldn't mess up existing highlighting) " reloading an existing file (shouldn't mess up existing highlighting) -command! -nargs=1 E call EditSubx("edit", <f-args>) +command! -nargs=1 E call EditMuFile("edit", <f-args>) if exists("&splitvertical") - command! -nargs=1 S call EditSubx("vert split", <f-args>) - command! -nargs=1 H call EditSubx("hor split", <f-args>) + command! -nargs=1 S call EditMuFile("vert split", <f-args>) + command! -nargs=1 H call EditMuFile("hor split", <f-args>) else - command! -nargs=1 S call EditSubx("vert split", <f-args>) - command! -nargs=1 H call EditSubx("split", <f-args>) + command! -nargs=1 S call EditMuFile("vert split", <f-args>) + command! -nargs=1 H call EditMuFile("split", <f-args>) endif -function! EditSubx(cmd, arg) - exec "silent! " . a:cmd . " apps/" . a:arg . ".subx" +function! EditMuFile(cmd, arg) + let l:full_path = "apps/" . a:arg + if filereadable(l:full_path . ".mu") + let l:full_path = l:full_path . ".mu" + else + let l:full_path = l:full_path . ".subx" + endif + exec "silent! " . a:cmd . " " . l:full_path endfunction " we often want to crib lines of machine code from other files |