Files
zedhugh b5d9ce18a7 use "creature/pkg-active" manage packages manually
- replace "add-pkg-in-pkg-dir" (recursive load-path scanning) with a
  central "creature/pkgs" registry that handles load path, autoloads,
  info dirs and dependencies
- adapt all init-*.el files to the new activation function
- add a top-level Makefile to byte-compile site-lisp packages
- remove unused "emacs-kv" and "emacs-db" submodules
2026-09-14 15:02:43 +08:00

54 lines
1.4 KiB
EmacsLisp

;; -*- coding: utf-8; lexical-binding: t; -*-
(require 'init-package)
(creature/pkg-active 'magit)
(creature/pkg-active 'git-modes)
(creature/pkg-active 'pinentry)
(creature/pkg-active 'lazy-load)
(lazy-load-global-keys
'(("C-x g" . magit-status))
"magit")
(require 'init-keybindings)
(lazy-load-local-keys
'(("gb" . magit-blame)
("gc" . magit-clone)
("gff" . magit-find-file)
("gfc" . magit-find-git-config-file)
("gfs" . magit-stage-file)
("gi" . magit-init)
("gl" . magit-list-repositories)
("gs" . magit-status))
creature/map "magit")
;; gpg config
(defun kill-gpg-agent-when-emacs-exit ()
"Kill `gpg-agent' for security when Emacs be killed."
(when (and (bound-and-true-p epg-gpgconf-program)
(executable-find epg-gpgconf-program))
(start-process "" nil epg-gpgconf-program "--kill" "gpg-agent")))
(add-hook 'kill-emacs-hook #'kill-gpg-agent-when-emacs-exit)
(setq epg-pinentry-mode 'loopback)
(require 'git-modes)
(with-eval-after-load 'magit
;; (require 'forge)
;; pinentry for prompting password of gpg when sign git commit
(condition-case nil (pinentry-start) (error nil))
(setq magit-revision-show-gravatars t))
;;; ediff
(setq ediff-split-window-function 'split-window-horizontally)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(with-eval-after-load 'project
(require 'magit-extras))
(provide 'init-git)