Function: treemacs-peek-mode
treemacs-peek-mode is an autoloaded, interactive and byte-compiled
function defined in treemacs-peek-mode.el.
Signature
(treemacs-peek-mode &optional ARG)
Documentation
Minor mode that allows you to peek at buffers before deciding to open them.
While the mode is active treemacs will automatically display the file at point, without leaving the treemacs window.
Peeking will stop when you leave the treemacs window, be it through a command
like treemacs-RET-action or some other window selection change.
Files' buffers that have been opened for peeking will be cleaned up if they did not exist before peeking started.
The peeked window can be scrolled using
treemacs-next/previous-line-other-window and
treemacs-next/previous-page-other-window
This is a global minor mode. If called interactively, toggle the
Treemacs-Peek mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=treemacs-peek-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-peek-mode.el
;;;###autoload
(define-minor-mode treemacs-peek-mode
"Minor mode that allows you to peek at buffers before deciding to open them.
While the mode is active treemacs will automatically display the file at point,
without leaving the treemacs window.
Peeking will stop when you leave the treemacs window, be it through a command
like `treemacs-RET-action' or some other window selection change.
Files' buffers that have been opened for peeking will be cleaned up if they did
not exist before peeking started.
The peeked window can be scrolled using
`treemacs-next/previous-line-other-window' and
`treemacs-next/previous-page-other-window'"
:init-value nil
:global t
:lighter nil
:group 'treemacs
(if treemacs-peek-mode
(progn
(unless (boundp 'window-selection-change-functions)
(user-error "%s %s"
"Peek-mode is only available in Emacs"
"versions that support `window-selection-change-functions'"))
(treemacs--setup-peek-mode))
(treemacs--tear-down-peek-mode (called-interactively-p 'interactive))))