diff options
Diffstat (limited to '')
-rw-r--r-- | config/init-git.el | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/config/init-git.el b/config/init-git.el index 4741f35..3827b83 100644 --- a/config/init-git.el +++ b/config/init-git.el @@ -12,9 +12,19 @@ (use-package magit :defer t :ensure t - :bind (("C-x g" . magit-status) - ("C-x G" . magit-status-with-prefix)) + :hook (magit-mode . hl-line-mode) + :commands (magit-blame + magit-get-current-branch + magit-commit + magit-diff-unstaged + magit-init + magit-stage-file + magit-status + magit-unstage-file + magit-blame-mode) + :bind ("C-x g" . magit-status) :custom + (magit-buffer-name-format "%x%M%v: %t%x") (magit-diff-options nil) (magit-diff-refine-hunk t) (magit-fetch-arguments nil) @@ -23,7 +33,10 @@ (magit-process-popup-time 15) (magit-clone-default-directory "~/workspace/") (magit-section-initial-visibility-alist '((untracked . hide))) - :hook (magit-mode . hl-line-mode)) + :config + ;; show ANSI colors in the process buffer, so it's easier to read what's going on + ;; for some reasons if it's in the `:custom' section it does not get set + (setq magit-process-finish-apply-ansi-colors t)) (use-package magit-commit :defer t @@ -37,19 +50,6 @@ git-commit-turn-on-flyspell bug-reference-mode)))) -(use-package magit-status - :defer t - :config - (dolist (func '(magit-insert-unpushed-to-upstream-or-recent - magit-insert-unpulled-from-pushremote - magit-insert-unpulled-from-upstream)) - (remove-hook 'magit-status-sections-hook func)) - - (dolist (func '(magit-insert-diff-filter-header - magit-insert-tags-header)) - (remove-hook 'magit-status-headers-hook func))) - - (use-package vc :defer t :custom @@ -65,23 +65,7 @@ :custom (git-link-open-in-browser t) - :preface - (defun git-link-fcuny-net (hostname dirname filename branch commit start end) - (format "http://git.fcuny.net/%s/tree/%s?id=%s#n%s" - (replace-regexp-in-string "^r/\\(.*\\)" "\\1.git" dirname) - filename - commit - start)) - - (defun git-link-commit-fcuny-net (hostname dirname commit) - (format "http://git.fcuny.net/%s/commit/?id=%s" - (replace-regexp-in-string "^r/\\(.*\\)" "\\1.git" dirname) - commit)) - :config - (add-to-list 'git-link-remote-alist '("git\\.fcuny\\.net" git-link-fcuny-net)) - (add-to-list 'git-link-commit-remote-alist '("git\\.fcuny\\.net" git-link-commit-fcuny-net)) - ;; sets up roblox git enterprise as a git-link handler (add-to-list 'git-link-remote-alist '("github\\.rblx\\.com" git-link-github)) (add-to-list 'git-link-commit-remote-alist '("github\\.rblx\\.com" git-link-commit-github))) |