mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Updating Doom Emacs.
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
;;; emacs/vc/autoload/evil.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! :editor evil)
|
||||
|
||||
;;;###autoload (autoload '+vc:git-browse "emacs/vc/autoload/evil" nil t)
|
||||
(evil-define-command +vc:git-browse (bang)
|
||||
"Ex interface to `+vc/git-browse-region-or-line'."
|
||||
(interactive "<!>")
|
||||
(+vc/git-browse-region-or-line bang))
|
||||
@@ -1,30 +1,5 @@
|
||||
;;; emacs/vc/autoload/vc.el -*- lexical-binding: t; -*-
|
||||
|
||||
(autoload 'browse-at-remote--file-url "browse-at-remote")
|
||||
|
||||
;;;###autoload
|
||||
(defun +vc/browse-at-remote-file-or-region ()
|
||||
"Open the current file at remote in your browser.
|
||||
If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
|
||||
the URL."
|
||||
(interactive)
|
||||
(if (or (use-region-p)
|
||||
(ignore-errors (evil-visual-state-p)))
|
||||
(browse-at-remote)
|
||||
(browse-url (browse-at-remote--file-url (buffer-file-name)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +vc/browse-at-remote-kill-file-or-region ()
|
||||
"Copy the current file's remote URL to your clipboard.
|
||||
If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
|
||||
the URL."
|
||||
(interactive)
|
||||
(if (or (use-region-p)
|
||||
(ignore-errors (evil-visual-state-p)))
|
||||
(browse-at-remote-kill)
|
||||
(kill-new (browse-at-remote--file-url (buffer-file-name)))))
|
||||
|
||||
|
||||
(defun +vc--remote-homepage ()
|
||||
(or (let ((url (browse-at-remote--remote-ref)))
|
||||
(cdr (browse-at-remote--get-url-from-remote (car url))))
|
||||
@@ -40,4 +15,6 @@ the URL."
|
||||
(defun +vc/browse-at-remote-kill-homepage ()
|
||||
"Copy homepage URL of current project to clipboard."
|
||||
(interactive)
|
||||
(kill-new (+vc--remote-homepage)))
|
||||
(let ((url (+vc--remote-homepage)))
|
||||
(kill-new url)
|
||||
(message "Copied to clipboard: %S" url)))
|
||||
|
||||
@@ -4,18 +4,33 @@
|
||||
(setenv "GIT_ASKPASS" "git-gui--askpass"))
|
||||
|
||||
|
||||
(after! log-view
|
||||
(set-evil-initial-state!
|
||||
'(log-view-mode
|
||||
vc-git-log-view-mode
|
||||
vc-hg-log-view-mode
|
||||
vc-bzr-log-view-mode
|
||||
vc-svn-log-view-mode)
|
||||
'emacs)
|
||||
(map! :map log-view-mode-map
|
||||
"j" #'log-view-msg-next
|
||||
"k" #'log-view-msg-prev))
|
||||
|
||||
|
||||
(after! vc-annotate
|
||||
(set-popup-rules!
|
||||
'(("^\\vc-d" :select nil) ; *vc-diff*
|
||||
("^\\vc-c" :select t))) ; *vc-change-log*
|
||||
(set-evil-initial-state!
|
||||
'(vc-annotate-mode vc-git-log-view-mode)
|
||||
'normal)
|
||||
'(("^\\*vc-diff" :select nil) ; *vc-diff*
|
||||
("^\\*vc-change" :select t))) ; *vc-change-log*
|
||||
(set-evil-initial-state! 'vc-annotate-mode 'normal)
|
||||
|
||||
;; Clean up after itself
|
||||
(define-key vc-annotate-mode-map [remap quit-window] #'kill-current-buffer))
|
||||
|
||||
|
||||
(after! vc-dir
|
||||
(set-evil-initial-state! 'vc-dir-mode 'emacs))
|
||||
|
||||
|
||||
(after! git-timemachine
|
||||
;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of
|
||||
;; showing revision details in the minibuffer, show them in
|
||||
@@ -53,9 +68,8 @@ info in the `header-line-format' is a good indication."
|
||||
|
||||
|
||||
(use-package! git-commit
|
||||
:after-call after-find-file
|
||||
:hook (doom-first-file . global-git-commit-mode)
|
||||
:config
|
||||
(global-git-commit-mode +1)
|
||||
(set-yas-minor-mode! 'git-commit-mode)
|
||||
|
||||
;; Enforce git commit conventions.
|
||||
@@ -71,3 +85,15 @@ otherwise in default state."
|
||||
(when (and (bound-and-true-p evil-mode)
|
||||
(bobp) (eolp))
|
||||
(evil-insert-state)))))
|
||||
|
||||
|
||||
(after! browse-at-remote
|
||||
(setq browse-at-remote-add-line-number-if-no-region-selected nil)
|
||||
|
||||
;; HACK `browse-at-remote' produces urls with `nil' in them, when the repo is
|
||||
;; detached. This creates broken links. I think it is more sensible to
|
||||
;; fall back to master in those cases.
|
||||
(defadvice! +vc--fallback-to-master-branch-a ()
|
||||
"Return 'master' in detached state."
|
||||
:after-until #'browse-at-remote--get-local-branch
|
||||
"master"))
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
(package! vc-annotate :built-in t)
|
||||
(package! smerge-mode :built-in t)
|
||||
|
||||
(package! browse-at-remote)
|
||||
(package! git-timemachine)
|
||||
(package! gitconfig-mode)
|
||||
(package! gitignore-mode)
|
||||
(package! browse-at-remote :pin "6aecae4b5d202e582425fc8aa2c9c2b6a4779f25")
|
||||
(package! git-commit :pin "d459e528f46423f1976e5fa415e64f8f7162b473")
|
||||
(package! git-timemachine :pin "391eb61050de321101e631fcf373fc70ec6e7700")
|
||||
(package! gitconfig-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||
(package! gitignore-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||
|
||||
Reference in New Issue
Block a user