doomemacs/core/core-vcs.el

80 lines
2.9 KiB
EmacsLisp
Raw Normal View History

2015-06-15 15:05:52 +08:00
;;; core-vcs.el --- version control awareness
(use-package gitconfig-mode
2015-08-14 00:14:41 +08:00
:mode ("/\\.?git/?config$" "/\\.gitmodules$")
2016-03-28 06:18:43 +08:00
:init (add-hook 'gitconfig-mode-hook 'flyspell-mode))
2015-06-15 15:05:52 +08:00
(use-package gitignore-mode
2015-08-14 00:14:41 +08:00
:mode ("/\\.gitignore$"
"/\\.git/info/exclude$"
"/git/ignore$"))
2015-06-15 15:05:52 +08:00
2015-12-09 14:16:31 +08:00
(use-package git-gutter
2016-05-21 10:37:30 +08:00
:commands (git-gutter-mode doom/vcs-next-hunk doom/vcs-prev-hunk
doom/vcs-show-hunk doom/vcs-stage-hunk doom/vcs-revert-hunk)
2015-12-09 14:16:31 +08:00
:init
NARF v0.7.0 vcs: + +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit + switch github-browse-file for browse-at-remote + fix <leader>ob; add <leader>d[./sr] vc bindings + vc-annotate bindings and initial state Workgroups2 integration: + don't mess with buffers (speeds up emacs a lot!) + unicode numbers in display + single display function + remember workgroup uid instead (and smarter :tabrename) + clean up after wg update Org-mode + give highlight precedence to links in org-mode + enable encryption + config clean up + use different font for org + exclude attachments in recentf + redo latex and inline-image config + add narf/org-open-notes + update file templates for org CRM Mode-line + polish mode-line + decouple from spaceline-segments.el + refactor narf|spaceline-env-update + add macro-recording and buffer-size indicators to mode-line + python: '2>&1' in env-command + flycheck fringe indicator: change to arrow Aesthetics + update narf-dark-theme + add narf-minibuffer-active face + change writing indicator in writing-mode Misc + fix whitespace in display-startup-echo-area-message + reset fonts for more unicode characters + custom imenu entries + helm-imenu fontification + enable yascroll-bar in REPLs + reorganize my-commands.el + force quit iedit on ESC in normal mode + update snippets submodule + remove ido init (helm handles it all) [EXPERIMENTAL] + back to Terminus(TTF) font + popwin: update config for git-gutter and vc-diff windows + highlight :g[lobal] and :al[ign] matches + decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list + fix narf/helm-buffers-dwim (add interactive form)
2015-12-12 05:51:04 +08:00
(add-hook! (text-mode prog-mode conf-mode) 'git-gutter-mode)
2015-12-09 14:16:31 +08:00
:config
(require 'git-gutter-fringe)
2016-05-25 09:57:25 +08:00
(def-popup! "^\\*git-gutter.+\\*$" :align below :size 15 :noselect t :regexp t)
2015-12-09 14:16:31 +08:00
(define-fringe-bitmap 'git-gutter-fr:added
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
2015-12-09 14:16:31 +08:00
nil nil 'center)
(define-fringe-bitmap 'git-gutter-fr:modified
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
2015-12-09 14:16:31 +08:00
nil nil 'center)
(define-fringe-bitmap 'git-gutter-fr:deleted
2016-05-21 04:56:55 +08:00
[0 0 0 0 0 0 0 0 0 0 0 0 0 128 192 224 240 248]
2015-12-09 14:16:31 +08:00
nil nil 'center)
2016-05-21 07:08:02 +08:00
;; Refreshing git-gutter
2015-12-09 14:16:31 +08:00
(advice-add 'evil-force-normal-state :after 'git-gutter)
(add-hook 'focus-in-hook 'git-gutter:update-all-windows)
2016-05-21 10:37:30 +08:00
(defalias 'doom/vcs-next-hunk 'git-gutter:next-hunk)
(defalias 'doom/vcs-prev-hunk 'git-gutter:previous-hunk)
(defalias 'doom/vcs-show-hunk 'git-gutter:popup-hunk)
(defalias 'doom/vcs-stage-hunk 'git-gutter:stage-hunk)
(defalias 'doom/vcs-revert-hunk 'git-gutter:revert-hunk))
2015-12-09 14:16:31 +08:00
(use-package git-messenger
:commands git-messenger:popup-message
:init (defvar git-messenger-map (make-sparse-keymap))
:config
2016-05-25 09:57:25 +08:00
(def-popup! "*git-messenger*" :align left :size 55 :select t)
(setq git-messenger:show-detail t)
(map! :map git-messenger-map
"<escape>" 'git-messenger:popup-close
"q" 'git-messenger:popup-close))
(use-package magit
:commands (magit-status)
:config
2016-05-25 09:57:25 +08:00
(doom-popup-magit-hacks)
(def-popup! (:custom (lambda (b &rest _) (derived-mode-p 'magit-mode)))
:align below :size 0.5)
(add-hook 'magit-mode-hook 'turn-off-evil-snipe-override-mode))
(use-package evil-magit
:after magit
:config (evil-set-initial-state 'magit-popup-mode 'normal))
NARF v0.7.0 vcs: + +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit + switch github-browse-file for browse-at-remote + fix <leader>ob; add <leader>d[./sr] vc bindings + vc-annotate bindings and initial state Workgroups2 integration: + don't mess with buffers (speeds up emacs a lot!) + unicode numbers in display + single display function + remember workgroup uid instead (and smarter :tabrename) + clean up after wg update Org-mode + give highlight precedence to links in org-mode + enable encryption + config clean up + use different font for org + exclude attachments in recentf + redo latex and inline-image config + add narf/org-open-notes + update file templates for org CRM Mode-line + polish mode-line + decouple from spaceline-segments.el + refactor narf|spaceline-env-update + add macro-recording and buffer-size indicators to mode-line + python: '2>&1' in env-command + flycheck fringe indicator: change to arrow Aesthetics + update narf-dark-theme + add narf-minibuffer-active face + change writing indicator in writing-mode Misc + fix whitespace in display-startup-echo-area-message + reset fonts for more unicode characters + custom imenu entries + helm-imenu fontification + enable yascroll-bar in REPLs + reorganize my-commands.el + force quit iedit on ESC in normal mode + update snippets submodule + remove ido init (helm handles it all) [EXPERIMENTAL] + back to Terminus(TTF) font + popwin: update config for git-gutter and vc-diff windows + highlight :g[lobal] and :al[ign] matches + decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list + fix narf/helm-buffers-dwim (add interactive form)
2015-12-12 05:51:04 +08:00
(after! vc-annotate
2016-05-21 07:08:02 +08:00
(evil-set-initial-state 'vc-annotate-mode 'normal)
NARF v0.7.0 vcs: + +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit + switch github-browse-file for browse-at-remote + fix <leader>ob; add <leader>d[./sr] vc bindings + vc-annotate bindings and initial state Workgroups2 integration: + don't mess with buffers (speeds up emacs a lot!) + unicode numbers in display + single display function + remember workgroup uid instead (and smarter :tabrename) + clean up after wg update Org-mode + give highlight precedence to links in org-mode + enable encryption + config clean up + use different font for org + exclude attachments in recentf + redo latex and inline-image config + add narf/org-open-notes + update file templates for org CRM Mode-line + polish mode-line + decouple from spaceline-segments.el + refactor narf|spaceline-env-update + add macro-recording and buffer-size indicators to mode-line + python: '2>&1' in env-command + flycheck fringe indicator: change to arrow Aesthetics + update narf-dark-theme + add narf-minibuffer-active face + change writing indicator in writing-mode Misc + fix whitespace in display-startup-echo-area-message + reset fonts for more unicode characters + custom imenu entries + helm-imenu fontification + enable yascroll-bar in REPLs + reorganize my-commands.el + force quit iedit on ESC in normal mode + update snippets submodule + remove ido init (helm handles it all) [EXPERIMENTAL] + back to Terminus(TTF) font + popwin: update config for git-gutter and vc-diff windows + highlight :g[lobal] and :al[ign] matches + decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list + fix narf/helm-buffers-dwim (add interactive form)
2015-12-12 05:51:04 +08:00
(evil-set-initial-state 'vc-git-log-view-mode 'normal)
(map! :map vc-annotate-mode-map
:n "q" 'kill-this-buffer
:n "d" 'vc-annotate-show-diff-revision-at-line
:n "D" 'vc-annotate-show-changeset-diff-revision-at-line
:n "SPC" 'vc-annotate-show-log-revision-at-line
:n "]]" 'vc-annotate-next-revision
:n "[[" 'vc-annotate-prev-revision
:n [tab] 'vc-annotate-toggle-annotation-visibility
:n "RET" 'vc-annotate-find-revision-at-line))
(use-package browse-at-remote
:commands (browse-at-remote/browse browse-at-remote/get-url))
2015-06-15 15:05:52 +08:00
(provide 'core-vcs)
;;; core-vcs.el ends here