Use =use-package= instead of =after=

This commit is contained in:
Thomas Dehaeze 2020-02-14 16:08:11 +01:00
parent ed7ac9bf25
commit c5a22c5585

View File

@ -430,9 +430,9 @@ https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb
(setq org-default-priority ?C) (setq org-default-priority ?C)
;; Set colours for priorities ;; Set colours for priorities
(setq org-priority-faces '((?A . (:foreground "#CC241D")) (setq org-priority-faces '((?A . (:foreground "#FB4934"))
(?B . (:foreground "#D65D0E")) (?B . (:foreground "#FABD2F"))
(?C . (:foreground "#D79921")))) (?C . (:foreground "#98971A"))))
;; Open agenda in current window ;; Open agenda in current window
(setq org-agenda-window-setup 'current-window) (setq org-agenda-window-setup 'current-window)
@ -1154,7 +1154,10 @@ Ressources:
- https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/ - https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org-ref (use-package! org-ref
:after org
:init
:config
;; Folder where the notes files are located (or file if just one Note file) ;; Folder where the notes files are located (or file if just one Note file)
(setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes") (setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes")
(setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes") (setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes")
@ -1177,7 +1180,6 @@ Ressources:
(setq org-ref-show-broken-links t) (setq org-ref-show-broken-links t)
;; Display information on the citation ;; Display information on the citation
(setq org-ref-show-citation-on-enter t) (setq org-ref-show-citation-on-enter t)
(bibtex-set-dialect 'BibTeX)
) )
#+end_src #+end_src
@ -1185,7 +1187,10 @@ Ressources:
- https://github.com/weirdNox/org-noter - https://github.com/weirdNox/org-noter
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org-noter (use-package! org-noter
:after org
:init
:config
(setq org-noter-always-create-frame nil) (setq org-noter-always-create-frame nil)
(setq org-noter-kill-frame-at-session-end nil) (setq org-noter-kill-frame-at-session-end nil)
;; Fraction of the frame that the document window will occupy when split ;; Fraction of the frame that the document window will occupy when split
@ -1430,18 +1435,11 @@ when inside a source block. Otherwise, keep the normal behavior for ctrl-ent.
(in-src-block-function) (in-src-block-function)
(+org--insert-item 'below))) (+org--insert-item 'below)))
(after! org (map! :after evil-org
(map! :map evil-org-mode-map :map evil-org-mode-map
:n "<C-return>" #'tdh/ctrl-ret)) :n "<C-return>" #'tdh/ctrl-ret)
#+end_src #+end_src
#+begin_src emacs-lisp
;; (evil-define-minor-mode-key 'normal 'org-src-mode "q" 'org-edit-src-exit)
#+end_src
Remap =C-c C-c=:
https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun tdh/ctrl-shit-ret () (defun tdh/ctrl-shit-ret ()
(interactive) (interactive)
@ -1453,11 +1451,14 @@ https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-blo
(tdh/org-babel-execute-goto-next) (tdh/org-babel-execute-goto-next)
(+org/insert-item-above))) (+org/insert-item-above)))
(after! org (map! :after evil-org
(map! :map evil-org-mode-map :map evil-org-mode-map
:n "<C-S-return>" #'tdh/ctrl-shit-ret)) :n "<C-S-return>" #'tdh/ctrl-shit-ret)
#+end_src #+end_src
Remap =C-c C-c=:
https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530
** Org-Babel Matlab ** Org-Babel Matlab
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org (after! org
@ -1672,7 +1673,6 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
#+end_src #+end_src
*** Map Custom functions *** Map Custom functions
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org (after! org
(map! :map org-mode-map :n ",bT" 'tdh/org-babel-tangle-subtree) (map! :map org-mode-map :n ",bT" 'tdh/org-babel-tangle-subtree)
@ -1706,7 +1706,7 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
(setq-default TeX-master nil) (setq-default TeX-master nil)
#+end_src #+end_src
** Pdf Viewer ** PDF Viewer
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq TeX-view-program-selection '((output-pdf "Zathura"))) (setq TeX-view-program-selection '((output-pdf "Zathura")))
(setq TeX-source-correlate-mode t) (setq TeX-source-correlate-mode t)
@ -1716,20 +1716,18 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
'(("PDF Tools" TeX-pdf-tools-sync-view))) '(("PDF Tools" TeX-pdf-tools-sync-view)))
#+end_src #+end_src
** Bibtex
#+begin_src emacs-lisp
(after! bibtex
(bibtex-set-dialect 'BibTeX))
#+end_src
* Helm-Bibtex * Helm-Bibtex
** General Config ** General Config
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Use "tags" field when looking for bib entries (use-package! helm-bibtex
(setq helm-bibtex-additional-search-fields '(tags)) :init
:config
;; Display of bibtex entries with helm
(setq bibtex-completion-display-formats
'((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
;; Special symbols for notes and pdf
(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
;; Bibliography file ;; Bibliography file
(setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib") (setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib")
@ -1739,6 +1737,19 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
;; Directory with notes files ;; Directory with notes files
(setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes") (setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes")
;; Use "tags" field when looking for bib entries
(setq helm-bibtex-additional-search-fields '(tags))
(setq helm-bibtex-full-frame nil)
;; Display of bibtex entries with helm
(setq bibtex-completion-display-formats
'((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
;; Special symbols for notes and pdf
(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
;; Template used when creating new Note file ;; Template used when creating new Note file
(setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n" (setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n"
":DRAWER:\n" ":DRAWER:\n"
@ -1779,22 +1790,20 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n" ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
":END:\n" ":END:\n"
"\n")) "\n"))
;; Make "Edit notes" the default action ;; Make "Edit notes" the default action
(after! helm-bibtex
(helm-delete-action-from-source "Edit notes" helm-source-bibtex) (helm-delete-action-from-source "Edit notes" helm-source-bibtex)
(helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0)) (helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0)
(helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex)
(helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1)
)
#+end_src #+end_src
** Open pdf externally ** Open pdf externally
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Action to open the pdf with Zathura
(defun tdehaeze/open-pdf-externally (key) (defun tdehaeze/open-pdf-externally (key)
(call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key))))) (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
;; Action to open the pdf with Zathura
(after! helm-bibtex
(helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex)
(helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1))
#+end_src #+end_src
** Special Commands ** Special Commands
@ -2279,6 +2288,10 @@ they are implemented.
:END: :END:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when noninteractive
(after! undo-tree
(global-undo-tree-mode -1)))
(doom! :completion (doom! :completion
company ; the ultimate code completion backend company ; the ultimate code completion backend
helm ; the *other* search engine for love and life helm ; the *other* search engine for love and life
@ -2286,6 +2299,7 @@ they are implemented.
:ui :ui
doom ; what makes DOOM look the way it does doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
hydra hydra
modeline ; snazzy, Atom-inspired modeline, plus API modeline ; snazzy, Atom-inspired modeline, plus API
@ -2317,7 +2331,7 @@ they are implemented.
eshell ; a consistent, cross-platform shell (WIP) eshell ; a consistent, cross-platform shell (WIP)
:tools :tools
debugger ; FIXME stepping through code, to help you add bugs debugger ; Stepping through code, to help you add bugs
(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
(lookup ; helps you navigate your code and documentation (lookup ; helps you navigate your code and documentation
+docsets) ; ...or in Dash docsets locally +docsets) ; ...or in Dash docsets locally
@ -2339,6 +2353,7 @@ they are implemented.
+dragndrop ; drag & drop files/images into org buffers +dragndrop ; drag & drop files/images into org buffers
+hugo ; use Emacs for hugo blogging +hugo ; use Emacs for hugo blogging
+journal ; +journal ;
+pomodoro ;
+present) ; using org-mode for presentations +present) ; using org-mode for presentations
;;python ; beautiful is better than ugly ;;python ; beautiful is better than ugly
sh ; she sells {ba,z,fi}sh shells on the C xor sh ; she sells {ba,z,fi}sh shells on the C xor
@ -2347,7 +2362,7 @@ they are implemented.
;;(mu4e +gmail) ;;(mu4e +gmail)
:app :app
;;calendar calendar
;;(rss +org) ; emacs as an RSS reader ;;(rss +org) ; emacs as an RSS reader
;;write ; emacs for writers (fiction, notes, papers, etc.) ;;write ; emacs for writers (fiction, notes, papers, etc.)
@ -2371,6 +2386,8 @@ they are implemented.
(package! matlab-mode (package! matlab-mode
:recipe (:host github :repo "matlab-mode/mirror")) :recipe (:host github :repo "matlab-mode/mirror"))
(package! org-ref) (package! org-ref)
(package! org-ql)
(package! org-fancy-priorities)
#+end_src #+end_src
* Snippets * Snippets
@ -2661,13 +2678,13 @@ $0
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com> #contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
#name :Matlab-Figure #name :Matlab-Figure
# -- # --
#+HEADER: :tangle no :exports results :results none :noweb yes #+header: :tangle no :exports results :results none :noweb yes
,#+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png") ,#+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png")
<<plt-matlab>>$0 <<plt-matlab>>$0
,#+end_src ,#+end_src
#+NAME: fig:$1 #+name: fig:$1
#+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])} #+caption: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}
[[file:$2/$1.png]] [[file:$2/$1.png]]
#+end_src #+end_src