nvim: mkdir debugger input folder

This commit is contained in:
dogeystamp 2023-10-24 17:49:55 -04:00
parent 18aeacdcba
commit 2f133e087a
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -28,9 +28,12 @@ nnoremap <silent> <leader>de :call vimspector#Reset()<cr>
" write clipboard into input file " write clipboard into input file
function WriteInput() function WriteInput()
let inputfile=$HOME .. "/.cache/termdebug/input/" .. expand("%:r") let inputfolder=$HOME .. "/.cache/termdebug/input/" .. expand("%:h")
echo "Input written to '" .. inputfile .. "'." silent exec "!mkdir -p " .. inputfolder
let inputfile=inputfolder .. "/" .. expand("%:t:r")
call writefile(getreg('+', 1, 1), inputfile) call writefile(getreg('+', 1, 1), inputfile)
" for some reason this line causes a Press Enter to continue
"echo "Input written to '" .. inputfile .. "'."
endfunction endfunction
nnoremap <silent> <leader>rw :call WriteInput()<cr> nnoremap <silent> <leader>rw :call WriteInput()<cr>