2

I can insert a src structure template with

C-c C-, s

, but do I have to write the language every time?

Is there some expansion or completion mode that can show the available languages?;)

1
  • It depends on what you've loaded but try C-h v org-babel-load-languages.
    – NickD
    Commented Apr 26, 2022 at 7:15

1 Answer 1

3

You can add entries to org-structure-template-alist, e.g.

#+begin_src elisp
  (add-to-list 'org-structure-template-alist
               '("sl" . "src elisp"))
  (add-to-list 'org-structure-template-alist
               '("sp" . "src python"))
  (add-to-list 'org-structure-template-alist
               '("sh" . "src shell"))

#+end_src

Then when you say C-c C-, s, you'll get a submenu with the options above:

s[h]     src shell
s[p]     src python
s[l]     src elisp
s[    ]  src

The last one is what you get if you press SP or TAB after the s.

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.