3

I want to manage my library of snippets from a single org-mode document and tangle these to their respective snippet files, as needed. Now functionally, this works out-of-the box, with the one exception: org-babel does not know how to font-lock a snippet and I cannot find an ob-snippet.el file anywhere on the web.

Now Yasnippet does has a snippet major mode that it uses to font-locks snippets, when viewed from their own buffer. How can I get org-babel to use this to fontify snippets from within a babel code block?

To better illustrate, here is a screenshot of my article snippet from within org-mode

enter image description here and here it is, nice and fontified under the snippet major mode:

enter image description here Any ideas?

1
  • Please don't use images for code: you make life difficult for potential answerers. Commented May 8, 2020 at 20:50

1 Answer 1

3

Your source code block has text set as the mode. Try changing that to read

#+BEGIN_SRC snippet :tangle ~/org/snippets/bibtex-mode/article

enter image description here

1
  • 1
    That did it. Thanks @gregoryg! Commented May 10, 2020 at 4:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.