Org-tempo for source code blocks for languages like python

I am trying to add source code blocks like how <s, then TAB completion produces a source code block like #+begin_src #+end_src, but for other languages like python.

So far I am using this config, similar to my vanilla emacs config, to try to add keybindings for python, sh src code blocks, but did have any luck

  (after! org
    (org-babel-do-load-languages
        'org-babel-load-languages
        '((emacs-lisp . t)
        (python . t)))

    (push '("conf-unix" . conf-unix) org-src-lang-modes))
  (after! org-tempo
    ;; This is needed as of Org 9.2
    (require 'org-tempo)

    (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
    (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
    (add-to-list 'org-structure-template-alist '("li" . "src lisp"))
    (add-to-list 'org-structure-template-alist '("py" . "src python")))

My vanilla emacs config had the same code except after! replaced with ‘with-eval-afer-load’

Any suggestions would be greatly appreciated

This topic was automatically closed after 360 days. New replies are no longer allowed.