How to enable org-indent-mode by default?

寵の児 提交于 2019-12-06 10:47:41

问题


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 :)


回答1:


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.



来源:https://stackoverflow.com/questions/36416030/how-to-enable-org-indent-mode-by-default

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!