diff options
Diffstat (limited to '.config/emacs/modules/mm-projects.el')
| -rw-r--r-- | .config/emacs/modules/mm-projects.el | 66 |
1 files changed, 51 insertions, 15 deletions
diff --git a/.config/emacs/modules/mm-projects.el b/.config/emacs/modules/mm-projects.el index 2ce88f7..02d7af4 100644 --- a/.config/emacs/modules/mm-projects.el +++ b/.config/emacs/modules/mm-projects.el @@ -19,15 +19,15 @@ This is intended to be called interactively via (project-find-file "Find File" ?f) (mm-projects-project-magit-status "Git Status" ?s))) :config - (unless mm-darwin-p - (if-let ((repo-directory (getenv "REPODIR")) - (directories - (cl-loop - for author in (directory-files repo-directory :full "\\`[^.]") - append (cl-loop - for path in (directory-files author :full "\\`[^.]") - collect (list (concat path "/")))))) - (progn + (unless mm-humanwave-p + (if-let ((repo-directory (getenv "REPODIR"))) + (let* ((list-dir + (lambda (path) + (directory-files path :full "\\`[^.]"))) + (directories + (cl-loop for author in (funcall list-dir (getenv "REPODIR")) + append (cl-loop for path in (funcall list-dir author) + collect (list (concat path "/")))))) (with-temp-buffer (prin1 directories (current-buffer)) (write-file project-list-file)) @@ -35,17 +35,30 @@ This is intended to be called interactively via (warn "The REPODIR environment variable is not set.")))) +;;; Emacs VC + +(use-package vc-hooks + :custom + (vc-follow-symlinks t) + (vc-handled-backends '(Git))) + + ;;; Git Client (use-package magit :ensure t - :bind ( :map magit-status-mode-map - ("[" . magit-section-backward-sibling) - ("]" . magit-section-forward-sibling)) + :bind (("C-c b" . magit-blame-addition) + :map magit-status-mode-map + ("[" . magit-section-backward-sibling) + ("]" . magit-section-forward-sibling)) :custom - (transient-default-level 7) + (git-commit-style-convention-checks + '(non-empty-second-line overlong-summary-line)) + (git-commit-summary-max-length 50) + (magit-diff-refine-hunk t) (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) + (transient-default-level 7) :config (transient-define-suffix mm-projects-magit-push-current-to-all-remotes (args) "Push the current branch to all remotes." @@ -58,7 +71,23 @@ This is intended to be called interactively via "push" "-v" args remote (format "refs/heads/%s:refs/heads/%s" branch branch))))) (transient-append-suffix #'magit-push '(1 -1) - '("a" "all remotes" mm-projects-magit-push-current-to-all-remotes))) + '("a" "all remotes" mm-projects-magit-push-current-to-all-remotes)) + (add-to-list 'magit-blame-styles + '(margin + (show-lines . t) + (margin-format . (" %C %a" " %s%f" " ")) + (margin-width . 73) + (margin-face . magit-blame-margin) + (margin-body-face . (magit-blame-dimmed))))) + +(use-package magit-repos + :ensure nil ; Part of ‘magit’ + :if (not mm-humanwave-p) + :commands (magit-list-repositories) + :init + (if-let ((directory (getenv "REPODIR"))) + (setopt magit-repository-directories `((,directory . 2))) + (warn "The REPODIR environment variable is not set."))) (use-package magit-todos :ensure t @@ -75,4 +104,11 @@ This is intended to be called interactively via (require 'ansi-color) (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)) -(provide 'mm-projects)
\ No newline at end of file + +;;; GitHub Pull Requests + +(require 'gh) +(keymap-global-set "C-c p c" #'gh-create-pr) +(keymap-global-set "C-c p o" #'gh-open-previous-pr) + +(provide 'mm-projects) |