Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable org-indent-mode by default?

Tags:

emacs

org-mode

I am using Emacs 25.1.50.2

When I am using Org-mode, the org-indent-mode is off by default. So I have to enable it using M-x org-indent-mode everytime.

I put the lisp below into my config file ~/.emecs.d/init.el with no effect.

;; Enable org-indent mode by default
(org-indent mode 1)
;; Above line really should be (org-indent-mode 1)

Thanks for your time :)

like image 227
X.Creates Avatar asked Apr 05 '16 02:04

X.Creates


2 Answers

You can use the mode hook for the major mode to enable this buffer-local minor mode in org-mode buffers.

For Emacs 24+ you can simply write:

(add-hook 'org-mode-hook 'org-indent-mode)

In earlier Emacs versions you should instead use a custom function to explicitly enable the minor mode by calling (org-indent-mode 1), and then add that custom function to the hook variable.

like image 130
phils Avatar answered Nov 09 '22 10:11

phils


In 2021 current version of org, you can do this:

(setq org-startup-indented t)
like image 41
aruku7230 Avatar answered Nov 09 '22 09:11

aruku7230