Spawn remedy using vim-dispatch, add remedy script

This commit is contained in:
doylet 2023-10-06 10:45:23 +11:00
parent 8c6455578b
commit df2cf4e977
2 changed files with 22 additions and 10 deletions

View File

@ -309,31 +309,31 @@ augroup persistent_settings
augroup end augroup end
function! RemedyBGOpenFile() function! RemedyBGOpenFile()
execute("!start remedybg open-file " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg open-file " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')") execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction endfunction
command RemedyBGOpenFile call RemedyBGOpenFile() command RemedyBGOpenFile call RemedyBGOpenFile()
function! RemedyBGStartDebugging() function! RemedyBGStartDebugging()
execute("!start remedybg start-debugging " . expand("%:p") . " " . line(".")) execute("Spawn! start remedybg start-debugging " . expand("%:p") . " " . line("."))
endfunction endfunction
command RemedyBGStartDebugging call RemedyBGStartDebugging() command RemedyBGStartDebugging call RemedyBGStartDebugging()
function! RemedyBGStopDebugging() function! RemedyBGStopDebugging()
execute("!start remedybg stop-debugging " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg stop-debugging " . expand("%:p") . " " . line("."))
endfunction endfunction
command RemedyBGStopDebugging call RemedyBGStopDebugging() command RemedyBGStopDebugging call RemedyBGStopDebugging()
function! RemedyBGRunToCursor() function! RemedyBGRunToCursor()
execute("!start remedybg open-file " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg open-file " . expand("%:p") . " " . line("."))
execute("!start remedybg run-to-cursor " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg run-to-cursor " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')") execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction endfunction
command RemedyBGRunToCursor call RemedyBGRunToCursor() command RemedyBGRunToCursor call RemedyBGRunToCursor()
function! RemedyBGAddBreakpointAtFile() function! RemedyBGAddBreakpointAtFile()
execute("!start remedybg open-file " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg open-file " . expand("%:p") . " " . line("."))
execute("!start remedybg add-breakpoint-at-file " . expand("%:p") . " " . line(".")) execute("Spawn! remedybg add-breakpoint-at-file " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')") execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction endfunction
command RemedyBGAddBreakpointAtFile call RemedyBGAddBreakpointAtFile() command RemedyBGAddBreakpointAtFile call RemedyBGAddBreakpointAtFile()
@ -435,11 +435,11 @@ set errorformat+=%\\%%(CTIME%\\)%\\@=%m " ctime.exe -stat
" ============================================================================== " ==============================================================================
let s:running_windows = has("win16") || has("win32") || has("win64") let s:running_windows = has("win16") || has("win32") || has("win64")
if s:running_windows if s:running_windows
set makeprg=./build.bat set makeprg=build
nnoremap <C-b> :Make ./build.bat<cr>
else else
" Set vim terminal to enter normal mode using escape like normal vim behaviour " Set vim terminal to enter normal mode using escape like normal vim behaviour
tnoremap <Esc> <C-\><C-n> tnoremap <Esc> <C-\><C-n>
nnoremap <C-b> :Make ./build.sh<cr>
set makeprg=./build.sh set makeprg=./build.sh
endif endif
nnoremap <C-b> :Make<cr>

12
Win/Scripts/remedybg.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
setlocal
set desired_path=%devenver_root%\..\..\Cryptomator\Dev\Win\RemedyBG\0_3_9_4
set desired_exe=remedybg.exe
set path=%desired_path%;%path%
set exe_to_use=""
for /f "delims=" %%a in ('where "$desired_path:%desired_exe%"') do ( set "exe_to_use=%%a")
echo [DEVENVER] Executing script "%~dpnx0" with "%exe_to_use%"
call %desired_exe% %*
endlocal