let g:vimspector_sidebar_width = 30 let g:vimspector_terminal_maxwidth = 30 func VimspectorTerminalSetup() endfunc au User VimspectorTerminalOpened call VimspectorTerminalSetup() func VimspectorUISetup() "call win_gotoid(g:vimspector_session_windows.stack_trace) endfunc au User VimspectorUICreated call VimspectorUISetup() " compile function Compile() if exists("g:vimspector_session_windows.code") call win_gotoid(g:vimspector_session_windows.code) endif w execute "make ~/.cache/termdebug/bin/" .. expand("%:r") .. " -f ~/.config/nvim/makefile" endfunction nnoremap dc :call Compile() " quickfix window (after running make) nnoremap dqf :tab cope nnoremap df :tabNext nnoremap dd :call vimspector#Launch() nnoremap de :call vimspector#Reset() " write clipboard into input file function WriteInput() let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r") echo "Written input to '" .. inputfile .. "'." call writefile(getreg('+', 1, 1), inputfile) endfunction nnoremap rw :call WriteInput() " start from input file function RunInput() call vimspector#Stop() call vimspector#Restart() call win_gotoid(g:vimspector_session_windows.code) let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r") let @x = join(readfile(inputfile), "\n") .. "\n\n" call win_gotoid(g:vimspector_session_windows.terminal) " let vimspector set up before feeding input sleep 1 normal G"xp call win_gotoid(g:vimspector_session_windows.code) endfunction nnoremap ri :call RunInput() " debugging program flow nnoremap rs :call vimspector#Restart() nnoremap rr :call vimspector#Stop() nnoremap rf :call vimspector#Continue() nnoremap :call vimspector#StepInto() nnoremap :call vimspector#StepOver() " breakpoints nnoremap dsf :call vimspector#ToggleBreakpoint() nnoremap dsc :call vimspector#ClearBreakpoints() " watches au BufEnter vimspector.Watches* nnoremap dd :call vimspector#DeleteWatch()