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

1 Answer 1

2

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 and acknowledge you have read our privacy policy.

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