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
  • 1
    If you found a solution to your problem, add it as an answer and then accept it once you're able to.
    – user12563
    Jan 10 '19 at 22:46

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.