Indenting code blocks in Spacemacs org-mode

in #spacemacs6 years ago

Org-mode (along with org-reveal) is an simple and easy to use method for creating documents and presentations in Spacemacs.

However, the default formatting for the code blocks isn't great. Here's how one can format code block:

  • In org-mode, enter the code block (designated by #+BEGIN_SRC and #+END_SRC blocks) and type

C-c '

to open a new buffer with the source code in the block

  • Type

M-m j =

to indent the whole buffer

  • Type

, c

in the code block buffer to return the org-mode document (which also copies the indented code back.

Links:

Sort:  

@shark8me, I gave you an upvote on your first post! Please give me a follow and I will give you a follow in return!

Please also take a moment to read this post regarding bad behavior on Steemit.

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.027
BTC 60003.48
ETH 2309.22
USDT 1.00
SBD 2.49