diff options
author | mattkae <mattkae@protonmail.com> | 2022-11-22 16:46:16 -0500 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2022-11-22 16:46:16 -0500 |
commit | 355bab6730c5a20ee45f323507c217e37b157a4d (patch) | |
tree | 0c312d0b366a8f89baf674a28924d2659309bbe3 | |
parent | c85004a0c3639d166efb511a5e0c06409348ce1e (diff) |
Work in progress on annotate lens
-rw-r--r-- | init.el | 1 | ||||
-rw-r--r-- | lisp/general.el | 3 | ||||
-rw-r--r-- | lisp/vc-annotate-lens-mode.el | 24 |
3 files changed, 26 insertions, 2 deletions
@@ -50,6 +50,7 @@ (require 'lisp) (require 'json) (require 'python-custom) +(require 'vc-annotate-lens-mode) (custom-set-variables ;; custom-set-variables was added by Custom. diff --git a/lisp/general.el b/lisp/general.el index e78e86e..f9fb573 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -98,7 +98,6 @@ ;; (evil-define-key 'normal neotree-mode-map (kbd "p") 'neotree-previous-line) ;; (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) ;; (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) - (defun my-neotree-mode-hook() "Set the colors of neotree to match my personal taste." (setq left-fringe-width 0) @@ -259,7 +258,7 @@ :ensure t :defer t) -(eldoc-box-hover-at-point-mode 1) +(add-hook 'emacs-lisp-mode-hook #'eldoc-box-hover-at-point-mode t) (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-at-point-mode t) ;; Vterm diff --git a/lisp/vc-annotate-lens-mode.el b/lisp/vc-annotate-lens-mode.el new file mode 100644 index 0000000..00f674e --- /dev/null +++ b/lisp/vc-annotate-lens-mode.el @@ -0,0 +1,24 @@ + +;;; Code: + +(make-variable-buffer-local + (defvar vc-annotate-lens-cursor-position 0 + "Holds the cursor position from the last run of post-command-hooks.")) + +(defun do-stuff-if-moved-post-command () + (interactive) + (unless (equal (line-number-at-pos) vc-annotate-lens-cursor-position) + (vc-region-history line-number-at-pos) + (message "%s" vc-annotate-lens-cursor-position)) + (setq vc-annotate-lens-cursor-position (line-number-at-pos))) + +(define-minor-mode vc-annotate-lens-mode + "Show 'vc-annotate' information when you move to a line." + :lighter " vc-annotate-lens" + ) + +(add-hook 'vc-annotate-lens-mode-on-hook (lambda () (add-hook 'post-command-hook #'do-stuff-if-moved-post-command))) +(add-hook 'vc-annotate-lens-mode-off-hook (lambda () (remove-hook 'post-command-hook #'do-stuff-if-moved-post-command))) + +(provide 'vc-annotate-lens-mode) +;;; vc-annotate-lens-mode.el ends here. |