I want something similar to what I get when I enter debug mode and type "step", then enter and up, enter and up, ten thousand times... But without having to do all that work, allows it to be done programmatically and ideally with a cleaner output.
e.g. given this file, named example.vim:
function! F()
echo 1
echo 2
endf
Today the best I can do is this:
$ nvim --noplugin -u example.vim -E +'debug call F()'
Entering Debug mode. Type "cont" to continue.
command line
cmd: call F()
>step
function F
line 1: echo 1
>step
1
function F
line 2: echo 2
>step
2
function F
line 2: End of function
>step
Entering Ex mode. Type "visual" to go to Normal mode.
:q
I wish I had this (or something at least close to it):
$ nvim_stepthrough example.vim 'call F()'
call F()
line 1: echo 1
1
line 2: echo 2
2
(or a StepThrough call F() vimscript command that gave similar output)
I've been trying to be clever with the shell to achieve something like this with piping and fifos and redirection but so far the only thing I've accomplished was crashing my computer*.
I have a few ideas on how I could do this, but before I delve deep into it I wanted to know if there is anything that already exists that can accomplish something similar.
*tip: don't yes step to nvim -D &
nvim "+set verbose=10|redir @x|call F()|redir END|echo @x"or something similar could work but I'm not sure – rbernabe Mar 11 '17 at 02:23:debug-mode command. – Justin M. Keyes Mar 29 '17 at 22:19