Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defhydra hydra-zoom (global-map "<f2>")
- "zoom"
- ("<kp-add>" text-scale-increase "in")
- ("+" text-scale-increase "in")
- ("-" text-scale-decrease "out")
- ("<kp-subtract>" text-scale-decrease "out")
- ("0" (text-scale-set 0) "reset")
- ("<kp-0>" (text-scale-set 0) "reset"))
- (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
- (global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
- (defhydra hydra-buffer-menu (:color pink
- :hint nil)
- "
- ^Mark^ ^Unmark^ ^Actions^ ^Search
- ^^^^^^^^-----------------------------------------------------------------
- _m_: mark _u_: unmark _x_: execute _R_: re-isearch
- _s_: save _U_: unmark up _b_: bury _I_: isearch
- _d_: delete ^ ^ _g_: refresh _O_: multi-occur
- _D_: delete up ^ ^ _T_: files only: % -28`Buffer-menu-files-only
- _~_: modified
- "
- ("m" Buffer-menu-mark)
- ("u" Buffer-menu-unmark)
- ("U" Buffer-menu-backup-unmark)
- ("d" Buffer-menu-delete)
- ("D" Buffer-menu-delete-backwards)
- ("s" Buffer-menu-save)
- ("~" Buffer-menu-not-modified)
- ("x" Buffer-menu-execute)
- ("b" Buffer-menu-bury)
- ("g" revert-buffer)
- ("T" Buffer-menu-toggle-files-only)
- ("O" Buffer-menu-multi-occur :color blue)
- ("I" Buffer-menu-isearch-buffers :color blue)
- ("R" Buffer-menu-isearch-buffers-regexp :color blue)
- ("c" nil "cancel")
- ("v" Buffer-menu-select "select" :color blue)
- ("o" Buffer-menu-other-window "other-window" :color blue)
- ("q" quit-window "quit" :color blue))
- (define-key Buffer-menu-mode-map "." 'hydra-buffer-menu/body)
- (defun occur-dwim ()
- "Call `occur' with a sane default, chosen as the thing under point or selected region"
- (interactive)
- (push (if (region-active-p)
- (buffer-substring-no-properties
- (region-beginning)
- (region-end))
- (let ((sym (thing-at-point 'symbol)))
- (when (stringp sym)
- (regexp-quote sym))))
- regexp-history)
- (call-interactively 'occur))
- ;; Keeps focus on *Occur* window, even when when target is visited via RETURN key.
- ;; See hydra-occur-dwim for more options.
- (defadvice occur-mode-goto-occurrence (after occur-mode-goto-occurrence-advice activate)
- (other-window 1)
- (hydra-occur-dwim/body))
- ;; Focus on *Occur* window right away.
- (add-hook 'occur-hook (lambda () (other-window 1)))
- (defun reattach-occur ()
- (if (get-buffer "*Occur*")
- (switch-to-buffer-other-window "*Occur*")
- (hydra-occur-dwim/body) ))
- ;; Used in conjunction with occur-mode-goto-occurrence-advice this helps keep
- ;; focus on the *Occur* window and hides upon request in case needed later.
- (defhydra hydra-occur-dwim ()
- "Occur mode"
- ("o" occur-dwim "Start occur-dwim" :color red)
- ("j" occur-next "Next" :color red)
- ("k" occur-prev "Prev":color red)
- ("h" delete-window "Hide" :color blue)
- ("r" (reattach-occur) "Re-attach" :color red))
- (global-set-key (kbd "C-x o") 'hydra-occur-dwim/body)
- (use-package pdf-tools
- :ensure t
- :config
- (pdf-tools-install)
- (setq-default pdf-view-display-size 'fit-page)
- (bind-keys :map pdf-view-mode-map
- ("\\" . hydra-pdftools/body)
- ("<s-spc>" . pdf-view-scroll-down-or-next-page)
- ("g" . pdf-view-first-page)
- ("G" . pdf-view-last-page)
- ("l" . image-forward-hscroll)
- ("h" . image-backward-hscroll)
- ("j" . pdf-view-next-page)
- ("k" . pdf-view-previous-page)
- ("e" . pdf-view-goto-page)
- ("u" . pdf-view-revert-buffer)
- ("al" . pdf-annot-list-annotations)
- ("ad" . pdf-annot-delete)
- ("aa" . pdf-annot-attachment-dired)
- ("am" . pdf-annot-add-markup-annotation)
- ("at" . pdf-annot-add-text-annotation)
- ("y" . pdf-view-kill-ring-save)
- ("i" . pdf-misc-display-metadata)
- ("s" . pdf-occur)
- ("b" . pdf-view-set-slice-from-bounding-box)
- ("r" . pdf-view-reset-slice))
- (use-package org-pdfview
- :ensure t))
- (defhydra hydra-pdftools (:color blue :hint nil)
- "
- ╭───────────┐
- Move History Scale/Fit Annotations Search/Link Do │ PDF Tools │
- ╭──────────────────────────────────────────────────────────────────┴───────────╯
- ^^_g_^^ _B_ ^↧^ _+_ ^ ^ [_al_] list [_s_] search [_u_] revert buffer
- ^^^↑^^^ ^↑^ _H_ ^↑^ ↦ _W_ ↤ [_am_] markup [_o_] outline [_i_] info
- ^^_p_^^ ^ ^ ^↥^ _0_ ^ ^ [_at_] text [_F_] link [_d_] dark mode
- ^^^↑^^^ ^↓^ ╭─^─^─┐ ^↓^ ╭─^ ^─┐ [_ad_] delete [_f_] search link
- _h_ ←pag_e_→ _l_ _N_ │ _P_ │ _-_ _b_ [_aa_] dired
- ^^^↓^^^ ^ ^ ╰─^─^─╯ ^ ^ ╰─^ ^─╯ [_y_] yank
- ^^_n_^^ ^ ^ _r_eset slice box
- ^^^↓^^^
- ^^_G_^^
- --------------------------------------------------------------------------------
- "
- ("\\" hydra-master/body "back")
- ("<ESC>" nil "quit")
- ("al" pdf-annot-list-annotations)
- ("ad" pdf-annot-delete)
- ("aa" pdf-annot-attachment-dired)
- ("am" pdf-annot-add-markup-annotation)
- ("at" pdf-annot-add-text-annotation)
- ("y" pdf-view-kill-ring-save)
- ("+" pdf-view-enlarge :color red)
- ("-" pdf-view-shrink :color red)
- ("0" pdf-view-scale-reset)
- ("H" pdf-view-fit-height-to-window)
- ("W" pdf-view-fit-width-to-window)
- ("P" pdf-view-fit-page-to-window)
- ("n" pdf-view-next-page-command :color red)
- ("p" pdf-view-previous-page-command :color red)
- ("d" pdf-view-dark-minor-mode)
- ("b" pdf-view-set-slice-from-bounding-box)
- ("r" pdf-view-reset-slice)
- ("g" pdf-view-first-page)
- ("G" pdf-view-last-page)
- ("e" pdf-view-goto-page)
- ("o" pdf-outline)
- ("s" pdf-occur)
- ("i" pdf-misc-display-metadata)
- ("u" pdf-view-revert-buffer)
- ("F" pdf-links-action-perfom)
- ("f" pdf-links-isearch-link)
- ("B" pdf-history-backward :color red)
- ("N" pdf-history-forward :color red)
- ("l" image-forward-hscroll :color red)
- ("h" image-backward-hscroll :color red))
Advertisement
Add Comment
Please, Sign In to add comment