Reworks the way spacemacs config is organized
This commit is contained in:
parent
531d04dfc4
commit
ee744ab206
@ -1,22 +1,23 @@
|
|||||||
#+TITLE: Spacemacs configuration
|
#+TITLE: Spacemacs configuration
|
||||||
#+STARTUP: headlines
|
|
||||||
#+STARTUP: nohideblocks
|
|
||||||
#+STARTUP: noindent
|
|
||||||
#+PROPERTY: header-args:emacs-lisp :comments link :results silent
|
#+PROPERTY: header-args:emacs-lisp :comments link :results silent
|
||||||
|
|
||||||
* User Init
|
* User Init
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args:emacs-lisp+: :tangle ~/.spacemacs.d/user-init.el
|
||||||
|
:END:
|
||||||
|
|
||||||
** Melpa
|
** Melpa
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(add-to-list 'package-archives '("melpa" . "http://www.mirrorservice.org/sites/melpa.org/packages/"))
|
(add-to-list 'package-archives '("melpa" . "http://www.mirrorservice.org/sites/melpa.org/packages/"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Ispell
|
** Ispell
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq ispell-program-name "/usr/bin/aspell")
|
(setq ispell-program-name "/usr/bin/aspell")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org latex fragment
|
** Org latex fragment
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defvar kk/org-latex-fragment-last nil
|
(defvar kk/org-latex-fragment-last nil
|
||||||
"Holds last fragment/environment you were on.")
|
"Holds last fragment/environment you were on.")
|
||||||
|
|
||||||
@ -99,13 +100,18 @@
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Default Browser
|
** Default Browser
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq browse-url-browser-function 'browse-url-generic
|
(setq browse-url-browser-function 'browse-url-generic
|
||||||
browse-url-generic-program "qutebrowser")
|
browse-url-generic-program "qutebrowser")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
* User-Config
|
||||||
|
:PROPERTIES:
|
||||||
|
:header-args:emacs-lisp+: :tangle ~/.spacemacs.d/user-config.el
|
||||||
|
:END:
|
||||||
|
|
||||||
** Others
|
** Others
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; Line Wrapping
|
;; Line Wrapping
|
||||||
(spacemacs/toggle-truncate-lines-on)
|
(spacemacs/toggle-truncate-lines-on)
|
||||||
|
|
||||||
@ -127,55 +133,54 @@
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Windows Management
|
** Windows Management
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(global-set-key (kbd "<C-up>") 'shrink-window)
|
(global-set-key (kbd "<C-up>") 'shrink-window)
|
||||||
(global-set-key (kbd "<C-down>") 'enlarge-window)
|
(global-set-key (kbd "<C-down>") 'enlarge-window)
|
||||||
(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
|
(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
|
||||||
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
|
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Lockfiles
|
** Lockfiles
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq create-lockfiles nil)
|
(setq create-lockfiles nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Autosave
|
** Autosave
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq backup-directory-alist `(("." . "~/.saves")))
|
(setq backup-directory-alist `(("." . "~/.saves")))
|
||||||
(setq backup-by-copying t)
|
(setq backup-by-copying t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Path
|
** Path
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq thesis-base-path (expand-file-name "~/MEGA/These"))
|
(setq thesis-base-path (expand-file-name "~/MEGA/These"))
|
||||||
(setq dropbox-base-path (expand-file-name "~/Dropbox"))
|
(setq dropbox-base-path (expand-file-name "~/Dropbox"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Magit
|
** Magit
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setenv "GIT_ASKPASS" "git-gui--askpass")
|
(setenv "GIT_ASKPASS" "git-gui--askpass")
|
||||||
|
|
||||||
(setq magit-diff-refine-hunk 'all)
|
(setq magit-diff-refine-hunk 'all)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* User informations
|
** User informations
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; Used to the \author for LaTeX export
|
;; Used to the \author for LaTeX export
|
||||||
(setq user-full-name "Thomas Dehaeze")
|
(setq user-full-name "Thomas Dehaeze")
|
||||||
;; Used to set \email for LaTeX export
|
;; Used to set \email for LaTeX export
|
||||||
(setq user-mail-address "dehaeze.thomas@gmail.com")
|
(setq user-mail-address "dehaeze.thomas@gmail.com")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Alerts
|
|
||||||
** Change default alert backend
|
** Change default alert backend
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq alert-default-style 'libnotify)
|
(setq alert-default-style 'libnotify)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* LaTeX
|
** LaTeX
|
||||||
- https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick
|
- https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick
|
||||||
- https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex
|
- https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex
|
||||||
** Basic LaTeX configuration
|
*** Basic LaTeX configuration
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun latex/clean ()
|
(defun latex/clean ()
|
||||||
"Clean LaTeX output using latexmk"
|
"Clean LaTeX output using latexmk"
|
||||||
(interactive)
|
(interactive)
|
||||||
@ -191,13 +196,13 @@
|
|||||||
(add-hook 'TeX-mode-hook #'TeX-fold-mode)
|
(add-hook 'TeX-mode-hook #'TeX-fold-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Master file
|
*** Master file
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq-default TeX-master nil)
|
(setq-default TeX-master nil)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Pdf Viewer
|
*** Pdf Viewer
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+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)
|
||||||
(setq TeX-source-correlate-start-server t)
|
(setq TeX-source-correlate-start-server t)
|
||||||
@ -206,9 +211,9 @@
|
|||||||
'(("PDF Tools" TeX-pdf-tools-sync-view)))
|
'(("PDF Tools" TeX-pdf-tools-sync-view)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Helm-Bibtex
|
*** Helm-Bibtex
|
||||||
*** TODO General Config
|
**** General Config
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'helm-bibtex
|
(with-eval-after-load 'helm-bibtex
|
||||||
;; Use "tags" field when looking for bib entries
|
;; Use "tags" field when looking for bib entries
|
||||||
(setq helm-bibtex-additional-search-fields '(keywords))
|
(setq helm-bibtex-additional-search-fields '(keywords))
|
||||||
@ -283,8 +288,8 @@
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Open pdf externally
|
**** Open pdf externally
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'helm-bibtex
|
(with-eval-after-load 'helm-bibtex
|
||||||
(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)))))
|
||||||
@ -295,40 +300,40 @@
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Special Commands
|
**** Special Commands
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun helm-bibtex-favorites (&optional arg)
|
(defun helm-bibtex-favorites (&optional arg)
|
||||||
"Search Favorite BibTeX entries"
|
"Search Favorite BibTeX entries"
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(helm-bibtex arg nil "favorite "))
|
(helm-bibtex arg nil "favorite "))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Auto Complete
|
** Auto Complete
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(global-company-mode)
|
(global-company-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Yas Snippets
|
** Yas Snippets
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq yas-indent-line "fixed")
|
(setq yas-indent-line "fixed")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Org-Mode
|
** Org-Mode
|
||||||
- http://cachestocaches.com/2016/9/my-workflow-org-agenda/
|
- http://cachestocaches.com/2016/9/my-workflow-org-agenda/
|
||||||
- http://doc.norang.ca/org-mode.html#TodoKeywords
|
- http://doc.norang.ca/org-mode.html#TodoKeywords
|
||||||
- https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
|
- https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
|
||||||
|
|
||||||
** Org Tagging
|
*** Org Tagging
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; Tags with fast selection keys
|
;; Tags with fast selection keys
|
||||||
(setq org-tag-alist (quote (("@christophe" . ?c)
|
(setq org-tag-alist (quote (("@christophe" . ?c)
|
||||||
("@muriel" . ?m))))
|
("@muriel" . ?m))))
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Org Gcal
|
*** Org Gcal
|
||||||
- https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk
|
- https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"
|
(setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"
|
||||||
org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9"
|
org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9"
|
||||||
@ -340,15 +345,15 @@
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org Refile
|
*** Org Refile
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
|
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Org Todos
|
*** Org Todos
|
||||||
http://sachachua.com/blog/2014/04/thinking-todo-keywords/
|
http://sachachua.com/blog/2014/04/thinking-todo-keywords/
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; Tags with fast selection keys
|
;; Tags with fast selection keys
|
||||||
(setq org-todo-keywords '(
|
(setq org-todo-keywords '(
|
||||||
@ -377,9 +382,9 @@ http://sachachua.com/blog/2014/04/thinking-todo-keywords/
|
|||||||
("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
|
("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Org Agenda
|
*** Org Agenda
|
||||||
*** General configuration
|
**** General configuration
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; File to save todo items
|
;; File to save todo items
|
||||||
(setq org-agenda-files (list (format "%s/%s" thesis-base-path "TODOs/")
|
(setq org-agenda-files (list (format "%s/%s" thesis-base-path "TODOs/")
|
||||||
@ -408,9 +413,9 @@ http://sachachua.com/blog/2014/04/thinking-todo-keywords/
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Org Agenda Custom Views
|
**** Org Agenda Custom Views
|
||||||
https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html
|
https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defun tdehaeze/org-agenda-skip-scheduled ()
|
(defun tdehaeze/org-agenda-skip-scheduled ()
|
||||||
(org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))
|
(org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))
|
||||||
@ -438,13 +443,13 @@ https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** TODO Add Custom Views for the bibliography
|
**** TODO Add Custom Views for the bibliography
|
||||||
- Things reading (BOOKMARS)
|
- Things reading (BOOKMARS)
|
||||||
- Things to read
|
- Things to read
|
||||||
- etc...
|
- etc...
|
||||||
** Org Notification based on calendar event
|
*** Org Notification based on calendar event
|
||||||
https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events
|
https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq appt-message-warning-time 5)
|
(setq appt-message-warning-time 5)
|
||||||
(defun my-org-agenda-to-appt ()
|
(defun my-org-agenda-to-appt ()
|
||||||
@ -466,7 +471,7 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** appt-notification script
|
**** appt-notification script
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:header-args: :tangle ~/bin/appt-notification
|
:header-args: :tangle ~/bin/appt-notification
|
||||||
:header-args+: :comments none :mkdirp yes
|
:header-args+: :comments none :mkdirp yes
|
||||||
@ -479,8 +484,8 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
|
|||||||
dunstify --replace=85401 "Event in $TIME minutes" "$MSG"
|
dunstify --replace=85401 "Event in $TIME minutes" "$MSG"
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Org Structure Template
|
*** Org Structure Template
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-structure-template-alist
|
(setq org-structure-template-alist
|
||||||
'(("a" . "export ascii")
|
'(("a" . "export ascii")
|
||||||
@ -497,8 +502,8 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org Capture
|
*** Org Capture
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-directory "~/MEGA/These/TODOs/")
|
(setq org-directory "~/MEGA/These/TODOs/")
|
||||||
(setq org-default-notes-file "~/MEGA/These/TODOs/refile.org")
|
(setq org-default-notes-file "~/MEGA/These/TODOs/refile.org")
|
||||||
@ -542,10 +547,10 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Org Publish
|
*** TODO Org Publish
|
||||||
https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-publish-project-alist
|
(setq org-publish-project-alist
|
||||||
'(
|
'(
|
||||||
@ -570,9 +575,9 @@ https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org Babel
|
*** Org Babel
|
||||||
*** Main configuration
|
**** Main configuration
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; Don't ask for confirmation when evalutating latex blocs
|
;; Don't ask for confirmation when evalutating latex blocs
|
||||||
(defun my-org-confirm-babel-evaluate (lang body)
|
(defun my-org-confirm-babel-evaluate (lang body)
|
||||||
@ -588,15 +593,15 @@ https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Library of Babel
|
**** Library of Babel
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(org-babel-lob-ingest "~/MEGA/These/org-mode/org-babel-tutorial/org-babel-library.org")
|
(org-babel-lob-ingest "~/MEGA/These/org-mode/org-babel-tutorial/org-babel-library.org")
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Matlab
|
**** Matlab
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-babel-matlab-shell-command "/usr/local/bin/matlab -nodesktop -nosplash")
|
(setq org-babel-matlab-shell-command "/usr/local/bin/matlab -nodesktop -nosplash")
|
||||||
|
|
||||||
@ -628,21 +633,21 @@ https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
|
|||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Asynchronous execution
|
**** Asynchronous execution
|
||||||
https://github.com/astahlman/ob-async
|
https://github.com/astahlman/ob-async
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(require 'ob-async)
|
(require 'ob-async)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Theme
|
**** Theme
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(require 'color)
|
(require 'color)
|
||||||
(set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))
|
(set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Org Export
|
*** Org Export
|
||||||
*** Basic
|
**** Basic
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; How many levels of headline to export
|
;; How many levels of headline to export
|
||||||
(setq org-export-headline-levels 4)
|
(setq org-export-headline-levels 4)
|
||||||
@ -657,18 +662,18 @@ https://github.com/astahlman/ob-async
|
|||||||
(ox-extras-activate '(ignore-headlines))
|
(ox-extras-activate '(ignore-headlines))
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Ox Latex Subfigure package
|
**** Ox Latex Subfigure package
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ox-latex-subfigure
|
(use-package ox-latex-subfigure
|
||||||
:init
|
:init
|
||||||
(setq org-latex-prefer-user-labels t)
|
(setq org-latex-prefer-user-labels t)
|
||||||
:config (require 'ox-latex-subfigure))
|
:config (require 'ox-latex-subfigure))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Clear page before heading
|
**** Clear page before heading
|
||||||
https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892
|
https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-latex
|
(with-eval-after-load 'ox-latex
|
||||||
(defun org/get-headline-string-element (headline backend info)
|
(defun org/get-headline-string-element (headline backend info)
|
||||||
@ -685,24 +690,24 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
'org/ensure-latex-clearpage)
|
'org/ensure-latex-clearpage)
|
||||||
))
|
))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** TODO HTML Export
|
**** TODO HTML Export
|
||||||
**** Export with css class instead of inline css
|
***** Export with css class instead of inline css
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-html-htmlize-output-type 'css)
|
(setq org-html-htmlize-output-type 'css)
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
**** TODO MP4 movies
|
***** TODO MP4 movies
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-html-html5-fancy t)
|
(setq org-html-html5-fancy t)
|
||||||
(setq org-html-doctype "xhtml-strict")
|
(setq org-html-doctype "xhtml-strict")
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
**** TODO MathJax with SIunix
|
***** TODO MathJax with SIunix
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-html-mathjax-template
|
(setq org-html-mathjax-template
|
||||||
"<script type=\"text/x-mathjax-config\">
|
"<script type=\"text/x-mathjax-config\">
|
||||||
@ -736,9 +741,9 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org LaTeX
|
*** Org LaTeX
|
||||||
*** LaTeX Classes
|
**** LaTeX Classes
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-latex
|
(with-eval-after-load 'ox-latex
|
||||||
;; Custom classes to use when exporting to latex
|
;; Custom classes to use when exporting to latex
|
||||||
@ -791,8 +796,8 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Basic
|
**** Basic
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-latex
|
(with-eval-after-load 'ox-latex
|
||||||
;; Add packages by default
|
;; Add packages by default
|
||||||
@ -823,12 +828,12 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Beamer
|
**** Beamer
|
||||||
**** TODO Make a custom environment for columns with title
|
***** TODO Make a custom environment for columns with title
|
||||||
#+beamer: \csubtitle{title}\vspace{1em}
|
#+beamer: \csubtitle{title}\vspace{1em}
|
||||||
|
|
||||||
**** Custom Environments
|
***** Custom Environments
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-beamer
|
(with-eval-after-load 'ox-beamer
|
||||||
(add-to-list 'org-beamer-environments-extra
|
(add-to-list 'org-beamer-environments-extra
|
||||||
@ -845,8 +850,8 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
**** Beamer export options
|
***** Beamer export options
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-beamer
|
(with-eval-after-load 'ox-beamer
|
||||||
(defun my-beamer-bold (contents backend info)
|
(defun my-beamer-bold (contents backend info)
|
||||||
@ -858,8 +863,8 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Latex Fragments
|
**** Latex Fragments
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(with-eval-after-load 'ox-latex
|
(with-eval-after-load 'ox-latex
|
||||||
;; Automatic toggle of latex fragments http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/
|
;; Automatic toggle of latex fragments http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/
|
||||||
@ -916,10 +921,10 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
|||||||
))
|
))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** TODO Custom Export - Add Page and Label for LaTeX export
|
**** TODO Custom Export - Add Page and Label for LaTeX export
|
||||||
https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1
|
https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defcustom tdehaeze/org-property-mapping
|
(defcustom tdehaeze/org-property-mapping
|
||||||
'((latex ("CUSTOM_PAGE" . tdehaeze/insert-org-page-latex)
|
'((latex ("CUSTOM_PAGE" . tdehaeze/insert-org-page-latex)
|
||||||
@ -934,7 +939,7 @@ https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbit
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defun tdehaeze/replace-org-property (backend)
|
(defun tdehaeze/replace-org-property (backend)
|
||||||
"Convert org properties using `tdehaeze/org-property-mapping'.
|
"Convert org properties using `tdehaeze/org-property-mapping'.
|
||||||
@ -956,7 +961,7 @@ https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbit
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defun tdehaeze/insert-org-label-latex (label)
|
(defun tdehaeze/insert-org-label-latex (label)
|
||||||
"Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."
|
"Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."
|
||||||
@ -971,7 +976,7 @@ https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbit
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info)
|
(defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info)
|
||||||
"Default format function for a headline.
|
"Default format function for a headline.
|
||||||
@ -987,22 +992,22 @@ https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbit
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Org-Bibtex
|
*** TODO Org-Bibtex
|
||||||
It seems it is uncompatble with org-ref (https://github.com/jkitchin/org-ref/issues/101)
|
It seems it is uncompatble with org-ref (https://github.com/jkitchin/org-ref/issues/101)
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; (require 'ox-bibtex)
|
;; (require 'ox-bibtex)
|
||||||
;; (with-eval-after-load 'org
|
;; (with-eval-after-load 'org
|
||||||
;; )
|
;; )
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Org-pomodoro
|
*** TODO Org-pomodoro
|
||||||
** Org Ref
|
*** Org Ref
|
||||||
Ressources:
|
Ressources:
|
||||||
- https://github.com/tmalsburg/helm-bibtex
|
- https://github.com/tmalsburg/helm-bibtex
|
||||||
- https://github.com/jkitchin/org-ref
|
- https://github.com/jkitchin/org-ref
|
||||||
- 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 :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; 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 "~/MEGA/These/Ressources/notes")
|
(setq org-ref-notes-directory "~/MEGA/These/Ressources/notes")
|
||||||
@ -1028,10 +1033,10 @@ Ressources:
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org Noter
|
*** Org Noter
|
||||||
- https://github.com/weirdNox/org-noter
|
- https://github.com/weirdNox/org-noter
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; Fraction of the frame that the document window will occupy when split
|
;; Fraction of the frame that the document window will occupy when split
|
||||||
(setq org-noter-doc-split-fraction '(0.6 . 0.6))
|
(setq org-noter-doc-split-fraction '(0.6 . 0.6))
|
||||||
@ -1044,8 +1049,8 @@ Ressources:
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Custom key bindings
|
*** TODO Custom key bindings
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; Export to LaTeX
|
;; Export to LaTeX
|
||||||
(evil-define-key 'normal org-mode-map (kbd ", l") 'org-latex-export-to-latex)
|
(evil-define-key 'normal org-mode-map (kbd ", l") 'org-latex-export-to-latex)
|
||||||
;; Open pdf externally with Zathura
|
;; Open pdf externally with Zathura
|
||||||
@ -1053,15 +1058,15 @@ Ressources:
|
|||||||
;; (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)))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org-Contacts
|
*** Org-Contacts
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
(setq org-contacts-files (list (format "%s/%s" dropbox-base-path "org/contacts.org")))
|
(setq org-contacts-files (list (format "%s/%s" dropbox-base-path "org/contacts.org")))
|
||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org-Wunderlist
|
*** Org-Wunderlist
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(require 'org-wunderlist)
|
(require 'org-wunderlist)
|
||||||
(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641"
|
(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641"
|
||||||
org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"
|
org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"
|
||||||
@ -1069,8 +1074,8 @@ Ressources:
|
|||||||
org-wunderlist-dir "~/.emacs.d/org-wunderlist/")
|
org-wunderlist-dir "~/.emacs.d/org-wunderlist/")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** More Config
|
*** More Config
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
;; Highligh latex parts in org mode
|
;; Highligh latex parts in org mode
|
||||||
(setq org-highlight-latex-and-related '(latex))
|
(setq org-highlight-latex-and-related '(latex))
|
||||||
@ -1084,31 +1089,23 @@ Ressources:
|
|||||||
)
|
)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** NOTE Cheatsheet
|
** Projectile
|
||||||
*** View current TODOs of the file
|
#+BEGIN_SRC emacs-lisp
|
||||||
From the file:
|
|
||||||
- run the agenda =,a=
|
|
||||||
- restrict to the buffer using =<=
|
|
||||||
- run the agenda command like listing all TODOs entries using =t=
|
|
||||||
|
|
||||||
* Projectile
|
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
|
||||||
(setq projectile-generic-command "fd -H --ignore-file .projectile -t f -0")
|
(setq projectile-generic-command "fd -H --ignore-file .projectile -t f -0")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** TODO [#A] Matlab
|
||||||
* TODO [#A] Matlab
|
|
||||||
- https://github.com/yuhonglin/matlab-mode
|
- https://github.com/yuhonglin/matlab-mode
|
||||||
- https://github.com/pronobis/matlab-mode
|
- https://github.com/pronobis/matlab-mode
|
||||||
|
|
||||||
** Setup Matlab Mode
|
*** Setup Matlab Mode
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq matlab-shell-command "/usr/local/bin/matlab")
|
(setq matlab-shell-command "/usr/local/bin/matlab")
|
||||||
(setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
|
(setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
|
||||||
(setq mlint-programs '("mlint" "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint"))
|
(setq mlint-programs '("mlint" "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Setup Flycheck
|
*** Setup Flycheck
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defvar mlint-executable "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint")
|
(defvar mlint-executable "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint")
|
||||||
|
|
||||||
(flycheck-define-command-checker 'matlab-mlint
|
(flycheck-define-command-checker 'matlab-mlint
|
||||||
@ -1124,19 +1121,19 @@ From the file:
|
|||||||
(add-hook 'matlab-mode-hook 'flycheck-mode)
|
(add-hook 'matlab-mode-hook 'flycheck-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
|
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
|
||||||
(let ((file-name (buffer-file-name))) ;; (1)
|
(let ((file-name (buffer-file-name))) ;; (1)
|
||||||
ad-do-it ;; (2)
|
ad-do-it ;; (2)
|
||||||
(setq buffer-file-name file-name))) ;; (3)
|
(setq buffer-file-name file-name))) ;; (3)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Setup Company - not working
|
*** Setup Company - not working
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; (add-to-list 'company-backends 'company-matlab)
|
;; (add-to-list 'company-backends 'company-matlab)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Mails With Mu4e
|
** Mails With Mu4e
|
||||||
- https://github.com/kzar/davemail
|
- https://github.com/kzar/davemail
|
||||||
- http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/
|
- http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/
|
||||||
- http://spacemacs.org/layers/+email/mu4e/README.html
|
- http://spacemacs.org/layers/+email/mu4e/README.html
|
||||||
@ -1146,14 +1143,14 @@ From the file:
|
|||||||
- http://www.brool.com/post/using-mu4e/
|
- http://www.brool.com/post/using-mu4e/
|
||||||
- https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/
|
- https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/
|
||||||
|
|
||||||
** Set default mail user agent to mu4e
|
*** Set default mail user agent to mu4e
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mail-user-agent 'mu4e-user-agent)
|
(setq mail-user-agent 'mu4e-user-agent)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Default config
|
*** Default config
|
||||||
*** Default behavior
|
**** Default behavior
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-maildir "~/.mail"
|
(setq mu4e-maildir "~/.mail"
|
||||||
mu4e-update-interval nil
|
mu4e-update-interval nil
|
||||||
mu4e-compose-signature-auto-include t
|
mu4e-compose-signature-auto-include t
|
||||||
@ -1161,8 +1158,8 @@ From the file:
|
|||||||
mu4e-view-show-addresses t)
|
mu4e-view-show-addresses t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Default folders
|
**** Default folders
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-sent-folder "/gmail/Sent"
|
(setq mu4e-sent-folder "/gmail/Sent"
|
||||||
mu4e-drafts-folder "/gmail/Drafts"
|
mu4e-drafts-folder "/gmail/Drafts"
|
||||||
mu4e-trash-folder "/gmail/Trash"
|
mu4e-trash-folder "/gmail/Trash"
|
||||||
@ -1171,24 +1168,24 @@ From the file:
|
|||||||
user-mail-address "dehaeze.thomas@gmail.com")
|
user-mail-address "dehaeze.thomas@gmail.com")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Default signature and email address
|
**** Default signature and email address
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-compose-signature "Thomas Dehaeze\n"
|
(setq mu4e-compose-signature "Thomas Dehaeze\n"
|
||||||
user-mail-address "dehaeze.thomas@gmail.com")
|
user-mail-address "dehaeze.thomas@gmail.com")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Saving the attachment to Downloads directory
|
**** Saving the attachment to Downloads directory
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-attachment-dir "~/Downloads")
|
(setq mu4e-attachment-dir "~/Downloads")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** A list of user's e-mail addresses
|
**** A list of user's e-mail addresses
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr" "thomas.dehaeze@doct.ulg.ac.be"))
|
(setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr" "thomas.dehaeze@doct.ulg.ac.be"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Mail directory shortcuts
|
**** Mail directory shortcuts
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-maildir-shortcuts
|
(setq mu4e-maildir-shortcuts
|
||||||
'(
|
'(
|
||||||
("/gmail/Inbox" . ?g)
|
("/gmail/Inbox" . ?g)
|
||||||
@ -1197,8 +1194,8 @@ From the file:
|
|||||||
))
|
))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Contexts - Email accounts
|
*** Contexts - Email accounts
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq mu4e-contexts
|
(setq mu4e-contexts
|
||||||
`( ,(make-mu4e-context
|
`( ,(make-mu4e-context
|
||||||
:name "gmail"
|
:name "gmail"
|
||||||
@ -1259,8 +1256,8 @@ From the file:
|
|||||||
(setq mu4e-context-policy 'pick-first)
|
(setq mu4e-context-policy 'pick-first)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Receiving emails - Mbsync
|
*** Receiving emails - Mbsync
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq mu4e-get-mail-command "mbsync -a"
|
(setq mu4e-get-mail-command "mbsync -a"
|
||||||
smtpmail-default-smtp-server "smtp.gmail.com"
|
smtpmail-default-smtp-server "smtp.gmail.com"
|
||||||
smtpmail-smtp-server "smtp.gmail.com"
|
smtpmail-smtp-server "smtp.gmail.com"
|
||||||
@ -1268,17 +1265,17 @@ From the file:
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Let systemd get the mail, then pressing =U= will just run =mu= to reindex everything.
|
Let systemd get the mail, then pressing =U= will just run =mu= to reindex everything.
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-get-mail-command "true")
|
(setq mu4e-get-mail-command "true")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Fix for mbsync found [[http://pragmaticemacs.com/emacs/fixing-duplicate-uid-errors-when-using-mbsync-and-mu4e/][here]].
|
Fix for mbsync found [[http://pragmaticemacs.com/emacs/fixing-duplicate-uid-errors-when-using-mbsync-and-mu4e/][here]].
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-change-filenames-when-moving t)
|
(setq mu4e-change-filenames-when-moving t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Sending emails - Msmtp
|
*** Sending emails - Msmtp
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq smtpmail-default-smtp-server "smtp.gmail.com"
|
(setq smtpmail-default-smtp-server "smtp.gmail.com"
|
||||||
smtpmail-smtp-server "smtp.gmail.com"
|
smtpmail-smtp-server "smtp.gmail.com"
|
||||||
smtpmail-smtp-service 587)
|
smtpmail-smtp-service 587)
|
||||||
@ -1288,8 +1285,8 @@ Fix for mbsync found [[http://pragmaticemacs.com/emacs/fixing-duplicate-uid-erro
|
|||||||
user-full-name "Thomas Dehaeze")
|
user-full-name "Thomas Dehaeze")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Bookmarks
|
*** Bookmarks
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq mu4e-bookmarks
|
(setq mu4e-bookmarks
|
||||||
`(("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
|
`(("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
|
||||||
("date:today..now" "Today's messages" ?t)
|
("date:today..now" "Today's messages" ?t)
|
||||||
@ -1303,25 +1300,25 @@ Fix for mbsync found [[http://pragmaticemacs.com/emacs/fixing-duplicate-uid-erro
|
|||||||
"All inboxes" ?i)))
|
"All inboxes" ?i)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Notifications
|
*** Notifications
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'mu4e-alert
|
(with-eval-after-load 'mu4e-alert
|
||||||
(mu4e-alert-set-default-style 'libnotify))
|
(mu4e-alert-set-default-style 'libnotify))
|
||||||
(mu4e-alert-enable-notifications)
|
(mu4e-alert-enable-notifications)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO Mode-line notifications
|
**** TODO Mode-line notifications
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq mu4e-enable-mode-line t)
|
(setq mu4e-enable-mode-line t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** TODO [#A] When putting something on the Trash, it will be in the archive folder on gmail
|
*** TODO [#A] When putting something on the Trash, it will be in the archive folder on gmail
|
||||||
Even when totally deleting it. It will stage on gmail. How to fix that?
|
Even when totally deleting it. It will stage on gmail. How to fix that?
|
||||||
|
|
||||||
** TODO Verify that sending mails with gmail account works and that there is no duplicate
|
*** TODO Verify that sending mails with gmail account works and that there is no duplicate
|
||||||
SCHEDULED: <2019-01-17 jeu.>
|
SCHEDULED: <2019-01-17 jeu.>
|
||||||
Should check this variable: mu4e-sent-messages-behavior
|
Should check this variable: mu4e-sent-messages-behavior
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq mu4e-sent-messages-behavior 'delete)
|
(setq mu4e-sent-messages-behavior 'delete)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
And [[https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html][here]].
|
And [[https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html][here]].
|
||||||
@ -1330,7 +1327,7 @@ If I put it to delete, it works for gmail but not for the other ones...
|
|||||||
|
|
||||||
Check [[https://github.com/djcb/mu/issues/179][here]].
|
Check [[https://github.com/djcb/mu/issues/179][here]].
|
||||||
|
|
||||||
** TODO Cheatsheet
|
*** TODO Cheatsheet
|
||||||
| Command | Usage |
|
| Command | Usage |
|
||||||
|---------+-----------------------|
|
|---------+-----------------------|
|
||||||
| =C-j= | Next mail |
|
| =C-j= | Next mail |
|
||||||
@ -1339,22 +1336,22 @@ Check [[https://github.com/djcb/mu/issues/179][here]].
|
|||||||
| =t= | Move to Archive |
|
| =t= | Move to Archive |
|
||||||
| =d= | Move to Trash |
|
| =d= | Move to Trash |
|
||||||
|
|
||||||
*** TODO Add keybindings to refresh mu
|
**** TODO Add keybindings to refresh mu
|
||||||
|
|
||||||
*** TODO Send email using org-mode
|
**** TODO Send email using org-mode
|
||||||
|
|
||||||
*** Store emails into org-mode
|
**** Store emails into org-mode
|
||||||
Use =mu4e-org-store-and-capture= when on an email to store it using a capture template.
|
Use =mu4e-org-store-and-capture= when on an email to store it using a capture template.
|
||||||
Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste the link.
|
Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste the link.
|
||||||
|
|
||||||
* PDF-Tools
|
** PDF-Tools
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
|
(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Custom command and leader keys
|
** Custom command and leader keys
|
||||||
** Watch LaTeX file using latexmk
|
*** Watch LaTeX file using latexmk
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun latex/watch ()
|
(defun latex/watch ()
|
||||||
"Watch LaTeX file using latexmk"
|
"Watch LaTeX file using latexmk"
|
||||||
(interactive)
|
(interactive)
|
||||||
@ -1372,32 +1369,31 @@ Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste t
|
|||||||
(spacemacs/set-leader-keys "ok" 'latex/watch/kill)
|
(spacemacs/set-leader-keys "ok" 'latex/watch/kill)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Helm-Bibtex
|
*** Helm-Bibtex
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(spacemacs/set-leader-keys "ob" 'helm-bibtex)
|
(spacemacs/set-leader-keys "ob" 'helm-bibtex)
|
||||||
(spacemacs/set-leader-keys "of" 'helm-bibtex-favorites)
|
(spacemacs/set-leader-keys "of" 'helm-bibtex-favorites)
|
||||||
(spacemacs/set-leader-keys "or" 'helm-resume)
|
(spacemacs/set-leader-keys "or" 'helm-resume)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Eshell
|
*** Eshell
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(spacemacs/set-leader-keys "os" 'eshell)
|
(spacemacs/set-leader-keys "os" 'eshell)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Other Config
|
|
||||||
** Disable automatic highlight of TODO keywords in orgmode buffers
|
** Disable automatic highlight of TODO keywords in orgmode buffers
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-hook 'org-mode-hook (lambda () (hl-todo-mode -1)))
|
(add-hook 'org-mode-hook (lambda () (hl-todo-mode -1)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Path for Shell
|
** Path for Shell
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(when (memq window-system '(mac ns x))
|
(when (memq window-system '(mac ns x))
|
||||||
(exec-path-from-shell-initialize))
|
(exec-path-from-shell-initialize))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Proxy
|
** Proxy
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq url-proxy-services
|
(setq url-proxy-services
|
||||||
'(("http" . "proxy.esrf.fr:3128")
|
'(("http" . "proxy.esrf.fr:3128")
|
||||||
("https" . "proxy.esrf.fr:3128")
|
("https" . "proxy.esrf.fr:3128")
|
||||||
@ -1405,6 +1401,6 @@ Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste t
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Remove the problem of recentf files
|
** Remove the problem of recentf files
|
||||||
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
|
#+BEGIN_SRC emacs-lisp
|
||||||
(cancel-timer recentf-auto-save-timer)
|
(cancel-timer recentf-auto-save-timer)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
Loading…
Reference in New Issue
Block a user