[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,51 +1633,51 @@ reader?
:magic ("%PDF" . pdf-view-mode) :magic ("%PDF" . pdf-view-mode)
:straight (:build t) :straight (:build t)
:mode (("\\.pdf\\'" . pdf-view-mode)) :mode (("\\.pdf\\'" . pdf-view-mode))
:hook (pdf-tools-enabled . pdf-view-midnight-minor-mode)
:config :config
(progn (progn
(with-eval-after-load 'pdf-view (with-eval-after-load 'pdf-view
(setq pdf-view-midnight-colors '("#d8dee9" . "#2e3440"))) (setq pdf-view-midnight-colors '("#d8dee9" . "#2e3440")))
(general-define-key (general-define-key
:keymaps 'pdf-view-mode-map :keymaps 'pdf-view-mode-map
"SPC" nil) "SPC" nil
"," nil)
(general-define-key (general-define-key
:states 'normal :states 'normal
:keymaps 'pdf-view-mode-map :keymaps 'pdf-view-mode-map
"SPC" nil "SPC" nil
"," nil
"y" #'pdf-view-kill-ring-save "y" #'pdf-view-kill-ring-save
"t" #'evil-collection-pdf-view-next-line-or-next-page "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 (general-define-key
:states 'motion :states 'motion
:keymaps 'pdf-view-mode-map :keymaps 'pdf-view-mode-map
:prefix "SPC" :prefix ","
"a" '(nil :which-key "annotations") "a" '(nil :which-key "annotations")
"aD" #'pdf-annot-delete "aD" #'pdf-annot-delete
"at" #'pdf-annot-attachment-dired "at" #'pdf-annot-attachment-dired
"ah" #'pdf-annot-add-highlight-markup-annotation "ah" #'pdf-annot-add-highlight-markup-annotation
"al" #'pdf-annot-list-annotations "al" #'pdf-annot-list-annotations
"am" #'pdf-annot-markup-annotation "am" #'pdf-annot-markup-annotation
"ao" #'pdf-annot-add-strikeout-markup-annotation "ao" #'pdf-annot-add-strikeout-markup-annotation
"as" #'pdf-annot-add-squiggly-markup-annotation "as" #'pdf-annot-add-squiggly-markup-annotation
"at" #'pdf-annot-add-text-annotation "at" #'pdf-annot-add-text-annotation
"au" #'pdf-annot-add-underline-markup-annotation "au" #'pdf-annot-add-underline-markup-annotation
"f" '(nil :which-key "fit") "f" '(nil :which-key "fit")
"fw" #'pdf-view-fit-width-to-window "fw" #'pdf-view-fit-width-to-window
"fh" #'pdf-view-fit-height-to-window "fh" #'pdf-view-fit-height-to-window
"fp" #'pdf-view-fit-page-to-window "fp" #'pdf-view-fit-page-to-window
"s" '(nil :which-key "slice/search") "s" '(nil :which-key "slice/search")
"sb" #'pdf-view-set-slice-from-bounding-box "sb" #'pdf-view-set-slice-from-bounding-box
"sm" #'pdf-view-set-slice-using-mouse "sm" #'pdf-view-set-slice-using-mouse
"sr" #'pdf-view-reset-slice "sr" #'pdf-view-reset-slice
"ss" #'pdf-occur "ss" #'pdf-occur
"o" 'pdf-outline "o" 'pdf-outline
"m" 'pdf-view-midnight-minor-mode) "m" 'pdf-view-midnight-minor-mode)))
:hook
(pdf-tools-enabled . pdf-view-midnight-minor-mode))
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp