Update emacs config

This commit is contained in:
Thomas Dehaeze 2022-05-09 10:29:00 +02:00
parent 075f233156
commit aae57a4654

View File

@ -404,10 +404,12 @@ Disable flycheck for now with orgmode buffers:
** Tramp ** Tramp
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! tramp
(add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_EMAIL=thomas.dehaeze@esrf.fr") (add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_EMAIL=thomas.dehaeze@esrf.fr")
(add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_NAME='Thomas Dehaeze'") (add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_NAME='Thomas Dehaeze'")
(add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL=thomas.dehaeze@esrf.fr") (add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL=thomas.dehaeze@esrf.fr")
(add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL='Thomas Dehaeze'") (add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL='Thomas Dehaeze'")
)
#+end_src #+end_src
** Others ** Others
@ -502,34 +504,28 @@ Display the real size of images and not the one set with =attr_latex: :width \li
) )
#+end_src #+end_src
** Org TODO ** TODO Org TODO
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org (after! org
;; Tags with fast selection keys ;; Tags with fast selection keys
(setq org-todo-keywords '( (setq org-todo-keywords '(
(sequence "TODO(t)" "NEXT(n)" "MAIL(m)" "|" "DONE(d)") (sequence "TODO(t)" "MAIL(m)" "|" "DONE(d)")
(sequence "READ(r)" "BKMK(b)" "EXER(x)" "|" "DONE(d)") (sequence "READ(r)" "|" "DONE(d)")
(sequence "WAIT(w@/!)" "SDAY(s)" "|" "CANC(c@/!)") (sequence "WAIT(w@/!)" "DELE(e)" "|" "CANC(c@/!)")
(sequence "QUES(q)" "|" "ANSW(a)") (sequence "QUES(q)" "|" "ANSW(a)")
(sequence "EXAM(e)" "IDEA(i)" "|")
)) ))
;; Display of the keywords ;; Display of the keywords
(setq org-todo-keyword-faces (setq org-todo-keyword-faces
'(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red '(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red
("EXER" . (:foreground "#cc241d" :weight bold)) ;; red
("NEXT" . (:foreground "#cc241d" :weight bold)) ;; red
("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red ("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red
("READ" . (:foreground "#cc241d" :weight bold)) ;; red ("READ" . (:foreground "#cc241d" :weight bold)) ;; red
("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua ("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua
("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua ("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua
("QUES" . (:foreground "#d65d0e" :weight bold)) ;; orange
("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange ("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange
("QUES" . (:foreground "#d79921" :weight bold)) ;; yellow
("CANC" . (:foreground "#a89984" :weight bold)) ;; grey ("CANC" . (:foreground "#a89984" :weight bold)) ;; grey
("SDAY" . (:foreground "#98971a" :weight bold)) ;; green ("DELE" . (:foreground "#98971a" :weight bold)))) ;; green
("BKMK" . (:foreground "#98971a" :weight bold)) ;; green
("IDEA" . (:foreground "#98971a" :weight bold)) ;; green
("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
) )
#+end_src #+end_src
@ -713,6 +709,36 @@ Org Agenda Custom Views
) )
#+end_src #+end_src
** Synchronize Agenda with ICS
https://200ok.ch/posts/2022-02-13_integrating_org_mode_agenda_into_other_calendar_apps.html
#+begin_src emacs-lisp :tangle no
;; Setting variables for the ics file path
(setq org-agenda-private-local-path "~/.calendars/radicale/d2ff3f82-9cdb-7e0c-ec9e-5887da0993f4/dummy.ics")
;; Define a custom command to save the org agenda to a file
(setq org-agenda-custom-commands
`(("X" agenda "" nil ,(list org-agenda-private-local-path))))
(defun org-agenda-export-to-ics ()
(setq org-agenda-files (list "~/Cloud/org/"))
;; Run all custom agenda commands that have a file argument.
(org-batch-store-agenda-views)
;; Org mode correctly exports TODO keywords as VTODO events in ICS.
;; However, some proprietary calendars do not really work with
;; standards (looking at you Google), so VTODO is ignored and only
;; VEVENT is read.
(with-current-buffer (find-file-noselect org-agenda-private-local-path)
(goto-char (point-min))
(save-buffer)))
#+end_src
Then, use:
#+begin_src emacs-lisp :tangle no
(org-agenda-export-to-ics)
#+end_src
** TODO Org Agenda HTML ** TODO Org Agenda HTML
This function can be used to export the week calendar to html. This function can be used to export the week calendar to html.
This html page can be used as a starting page for the browser. This html page can be used as a starting page for the browser.
@ -1953,8 +1979,8 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c
:ni "C-c F" 'tdh-insert-link-to-previous-figure) :ni "C-c F" 'tdh-insert-link-to-previous-figure)
(:desc "Insert Screenshot" (:desc "Insert Screenshot"
:ni "C-c s" 'tdh-insert-screenshot-org-link) :ni "C-c s" 'tdh-insert-screenshot-org-link)
(:desc "Insert Roam" (:desc "Insert Screenshot"
:ni "C-c R" 'orb-insert-non-ref) :ni "C-c R" 'org-roam-node-find)
)) ))
#+end_src #+end_src
@ -2678,6 +2704,16 @@ Nice Functions:
(use-package! org-ref (use-package! org-ref
:after org :after org
:init :init
(with-eval-after-load 'ox
(defun my/org-ref-process-buffer--html (backend)
"Preprocess `org-ref' citations to HTML format.
Do this only if the export backend is `html' or a derivative of
that."
;; `ox-hugo' is derived indirectly from `ox-html'.
;; ox-hugo <- ox-blackfriday <- ox-md <- ox-html
(when (org-export-derived-backend-p backend 'html)
(org-ref-process-buffer 'html)))
(add-to-list 'org-export-before-parsing-hook #'my/org-ref-process-buffer--html))
:config :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 bibtex-completion-notes-path "~/Cloud/brain/") (setq bibtex-completion-notes-path "~/Cloud/brain/")
@ -2802,8 +2838,8 @@ Nice Functions:
:NOTER_DOCUMENT: ../pdfs/%^{citekey}.pdf :NOTER_DOCUMENT: ../pdfs/%^{citekey}.pdf
:END: :END:
,* Bibliography :ignore: ,* Bibliography
,#+BIBLIOGRAPHY: here bibliography:./biblio/references.bib
#+end_src #+end_src
*** Default *** Default
@ -2812,8 +2848,8 @@ Nice Functions:
%? %?
,* Bibliography :ignore: ,* Bibliography
,#+BIBLIOGRAPHY: here bibliography:./biblio/references.bib
#+end_src #+end_src
** Org Roam ([[https://github.com/jethrokuan/org-roam/][link]]) ** Org Roam ([[https://github.com/jethrokuan/org-roam/][link]])
@ -2863,7 +2899,7 @@ Re-Export all roam files.
(defun tdh-org-roam-export-all () (defun tdh-org-roam-export-all ()
"Re-exports all Org-roam files to Hugo markdown." "Re-exports all Org-roam files to Hugo markdown."
(interactive) (interactive)
(dolist (f (org-roam--list-all-files)) (dolist (f (org-roam--list-files "~/Cloud/brain/"))
(with-current-buffer (find-file f) (with-current-buffer (find-file f)
(when (s-contains? "SETUPFILE" (buffer-string)) (when (s-contains? "SETUPFILE" (buffer-string))
(org-hugo-export-wim-to-md))))) (org-hugo-export-wim-to-md)))))
@ -3375,6 +3411,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf
+all ; catch all popups that start with an asterix +all ; catch all popups that start with an asterix
+defaults) ; default popup rules +defaults) ; default popup rules
unicode ; extended unicode support for various languages unicode ; extended unicode support for various languages
indent-guides
vc-gutter ; vcs diff in the fringe vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
@ -3467,6 +3504,12 @@ Choose account label to feed msmtp -a option based on From header in Message buf
:files ("resources" "*.el"))) :files ("resources" "*.el")))
#+end_src #+end_src
#+begin_src emacs-lisp
(package! yasnippet-radical-snippets
:recipe (:host github :repo "Xaldew/yasnippet-radical-snippets"
:files (:defaults "snippets" "yasnippet-radical-snippets.el")))
#+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(package! igo-org (package! igo-org
:recipe (:host github :recipe (:host github