Open jonahx opened 7 years ago
Hi, thank you for your interest; using it with Node actually is a good idea. I will have a look at it very soon unless you solve it before me. Most of the time issues are fixed by wrapping the main program in some unbuffer
, stdbuf
or even script
for unbuffering its input/output. Regards.
I got working settings though a little hacky. First, try to launch it with node -i
(though I didn't check it was absolutely necessary). Then add the two characters of the prompt >
(greater than followed by one space before the expected output); what I used was:
let g:notebook_sed='console.log(\"VIMNODENOTEBOOK\");'
let g:notebook_detect='> VIMNODENOTEBOOK'
because the prompt is merged with the output. Please, let me know if you get something working. Maybe there is a way to disable the prompt, which would be cleaner.
Thanks. I got it working with that, but it still outputs the prompt, and, perhaps more difficult to address, it outputs the result of every line, including variable assignments. Probably what you want is for only console.log
statements and the result of the final line in a code block to be shown. Any idea how difficult that change would be?
Also, if you do any node dev yourself, I just discovered this, which looks promising (though has the drawback of not existing within vim itself): https://runkit.com
I've tried the following configuration:
Note that the final two lines reflect the fact that node echoes back quotes when literal strings are entered:
However, when I
:NotebookStart
, vim just hangs and needs to be killed. Do you know the correct settings for node? If not, any tips for debugging or what I might attempt to make it work?Thanks!