How can I unbind the SPC keybinding from a pdf-view-mode window and use the evil leader key instead?

This is what I have currently:

  (use-package pdf-tools
    :ensure t
    (with-eval-after-load 'pdf-view 
        (define-key pdf-view-mode-map (kbd "SPC") nil)))

Describe-key shows the SPC key is being bound to "pdf-view-scroll-up-or-next-page"

1 Answer 1


How about moving the define-key location to the mode-hook you want to use like this?

(add-hook 'evil-leader-mode-hook
          (lambda ()
            (define-key pdf-view-mode-map (kbd "SPC") nil)))
  • 1
    I don't use the 'evil-leader' package, is there a way to achieve this without this package? I have evil-collection installed. Feb 26, 2023 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.