Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic example use with evil #16

Open
jstaursky opened this issue Sep 8, 2021 · 1 comment
Open

basic example use with evil #16

jstaursky opened this issue Sep 8, 2021 · 1 comment

Comments

@jstaursky
Copy link

Hey I have the following which I feel should work, what am I doing wrong? From the readme shouldn't better-jumper piggy back off of the built in jumplist implementation to track when jumps occur? Or maybe Im misunderstanding what you mean by "built in jump list implemention"?

  (use-package better-jumper
    :config
    (define-key evil-motion-state-map (kbd "C-o") 'better-jumper-jump-backward)
    (define-key evil-motion-state-map (kbd "<C-i>") 'better-jumper-jump-forward))

  (use-package evil
    :config
    (setq evil-jmp-triggers
          '(xref-goto-xref       xref-quit-and-goto-xref  evil-scroll-page-down
            evil-scroll-page-up  jump-to-register         switch-to-buffer
            previous-buffer      helm-gtags-find-tag

            spacemacs/c-c++-lsp-ccls-find-callers   spacemacs/c-c++-lsp-ccls-find-callees
            spacemacs/c-c++-lsp-ccls-find-refs-read spacemacs/c-c++-lsp-ccls-find-refs-write))

    (dolist (cmd evil-jmp-triggers)
      (evil-add-command-properties cmd :jmp t))

    (advice-add 'evil-jump-backward
                :around (lambda (oldfn &rest args)
                          (apply oldfn args)
                          (run-at-time ".1 sec") nil #'recenter)
                          (redraw-display))
    (advice-add 'evil-jump-forward
                :around (lambda (oldfn &rest args)
                          (apply oldfn args)
                          (run-at-time ".1 sec") nil #'recenter)
                (redraw-display))

    (better-jumper-mode)

    ) ; end use-package 'evil
@gilbertw1
Copy link
Owner

gilbertw1 commented Sep 8, 2021

Hey,

You want to set better-jumper-use-evil-jump-advice to t. This will instruct better-jumper at attach advice to the evil add jump function that will make better-jumper track jumps from evil.

See more here: https://github.com/gilbertw1/better-jumper#use-evil-jump-advice-better-jumper-use-evil-jump-advice

Edit: Sorry, that value actually defaults to t. I'll take a look at your config in more detail when I get a chance to see if I can spot any issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants