From bdf9a71ab7baa2b1de9abcfd5df1a9107a55d141 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sun, 5 Jul 2026 01:19:30 -0400 Subject: add a bunch of emacs packages HELP --- .../lisp/evil-collection/modes/doc-view/README.org | 42 ++++++++++ .../modes/doc-view/evil-collection-doc-view.el | 89 ++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 .config/emacs/lisp/evil-collection/modes/doc-view/README.org create mode 100644 .config/emacs/lisp/evil-collection/modes/doc-view/evil-collection-doc-view.el (limited to '.config/emacs/lisp/evil-collection/modes/doc-view') diff --git a/.config/emacs/lisp/evil-collection/modes/doc-view/README.org b/.config/emacs/lisp/evil-collection/modes/doc-view/README.org new file mode 100644 index 0000000..ea0af7c --- /dev/null +++ b/.config/emacs/lisp/evil-collection/modes/doc-view/README.org @@ -0,0 +1,42 @@ +* doc-view + + Evil bindings for [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html][doc-view]] (PDF / PS / DVI viewer). + + =doc-view-mode= starts in normal state. + +** Key bindings + + | Command | Original | Evil | + |-------------------------------------------+----------------+-------------------------------------| + | =doc-view-next-line-or-next-page= | =C-n=, =down= | =j= (remap) | + | =doc-view-previous-line-or-previous-page= | =C-p=, =up= | =k= (remap) | + | =image-forward-hscroll= | n/a | =l= (remap) | + | =image-backward-hscroll= | n/a | =h= (remap) | + | =doc-view-next-page= | =n= | =gj=, =C-j=, =n= | + | =doc-view-previous-page= | =p= | =gk=, =C-k=, =p= | + | =doc-view-first-page= | =M-<= | =gg= | + | =doc-view-last-page= | =M->= | =G= | + | =doc-view-goto-page= | =M-g M-g= | =J= | + | =doc-view-scroll-up-or-next-page= | =SPC= | =SPC= | + | =doc-view-scroll-down-or-previous-page= | =DEL=, =S-SPC= | =DEL=, =S-SPC= | + | =forward-page= | =next= | =C-d= | + | =backward-page= | =prior= | =C-u= (when =evil-want-C-u-scroll=) | + | =image-next-line= | =RET= | =RET= | + | =doc-view-enlarge= | =+=, === | =+=, === | + | =doc-view-shrink= | =-= | =-= | + | =doc-view-scale-reset= | =0= | =0= | + | =doc-view-fit-width-to-window= | =W= | =W= | + | =doc-view-fit-height-to-window= | =H= | =H= | + | =doc-view-fit-page-to-window= | =P= | =P= | + | =doc-view-kill-proc= | =K= | =X= | + | =doc-view-set-slice= | =c s= | =s s= | + | =doc-view-set-slice-using-mouse= | =c m= | =s m= | + | =doc-view-set-slice-from-bounding-box= | =c b= | =s b= | + | =doc-view-reset-slice= | =c r= | =s r= | + | =doc-view-search= | =C-s=, =find= | =/= | + | =doc-view-search-backward= | =C-r= | =?= | + | =doc-view-show-tooltip= | =C-t= | =C-t= | + | =doc-view-toggle-display= | =C-c C-c= | =C-c C-c= | + | =doc-view-open-text= | =C-c C-t= | =C-c C-t= | + | =doc-view-revert-buffer= | n/a | =gr= | + | =quit-window= | n/a | =q= | diff --git a/.config/emacs/lisp/evil-collection/modes/doc-view/evil-collection-doc-view.el b/.config/emacs/lisp/evil-collection/modes/doc-view/evil-collection-doc-view.el new file mode 100644 index 0000000..42b10ff --- /dev/null +++ b/.config/emacs/lisp/evil-collection/modes/doc-view/evil-collection-doc-view.el @@ -0,0 +1,89 @@ +;;; evil-collection-doc-view.el --- Evil bindings for docview -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "26.3")) +;; Keywords: evil, bindings, files, pdf, ps, dvi + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;;; Evil bindings for doc-view. + +;;; Code: +(require 'evil-collection) +(require 'doc-view) + +(defconst evil-collection-doc-view-maps '(doc-view-mode-map)) + +;;;###autoload +(defun evil-collection-doc-view-setup () + "Set up `evil' bindings for `doc-view'." + (evil-set-initial-state 'doc-view-mode 'normal) + (evil-collection-define-key 'normal 'doc-view-mode-map + "q" 'quit-window + [remap evil-next-line] 'doc-view-next-line-or-next-page + [remap evil-previous-line] 'doc-view-previous-line-or-previous-page + [remap evil-backward-char] 'image-backward-hscroll + [remap evil-forward-char] 'image-forward-hscroll + (kbd "C-j") 'doc-view-next-page + (kbd "C-k") 'doc-view-previous-page + "gj" 'doc-view-next-page + "gk" 'doc-view-previous-page + (kbd "C-d") 'forward-page + (kbd "SPC") 'doc-view-scroll-up-or-next-page + (kbd "DEL") 'doc-view-scroll-down-or-previous-page + (kbd "S-SPC") 'doc-view-scroll-down-or-previous-page + "gg" 'doc-view-first-page + "G" 'doc-view-last-page + "J" 'doc-view-goto-page + (kbd "RET") 'image-next-line + + ;; zoom + "+" 'doc-view-enlarge + "=" 'doc-view-enlarge + "0" 'doc-view-scale-reset + "-" 'doc-view-shrink + + "W" 'doc-view-fit-width-to-window ; Like evil-image. + "H" 'doc-view-fit-height-to-window ; Like evil-image. + "P" 'doc-view-fit-page-to-window + "X" 'doc-view-kill-proc + + (kbd "s s") 'doc-view-set-slice + (kbd "s m") 'doc-view-set-slice-using-mouse + (kbd "s b") 'doc-view-set-slice-from-bounding-box + (kbd "s r") 'doc-view-reset-slice + + (kbd "/") 'doc-view-search + (kbd "?") 'doc-view-search-backward + (kbd "C-t") 'doc-view-show-tooltip + (kbd "C-c C-c") 'doc-view-toggle-display + (kbd "C-c C-t") 'doc-view-open-text + + ;; refresh + (kbd "gr") 'doc-view-revert-buffer) + + ;; TODO: What if the user changes `evil-want-C-u-scroll' after this is run? + (when evil-want-C-u-scroll + (evil-collection-define-key 'normal 'doc-view-mode-map + (kbd "C-u") 'backward-page))) + +(provide 'evil-collection-doc-view) +;;; evil-collection-doc-view.el ends here -- cgit v1.2.3