Updated and cleaned up magit config

This commit is contained in:
Emmet 2024-06-28 12:33:40 -05:00
parent 2886853a72
commit 86d3fe5fea
4 changed files with 9 additions and 33 deletions

View file

@ -750,16 +750,16 @@
"magit-file-icons": {
"flake": false,
"locked": {
"lastModified": 1719343259,
"narHash": "sha256-yE11UXM49emqnCBqJvf2ck4BwmHmhIhuJUPvxEBaQr8=",
"lastModified": 1719595750,
"narHash": "sha256-n/uXppejl6js/wrvEEIKmfmCh7ssbSBMMZWYrrvG1JQ=",
"owner": "librephoenix",
"repo": "magit-file-icons",
"rev": "d2fae0b97e7499e6b20d1af3dc6e098d4182cfdb",
"rev": "6c90eb03eb8a382110d862ec792ae50556bffd6e",
"type": "github"
},
"original": {
"owner": "librephoenix",
"ref": "all-the-icons",
"ref": "abstract-icon-getters-compat",
"repo": "magit-file-icons",
"type": "github"
}

View file

@ -266,7 +266,7 @@
flake = false;
};
magit-file-icons = {
url = "github:librephoenix/magit-file-icons/all-the-icons";
url = "github:librephoenix/magit-file-icons/abstract-icon-getters-compat";
flake = false;
};
phscroll = {

View file

@ -1244,26 +1244,14 @@ If the path from LINK does not exist, nil is returned."
;;;------ magit configuration ------;;;
;; Need the following two blocks to make magit work with git bare repos
(defun ~/magit-process-environment (env)
"Add GIT_DIR and GIT_WORK_TREE to ENV when in a special directory.
https://github.com/magit/magit/issues/460 (@cpitclaudel)."
(let ((default (file-name-as-directory (expand-file-name default-directory)))
(home (expand-file-name "~/")))
(when (string= default home)
(let ((gitdir (expand-file-name "~/.dotfiles.git/")))
(push (format "GIT_WORK_TREE=%s" home) env)
(push (format "GIT_DIR=%s" gitdir) env))))
env)
(advice-add 'magit-process-environment
:filter-return #'~/magit-process-environment)
(require 'magit-todos)
(setq magit-todos-keywords-list '("TODO" "FIXME" "HACK" "REVIEW" "DEPRECATED" "BUG"))
(magit-todos-mode 1)
(add-load-path! "~/.emacs.d/magit-file-icons")
(require 'magit-file-icons)
(setq magit-file-icons-icon-for-file-func 'all-the-icons-icon-for-file)
(setq magit-file-icons-icon-for-dir-func 'all-the-icons-icon-for-dir)
(magit-file-icons-mode 1)
(require 'all-the-icons-ibuffer)

View file

@ -1459,26 +1459,14 @@ On Wayland, EAF doesn't work.
#+BEGIN_SRC emacs-lisp :tangle config.el
;;;------ magit configuration ------;;;
;; Need the following two blocks to make magit work with git bare repos
(defun ~/magit-process-environment (env)
"Add GIT_DIR and GIT_WORK_TREE to ENV when in a special directory.
https://github.com/magit/magit/issues/460 (@cpitclaudel)."
(let ((default (file-name-as-directory (expand-file-name default-directory)))
(home (expand-file-name "~/")))
(when (string= default home)
(let ((gitdir (expand-file-name "~/.dotfiles.git/")))
(push (format "GIT_WORK_TREE=%s" home) env)
(push (format "GIT_DIR=%s" gitdir) env))))
env)
(advice-add 'magit-process-environment
:filter-return #'~/magit-process-environment)
(require 'magit-todos)
(setq magit-todos-keywords-list '("TODO" "FIXME" "HACK" "REVIEW" "DEPRECATED" "BUG"))
(magit-todos-mode 1)
(add-load-path! "~/.emacs.d/magit-file-icons")
(require 'magit-file-icons)
(setq magit-file-icons-icon-for-file-func 'all-the-icons-icon-for-file)
(setq magit-file-icons-icon-for-dir-func 'all-the-icons-icon-for-dir)
(magit-file-icons-mode 1)
#+END_SRC