mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-13 23:51:34 +09:00
emacs : diff-hl, pdf-tools windows
This commit is contained in:
@ -53,11 +53,6 @@
|
|||||||
|
|
||||||
(use-package dired-single
|
(use-package dired-single
|
||||||
:commands (dired dired-jump))
|
:commands (dired dired-jump))
|
||||||
(use-package diff-hl
|
|
||||||
:hook ((dired-mode . diff-hl-dired-mode-unless-remote)
|
|
||||||
(magit-post-refresh . diff-hl-magit-post-refresh))
|
|
||||||
:config
|
|
||||||
(diff-hl-margin-mode))
|
|
||||||
(use-package dired-hide-dotfiles
|
(use-package dired-hide-dotfiles
|
||||||
:hook (dired-mode) ;; hide default when dired-mode enabled.
|
:hook (dired-mode) ;; hide default when dired-mode enabled.
|
||||||
:config
|
:config
|
||||||
|
|||||||
@ -67,9 +67,7 @@
|
|||||||
("M-v" pager-page-up "↖")
|
("M-v" pager-page-up "↖")
|
||||||
("M-<" beginning-of-buffer "⭶")
|
("M-<" beginning-of-buffer "⭶")
|
||||||
("M->" end-of-buffer "⭸"))))
|
("M->" end-of-buffer "⭸"))))
|
||||||
:bind (:map hs-minor-mode-map
|
:bind ("C-~" . hideshow-hydra/body)
|
||||||
("C-~" . hideshow-hydra/body)
|
|
||||||
("C-S-<escape>" . hideshow-hydra/body))
|
|
||||||
:hook (prog-mode . hs-minor-mode)
|
:hook (prog-mode . hs-minor-mode)
|
||||||
:config
|
:config
|
||||||
;; More functions
|
;; More functions
|
||||||
|
|||||||
@ -99,6 +99,7 @@
|
|||||||
"o a r" '(my/org-roam-refresh-agenda-list :which-key "Org agenda refresh list")
|
"o a r" '(my/org-roam-refresh-agenda-list :which-key "Org agenda refresh list")
|
||||||
"o a c" '((lambda () (interactive) (find-file (expand-file-name "agenda/agenda.org" org-directory))) :which-key "org agenda file")
|
"o a c" '((lambda () (interactive) (find-file (expand-file-name "agenda/agenda.org" org-directory))) :which-key "org agenda file")
|
||||||
"o c" '(cfw:open-org-calendar :which-key "org calendar")
|
"o c" '(cfw:open-org-calendar :which-key "org calendar")
|
||||||
|
"o t" '(org-insert-structure-template :which-key "org insert structure template")
|
||||||
;; Project-el
|
;; Project-el
|
||||||
"p" '(:ignore t :which-key "project")
|
"p" '(:ignore t :which-key "project")
|
||||||
"p ." '(project-switch-project :which-key "switch project")
|
"p ." '(project-switch-project :which-key "switch project")
|
||||||
|
|||||||
@ -109,18 +109,13 @@
|
|||||||
(dolist (keyword '("DEPRECATED"))
|
(dolist (keyword '("DEPRECATED"))
|
||||||
(add-to-list 'hl-todo-keyword-faces `(,keyword . "#8d9eaf"))))
|
(add-to-list 'hl-todo-keyword-faces `(,keyword . "#8d9eaf"))))
|
||||||
|
|
||||||
;;(use-package diff-hl
|
|
||||||
;; :config
|
|
||||||
;; (diff-hl-margin-mode))
|
|
||||||
|
|
||||||
(use-package diff-hl
|
(use-package diff-hl
|
||||||
:hook ((after-init . global-diff-hl-mode)
|
:hook ((after-init . global-diff-hl-mode)
|
||||||
(magit-post-refresh . diff-hl-magit-post-refresh)
|
(magit-post-refresh . diff-hl-magit-post-refresh)
|
||||||
(dired-mode . diff-hl-dired-mode-unless-remote))
|
(dired-mode . diff-hl-dired-mode-unless-remote))
|
||||||
;;(dired-mode . diff-hl-dired-mode))
|
|
||||||
:config
|
:config
|
||||||
;; Highlight on-the-fly
|
;; Highlight on-the-fly
|
||||||
(diff-hl-flydiff-mode 1)
|
(diff-hl-flydiff-mode t)
|
||||||
|
|
||||||
;; Set fringe style
|
;; Set fringe style
|
||||||
(setq-default fringes-outside-margins nil)
|
(setq-default fringes-outside-margins nil)
|
||||||
@ -129,7 +124,7 @@
|
|||||||
(defun my-diff-hl-fringe-bmp-function (_type _pos)
|
(defun my-diff-hl-fringe-bmp-function (_type _pos)
|
||||||
"Fringe bitmap function for use as `diff-hl-fringe-bmp-function'."
|
"Fringe bitmap function for use as `diff-hl-fringe-bmp-function'."
|
||||||
(define-fringe-bitmap 'my-diff-hl-bmp
|
(define-fringe-bitmap 'my-diff-hl-bmp
|
||||||
(vector (if sys/linuxp #b11111100 #b11100000))
|
(vector (if ON-LINUX #b11111100 #b11100000))
|
||||||
1 8
|
1 8
|
||||||
'(center t)))
|
'(center t)))
|
||||||
(setq diff-hl-fringe-bmp-function #'my-diff-hl-fringe-bmp-function)
|
(setq diff-hl-fringe-bmp-function #'my-diff-hl-fringe-bmp-function)
|
||||||
|
|||||||
@ -1,41 +1,40 @@
|
|||||||
;;; init-reader.el -*- lexical-binding: t -*-
|
;;; init-reader.el -*- lexical-binding: t -*-
|
||||||
(when (and ON-LINUX (display-graphic-p))
|
(use-package pdf-view
|
||||||
(use-package pdf-view
|
:ensure pdf-tools
|
||||||
:ensure pdf-tools
|
:diminish (pdf-view-themed-minor-mode
|
||||||
:diminish (pdf-view-themed-minor-mode
|
pdf-view-midnight-minor-mode
|
||||||
pdf-view-midnight-minor-mode
|
pdf-view-printer-minor-mode)
|
||||||
pdf-view-printer-minor-mode)
|
:defines pdf-annot-activate-created-annotations
|
||||||
:defines pdf-annot-activate-created-annotations
|
:hook ((pdf-tools-enabled . pdf-view-auto-slice-minor-mode)
|
||||||
:hook ((pdf-tools-enabled . pdf-view-auto-slice-minor-mode)
|
(pdf-tools-enabled . pdf-isearch-minor-mode)
|
||||||
(pdf-tools-enabled . pdf-isearch-minor-mode)
|
(pdf-tools-enabled . pdf-view-themed-minor-mode))
|
||||||
(pdf-tools-enabled . pdf-view-themed-minor-mode))
|
:mode ("\\.[pP][dD][fF]\\'" . pdf-view-mode)
|
||||||
:mode ("\\.[pP][dD][fF]\\'" . pdf-view-mode)
|
:magic ("%PDF" . pdf-view-mode)
|
||||||
:magic ("%PDF" . pdf-view-mode)
|
:bind (:map pdf-view-mode-map
|
||||||
:bind (:map pdf-view-mode-map
|
("C-s" . isearch-forward))
|
||||||
("C-s" . isearch-forward))
|
:init (setq pdf-view-use-scaling t
|
||||||
:init (setq pdf-view-use-scaling t
|
pdf-view-use-imagemagick nil
|
||||||
pdf-view-use-imagemagick nil
|
pdf-annot-activate-created-annotations t
|
||||||
pdf-annot-activate-created-annotations t
|
pdf-view-display-size 'fit-page)
|
||||||
pdf-view-display-size 'fit-page)
|
:config
|
||||||
|
;; install manually
|
||||||
|
;;(pdf-tools-install t nil t nil)
|
||||||
|
;; my funtion
|
||||||
|
(defun my/pdf-view-open-in-zathura ()
|
||||||
|
(interactive)
|
||||||
|
(save-window-excursion
|
||||||
|
(let ((current-file (buffer-file-name))
|
||||||
|
(current-page (number-to-string (pdf-view-current-page))))
|
||||||
|
(async-shell-command
|
||||||
|
(format "zathura -P %s \"%s\"" current-page current-file))))
|
||||||
|
(message "Sent to zathura"))
|
||||||
|
;; Recover last viewed position
|
||||||
|
(use-package pdf-view-restore
|
||||||
|
:defer t
|
||||||
|
:hook (pdf-view-mode . pdf-view-restore-mode)
|
||||||
:config
|
:config
|
||||||
;; Activate the package
|
(setq pdf-view-restore-filename
|
||||||
(pdf-tools-install t nil t nil)
|
(expand-file-name "pdf-view-restore" user-emacs-directory))))
|
||||||
;; my funtion
|
|
||||||
(defun my/pdf-view-open-in-zathura ()
|
|
||||||
(interactive)
|
|
||||||
(save-window-excursion
|
|
||||||
(let ((current-file (buffer-file-name))
|
|
||||||
(current-page (number-to-string (pdf-view-current-page))))
|
|
||||||
(async-shell-command
|
|
||||||
(format "zathura -P %s \"%s\"" current-page current-file))))
|
|
||||||
(message "Sent to zathura"))
|
|
||||||
;; Recover last viewed position
|
|
||||||
(use-package pdf-view-restore
|
|
||||||
:defer t
|
|
||||||
:hook (pdf-view-mode . pdf-view-restore-mode)
|
|
||||||
:config
|
|
||||||
(setq pdf-view-restore-filename
|
|
||||||
(expand-file-name "pdf-view-restore" user-emacs-directory)))))
|
|
||||||
|
|
||||||
|
|
||||||
;; Epub reader
|
;; Epub reader
|
||||||
|
|||||||
Reference in New Issue
Block a user