1

I want to use js2-mode instead of js-mode inside org-babel sources. Is there a way to define a mode for JavaScript inside those chunks?

#+begin_src js
console.log(1+1)
#+end_src
  • 1
    If you found a solution to your problem, add it as an answer and then accept it once you're able to. – DoMiNeLa10 Jan 10 at 22:46
1

I suddenly ran onto org-src-lang-modes, whereas the following snippet solved the problem:

(add-to-list 'org-src-lang-modes
               '("js" . js2)
               )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.