Adding pdf-tools

This commit is contained in:
Chris Cochrun 2021-02-18 05:39:47 -06:00
parent b51776f0d2
commit a59b853c75
2 changed files with 77 additions and 22 deletions

View file

@ -15,6 +15,7 @@
- [[#format][Format]] - [[#format][Format]]
- [[#org-mode][Org Mode]] - [[#org-mode][Org Mode]]
- [[#magit][Magit]] - [[#magit][Magit]]
- [[#pdf-tools][PDF-Tools]]
- [[#garbage-collection][Garbage Collection]] - [[#garbage-collection][Garbage Collection]]
- [[#early-init][Early Init]] - [[#early-init][Early Init]]
@ -89,6 +90,11 @@ Then let's make sure line-numbers are relative and on. And let's turn on visual-
(global-visual-line-mode +1) (global-visual-line-mode +1)
#+end_src #+end_src
Let's make doc-view better
#+begin_src emacs-lisp
(setq doc-view-resolution 192)
#+end_src
Also, real quick let's make sure that ~<escape>~ works as the same as ~<C-g>~ Also, real quick let's make sure that ~<escape>~ works as the same as ~<C-g>~
#+begin_src emacs-lisp #+begin_src emacs-lisp
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
@ -200,13 +206,14 @@ This evil-collection package includes a lot of other evil based things.
"n" '(:ignore t :which-key "notes") "n" '(:ignore t :which-key "notes")
"bs" '(consult-buffer :which-key "buffer search") "bs" '(consult-buffer :which-key "buffer search")
"bd" '(kill-this-buffer :which-key "kill buffer") "bd" '(kill-this-buffer :which-key "kill buffer")
"nf" '(org-roam-find-file :which-key "org roam ff")
"tt" '(consult-theme :which-key "choose theme") "tt" '(consult-theme :which-key "choose theme")
"ff" '(find-file :which-key "find file") "ff" '(find-file :which-key "find file")
"fr" '(consult-recent-file :which-key "recent file") "fr" '(consult-recent-file :which-key "recent file")
"fs" '(save-buffer :which-key "save") "fs" '(save-buffer :which-key "save")
"hf" '(helpful-callable :which-key "describe-function") "hf" '(helpful-function :which-key "describe-function")
"hv" '(helpful-variable :which-key "describe-variable") "hv" '(helpful-variable :which-key "describe-variable")
"hk" '(helpful-key :which-key "describe-key")
"hi" '(info :which-key "info manual")
"od" '(dired-jump :which-key "dired jump") "od" '(dired-jump :which-key "dired jump")
"ss" '(consult-line :which-key "consult search") "ss" '(consult-line :which-key "consult search")
"ww" '(other-window :which-key "other window") "ww" '(other-window :which-key "other window")
@ -218,13 +225,21 @@ This evil-collection package includes a lot of other evil based things.
(use-package evil-escape (use-package evil-escape
:after evil :after evil
:init (evil-escape-mode +1) :init (evil-escape-mode +1)
:config (setq evil-escape-key-sequence "fd")) :config
(setq evil-escape-key-sequence "fd"
evil-escape-delay 0.3))
#+end_src #+end_src
** Undo-Tree ** Undo-Tree
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package undo-tree (use-package undo-tree
:defer 1) :defer 1
:config
(global-undo-tree-mode +1)
:general
(general-def 'normal undo-tree-visualize-mode-map
"j" 'undo-tree-visualize-redo
"k" 'undo-tree-visualize-undo))
#+end_src #+end_src
** Better UI ** Better UI
@ -462,6 +477,9 @@ This is the use-package definition with a lot of customization. Need to setup au
(setq org-imenu-depth 4) (setq org-imenu-depth 4)
(setq org-odt-styles-file "/home/chris/org/style.odt") (setq org-odt-styles-file "/home/chris/org/style.odt")
(setq org-export-with-toc nil)
(setq org-export-with-author nil)
(setq org-todo-keywords (setq org-todo-keywords
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)") '((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))) (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
@ -471,8 +489,8 @@ This is the use-package definition with a lot of customization. Need to setup au
'("/home/chris/org/DMPREADME.org" "/home/chris/org/DMPTODO.org" "/home/chris/org/inbox.org" "/home/chris/org/notes.org" "/home/chris/org/repetition.org" "/home/chris/org/tasks.org" "/home/chris/org/tfc_plans.org" "/home/chris/org/ministry_team.org" "/home/chris/org/todo.org" "/home/chris/org/newsletter.org")) '("/home/chris/org/DMPREADME.org" "/home/chris/org/DMPTODO.org" "/home/chris/org/inbox.org" "/home/chris/org/notes.org" "/home/chris/org/repetition.org" "/home/chris/org/tasks.org" "/home/chris/org/tfc_plans.org" "/home/chris/org/ministry_team.org" "/home/chris/org/todo.org" "/home/chris/org/newsletter.org"))
(setq org-id-method 'ts) (setq org-id-method 'ts)
:general :general
(chris/leader-keys "o a" 'org-agenda) (chris/leader-keys "o a" 'org-agenda
(chris/leader-keys "c" 'org-capture)) "c" 'org-capture))
#+end_src #+end_src
We need to create a lesson capture function to find our lesson files differently each time we run our TFC plan capture. We need to create a lesson capture function to find our lesson files differently each time we run our TFC plan capture.
@ -537,7 +555,11 @@ We also need to setup some capture templates to use some specific setups with my
("b" "biblical daily" plain #'org-roam-capture--get-point "" ("b" "biblical daily" plain #'org-roam-capture--get-point ""
:immediate-finish t :immediate-finish t
:file-name "%<%Y-%m-%d>-bib" :file-name "%<%Y-%m-%d>-bib"
:head "#+TITLE: %<%Y-%m-%d> - Biblical\n#+AUTHOR: Chris Cochrun")))) :head "#+TITLE: %<%Y-%m-%d> - Biblical\n#+AUTHOR: Chris Cochrun")))
:general
(chris/leader-keys
"nf" '(org-roam-find-file :which-key "org roam ff")
"nr" 'org-roam))
#+END_SRC #+END_SRC
@ -571,6 +593,18 @@ Use magit, because why wouldn't you? duh!
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
#+end_src #+end_src
** PDF-Tools
Let's use pdf-tools for a lot better interaction with pdfs.
#+begin_src emacs-lisp
(use-package pdf-tools
:straight (:host github
:repo "flatwhatson/pdf-tools"
:branch "fix-macros")
:defer 1
:config
(pdf-tools-install))
#+end_src
** Garbage Collection ** Garbage Collection
We set the =gc-cons-threshold= variable to really high, now lets set it back low to make sure emacs performs properly. We set the =gc-cons-threshold= variable to really high, now lets set it back low to make sure emacs performs properly.
@ -578,9 +612,6 @@ We set the =gc-cons-threshold= variable to really high, now lets set it back low
(setq gc-cons-threshold 2000000) (setq gc-cons-threshold 2000000)
#+end_src #+end_src
#+begin_src emacs-lisp
#+end_src
* Early Init * Early Init
:PROPERTIES: :PROPERTIES:
:header-args: emacs-lisp :tangle early-init.el :header-args: emacs-lisp :tangle early-init.el

42
init.el
View file

@ -32,6 +32,8 @@
(display-line-numbers-mode +1) (display-line-numbers-mode +1)
(global-visual-line-mode +1) (global-visual-line-mode +1)
(setq doc-view-resolution 192)
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(defvar bootstrap-version) (defvar bootstrap-version)
@ -115,13 +117,14 @@
"n" '(:ignore t :which-key "notes") "n" '(:ignore t :which-key "notes")
"bs" '(consult-buffer :which-key "buffer search") "bs" '(consult-buffer :which-key "buffer search")
"bd" '(kill-this-buffer :which-key "kill buffer") "bd" '(kill-this-buffer :which-key "kill buffer")
"nf" '(org-roam-find-file :which-key "org roam ff")
"tt" '(consult-theme :which-key "choose theme") "tt" '(consult-theme :which-key "choose theme")
"ff" '(find-file :which-key "find file") "ff" '(find-file :which-key "find file")
"fr" '(consult-recent-file :which-key "recent file") "fr" '(consult-recent-file :which-key "recent file")
"fs" '(save-buffer :which-key "save") "fs" '(save-buffer :which-key "save")
"hf" '(helpful-callable :which-key "describe-function") "hf" '(helpful-function :which-key "describe-function")
"hv" '(helpful-variable :which-key "describe-variable") "hv" '(helpful-variable :which-key "describe-variable")
"hk" '(helpful-key :which-key "describe-key")
"hi" '(info :which-key "info manual")
"od" '(dired-jump :which-key "dired jump") "od" '(dired-jump :which-key "dired jump")
"ss" '(consult-line :which-key "consult search") "ss" '(consult-line :which-key "consult search")
"ww" '(other-window :which-key "other window") "ww" '(other-window :which-key "other window")
@ -131,10 +134,18 @@
(use-package evil-escape (use-package evil-escape
:after evil :after evil
:init (evil-escape-mode +1) :init (evil-escape-mode +1)
:config (setq evil-escape-key-sequence "fd")) :config
(setq evil-escape-key-sequence "fd"
evil-escape-delay 0.3))
(use-package undo-tree (use-package undo-tree
:defer 1) :defer 1
:config
(global-undo-tree-mode +1)
:general
(general-def 'normal undo-tree-visualize-mode-map
"j" 'undo-tree-visualize-redo
"k" 'undo-tree-visualize-undo))
(use-package olivetti (use-package olivetti
:after org :after org
@ -265,6 +276,9 @@
(setq org-imenu-depth 4) (setq org-imenu-depth 4)
(setq org-odt-styles-file "/home/chris/org/style.odt") (setq org-odt-styles-file "/home/chris/org/style.odt")
(setq org-export-with-toc nil)
(setq org-export-with-author nil)
(setq org-todo-keywords (setq org-todo-keywords
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)") '((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))) (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
@ -274,8 +288,8 @@
'("/home/chris/org/DMPREADME.org" "/home/chris/org/DMPTODO.org" "/home/chris/org/inbox.org" "/home/chris/org/notes.org" "/home/chris/org/repetition.org" "/home/chris/org/tasks.org" "/home/chris/org/tfc_plans.org" "/home/chris/org/ministry_team.org" "/home/chris/org/todo.org" "/home/chris/org/newsletter.org")) '("/home/chris/org/DMPREADME.org" "/home/chris/org/DMPTODO.org" "/home/chris/org/inbox.org" "/home/chris/org/notes.org" "/home/chris/org/repetition.org" "/home/chris/org/tasks.org" "/home/chris/org/tfc_plans.org" "/home/chris/org/ministry_team.org" "/home/chris/org/todo.org" "/home/chris/org/newsletter.org"))
(setq org-id-method 'ts) (setq org-id-method 'ts)
:general :general
(chris/leader-keys "o a" 'org-agenda) (chris/leader-keys "o a" 'org-agenda
(chris/leader-keys "c" 'org-capture)) "c" 'org-capture))
(defun chris/org-roam-capture-lesson-file () (defun chris/org-roam-capture-lesson-file ()
"Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion" "Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion"
@ -327,7 +341,11 @@
("b" "biblical daily" plain #'org-roam-capture--get-point "" ("b" "biblical daily" plain #'org-roam-capture--get-point ""
:immediate-finish t :immediate-finish t
:file-name "%<%Y-%m-%d>-bib" :file-name "%<%Y-%m-%d>-bib"
:head "#+TITLE: %<%Y-%m-%d> - Biblical\n#+AUTHOR: Chris Cochrun")))) :head "#+TITLE: %<%Y-%m-%d> - Biblical\n#+AUTHOR: Chris Cochrun")))
:general
(chris/leader-keys
"nf" '(org-roam-find-file :which-key "org roam ff")
"nr" 'org-roam))
(use-package org-roam-server (use-package org-roam-server
:config :config
@ -350,6 +368,12 @@
:custom :custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
(use-package pdf-tools
:straight (:host github
:repo "flatwhatson/pdf-tools"
:branch "fix-macros")
:defer 1
:config
(pdf-tools-install))
(setq gc-cons-threshold 2000000) (setq gc-cons-threshold 2000000)