jxq0 / org-tidy

🧹 An Emacs minor mode to automatically tidy org-mode property drawers
GNU General Public License v3.0
98 stars 7 forks source link
emacs org-mode

+title: org-tidy

+author: Xuqing Jia

🧹 An Emacs minor mode to automatically tidy org-mode property drawers.

At first I googled for some tricks to hide property drawers completely. And I found there are many people like me who are bothered by this problem. Of course there are solutions. But these solutions involve a lot of code. So I made this package.

@@html:

@@ @@html:@@ @@html:
@@

After org-tidy mode is turned on, these property drawers are hidden. And the symbol ♯ is appended after the headline. You can also customize how property drawers will be hidden.

** Manual

+begin_src emacs-lisp

(require 'org-tidy) (add-hook 'org-mode-hook #'org-tidy-mode)

+end_src

** use-package

+begin_src emacs-lisp

(use-package org-tidy :ensure t :hook (org-mode . org-tidy-mode))

+end_src

** How to edit property drawers in org-tidy-mode? If you need to edit only one drawer temporarily, you can simply ~M-x org-tidy-untidy-buffer~. When you save the buffer, it will be tidied again.

If you need to edit a lot of drawers, you can ~M-x org-tidy-toggle~. Then the buffer will not be tidied on save, until ~M-x org-tidy-toggle~ again.