Function: treemacs-follow-mode

treemacs-follow-mode is an interactive and byte-compiled function defined in treemacs-follow-mode.el.

Signature

(treemacs-follow-mode &optional ARG)

Documentation

Toggle treemacs-follow-mode(var)/treemacs-follow-mode(fun).

When enabled treemacs will keep track of and focus the currently selected buffer's file. This only applies if the file is within the treemacs root directory. This functionality can also be manually invoked with treemacs-find-file.

This is a minor mode. If called interactively, toggle the Treemacs-Follow 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-follow-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-follow-mode.el
(define-minor-mode treemacs-follow-mode
  "Toggle `treemacs-follow-mode'.
When enabled treemacs will keep track of and focus the currently selected
buffer's file.  This only applies if the file is within the treemacs root
directory.
This functionality can also be manually invoked with `treemacs-find-file'."
  :init-value nil
  :global     t
  :lighter    nil
  :group      'treemacs
  (if treemacs-follow-mode
      (treemacs--setup-follow-mode)
    (treemacs--tear-down-follow-mode)))