[Emacs] Better config for PDF reader

Improved keybinds, freed the use of local leader `,'
This commit is contained in:
Lucien Cartier-Tilet 2021-07-30 18:26:07 +02:00
parent 8604abc87d
commit 00c00f42ef
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -1633,24 +1633,27 @@ reader?
:magic ("%PDF" . pdf-view-mode)
:straight (:build t)
:mode (("\\.pdf\\'" . pdf-view-mode))
:hook (pdf-tools-enabled . pdf-view-midnight-minor-mode)
:config
(progn
(with-eval-after-load 'pdf-view
(setq pdf-view-midnight-colors '("#d8dee9" . "#2e3440")))
(general-define-key
:keymaps 'pdf-view-mode-map
"SPC" nil)
"SPC" nil
"," nil)
(general-define-key
:states 'normal
:keymaps 'pdf-view-mode-map
"SPC" nil
"," nil
"y" #'pdf-view-kill-ring-save
"t" #'evil-collection-pdf-view-next-line-or-next-page
"s" #'evil-collection-pdf-view-previous-line-or-previous-page))
"s" #'evil-collection-pdf-view-previous-line-or-previous-page)
(general-define-key
:states 'motion
:keymaps 'pdf-view-mode-map
:prefix "SPC"
:prefix ","
"a" '(nil :which-key "annotations")
"aD" #'pdf-annot-delete
"at" #'pdf-annot-attachment-dired
@ -1674,10 +1677,7 @@ reader?
"ss" #'pdf-occur
"o" 'pdf-outline
"m" 'pdf-view-midnight-minor-mode)
:hook
(pdf-tools-enabled . pdf-view-midnight-minor-mode))
"m" 'pdf-view-midnight-minor-mode)))
#+end_src
#+begin_src emacs-lisp