doomemacs/modules/ui/treemacs/autoload.el
2020-05-03 16:31:06 -04:00

18 lines
515 B
EmacsLisp

;;; ui/treemacs/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +treemacs/toggle ()
"Initialize or toggle treemacs.
Ensures that only the current project is present and all other projects have
been removed.
Use `treemacs' command for old functionality."
(interactive)
(require 'treemacs)
(pcase (treemacs-current-visibility)
(`visible (delete-window (treemacs-get-local-window)))
(_ (if (doom-project-p)
(treemacs-add-and-display-current-project)
(treemacs)))))