From cfb4b738c60ea7126f831248e665e15fea780216 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 19 Jul 2019 10:30:23 -0700 Subject: 5418 - vim tweaks When running a single test, stop always opening the trace. Instead create a separate affordance for that, and also have it reuse windows. --- subx/vimrc.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'subx') diff --git a/subx/vimrc.vim b/subx/vimrc.vim index 57c450d6..80ec5a5f 100644 --- a/subx/vimrc.vim +++ b/subx/vimrc.vim @@ -85,7 +85,11 @@ command! -nargs=0 L exec "%!grep -a label |grep -v clear-stream:loop" " can't avoid the function because that disables the wait for prompt " known issue: " cursor on '#' causes error -noremap t {j0:call RunTestMoveCursorAndMaybeOpenTrace("") +noremap t {j0:call RunTestMoveCursor("") +function RunTestMoveCursor(arg) + exec "!run_one_test.sh ".expand("%")." ".a:arg + exec "normal \" +endfunction function RunTestMoveCursorAndMaybeOpenTrace(arg) exec "!run_one_test.sh ".expand("%")." ".a:arg exec "normal \" @@ -93,3 +97,10 @@ function RunTestMoveCursorAndMaybeOpenTrace(arg) noautocmd vertical split last_run endif endfunction + +set switchbuf=useopen +if exists("&splitvertical") + command! -nargs=0 T badd last_run | sbuffer last_run +else + command! -nargs=0 T badd last_run | vert sbuffer last_run +endif -- cgit 1.4.1-2-gfad0