Function: treemacs

treemacs is an autoloaded, interactive and byte-compiled function defined in treemacs.el.

Signature

(treemacs &optional ARG)

Documentation

Initialise or toggle treemacs.

- If the treemacs window is visible hide it.
- If a treemacs buffer exists, but is not visible show it.
- If no treemacs buffer exists for the current frame create and show it.
- If the workspace is empty additionally ask for the root path of the first
  project to add.
- With a prefix ARG launch treemacs and force it to select a workspace

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs.el
;;;###autoload
(defun treemacs (&optional arg)
  "Initialise or toggle treemacs.
- If the treemacs window is visible hide it.
- If a treemacs buffer exists, but is not visible show it.
- If no treemacs buffer exists for the current frame create and show it.
- If the workspace is empty additionally ask for the root path of the first
  project to add.
- With a prefix ARG launch treemacs and force it to select a workspace"
  (interactive "P")
  (pcase (treemacs-current-visibility)
    ((guard arg)
     (treemacs-do-switch-workspace (treemacs--select-workspace-by-name))
     (treemacs-select-window))
    ('visible (delete-window (treemacs-get-local-window)))
    ('exists  (treemacs-select-window))
    ('none    (treemacs--init))))