Running node
in terminal will bring you into its REPL mode, with syntax highlighting (e.g. number
is yellow, while string
is green).
However, I'm not comfortable with it's default emacs-key-binding
, so I follow some suggestion:
alias node='env NODE_NO_READLINE=1 rlwrap node'
This works great, I get vim-key-binding
, but the syntax highlighter
is disabled.
So I give a second try:
alias node='rlwrap -a node'
This time I get both vim-key-binding
and syntax highlighter
work out, but the are some bug e.g. when I type this into REPL mode:
> [1,2,3]
the output is correct (with syntax highlighting)
[ 1, 2, 3, 4 ]
but the input line from above has changed to
> [1,[1,2,3]
This bug is more annoying than having no syntax highlight
.
Any idea to make this 2 things work well together?
P.S. I don't need tab-compilation (at least for this time).