nvim: misc fixes
vimspector now properly works
This commit is contained in:
parent
aad07e6abb
commit
a13717fe60
@ -1,9 +1,9 @@
|
|||||||
# makefile for compiling individual files from vim
|
# makefile for compiling individual files from vim
|
||||||
|
|
||||||
~/.cache/termdebug/%: %.cpp
|
~/.cache/termdebug/bin/%: %.cpp
|
||||||
mkdir -p ~/.cache/termdebug/
|
mkdir -p ~/.cache/termdebug/bin/
|
||||||
$(LINK.cpp) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
|
$(LINK.cpp) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
|
||||||
|
|
||||||
~/.cache/termdebug/%: %.c
|
~/.cache/termdebug/bin/%: %.c
|
||||||
mkdir -p ~/.cache/termdebug/
|
mkdir -p ~/.cache/termdebug/bin/
|
||||||
$(LINK.c) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
|
$(LINK.c) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
|
||||||
|
@ -15,7 +15,7 @@ function Compile()
|
|||||||
call win_gotoid(g:vimspector_session_windows.code)
|
call win_gotoid(g:vimspector_session_windows.code)
|
||||||
endif
|
endif
|
||||||
w
|
w
|
||||||
execute "make ~/.cache/termdebug/" .. expand("%:r") .. " -f ~/.config/nvim/makefile"
|
execute "make ~/.cache/termdebug/bin/" .. expand("%:r") .. " -f ~/.config/nvim/makefile"
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <silent> <leader>dc :call Compile()<cr>
|
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>dqf :tab cope<cr>
|
||||||
nnoremap <silent> <leader>df :tabNext<cr>
|
nnoremap <silent> <leader>df :tabNext<cr>
|
||||||
|
|
||||||
nnoremap <silent> <leader>dd :call vimspector#Launch()
|
nnoremap <silent> <leader>dd :call vimspector#Launch()<cr>
|
||||||
nnoremap <silent> <leader>de :call vimspector#Reset()
|
nnoremap <silent> <leader>de :call vimspector#Reset()<cr>
|
||||||
|
|
||||||
" write clipboard into input file
|
" write clipboard into input file
|
||||||
function WriteInput()
|
function WriteInput()
|
||||||
@ -42,7 +42,10 @@ function RunInput()
|
|||||||
let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r")
|
let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r")
|
||||||
let @x = join(readfile(inputfile), "\n") .. "\n\n"
|
let @x = join(readfile(inputfile), "\n") .. "\n\n"
|
||||||
call win_gotoid(g:vimspector_session_windows.terminal)
|
call win_gotoid(g:vimspector_session_windows.terminal)
|
||||||
|
" let vimspector set up before feeding input
|
||||||
|
sleep 1
|
||||||
normal G"xp
|
normal G"xp
|
||||||
|
call win_gotoid(g:vimspector_session_windows.code)
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <silent> <leader>ri :call RunInput()<cr>
|
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>rs :call vimspector#Restart()<cr>
|
||||||
nnoremap <silent> <leader>rr :call vimspector#Stop()<cr>
|
nnoremap <silent> <leader>rr :call vimspector#Stop()<cr>
|
||||||
nnoremap <silent> <leader>rf :call vimspector#Continue()<cr>
|
nnoremap <silent> <leader>rf :call vimspector#Continue()<cr>
|
||||||
nnoremap <silent> <c-p> :vimspector#StepInto()<cr>
|
nnoremap <silent> <c-p> :call vimspector#StepInto()<cr>
|
||||||
nnoremap <silent> <c-n> :vimspector#StepOver()<cr>
|
nnoremap <silent> <c-n> :call vimspector#StepOver()<cr>
|
||||||
|
|
||||||
" breakpoints
|
" breakpoints
|
||||||
nnoremap <silent> <leader>dsf :call vimspector#ToggleBreakpoint()<cr>
|
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user