Javascript on Emacs
Javascript on Emacs
People use many settings to have javascript on emacs and it’s really confusing. I prefer to keep things at an absolute minimum. So:
- Use
js2-mode
for syntax highlighting etc because everyone says it’s better. - Use
indium
because it provides the functionality I care about: evaluating js on emacs.
// Javascript on Emacs
// Here is how to set it up (on ubuntu):
// 1. installed latest npm
// 2. installed chromium with snap
// 3. installed indium and js2 on emacs (available from melpa)
// start the process by launching the server with
// yarn start
// then on emacs,
// M-x indium-launch
a=[1,2,3].map(d=>d**4); // C-x C-e after the expression evaluates it
indium
accomplishes this by connecting to a server.
I could also try using their server (but this wasn’t the approach I followed, I followed the above).
npm install -g indium
I am not satisfied, the reason I like to work on emacs is its portability. I like to code while on my phone using Termux, but it seems impossible to install chromium/chrome/firefox on Termux, as of this writing. Someone on GitHub mentioned that it is possible to install ubuntu on Termux and work from there. I could try that.
Update. I successfully installed chromium on alpine on Termux. Alpine is a lightweight (~130 MB) Linux.