Emacs: Refactor programming/git.

This commit is contained in:
tastytea 2020-06-23 02:26:38 +02:00
parent fb51ace721
commit a8f4b8a101
1 changed files with 10 additions and 23 deletions

View File

@ -1,6 +1,6 @@
;;; git.el --- magit and stuff. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-06-23T02:21:39+0200>
;; Time-stamp: <2020-06-23T02:26:26+0200>
;;; Commentary:
@ -18,19 +18,13 @@
(unless slow-computer
(use-package magit
:custom
(magit-diff-refine-hunk 'all) ; Show word-granularity differences.
:bind
("C-x g" . nil) ; Disable default.
("C-c g" . magit-status)
("C-c M-g" . magit-dispatch)
(:map magit-hunk-section-map
("RET" . magit-diff-visit-worktree-file-other-window))
:hook
(after-save . magit-after-save-refresh-status)
)
:custom (magit-diff-refine-hunk 'all) ; Show word-granularity differences.
:bind (("C-x g" . nil) ; Disable default.
("C-c g" . magit-status)
("C-c M-g" . magit-dispatch)
(:map magit-hunk-section-map
("RET" . magit-diff-visit-worktree-file-other-window)))
:hook (after-save . magit-after-save-refresh-status))
;; Use libgit rather than git.
(use-package magit-libgit)
@ -38,19 +32,12 @@
;; Show TODOs in magit-status.
(use-package magit-todos
:after magit
:init
;; Mark variables as safe. This prevents prompts when using .dir-locals.el.
(put 'magit-todos-depth 'safe-local-variable #'integerp)
:hook
(magit-mode . magit-todos-mode)
)
:init (put 'magit-todos-depth 'safe-local-variable #'integerp)
:hook (magit-mode . magit-todos-mode))
;; Work with Git forges from Magit.
(use-package forge
:after magit
:config (add-to-list 'forge-alist
'("schlomp.space" "schlomp.space/api/v1"
"schlomp.space" forge-gitea-repository))