Open vim (or editor of your choice) in nodejs REPL editor mode

There doesn't appear to be an easy way to customize this behavior. Digging through the code for nodejs, it appears that the editor mode is simply streaming each line of together.

See here for the relevant piece of code on GitHub.

The closest solution to "use" vim in this NodeJS REPL is to enable Vi(m) mode in bash (if you're using the bash shell).

set -o vi

After running this or putting into your .bashrc file, the command line interface will act like Vim and have editing modes you have to navigate.

Personally, even though I am a Vim user, don't like the Vi mode in bash because it is difficult to know which mode you're in, even if my go-to mode is Normal mode. Adding some text to indicate which mode you're in may be possible, but I don't think its worth looking into. But your mileage will vary.

See https://sanctum.geek.nz/arabesque/vi-mode-in-bash/ for more on Vi mode in bash.