Skip to content

Instantly share code, notes, and snippets.

@win0err
Created August 7, 2023 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save win0err/b2c7ac974326f8c1f65fbb5ded42bcf2 to your computer and use it in GitHub Desktop.
Save win0err/b2c7ac974326f8c1f65fbb5ded42bcf2 to your computer and use it in GitHub Desktop.
Toggle treemacs window
(defun treemacs-toggle ()
"Toggle treemacs exclusively with the current project.
If the treemacs window is visible, hide it; otherwise, create and show it with the current project exclusively."
(interactive)
(if (eq (treemacs-current-visibility) 'visible)
(delete-window (treemacs-get-local-window))
(treemacs-add-and-display-current-project-exclusively)))
(global-set-key (kbd "C-c b") 'treemacs-toggle)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment