2

I've searched the manual and I didn't find anything useful. It's annoying to write every time the tags to surround the code, and I'm surprised that org doesn't provide a macro to avoid a so boring task.

Any clue? Thanks in advance.

Daniele
  • 637
  • 1
  • 5
  • 14

1 Answers1

10

I think you are looking for "<s" and hitting [Tab].

These are called "Easy Templates", and the syntax is a < followed by the template selector. [Tab] expands them.

Here is a list of other templates you can quickly insert like this.

2019 update: "Easy Templates" are now "Structure Templates", and expansion with < is no longer default behavior, though you can turn it can turn it on by running M-x customize-variable on org-modules and enabling org-tempo, or you can use the new default keybinding which is bound to C-c C-,.

Archenoth
  • 2,106
  • 16
  • 17
  • 1
    Seems like "Easy Templates" are now "Structure Templates", and a corrected manual link for that is: https://orgmode.org/manual/Structure-Templates.html#Structure-Templates – Stuart Hickinbottom Jul 10 '19 at 06:51