Variable: projectile-mode-hook
projectile-mode-hook is a customizable variable defined in
projectile.el.
Value
nil
Documentation
Hook run after entering or leaving projectile-mode(var)/projectile-mode(fun).
No problems result if this variable is not bound.
add-hook automatically binds it. (This is true for all hook variables.)
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
;;;###autoload
(define-minor-mode projectile-mode
"Minor mode to assist project management and navigation.
When called interactively, toggle `projectile-mode'. With prefix
ARG, enable `projectile-mode' if ARG is positive, otherwise disable
it.
When called from Lisp, enable `projectile-mode' if ARG is omitted,
nil or positive. If ARG is `toggle', toggle `projectile-mode'.
Otherwise behave as if called interactively.
\\{projectile-mode-map}"
:lighter projectile--mode-line
:keymap projectile-mode-map
:group 'projectile
:require 'projectile
:global t
(cond
(projectile-mode
;; setup the commander bindings
(projectile-commander-bindings)
(add-hook 'project-find-functions #'project-projectile)
(add-hook 'find-file-hook 'projectile-find-file-hook-function)
(add-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook t)
(add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t)
(add-hook 'window-configuration-change-hook #'projectile-update-mode-line-on-window-change)
(advice-add 'compilation-find-file :around #'compilation-find-file-projectile-find-compilation-buffer)
(advice-add 'delete-file :before #'delete-file-projectile-remove-from-cache))
(t
(remove-hook 'project-find-functions #'project-projectile)
(remove-hook 'find-file-hook #'projectile-find-file-hook-function)
(remove-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook)
(remove-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook)
(remove-hook 'window-configuration-change-hook #'projectile-update-mode-line-on-window-change)
(advice-remove 'compilation-find-file #'compilation-find-file-projectile-find-compilation-buffer)
(advice-remove 'delete-file #'delete-file-projectile-remove-from-cache))))