Emacs: apply minor mode for all major modes [dupli

2019-09-11 08:39发布

This question already has an answer here:

I use the minor mode writeroom which I have set to be global, but this setting only makes the mode global for all text-modes. I can specify more modes in the settings. But is there something I can write to enable this minor mode for all major modes?

1条回答
何必那么认真
2楼-- · 2019-09-11 09:30

Add a hook to find-file:

(add-hook 'find-file-hook #'writeroom-mode)

Substitute #'writeroom-mode with whatever function you want to run.

查看更多
登录 后发表回答