nvim: misc fixes

vimspector now properly works
This commit is contained in:
dogeystamp 2023-05-20 16:27:20 -04:00
parent aad07e6abb
commit a13717fe60
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 16 additions and 9 deletions

View File

@ -1,9 +1,9 @@
# makefile for compiling individual files from vim
~/.cache/termdebug/%: %.cpp
mkdir -p ~/.cache/termdebug/
~/.cache/termdebug/bin/%: %.cpp
mkdir -p ~/.cache/termdebug/bin/
$(LINK.cpp) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
~/.cache/termdebug/%: %.c
mkdir -p ~/.cache/termdebug/
~/.cache/termdebug/bin/%: %.c
mkdir -p ~/.cache/termdebug/bin/
$(LINK.c) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@

View File

@ -15,7 +15,7 @@ function Compile()
call win_gotoid(g:vimspector_session_windows.code)
endif
w
execute "make ~/.cache/termdebug/" .. expand("%:r") .. " -f ~/.config/nvim/makefile"
execute "make ~/.cache/termdebug/bin/" .. expand("%:r") .. " -f ~/.config/nvim/makefile"
endfunction
nnoremap <silent> <leader>dc :call Compile()<cr>
@ -23,8 +23,8 @@ nnoremap <silent> <leader>dc :call Compile()<cr>
nnoremap <silent> <leader>dqf :tab cope<cr>
nnoremap <silent> <leader>df :tabNext<cr>
nnoremap <silent> <leader>dd :call vimspector#Launch()
nnoremap <silent> <leader>de :call vimspector#Reset()
nnoremap <silent> <leader>dd :call vimspector#Launch()<cr>
nnoremap <silent> <leader>de :call vimspector#Reset()<cr>
" write clipboard into input file
function WriteInput()
@ -42,7 +42,10 @@ function RunInput()
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 <silent> <leader>ri :call RunInput()<cr>
@ -50,8 +53,12 @@ nnoremap <silent> <leader>ri :call RunInput()<cr>
nnoremap <silent> <leader>rs :call vimspector#Restart()<cr>
nnoremap <silent> <leader>rr :call vimspector#Stop()<cr>
nnoremap <silent> <leader>rf :call vimspector#Continue()<cr>
nnoremap <silent> <c-p> :vimspector#StepInto()<cr>
nnoremap <silent> <c-n> :vimspector#StepOver()<cr>
nnoremap <silent> <c-p> :call vimspector#StepInto()<cr>
nnoremap <silent> <c-n> :call vimspector#StepOver()<cr>
" breakpoints
nnoremap <silent> <leader>dsf :call vimspector#ToggleBreakpoint()<cr>
nnoremap <silent> <leader>dsc :call vimspector#ClearBreakpoints()<cr>
" watches
au BufEnter vimspector.Watches* nnoremap <silent> <buffer> dd :call vimspector#DeleteWatch()<cr>