From a13717fe600f116029bd020f80648d50b8594526 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 20 May 2023 16:27:20 -0400 Subject: [PATCH] nvim: misc fixes vimspector now properly works --- src/.config/nvim/makefile | 8 ++++---- src/.config/nvim/vimspector.vim | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/.config/nvim/makefile b/src/.config/nvim/makefile index 930b895..2c7f4ca 100644 --- a/src/.config/nvim/makefile +++ b/src/.config/nvim/makefile @@ -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 $@ diff --git a/src/.config/nvim/vimspector.vim b/src/.config/nvim/vimspector.vim index 60a4cbf..52f1d76 100644 --- a/src/.config/nvim/vimspector.vim +++ b/src/.config/nvim/vimspector.vim @@ -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 dc :call Compile() @@ -23,8 +23,8 @@ nnoremap dc :call Compile() nnoremap dqf :tab cope nnoremap df :tabNext -nnoremap dd :call vimspector#Launch() -nnoremap de :call vimspector#Reset() +nnoremap dd :call vimspector#Launch() +nnoremap de :call vimspector#Reset() " 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 ri :call RunInput() @@ -50,8 +53,12 @@ nnoremap ri :call RunInput() nnoremap rs :call vimspector#Restart() nnoremap rr :call vimspector#Stop() nnoremap rf :call vimspector#Continue() -nnoremap :vimspector#StepInto() -nnoremap :vimspector#StepOver() +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()