如何默认启用org-indent-mode? [英] How to enable org-indent-mode by default?

查看:168
本文介绍了如何默认启用org-indent-mode?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Emacs 25.1.50.2

I am using Emacs 25.1.50.2

当我使用组织模式时,组织缩进模式默认关闭。所以我必须每次使用 Mx org-indent-mode 启用它。

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.

我把下面的lisp放入我的配置文件〜/ .emecs.d / init.el 不起作用。

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

推荐答案

您可以使用主模式的模式挂钩在 org-

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

对于Emacs 24+,您可以直接写:

For Emacs 24+ you can simply write:

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

在早期的Emacs版本中,您应该使用自定义函数通过调用(org-indent-mode 1),然后将该自定义函数添加到钩子变量。

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.

这篇关于如何默认启用org-indent-mode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆