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)
;; Set colours for priorities
(setq org-priority-faces '((?A . (:foreground "#CC241D"))
(?B . (:foreground "#D65D0E"))
(?C . (:foreground "#D79921"))))
(setq org-priority-faces '((?A . (:foreground "#FB4934"))
(?B . (:foreground "#FABD2F"))
(?C . (:foreground "#98971A"))))
;; Open agenda in current window
(setq org-agenda-window-setup 'current-window)
@ -1154,38 +1154,43 @@ Ressources:
- https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/
#+begin_src emacs-lisp
(after! org-ref
;; 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-bibliography-notes "~/Cloud/thesis/ressources/notes")
(use-package! org-ref
:after org
:init
:config
;; 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-bibliography-notes "~/Cloud/thesis/ressources/notes")
;; Bibliography File
(setq reftex-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
(setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
;; Bibliography File
(setq reftex-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
(setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
;; Folder where all the pdf are located
(setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs")
;; Folder where all the pdf are located
(setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs")
;; Tell org-ref to let helm-bibtex find notes for it
(setq org-ref-notes-function
(lambda (thekey)
(let ((bibtex-completion-bibliography (org-ref-find-bibliography)))
(bibtex-completion-edit-notes
(list (car (org-ref-get-bibtex-key-and-file thekey)))))))
;; Tell org-ref to let helm-bibtex find notes for it
(setq org-ref-notes-function
(lambda (thekey)
(let ((bibtex-completion-bibliography (org-ref-find-bibliography)))
(bibtex-completion-edit-notes
(list (car (org-ref-get-bibtex-key-and-file thekey)))))))
;; Problem with speed: don't display broken links
(setq org-ref-show-broken-links t)
;; Display information on the citation
(setq org-ref-show-citation-on-enter t)
(bibtex-set-dialect 'BibTeX)
)
;; Problem with speed: don't display broken links
(setq org-ref-show-broken-links t)
;; Display information on the citation
(setq org-ref-show-citation-on-enter t)
)
#+end_src
** Org Noter
- https://github.com/weirdNox/org-noter
#+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-kill-frame-at-session-end nil)
;; Fraction of the frame that the document window will occupy when split
@ -1417,31 +1422,24 @@ when inside a source block. Otherwise, keep the normal behavior for ctrl-ent.
(defun tdh/ctrl-ret ()
(interactive)
(defun in-src-block-p ()
"Returns t when the point is inside a source code block"
(string= "src" (org-in-block-p '("src"))))
"Returns t when the point is inside a source code block"
(string= "src" (org-in-block-p '("src"))))
(defun in-src-block-function ()
"Function to do when inside the src block"
(progn
(org-babel-execute-src-block)
(org-babel-next-src-block)))
"Function to do when inside the src block"
(progn
(org-babel-execute-src-block)
(org-babel-next-src-block)))
(if (in-src-block-p)
(in-src-block-function)
(+org--insert-item 'below)))
(+org--insert-item 'below)))
(after! org
(map! :map evil-org-mode-map
:n "<C-return>" #'tdh/ctrl-ret))
(map! :after evil-org
:map evil-org-mode-map
:n "<C-return>" #'tdh/ctrl-ret)
#+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
(defun tdh/ctrl-shit-ret ()
(interactive)
@ -1453,11 +1451,14 @@ https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-blo
(tdh/org-babel-execute-goto-next)
(+org/insert-item-above)))
(after! org
(map! :map evil-org-mode-map
:n "<C-S-return>" #'tdh/ctrl-shit-ret))
(map! :after evil-org
:map evil-org-mode-map
:n "<C-S-return>" #'tdh/ctrl-shit-ret)
#+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
#+begin_src emacs-lisp
(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
*** Map Custom functions
#+begin_src emacs-lisp
(after! org
(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)
#+end_src
** Pdf Viewer
** PDF Viewer
#+begin_src emacs-lisp
(setq TeX-view-program-selection '((output-pdf "Zathura")))
(setq TeX-source-correlate-mode t)
@ -1716,85 +1716,94 @@ Actually this tangle the file and then go to the file. Maybe I would like to ign
'(("PDF Tools" TeX-pdf-tools-sync-view)))
#+end_src
** Bibtex
#+begin_src emacs-lisp
(after! bibtex
(bibtex-set-dialect 'BibTeX))
#+end_src
* Helm-Bibtex
** General Config
#+begin_src emacs-lisp
;; Use "tags" field when looking for bib entries
(setq helm-bibtex-additional-search-fields '(tags))
(use-package! helm-bibtex
:init
:config
;; Bibliography file
(setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib")
;; Display of bibtex entries with helm
(setq bibtex-completion-display-formats
'((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
;; Directory with all the pdfs
(setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs")
;; Special symbols for notes and pdf
(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
;; Directory with notes files
(setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes")
;; Bibliography file
(setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib")
;; Use "tags" field when looking for bib entries
(setq helm-bibtex-additional-search-fields '(tags))
;; Directory with all the pdfs
(setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs")
(setq helm-bibtex-full-frame nil)
;; Directory with notes files
(setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes")
;; Display of bibtex entries with helm
(setq bibtex-completion-display-formats
'((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
;; Template used when creating new Note file
(setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n"
":DRAWER:\n"
"#+LATEX_CLASS: biblioreport\n"
"\n"
"#+OPTIONS: toc:nil title:nil\n"
"#+OPTIONS: ':t -:t\n"
"\n"
"#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"
"#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"
"#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"
"#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"
"#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"
"#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"
"#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"
"#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"
"#+LATEX_HEADER: \\newcommand{\\refKeywords}{${tags}}\n"
"#+LATEX_HEADER: \\input{config.tex}\n"
"#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"
"# #+TOC: headlines 2\n"
":END:\n"
"\n"
"#+BEGIN_abstract\n"
"\n"
"#+END_abstract\n"
"\n"
"* ${title} :ignore:\n"
":PROPERTIES:\n"
":CUSTOM_ID: ${=key=}\n"
":AUTHOR: ${author}\n"
":TYPE: ${=type=}\n"
":JOURNAL: ${journal}\n"
":YEAR: ${year}\n"
":VOLUME: ${volume}\n"
":PAGES: ${pages}\n"
":DOI: ${DOI}\n"
":URL: ${url}\n"
":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
":END:\n"
"\n"))
;; Special symbols for notes and pdf
(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
;; Make "Edit notes" the default action
(after! helm-bibtex
;; Template used when creating new Note file
(setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n"
":DRAWER:\n"
"#+LATEX_CLASS: biblioreport\n"
"\n"
"#+OPTIONS: toc:nil title:nil\n"
"#+OPTIONS: ':t -:t\n"
"\n"
"#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"
"#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"
"#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"
"#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"
"#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"
"#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"
"#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"
"#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"
"#+LATEX_HEADER: \\newcommand{\\refKeywords}{${tags}}\n"
"#+LATEX_HEADER: \\input{config.tex}\n"
"#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"
"# #+TOC: headlines 2\n"
":END:\n"
"\n"
"#+BEGIN_abstract\n"
"\n"
"#+END_abstract\n"
"\n"
"* ${title} :ignore:\n"
":PROPERTIES:\n"
":CUSTOM_ID: ${=key=}\n"
":AUTHOR: ${author}\n"
":TYPE: ${=type=}\n"
":JOURNAL: ${journal}\n"
":YEAR: ${year}\n"
":VOLUME: ${volume}\n"
":PAGES: ${pages}\n"
":DOI: ${DOI}\n"
":URL: ${url}\n"
":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
":END:\n"
"\n"))
;; Make "Edit notes" the default action
(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
** Open pdf externally
#+begin_src emacs-lisp
;; Action to open the pdf with Zathura
(defun tdehaeze/open-pdf-externally (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
** Special Commands
@ -2279,81 +2288,87 @@ they are implemented.
:END:
#+begin_src emacs-lisp
(doom! :completion
company ; the ultimate code completion backend
helm ; the *other* search engine for love and life
ivy ; a search engine for love and life
(when noninteractive
(after! undo-tree
(global-undo-tree-mode -1)))
:ui
doom ; what makes DOOM look the way it does
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
hydra
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink the current line after jumping
ophints ; highlight the region an operation acts on
(popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix
+defaults) ; default popup rules
unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
(doom! :completion
company ; the ultimate code completion backend
helm ; the *other* search engine for love and life
ivy ; a search engine for love and life
:editor
(evil +everywhere); come to the dark side, we have cookies
fold ; (nigh) universal code folding
rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:ui
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
hydra
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink the current line after jumping
ophints ; highlight the region an operation acts on
(popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix
+defaults) ; default popup rules
unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
ibuffer ; interactive buffer management
vc ; version-control and Emacs, sitting in a tree
:editor
(evil +everywhere); come to the dark side, we have cookies
fold ; (nigh) universal code folding
rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:term
eshell ; a consistent, cross-platform shell (WIP)
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
ibuffer ; interactive buffer management
vc ; version-control and Emacs, sitting in a tree
:tools
debugger ; FIXME stepping through code, to help you add bugs
(eval +overlay) ; run code, run (also, repls)
(lookup ; helps you navigate your code and documentation
+docsets) ; ...or in Dash docsets locally
;;lsp
magit ; a git porcelain for Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
:term
eshell ; a consistent, cross-platform shell (WIP)
:checkers
syntax ; tasing you for every semicolon you forget
spell ; tasing you for misspelling mispelling
:tools
debugger ; Stepping through code, to help you add bugs
(eval +overlay) ; run code, run (also, repls)
(lookup ; helps you navigate your code and documentation
+docsets) ; ...or in Dash docsets locally
;;lsp
magit ; a git porcelain for Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
:lang
data ; config/data formats
emacs-lisp ; drown in parentheses
latex ; writing papers in Emacs has never been so fun
markdown ; writing docs for people to ignore
(org ; organize your plain life in plain text
+dragndrop ; drag & drop files/images into org buffers
+hugo ; use Emacs for hugo blogging
+journal ;
+present) ; using org-mode for presentations
;;python ; beautiful is better than ugly
sh ; she sells {ba,z,fi}sh shells on the C xor
:checkers
syntax ; tasing you for every semicolon you forget
spell ; tasing you for misspelling mispelling
:email
;;(mu4e +gmail)
:lang
data ; config/data formats
emacs-lisp ; drown in parentheses
latex ; writing papers in Emacs has never been so fun
markdown ; writing docs for people to ignore
(org ; organize your plain life in plain text
+dragndrop ; drag & drop files/images into org buffers
+hugo ; use Emacs for hugo blogging
+journal ;
+pomodoro ;
+present) ; using org-mode for presentations
;;python ; beautiful is better than ugly
sh ; she sells {ba,z,fi}sh shells on the C xor
:app
;;calendar
;;(rss +org) ; emacs as an RSS reader
;;write ; emacs for writers (fiction, notes, papers, etc.)
:email
;;(mu4e +gmail)
:config
literate
(default +bindings +smartparens))
:app
calendar
;;(rss +org) ; emacs as an RSS reader
;;write ; emacs for writers (fiction, notes, papers, etc.)
:config
literate
(default +bindings +smartparens))
#+end_src
* Doom =packages.el=
@ -2371,6 +2386,8 @@ they are implemented.
(package! matlab-mode
:recipe (:host github :repo "matlab-mode/mirror"))
(package! org-ref)
(package! org-ql)
(package! org-fancy-priorities)
#+end_src
* Snippets
@ -2661,13 +2678,13 @@ $0
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
#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")
<<plt-matlab>>$0
,#+end_src
#+NAME: fig:$1
#+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}
#+name: fig:$1
#+caption: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}
[[file:$2/$1.png]]
#+end_src