From 99c08e560c8d24693246100735c2e6fc990cbe94 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sat, 8 Oct 2022 10:58:27 +0200 Subject: [PATCH] up config org --- assets/org/config.org | 802 ++++++++++++++++++++++-------------------- 1 file changed, 419 insertions(+), 383 deletions(-) diff --git a/assets/org/config.org b/assets/org/config.org index 4d344936..6d7463c2 100755 --- a/assets/org/config.org +++ b/assets/org/config.org @@ -6,20 +6,22 @@ * Ma config emacs - Voici la documentation au format Orgmode de ma configuration d'Emacs. Pour que cela fonctionne, il faut demander au fichier de config dans le dossier utilisateur, le fichier ".emacs" débutant par un point, de charger ce fichier config.org. + Voici la documentation au format Orgmode de ma configuration d'Emacs. Pour que cela fonctionne, il faut demander au fichier de config dans le dossier utilisateur, le fichier "~/.emacs" débutant par un point, de l'actuel fichier config.org. -J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souvent des mentions à ce dossier dans la config. Ma liste d0s tâches [[file:tasks.org]] pour la gestion de projets se compose d'un fichier principal et de quelques autres. +J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souvent des mentions à ce dossier dans la config. Ma liste de tâches [[file:tasks.org]] pour la gestion de projets se compose d'un fichier principal et de quelques autres. Les réunions ont leur propre fichier, le journal aussi. Fichiers souvent utiles: - file:/home/tykayn/Nextcloud/textes/orgmode/tasks.org - [[file:reunions.org]]. - [[file:journal.org]]. - [[id:d8636e1d-0137-4502-9384-767b41c892b0][boulot]] - - [[id:c1c19fdf-ccab-4d78-b191-dbe0f8c66609][lemonway]] + - [[id:c1c19fdf-ccab-4d78-b191-dbe0f8c66609][lemonway]] Contenu du fichier de config [[file:~/.emacs]] #+begin_quote ;; straight el bootstrap https://github.com/raxod502/straight.el#getting-started + + (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) @@ -39,9 +41,7 @@ Contenu du fichier de config [[file:~/.emacs]] (setq package-enable-at-startup nil) (use-package org) - - - (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") +(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") (org-babel-load-file "~/Nextcloud/textes/orgmode/config.org") @@ -49,7 +49,6 @@ Contenu du fichier de config [[file:~/.emacs]] * Introduction Ma configuration d'Emacs. Voir la doc personnelle des concepts généraux d'[[id:3adc0f02-729a-42fc-ae1f-7c29a1e5b11c][emacs]] ici. - ** Initialisation de cette configuration Pour que cela fonctionne, il faut demander au fichier de config dans le dossier utilisateur, le fichier ".emacs" débutant par un point, de charger ce fichier **config.org**. J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souvent des mentions à ce dossier dans la config. @@ -97,6 +96,7 @@ Contenu du fichier de config [[file:~/.emacs]] (setq org-fontify-whole-heading-line t) (setq org-tags-column 0) (setq org-adapt-indentation t) +;; (setq org-src-preserve-indentation t) (setq org-deadline-warning-days 0) (setq line-move-visual t) ;; Keep tasks with dates on the global todo lists @@ -165,36 +165,41 @@ Contenu du fichier de config [[file:~/.emacs]] #+end_src ** Contextes d'agenda #+begin_src emacs-lisp - (defvar my-org-agenda-contexts - '((tags-todo "phone") - (tags-todo "work") - (tags-todo "drawing") - (tags-todo "coding") - (tags-todo "writing") - (tags-todo "computer") - (tags-todo "home") - (tags-todo "errands")) - "Usual list of contexts.") + (defvar my-org-agenda-contexts + '((tags-todo "phone") + (tags-todo "work") + (tags-todo "drawing") + (tags-todo "coding") + (tags-todo "writing") + (tags-todo "reading") + (tags-todo "computer") + (tags-todo "home") + (tags-todo "santé") + (tags-todo "errands")) + "Usual list of contexts.") + + (setq org-agenda-sorting-strategy + '((agenda tag-up time-up priority-down category-keep) + ;; (todo user-defined-up todo-state-up priority-down effort-up) + (todo todo-state-up priority-down effort-up) + (tags user-defined-up) + (search category-keep))) + (setq org-agenda-cmp-user-defined 'my-org-sort-agenda-items-user-defined) + + + (defun my-org-agenda-list-unscheduled (&rest ignore) + "Create agenda view for tasks that are unscheduled and not done." + (let* ((org-agenda-todo-ignore-with-date t) + (org-agenda-overriding-header "List of unscheduled tasks: ")) + (org-agenda-get-todos))) + (setq org-stuck-projects + '("+PROJECT-MAYBE-DONE" + ("TODO") + nil + "\\")) - (setq org-agenda-sorting-strategy - '((agenda time-up priority-down tag-up category-keep) - ;; (todo user-defined-up todo-state-up priority-down effort-up) - (todo todo-state-up priority-down effort-up) - (tags user-defined-up) - (search category-keep))) - (setq org-agenda-cmp-user-defined 'my-org-sort-agenda-items-user-defined) - (defun my-org-agenda-list-unscheduled (&rest ignore) - "Create agenda view for tasks that are unscheduled and not done." - (let* ((org-agenda-todo-ignore-with-date t) - (org-agenda-overriding-header "List of unscheduled tasks: ")) - (org-agenda-get-todos))) - (setq org-stuck-projects - '("+PROJECT-MAYBE-DONE" - ("TODO") - nil - "\\")) #+end_src ** Séquences de choses à faire @@ -207,10 +212,6 @@ Contenu du fichier de config [[file:~/.emacs]] ;; "TOBLOG(b)" ; next action "WAITING(w@/!)" "SOMEDAY(.)" "BLOCKED(k@/!)" "|" "DONE(x!)" "CANCELLED(c)") - (sequence "PROJECT" "|" "DONE(x)") - (sequence "LEARN" "TRY" "TEACH" "|" "DONE(x)") - ;; (sequence "TOSKETCH" "SKETCHED" "|" "POSTED") - (sequence "TOBUY" "TOSHRINK" "TOCUT" "TOSEW" "|" "DONE(x)") (sequence "TODELEGATE(-)" "DELEGATED(d)" "|" "DONE(x)"))) #+end_src @@ -218,156 +219,184 @@ Contenu du fichier de config [[file:~/.emacs]] #+begin_src emacs-lisp - ;; Custom agenda command definitions -------------------------- - ;; https://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html - - (use-package org-super-agenda) - (use-package org-ql) - - - (bind-key " a" 'org-agenda) - - + ;; Custom agenda command definitions -------------------------- + ;; https://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html + (use-package org-super-agenda) + (use-package org-ql) + (bind-key " a" 'org-agenda) (setq org-return-follows-link t) (setq org-cycle-include-plain-lists 'integrate) + (defun my-org-agenda-skip-scheduled () + (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>")) - - (defun my-org-agenda-skip-scheduled () - (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>")) - - (setq org-agenda-custom-commands - (quote ( - ("a" "Agenda" - ((agenda "" ((org-agenda-span 2))))) - ("c" "Classique Agenda et Todos" - ((agenda "" ((org-agenda-span 2))) - (alltodo - "" - ((org-agenda-overriding-header "") - (org-super-agenda-groups - '((:name "Important, unscheduled" - :and (:priority "A" - :scheduled nil) - :order 2) - (:name "Inbox" - :file-path "Inbox.org" - :order 1) - (:name "Project-related, unscheduled" - :and (:tag "project" :date nil :todo ("STARTED" "WAITING" "TODO")) - :order 3) - (:name "Waiting" - :and (:todo "WAITING" - :scheduled nil) - :order 4) - (:discard (:todo "SOMEDAY" - :category "cooking" - :date t)) - (:name "Unscheduled" - :scheduled nil - :order 5) - (:discard (:anything t)) - ) - ))) - )) - ("x" "Unscheduled, untagged tasks" tags-todo "-someday-TODO=\"SOMEDAY\"-TODO=\"DELEGATED\"-TODO=\"WAITING\"-project-cooking-routine-evilplans-computer-writing-phone-sewing-home-errands-shopping" - ((org-agenda-skip-function 'my-org-agenda-skip-scheduled) - (org-agenda-view-columns-initially nil) - (org-tags-exclude-from-inheritance '("project")) - (org-agenda-overriding-header "Unscheduled TODO entries: ") - (org-columns-default-format "%50ITEM %TODO %3PRIORITY %Effort{:} %TAGS") - (org-agenda-sorting-strategy '(todo-state-up priority-down effort-up tag-up category-keep)))) - - ("b" "Boulot" tags-todo "+boulot") - ("c" "Cancelled" tags-todo "CANCELLED") - ("D" "Done tasks" tags-todo "DONE") - ("g". "GTD Searches") ;; category searches - ("gw" "Weekly review" - agenda "" - ( - (org-agenda-overriding-header "\nRevue hebdomadaire\n------------------\n") - (org-agenda-start-day "-7d") - (org-agenda-span 7) - (org-agenda-start-on-weekday 1) - (org-agenda-start-with-log-mode '(closed)) - (org-agenda-archives-mode t) - (org-agenda-skip-function - '(org-agenda-skip-entry-if 'notregexp "^\\*\\* DONE ") - ) + (setq org-agenda-custom-commands + (quote ( + ("a" "Agenda" + ((agenda "" ((org-agenda-span 2))))) + ("c" "Classique Agenda et Todos" + ((agenda "" ((org-agenda-span 2))) + (alltodo + "" + ((org-agenda-overriding-header "") + (org-super-agenda-groups + '((:name "Important, unscheduled" + :and (:priority "A" + :scheduled nil) + :order 2) + (:name "Inbox" + :file-path "Inbox.org" + :order 1) + (:name "Project-related, unscheduled" + :and (:tag "project" :date nil :todo ("STARTED" "WAITING" "TODO")) + :order 3) + (:name "Waiting" + :and (:todo "WAITING" + :scheduled nil) + :order 4) + (:discard (:todo "SOMEDAY" + :category "cooking" + :date t)) + (:name "Unscheduled" + :scheduled nil + :order 5) + (:discard (:anything t)) ) - ) - ("gW" "Weekly review" agenda "" - ((org-agenda-span 7) - (org-agenda-log-mode 1)) "~/Nextcloud/textes/orgmode/this-week.html") - ("g2" "Bi-weekly review" agenda "" ((org-agenda-span 14) (org-agenda-log-mode 1))) + ))) + )) + ("x" "Unscheduled, untagged tasks" tags-todo "-someday-TODO=\"SOMEDAY\"-TODO=\"DELEGATED\"-TODO=\"WAITING\"-project-cooking-routine-evilplans-computer-writing-phone-sewing-home-errands-shopping" + ((org-agenda-skip-function 'my-org-agenda-skip-scheduled) + (org-agenda-view-columns-initially nil) + (org-tags-exclude-from-inheritance '("project")) + (org-agenda-overriding-header "Unscheduled TODO entries: ") + (org-columns-default-format "%50ITEM %TODO %3PRIORITY %Effort{:} %TAGS") + (org-agenda-sorting-strategy '(todo-state-up priority-down effort-up tag-up category-keep)))) - ("0" "Unestimated tasks" tags-todo "EFFORT=\"\"") - ("5" "Quick tasks" tags-todo "EFFORT>=\"5\"&EFFORT<=\"15\"") - ("8" "Medium tasks" tags-todo "EFFORT>=\"15\"&EFFORT<=\"60\"") - ("9" "Unscheduled top 3 by context" my-org-agenda-contexts - ((org-agenda-skip-function 'my-org-agenda-skip-scheduled) - (org-agenda-sorting-strategy '(priority-down effort-down)) - (org-agenda-max-entries 3))) - - ("p" "By priority" - ((tags-todo "+PRIORITY=\"A\"") - (tags-todo "+PRIORITY=\"B\"") - (tags-todo "+PRIORITY=\"\"") - (tags-todo "+PRIORITY=\"C\"")) - ((org-agenda-prefix-format "%-10c %-10T %e ") - (org-agenda-sorting-strategy '(priority-down tag-up category-keep effort-down)))) - ("P" "Printed paper agenda" - ((agenda "" ((org-agenda-span 7) ;; overview of appointments - (org-agenda-start-on-weekday nil) ;; calendar begins today - (org-agenda-repeating-timestamp-show-all t) - (org-agenda-entry-types '(:timestamp :sexp)))) - (agenda "" ((org-agenda-span 1) ; daily agenda - (org-deadline-warning-days 7) ; 7 day advanced warning for deadlines - (org-agenda-todo-keyword-format "[ ]") - (org-agenda-scheduled-leaders '("" "")) - (org-agenda-prefix-format "%t%s"))) - (todo "TODO" ;; todos sorted by context - ((org-agenda-prefix-format "[ ] %T: ") - (org-agenda-sorting-strategy '(tag-up priority-down)) - (org-agenda-todo-keyword-format "") - (org-agenda-overriding-header "\nTasks by Context\n------------------\n"))) - ) - ((org-agenda-with-colors nil) - (org-agenda-compact-blocks t) - (org-agenda-remove-tags t) - (ps-number-of-columns 2) - (ps-landscape-mode t)) - ("~/agenda.ps")) - - ("f". "Filter Searches") ;; category searches - ("fc" tags "+claire") - ("fh" tags "+helia") - ("fv" tags "+vovo") - ("fs" tags "+social") - - ("n" "Non boulot" tags-todo "-boulot+TODO=TODO" - (todo "TODO" - ((org-agenda-prefix-format "[ ] %T: ") - (org-agenda-overriding-header "Tâches pour le fun") - (org-agenda-sorting-strategy - '(todo-state-down effort-up category-keep) - )) + ("b" "Boulot" tags-todo "+boulot") + ("c" "Cancelled" tags-todo "CANCELLED") + ("D" "Done tasks" tags-todo "DONE") + ("g". "GTD Searches") ;; category searches + ("gd" "Daily" + agenda "" ( + (org-agenda-overriding-header "\n-------------- Daily ------------------\n") + (org-agenda-span 1) + (tags-todo "+PRIORITY=\"A\"") + (tags-todo "+inbox") ) - ) - ("h" "Habits" tags-todo "STYLE=\"habit\"" - ((org-agenda-overriding-header "Habits") - (org-agenda-todo-keyword-format "[ ]") - (org-agenda-sorting-strategy - '(todo-state-down effort-up category-keep))) - ) - ) - )) + ) + ("gw" "Weekly review" + agenda "" ( + (org-agenda-overriding-header "\nRevue hebdomadaire\n------------------\n") + (org-agenda-start-day "-7d") + (org-agenda-span 7) + (org-agenda-start-on-weekday 1) + (org-agenda-start-with-log-mode '(closed)) + (org-agenda-archives-mode t) + (org-agenda-skip-function + '(org-agenda-skip-entry-if 'notregexp "^\\*\\* DONE ") + ) + ) + ) + ("gW" "Weekly review" agenda "" + ((org-agenda-span 7) + (org-agenda-log-mode 1)) "~/Nextcloud/textes/orgmode/this-week.html") + ("g2" "Bi-weekly review" agenda "" ((org-agenda-span 14) (org-agenda-log-mode 1))) + + ("0" "Unestimated tasks" tags-todo "EFFORT=\"\"") + ("5" "Quick tasks" tags-todo "EFFORT>=\"5\"&EFFORT<=\"15\"") + ("8" "Medium tasks" tags-todo "EFFORT>=\"15\"&EFFORT<=\"60\"") + ("9" "Unscheduled top 3 by context" my-org-agenda-contexts + ((org-agenda-skip-function 'my-org-agenda-skip-scheduled) + (org-agenda-sorting-strategy '(priority-down effort-down)) + (org-agenda-max-entries 3))) + ("p" "By priority" + ((tags-todo "+PRIORITY=\"A\"") + (tags-todo "+PRIORITY=\"B\"") + (tags-todo "+PRIORITY=\"\"") + (tags-todo "+PRIORITY=\"C\"")) + ((org-agenda-prefix-format "%-10c %-10T %e ") + (org-agenda-sorting-strategy '(priority-down tag-up category-keep effort-down)))) + ("P" "Printed paper agenda" + ((agenda "" ((org-agenda-span 7) ;; overview of appointments + (org-agenda-start-on-weekday nil) ;; calendar begins today + (org-agenda-repeating-timestamp-show-all t) + (org-agenda-entry-types '(:timestamp :sexp)))) + (agenda "" ( + (org-agenda-span 1) ; daily agenda + (org-deadline-warning-days 7) ; 7 day advanced warning for deadlines + (org-agenda-todo-keyword-format "[ ]") + (org-agenda-scheduled-leaders '("" "")) + (org-agenda-prefix-format "%t%s") + ) + ) + (todo "TODO" ;; todos sorted by context + ((org-agenda-prefix-format "[ ] %T: ") + (org-agenda-sorting-strategy '(tag-up priority-down)) + (org-agenda-todo-keyword-format "") + (org-agenda-overriding-header "\nTasks by Context\n------------------\n"))) + ) + ((org-agenda-with-colors nil) + (org-agenda-compact-blocks t) + (org-agenda-remove-tags t) + (ps-number-of-columns 2) + (ps-landscape-mode t)) + ("~/agenda.ps")) + + ("f". "Filter Searches") ;; category searches + ("fc" tags "+claire") + ("fh" tags "+helia") + ("fv" tags "+vovo") + ("fs" tags "+social") + + ("n" "Non boulot" tags-todo "-boulot+TODO=TODO" + (todo "TODO" + ((org-agenda-prefix-format "[ ] %T: ") + (org-agenda-overriding-header "Tâches pour le fun") + (org-agenda-sorting-strategy + '(todo-state-down effort-up category-keep) + )) + ) + ) + ("h" "Habits" tags-todo "STYLE=\"habit\"" + ((org-agenda-overriding-header "Habits") + (org-agenda-todo-keyword-format "[ ]") + (org-agenda-sorting-strategy + '(todo-state-down effort-up category-keep))) + ) + ) + ) + ) #+end_src +** Ménage dans les tâches réalisées -** Revue mensuelle +#+begin_src emacs-lisp + (defun my-org-clean-up-inbox () + "Archive all DONE tasks and sort the remainder by TODO order." + (interactive) + (with-current-buffer (find-file my-org-inbox-file) + (my-org-archive-done-tasks 'file) + (goto-char (point-min)) + (if (org-at-heading-p) (save-excursion (insert "\n"))) + (org-sort-entries nil ?p) + (goto-char (point-min)) + (org-sort-entries nil ?o) + (save-buffer))) + + (defun my-org-archive-done-tasks (&optional scope) + "Archive finished or cancelled tasks. + SCOPE can be 'file or 'tree." + (interactive) + (org-map-entries + (lambda () + (org-archive-subtree) + (setq org-map-continue-from (outline-previous-heading))) + "TODO=\"DONE\"|TODO=\"CANCELLED\"" (or scope (if (org-before-first-heading-p) 'file 'tree)))) +#+end_src +** Revue mensuelle (FIXME) #+begin_src emacs-lisp + (defun my-org-review-month (start-date) "Review the month's clocked tasks and time." (interactive (list (org-read-date))) @@ -432,7 +461,7 @@ Contenu du fichier de config [[file:~/.emacs]] #+end_src ** Définir l'effort sur une tâche - +Raccourci pour définir un effort compté en nombre de minutes à consacrer à une tâche: F6. #+begin_src emacs-lisp ;; org-set-effort (global-set-key (kbd "") 'org-set-effort) @@ -470,9 +499,23 @@ Contenu du fichier de config [[file:~/.emacs]] tags prédéfinis au choix lors de la qualification avec C-c C-q sur une tâche #+begin_src emacs-lisp - (setq org-tag-alist '(("boulot" . ?b) ("family" . ?f) ("tel" . ?t) ("osm" . ?o) ("cil-gometz" . ?g) ("administratif" . ?a) ("adminsys" . ?d) ("dev" . ?v) ("inbox" . ?i) ("privacy" . ?p) ("habitudes" . ?h) ("backup" . ?u) ("email" .?e))) + (setq org-tag-alist '( + ("adminsys" . ?A) + ("administratif" . ?a) + ("boulot" . ?b) + ("dev" . ?d) + ("email" .?e) + ("GULL" . ?g) + ("habitudes" . ?h) + ("social" . ?s) + ("tel" . ?t) + ("osm" . ?o) + ("inbox" . ?i) + ("rangement" . ?r) + ) + ) - (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t)))) + (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t)))) #+end_src @@ -481,52 +524,53 @@ Contenu du fichier de config [[file:~/.emacs]] https://orgmode.org/manual/Template-expansion.html #+begin_src emacs-lisp - ;;; templates de capture pour les nouvelles tâches - (setq org-capture-templates - '( - ("t" "Todo" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox") - "* TODO %?\n") - ("l" "ToLearn" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Recherches et éducation") - "* LEARN %?\n %i\n %a") - ("b" "Boulot" entry (file+headline "~/Nextcloud/textes/orgmode/boulot.org" "Inbox") - "* TODO %?\n :boulot:work: \n %a") - ;; (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org") - ("m" "Meeting" entry (file+datetree "~/Nextcloud/textes/orgmode/reunions.org" "Réunions") - "* Réunion %T \n :[[id:d8636e1d-0137-4502-9384-767b41c892b0][boulot:meeting:]] \n**** Gens présents\n**** Notes\n - %?\n**** Choses à investiguer\n -\n**** Prochaines actions\n - Fin de la réunion: \n" - ) - ("e" "E-mail" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox") - "* TODO %? :mail:écriture:\n ") - ("n" "Next Task" entry (file+headline org-default-notes-file "Next") - "** NEXT %? \nDEADLINE: %t") - ("p" "Phone call" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Tel") - "* PHONE %? :tel:\n%U" :clock-in t :clock-resume t) - ("j" "Journal" entry (file+datetree "~/Nextcloud/textes/orgmode/journal.org") - "* %?\nEntered on %U\n ")) - ) + ;;; templates de capture pour les nouvelles tâches + (setq org-capture-templates + '( + ("t" "Todo" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox") + "* TODO %?\n") + ("d" "Todo this Day" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox") + "* TODO %?\nDEADLINE:%T") + ("l" "ToLearn" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Recherches et éducation") + "* LEARN %?\n %i\n %a") + ("b" "Boulot" entry (file+headline "~/Nextcloud/textes/orgmode/boulot.org" "Inbox") + "* TODO %?\n :boulot:work: \n %a") + ;; (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org") + ("m" "Meeting" entry (file+datetree "~/Nextcloud/textes/orgmode/reunions.org" "Réunions") + "* Réunion %T \n :[[id:d8636e1d-0137-4502-9384-767b41c892b0][boulot:meeting:]] \n**** Gens présents\n**** Notes\n - %?\n**** Choses à investiguer\n -\n**** Prochaines actions\n - Fin de la réunion: \n" + ) + ("e" "E-mail" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox") + "* TODO %? :mail:écriture:\n ") + ("n" "Next Task" entry (file+headline org-default-notes-file "Next") + "** NEXT %? \nDEADLINE: %t") + ("p" "Phone call" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Tel") + "* PHONE %? :tel:\n%U" :clock-in t :clock-resume t) + ("j" "Journal" entry (file+datetree "~/Nextcloud/textes/orgmode/journal.org") + "* %?\nEntered on %U\n ")) + ) - ;; raccourci custom pour clavier sans pavé numérique - (global-set-key (kbd "C-T") 'org-todo) - - (defun insert-created-date(&rest ignore) - (insert (format-time-string - (concat "\nCREATED: " - (cdr org-time-stamp-formats)) - )) - (org-back-to-heading) ; in org-capture, this folds the entry; when inserting a heading, this moves point back to the heading line - (move-end-of-line()) ; when inserting a heading, this moves point to the end of the line - ) + ;; raccourci custom pour clavier sans pavé numérique + (global-set-key (kbd "C-T") 'org-capture) + (defun insert-created-date(&rest ignore) + (org-back-to-heading) ; in org-capture, this folds the entry; when inserting a heading, this moves point back to the heading line + (move-end-of-line()) ; when inserting a heading, this moves point to the end of the line + (insert (format-time-string + (concat " \nCREATED: " + (cdr org-time-stamp-formats)) + )) + ) - ; add to the org-capture hook - (add-hook 'org-capture-before-finalize-hook - #'insert-created-date - ) + ; add to the org-capture hook + (add-hook 'org-capture-before-finalize-hook + #'insert-created-date + ) - ; hook it to adding headings with M-S-RET - ; do not add this to org-insert-heading-hook, otherwise this also works in non-TODO items - ; and Org-mode has no org-insert-todo-heading-hook - (advice-add 'org-insert-todo-heading :after #'insert-created-date) + ; hook it to adding headings with M-S-RET + ; do not add this to org-insert-heading-hook, otherwise this also works in non-TODO items + ; and Org-mode has no org-insert-todo-heading-hook + (advice-add 'org-insert-todo-heading :after #'insert-created-date) #+end_src @@ -536,46 +580,46 @@ https://orgmode.org/manual/Template-expansion.html Raccourcis Org Roam généraux #+begin_src emacs-lisp - (use-package org-roam + (use-package org-roam - :init - (setq org-roam-v2-ack t) - :custom - (org-roam-capture-templates - '(("d" "default" plain - "%?" - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t) - ("m" "meeting" plain (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org") - :if-new (file+head "%<%Y%m%d%H%M%S>-meeting-${slug}.org" "#+title: ${title}\n") - :unnarrowed t - ) - ("b" "book notes" plain - "\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n* Summary\n\n%?" - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") - :unnarrowed t)) - ) + :init + (setq org-roam-v2-ack t) + :custom + (org-roam-capture-templates + '(("d" "default" plain + "%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n\n* ${title}%?") + :unnarrowed t) + ("m" "meeting" plain (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org") + :if-new (file+head "%<%Y%m%d%H%M%S>-meeting-${slug}.org" "#+title: ${title}\n") + :unnarrowed t + ) + ("b" "book notes" plain + "\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n* Summary\n\n%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") + :unnarrowed t)) + ) - :bind ( - ("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert) - ("C-c n g" . org-roam-graph) - ("C-c n t" . org-roam-tag-add) - ("C-c n a" . org-roam-alias-add) - :map org-roam-dailies-map - ("Y" . org-roam-dailies-capture-yesterday) - ("T" . org-roam-dailies-capture-tomorrow) - ) - :bind-keymap - ("C-c n d" . org-roam-dailies-map) - :config - (require 'org-roam-dailies) - (org-roam-db-autosync-mode) - ) - (setq org-roam-directory "~/Nextcloud/textes/orgmode/org-roam") - (setq org-roam-completion-everywhere t) + :bind ( + ("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n i" . org-roam-node-insert) + ("C-c n g" . org-roam-graph) + ("C-c n t" . org-roam-tag-add) + ("C-c n a" . org-roam-alias-add) + :map org-roam-dailies-map + ("Y" . org-roam-dailies-capture-yesterday) + ("T" . org-roam-dailies-capture-tomorrow) + ) + :bind-keymap + ("C-c n d" . org-roam-dailies-map) + :config + (require 'org-roam-dailies) + (org-roam-db-autosync-mode) + ) + (setq org-roam-directory "~/Nextcloud/textes/orgmode/org-roam") + (setq org-roam-completion-everywhere t) #+end_src @@ -631,7 +675,6 @@ https://orgmode.org/manual/Template-expansion.html ;; agenda vue calendrier avec Ctrl Shift F12 (global-set-key (kbd "C-s-") 'cfw:open-org-calendar) - #+end_src * Insérer la date et l'heure @@ -662,12 +705,10 @@ exemple : <2022-06-27 lun. 18:51> ;; fait par tykayn le 7-04-2022 ;; version GNU Emacs 27.1 - #+end_src ** Gestion de paquets Straight.el #+begin_src emacs-lisp - ;; on utilise straight.el pour déclarer les packages à utiliser #+end_src ** Charset UTF-8 @@ -684,7 +725,6 @@ exemple : <2022-06-27 lun. 18:51> #+begin_src emacs-lisp (setq initial-buffer-choice "~/Nextcloud/textes/orgmode/tasks.org") - #+end_src ** Centrer la fenêtre #+begin_src emacs-lisp @@ -696,8 +736,8 @@ exemple : <2022-06-27 lun. 18:51> #+begin_src emacs-lisp ;; (use-package dirvish ;; :init - ;; Let Dirvish take over Dired globally - ;;(dirvish-override-dired-mode) +;; ;; Let Dirvish take over Dired globally +;; (dirvish-override-dired-mode) ;; ) ;; (require 'dirvish) #+end_src @@ -742,7 +782,6 @@ exemple : <2022-06-27 lun. 18:51> (global-set-key (kbd "C-") 'comment-eclipse) - #+end_src ** Tout sélectionner #+begin_src emacs-lisp @@ -764,10 +803,12 @@ exemple : <2022-06-27 lun. 18:51> "C-x C-q" ;; read-only-mode )) - #+end_src * Common usage CUA - +#+begin_src emacs-lisp + ;; raccourcis communs pour copier coller de texte + (cua-mode t) +#+end_src * Recherche globale Deft #+begin_src emacs-lisp @@ -784,8 +825,6 @@ Deft * Lecture #+begin_src emacs-lisp - ;; raccourcis communs pour copier coller de texte - (cua-mode t) ;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - - (global-set-key (kbd "C-c l") 'org-store-link) @@ -794,28 +833,23 @@ Deft ;;---- open tasks list at startup (setq initial-buffer-choice "~/Nextcloud/textes/orgmode/config.org") - ;; barres de GUI (setq tool-bar-mode t) (setq scroll-bar-mode t) (setq menu-bar-mode t) - (setq left-margin-width 5) (setq right-margin-width 5) - ;; highlight of lines (require 'hl-line) (add-hook 'prog-mode-hook #'hl-line-mode) (add-hook 'text-mode-hook #'hl-line-mode) - ;; fonts ;; font for errors (ignore-errors (set-frame-font "JuliaMono-12")) - (use-package doom-themes :config ;; Global settings (defaults) @@ -837,18 +871,16 @@ Deft (use-package doom-modeline :config (doom-modeline-mode)) - - - + ;; dossier des fichiers org à considérer pour les agendas, uniquement la racine du dossier orgmode dans Nextcloud (setq org-agenda-files (list "~/Nextcloud/textes/orgmode")) - - + ;; pouvoir faire du refile dans des headers de niveau 2 dans tasks.org + (setq org-refile-targets + '((nil :maxlevel . 1) + ( "~/Nextcloud/textes/orgmode/tasks.org" :maxlevel . 2))) ;; alias (defalias 'yes-or-no-p 'y-or-n-p) - - ;; - - - - - - - - - - - - - - matching parentheses - - - - - - - - - - - - - - - - - - - - - - - - - - (use-package paren :ensure nil @@ -871,8 +903,6 @@ Deft :after all-the-icons :hook (dired-mode . all-the-icons-dired-mode)) - - ;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - - (global-set-key (kbd "C-c l") 'org-store-link) (global-set-key (kbd "C-c a") 'org-agenda) @@ -892,15 +922,12 @@ Deft (bind-key "C-c K" #'kill-all-buffers) (bind-key "C-x !" #'delete-other-windows) ;; Access to the old keybinding. - - (defun switch-to-scratch-buffer () "Switch to the current session's scratch buffer." (interactive) (switch-to-buffer "*scratch*")) (bind-key "C-c s" #'switch-to-scratch-buffer) - ;; voir la liste des tâches à l'état DONE (fset 'done-tasks-list (kmacro-lambda-form [?\C-c ?a ?t kp-2 ?r] 0 "%d")) @@ -917,6 +944,7 @@ Deft ;; save all by default Was: isearch-forward (defun save-all () (interactive) (save-some-buffers t)) (global-set-key (kbd "C-x C-s") 'save-all) + (global-set-key (kbd "C-o") 'save-all) (global-set-key (kbd "C-S-c") 'comment-line) ;; recherche dans tous les fichiers du dossier orgmode (global-set-key (kbd "C-S-f") 'deft) @@ -924,12 +952,10 @@ Deft ;; recherche dans le fichier courant avec ctrl + f (global-set-key (kbd "C-f") 'isearch-forward) - (global-set-key (kbd "C-c C-f") 'org-roam-node-find) (global-set-key (kbd "C-c C-i") 'org-roam-node-insert) (global-set-key (kbd "C-c i") 'org-roam-node-insert) - (global-set-key (kbd "") 'org-capture) (global-set-key (kbd "") 'org-cycle-agenda-files) (global-set-key (kbd "") 'org-agenda) @@ -941,10 +967,8 @@ Deft (global-set-key (kbd "") 'dir-treeview) (global-set-key "\C-x\ \C-r" 'recentf-open-files) - (setq org-agenda-sticky t) - ;; use org-bullets-mode for utf8 symbols as org bullets (use-package org-bullets) (require 'org-bullets) @@ -966,9 +990,6 @@ Deft ;; make available "org-bullet-face" such that I can control the font size individually (setq org-bullets-face-name (quote org-bullet-face)) - - - ;; détail de combinaison de touches (use-package which-key :diminish @@ -1004,8 +1025,6 @@ Deft '(org-level-5 ((t (:inherit outline-5 :height 1.0)))) ) - - #+end_src * Heure dans la modeline @@ -1025,8 +1044,7 @@ Deft calendar-day-abbrev-array ["dim" "lun" "mar" "mer" "jeu" "ven" "sam"] calendar-day-name-array ["Dimanche" "Lundi" "Mardi" "Mercredi" "Jeudi" "Vendredi" "Samedi"] - calendar-month-abbrev-array - ["jan" "fév" "mar" "avr" "mai" "jun" "jul" "aou" "sep" "oct" "nov" "déc"] + calendar-month-abbrev-array ["jan" "fév" "mar" "avr" "mai" "jun" "jul" "aou" "sep" "oct" "nov" "déc"] calendar-month-name-array ["Janvier" "Février" "Mars" "Avril" "Mai" "Juin" "Juillet" "Août" "Septembre" "Octobre" "Novembre" "Décembre"] @@ -1046,8 +1064,6 @@ Deft (save-some-buffers t)) (add-hook 'focus-out-hook 'save-all) - - #+end_src ** Auto format à la sauvegarde #+begin_src emacs-lisp @@ -1058,22 +1074,30 @@ Deft ** Gestion de version #+begin_src emacs-lisp ;; https://github.com/emacsorphanage/git-gutter - (use-package git-gutter) - (global-git-gutter-mode +1) - (global-set-key (kbd "C-x C-g") 'git-gutter) + (use-package git-gutter) + (global-git-gutter-mode +1) #+end_src ** Auto format #+begin_src emacs-lisp - (setq org-adapt-indentation t) + ;; (setq org-adapt-indentation t) + ;; *** Auto Indent + + (defun indent-org-block-automatically () + (when (org-in-src-block-p) + (org-edit-special) + (indent-region (point-min) (point-max)) + (org-edit-src-exit))) + + (global-set-key (kbd "C-M-f") 'indent-org-block-automatically) #+end_src ** Tab avec largeur de 2 espaces #+begin_src emacs-lisp - (setq-default tab-width 2) + (setq-default tab-width 2) #+end_src ** Dupliquer la ligne #+begin_src emacs-lisp @@ -1101,33 +1125,36 @@ Deft (setq-default truncate-lines t) #+end_src - ** Auto indentation et autres trucs #+begin_src emacs-lisp (use-package aggressive-indent) - (global-aggressive-indent-mode 1) - (delete-selection-mode t) -;; (global-display-line-numbers-mode t) - (column-number-mode) - (add-hook 'before-save-hook #'delete-trailing-whitespace) - (setq require-final-newline t) - (defun do-nothing (interactive)) - (defalias 'view-emacs-news 'do-nothing) - (defalias 'describe-gnu-project 'do-nothing) + (global-aggressive-indent-mode 1) + (delete-selection-mode t) + ;; (global-display-line-numbers-mode t) + (column-number-mode) + (add-hook 'before-save-hook #'delete-trailing-whitespace) + (add-hook 'before-save-hook #'indent-org-block-automatically) + (setq require-final-newline t) + + ;; hide some annoyances + (defun do-nothing (interactive)) + (defalias 'view-emacs-news 'do-nothing) + (defalias 'describe-gnu-project 'do-nothing) + + ;; run auto indent org block sources every 10 seconds + (run-at-time 1 10 'indent-org-block-automatically) (setq user-full-name "TyKayn" - user-mail-address "contact@cipherbliss.com") + user-mail-address "contact@cipherbliss.com") #+end_src ** Markdown #+begin_src emacs-lisp - - (use-package markdown-mode - :mode ("\\.\\(njk\\|md\\)\\'" . markdown-mode)) - + (use-package markdown-mode + :mode ("\\.\\(njk\\|md\\)\\'" . markdown-mode)) #+end_src ** Json @@ -1140,73 +1167,70 @@ Deft (setq backup-directory-alist '(("." . "~/.config/emacs/backups"))) #+end_src - * Écriture ** Références bibliographiques #+begin_src emacs-lisp - ;; BibLaTeX settings + ;; BibLaTeX settings ;; bibtex-mode (setq bibtex-dialect 'biblatex) - (setq bib-files-directory (directory-files + (setq bib-files-directory (directory-files (concat (getenv "HOME") "/Nextcloud/textes/bibliography") t "^[A-Z|a-z].+.bib$") pdf-files-directory (concat (getenv "HOME") "/Nextcloud/textes/bibliography")) - (use-package helm-bibtex - :config - (setq bibtex-completion-bibliography bib-files-directory - bibtex-completion-library-path pdf-files-directory - bibtex-completion-pdf-field "File" - bibtex-completion-notes-path org-directory - bibtex-completion-additional-search-fields '(keywords)) - :bind - (("C-c n B" . helm-bibtex))) + (use-package helm-bibtex + :config + (setq bibtex-completion-bibliography bib-files-directory + bibtex-completion-library-path pdf-files-directory + bibtex-completion-pdf-field "File" + bibtex-completion-notes-path org-directory + bibtex-completion-additional-search-fields '(keywords)) + :bind + (("C-c n B" . helm-bibtex))) - (use-package org-roam-bibtex - :after (org-roam helm-bibtex) - :bind (:map org-mode-map ("C-c n b" . orb-note-actions)) - :config - (require 'org-ref)) - (org-roam-bibtex-mode) + (use-package org-roam-bibtex + :after (org-roam helm-bibtex) + :bind (:map org-mode-map ("C-c n b" . orb-note-actions)) + :config + (require 'org-ref)) + (org-roam-bibtex-mode) #+end_src ** Centrer le texte - Olivetti #+begin_src emacs-lisp - ;; olivetti - ;; Distraction-free screen - (use-package olivetti - :straight t - :init - (setq olivetti-body-width .67) - :config - ) - (setq olivetti-body-width .67 - text-scale-increase 1.5 - olivetti-mode t - ) + ;; olivetti + ;; Distraction-free screen + (use-package olivetti + :straight t + :init + (setq olivetti-body-width .67) + :config + ) + (setq olivetti-body-width .67 + text-scale-increase 1.15 + olivetti-mode t + ) + ;; change font size on load of text files + (add-hook 'text-mode-hook (lambda () + (interactive) + (message "Olivetti text-mode-hook") + ;; (text-scale-increase 1.5) + (olivetti-set-width .67) + ;; (hidden-mode-line-mode) + (olivetti-mode 1))) - (add-hook 'text-mode-hook (lambda () - (interactive) - (message "Olivetti text-mode-hook") - (text-scale-increase 1.5) - (olivetti-set-width .67) - ;; (hidden-mode-line-mode) - (olivetti-mode 1))) - - - - (use-package writeroom-mode) + ;; focus on text in fullscreen + (use-package writeroom-mode) #+end_src ** Auto complétion #+begin_src emacs-lisp - ;; Auto completion (use-package company :config @@ -1215,7 +1239,6 @@ Deft company-selection-wrap-around t)) (global-company-mode) - ;; Helm configuration (use-package helm :config @@ -1237,25 +1260,28 @@ Deft ** Exporter vers HTML avec un style commun #+begin_src emacs-lisp - ;; export with default modern css - (defun my-org-inline-css-hook (exporter) - "Insert custom inline css" - (when (eq exporter 'html) - (let* ((dir (ignore-errors (file-name-directory (buffer-file-name)))) - (path (concat dir "style.css")) - (homestyle (or (null dir) (null (file-exists-p path)))) - (final (if homestyle "~/Nextcloud/textes/orgmode/style.css" path))) ;; <- set your own style file path - (setq org-html-head-include-default-style nil) - (setq org-html-head (concat - "\n"))))) + ;; exporter sans nombres ajoutés dans les titres de section + (setq org-export-with-section-numbers nil) - (add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook) + ;; export with default modern css + (defun my-org-inline-css-hook (exporter) + "Insert custom inline css" + (when (eq exporter 'html) + (let* ((dir (ignore-errors (file-name-directory (buffer-file-name)))) + (path (concat dir "style.css")) + (homestyle (or (null dir) (null (file-exists-p path)))) + (final (if homestyle "~/Nextcloud/textes/orgmode/style.css" path))) ;; <- set your own style file path + (setq org-html-head-include-default-style nil) + (setq org-html-head (concat + "\n"))))) + + (add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook) #+end_src @@ -1283,7 +1309,7 @@ Deft (require 'ox-reveal) #+end_src -*** publication de site web du wiki +*** publication de site web du wiki FIXME Ox-Hugo https://ox-hugo.scripter.co/doc/installation/ #+begin_src emacs-lisp ;; ----- hugo export to publish website @@ -1313,26 +1339,36 @@ Deft #+end_src -* Mystères - trucs à trouver comment faire +* Mystères trucs à trouver comment faire faire de la recherche avec Ctrl + F faire du remplacement avec Ctrl + H #+begin_src emacs-lisp + + ;; non pris en compte pour l'ajout d'une deadline ou schedule + +(setq calendar-day-abbrev-array ["Dim" "Lun" "Mar" "Mer" "Jeu" "Ven" "Sam"]) #+end_src +uuuuehh * Autre -La suite est à inventer. + La suite est à inventer. Pour installer cette configuration d'emacs, lancez le script + + #+begin_quote bash # bash install_emacs_config.sh #!/bin/bash +echo "installation d'emacs version snap" +sudo apt install snapd snap install emacs --channel=beta --classic mkdir -p ~/Nextcloud/textes/orgmode mkdir -p ~/Nextcloud/textes/orgmode/org-roam +mkdir -p ~/Nextcloud/textes/orgmode + touch ~/.emacs touch ~/Nextcloud/textes/orgmode/config.org touch ~/Nextcloud/textes/orgmode/tasks.org