reddit / emacs

Is the some command or command which automatically aligns the code in a source block with the header and footer?

vfclists · 2022-04-25 06:51
I'm looking a function which automatically aligns the code with then `begin_src` and `end_src` line, eg If I have something this. #+begin_src sh echo "hello world" #+end_src The command should turn it into this: #+begin_src sh echo "hello world" #+end_src or even indent it further inwards. #+begin_src sh echo "hello world" #+end_src I have noticed that in newer versions of org, the code gets indented automatically though I don't know what keystrokes trigger it or what commands do that.
Ok_Refrigerator_1476 · 2022-04-25 07:33
> I have noticed that in newer versions of org, the code gets indented automatically though I don't know what keystrokes trigger it or what commands do that. Setting `org-src-preserve-indentation` to T should stop org messing with source block indentation.