summaryrefslogtreecommitdiff
path: root/emacs/inits/15-project-mgmt.el
blob: 6ea54e6ab5c33c8c129ce1aa4a4af637c907215c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;; Time-stamp: <2024-01-16 15h12 CET (9a3d20a4)>

(defun revert-all-file-buffers ()
  "Refresh all open file buffers without confirmation"
  (interactive)
  (dolist (buf (buffer-list))
    (let ((filename (buffer-file-name buf)))
      (when (and filename (not (buffer-modified-p buf)))
        (if (file-readable-p filename)
            (with-current-buffer buf (revert-buffer :ignore-auto :noconfirm :preserve-modes))
          (let (kill-buffer-query-functions)
            (kill-buffer buf)
            (message "Killed non-existing/unreadable file bufffer: %s" filename))))))
  (message "Finished reverting buffers containing unmodified files."))

(use-package projectile
  :ensure t
  :bind (("C-c p" . projectile-switch-project)
         ("C-c f" . projectile-find-file-dwim))
  :config
  (projectile-mode 1)

  (setq projectile-indexing-method 'alien
        projectile-sort-order 'recently-active
        projectile-enable-caching t
        projectile-mode-line-prefix ""
        projectile-mode-line-function '(lambda () (format " ¶[%s]" (projectile-project-name)))))

(use-package magit
  :ensure t
  :bind (("C-x g" . magit-status))
  :config
  (setq magit-process-find-password-functions '(magit-process-password-auth-source)))