Skip to content
Snippets Groups Projects
Commit 9e552e65 authored by Michael Hauspie's avatar Michael Hauspie
Browse files

Move more org configuration to its :custom block in use-package

parent 7dbe9d34
No related branches found
No related tags found
No related merge requests found
...@@ -417,88 +417,106 @@ org with contributed packages added. ...@@ -417,88 +417,106 @@ org with contributed packages added.
** Basics ** Basics
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package org (use-package org
:bind (("C-c l" . 'org-store-link) :bind (("C-c l" . 'org-store-link)
("C-c a" . 'org-agenda) ("C-c a" . 'org-agenda)
("C-c c" . 'org-capture) ("C-c c" . 'org-capture)
) )
:custom :custom
;; Tab keeps indenting in src blocks ;; Tab keeps indenting in src blocks
(org-src-tab-acts-natively t) (org-src-tab-acts-natively t)
;; IDO for completion when applicable ;; IDO for completion when applicable
(org-completion-use-ido t) (org-completion-use-ido t)
;; hide emphasis markers ;; hide emphasis markers
;; (org-hide-emphasis-markers t) ;; (org-hide-emphasis-markers t)
(org-file-apps '(("org" . emacs) (org-file-apps '(("org" . emacs)
("rs" . emacs) ("rs" . emacs)
("c" . emacs) ("c" . emacs)
("h" . emacs) ("h" . emacs)
)) ))
;; Define the right latexmk command to export to latex ;; Define the right latexmk command to export to latex
(org-latex-pdf-process (list "latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode' -output-directory=%o -pdf %f")) (org-latex-pdf-process (list "latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode' -output-directory=%o -pdf %f"))
;; Task management configuration ;; Task management configuration
(org-log-done 'time) (org-log-done 'time)
(org-enforce-todo-dependencies t) (org-enforce-todo-dependencies t)
(org-enforce-todo-checkbox-dependencies t) (org-enforce-todo-checkbox-dependencies t)
(org-todo-keywords '((sequence "TODO" "WAITING" "|" "DONE"))) (org-todo-keywords '((sequence "TODO" "WAITING" "|" "DONE")))
;; where org mode can find its files for archiving and capture ;; where org mode can find its files for archiving and capture
(org-directory "~/documents/org") (org-directory "~/documents/org")
(org-archive-location "~/documents/org/archive.org::* From %s") (org-archive-location "~/documents/org/archive.org::* From %s")
(org-agenda-files (list "~/documents/org/index.org" (org-agenda-files (list "~/documents/org/index.org"
"~/.emacs.d/configuration.org" "~/.emacs.d/configuration.org"
"~/documents/org/work.org" "~/documents/org/work.org"
"~/documents/org/archive.org")) "~/documents/org/archive.org"))
;; Agenda ;; Agenda
;; The week begin today ;; The week begin today
(org-agenda-start-on-weekday nil) (org-agenda-start-on-weekday nil)
;; 15 days in agenda view ;; 15 days in agenda view
(org-agenda-span 15) (org-agenda-span 15)
;; ;;
;; Define a custom agenda view. I want my agenda with tasks that are scheduled or have a deadline, ;; Define a custom agenda view. I want my agenda with tasks that are scheduled or have a deadline,
;; but also all other tasks that do not have a date scheduled or as deadline. This is for tasks ;; but also all other tasks that do not have a date scheduled or as deadline. This is for tasks
;; that I will eventualy do later. ;; that I will eventualy do later.
(org-agenda-custom-commands (org-agenda-custom-commands
'(("a" "Agenda" '(("a" "Agenda"
( (
(agenda "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)))) (agenda "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))))
(alltodo "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline 'todo 'done)))) (alltodo "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline 'todo 'done))))
)))) ))))
;; Define some capture template to be able to create tasks, or maybe ;; Define some capture template to be able to create tasks, or maybe
;; other things later ;; other things later
(org-capture-templates (org-capture-templates
'(("f" "Finished book" '(("f" "Finished book"
table-line (file "~/Documents/org/books-read.org") table-line (file "~/Documents/org/books-read.org")
"| %^{Title} | %^{Author} | %u |") "| %^{Title} | %^{Author} | %u |")
("t" "Todo" ("t" "Todo"
entry entry
(file+headline org-index-file "Tâches") (file+headline org-index-file "Tâches")
"* TODO %?\n:PROPERTIES:\nCREATED: %u\n:END:\n") "* TODO %?\n:PROPERTIES:\nCREATED: %u\n:END:\n")
("b" "Bookmarks" ("b" "Bookmarks"
table-line (file "~/Documents/org/bookmarks.org") table-line (file "~/Documents/org/bookmarks.org")
"| %^{prompt|rust|other} | %^{url} | %^{what}") "| %^{prompt|rust|other} | %^{url} | %^{what}")
("c" "Cycling" ("c" "Cycling"
table-line (file "~/Documents/org/cycling.org") table-line (file "~/Documents/org/cycling.org")
"| %t | balade | %^{prompt|standard|électrique} | %^{Distance} |") "| %t | balade | %^{prompt|standard|électrique} | %^{Distance} |")
("w" "Cycling to work" ("w" "Cycling to work"
table-line (file "~/Documents/org/cycling.org") table-line (file "~/Documents/org/cycling.org")
"| %t | boulot | %^{prompt|électrique|standard} | 26.2 |"))) "| %t | boulot | %^{prompt|électrique|standard} | 26.2 |")))
:config
(add-to-list 'org-structure-template-alist ;;
'("el" . "src emacs-lisp")) ;; Babel code blocks evaluation
(set-face-foreground 'org-verbatim "orange1") (org-babel-load-languages
;; Define a document class that do not use parts and start with chapters for latex export '((emacs-lisp . t)
) (C . t)
(latex . t)
(gnuplot . t)
(dot . t)
(java . t)
(python . t)
(makefile . t)
(org . t)
(perl . t)
(sed . t)
(shell . t)
(rust . t)
))
:config
(add-to-list 'org-structure-template-alist
'("el" . "src emacs-lisp"))
(set-face-foreground 'org-verbatim "orange1")
;; Define a document class that do not use parts and start with chapters for latex export
)
#+END_SRC #+END_SRC
Add a shortcut to toggle display of emphasis characters Add a shortcut to toggle display of emphasis characters
...@@ -536,7 +554,7 @@ Use bullets instead of asterisks ...@@ -536,7 +554,7 @@ Use bullets instead of asterisks
) )
#+end_src #+end_src
** Tree slide ** Tree slide
Tree slide displays an org file as /slides/ Tree slide displays an org file as /slides/
...@@ -623,31 +641,11 @@ Turn off validate link in org html export: ...@@ -623,31 +641,11 @@ Turn off validate link in org html export:
** Source code evaluation ** Source code evaluation
So that source code blocks can be evaluated inside =org-mode=, we add
it to babel languages. =org-babel= is what executes code and outputs
its result in your org file.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package gnuplot) (use-package gnuplot)
(use-package gnuplot-mode) (use-package gnuplot-mode)
(use-package ob-rust) (use-package ob-rust)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(C . t)
(latex . t)
(gnuplot . t)
(dot . t)
(java . t)
(python . t)
(makefile . t)
(org . t)
(perl . t)
(sed . t)
(shell . t)
(rust . t)
))
#+END_SRC #+END_SRC
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment