Add better-jumper

Replaces evil's jumplist; makes its functionality available for non evil
users.
This commit is contained in:
Henrik Lissner 2019-04-21 23:22:06 -04:00
parent b189254050
commit a4c5396558
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
11 changed files with 55 additions and 25 deletions

View file

@ -128,7 +128,7 @@ Otherwise, these properties are available to be set:
#'switch-to-buffer)
(marker-buffer result))
(goto-char result)
(recenter)
(better-jumper-set-jump)
result)))

View file

@ -74,12 +74,6 @@ If the argument is interactive (satisfies `commandp'), it is called with
`call-interactively' (with no arguments). Otherwise, it is called with one
argument: the identifier at point.")
;; Recenter buffer after certain jumps
(add-hook!
'(imenu-after-jump-hook evil-jumps-post-jump-hook
counsel-grep-post-action-hook dumb-jump-after-jump-hook)
#'recenter)
;;
;;; dumb-jump
@ -92,7 +86,8 @@ argument: the identifier at point.")
dumb-jump-selector
(cond ((featurep! :completion ivy) 'ivy)
((featurep! :completion helm) 'helm)
('popup))))
('popup)))
(add-hook 'dumb-jump-after-jump-hook #'better-jumper-set-jump))
;;
@ -102,6 +97,9 @@ argument: the identifier at point.")
;; set these up ourselves in other modules.
(setq-default xref-backend-functions '(t))
;; Use `better-jumper' instead of xref's marker stack
(advice-add #'xref-push-marker-stack :around #'doom*set-jump)
;; ...however, it breaks `projectile-find-tag', unless we put it back.
(defun +lookup*projectile-find-tag (orig-fn)
(let ((xref-backend-functions '(etags--xref-backend t)))