Reworks the way spacemacs config is organized

This commit is contained in:
Thomas Dehaeze 2019-05-16 21:39:04 +02:00
parent 531d04dfc4
commit ee744ab206

View File

@ -1,22 +1,23 @@
#+TITLE: Spacemacs configuration
#+STARTUP: headlines
#+STARTUP: nohideblocks
#+STARTUP: noindent
#+PROPERTY: header-args:emacs-lisp :comments link :results silent
* User Init
:PROPERTIES:
:header-args:emacs-lisp+: :tangle ~/.spacemacs.d/user-init.el
:END:
** 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/"))
#+END_SRC
** Ispell
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
#+BEGIN_SRC emacs-lisp
(setq ispell-program-name "/usr/bin/aspell")
#+END_SRC
** Org latex fragment
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
#+BEGIN_SRC emacs-lisp
(defvar kk/org-latex-fragment-last nil
"Holds last fragment/environment you were on.")
@ -99,13 +100,18 @@
#+END_SRC
** Default Browser
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-init.el
#+BEGIN_SRC emacs-lisp
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "qutebrowser")
#+END_SRC
* User-Config
:PROPERTIES:
:header-args:emacs-lisp+: :tangle ~/.spacemacs.d/user-config.el
:END:
** Others
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
;; Line Wrapping
(spacemacs/toggle-truncate-lines-on)
@ -127,55 +133,54 @@
#+END_SRC
** 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-down>") 'enlarge-window)
(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
#+END_SRC
** Lockfiles
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(setq create-lockfiles nil)
#+end_src
** Autosave
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(setq backup-directory-alist `(("." . "~/.saves")))
(setq backup-by-copying t)
#+END_SRC
* Path
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** Path
#+BEGIN_SRC emacs-lisp
(setq thesis-base-path (expand-file-name "~/MEGA/These"))
(setq dropbox-base-path (expand-file-name "~/Dropbox"))
#+END_SRC
* Magit
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** Magit
#+BEGIN_SRC emacs-lisp
(setenv "GIT_ASKPASS" "git-gui--askpass")
(setq magit-diff-refine-hunk 'all)
#+END_SRC
* User informations
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** User informations
#+BEGIN_SRC emacs-lisp
;; Used to the \author for LaTeX export
(setq user-full-name "Thomas Dehaeze")
;; Used to set \email for LaTeX export
(setq user-mail-address "dehaeze.thomas@gmail.com")
#+END_SRC
* Alerts
** Change default alert backend
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(setq alert-default-style 'libnotify)
#+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/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex
** Basic LaTeX configuration
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Basic LaTeX configuration
#+BEGIN_SRC emacs-lisp
(defun latex/clean ()
"Clean LaTeX output using latexmk"
(interactive)
@ -191,13 +196,13 @@
(add-hook 'TeX-mode-hook #'TeX-fold-mode)
#+END_SRC
** Master file
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Master file
#+BEGIN_SRC emacs-lisp
(setq-default TeX-master nil)
#+END_SRC
** Pdf Viewer
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Pdf Viewer
#+BEGIN_SRC emacs-lisp
(setq TeX-view-program-selection '((output-pdf "Zathura")))
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
@ -206,9 +211,9 @@
'(("PDF Tools" TeX-pdf-tools-sync-view)))
#+END_SRC
** Helm-Bibtex
*** TODO General Config
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Helm-Bibtex
**** General Config
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'helm-bibtex
;; Use "tags" field when looking for bib entries
(setq helm-bibtex-additional-search-fields '(keywords))
@ -283,8 +288,8 @@
)
#+END_SRC
*** Open pdf externally
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Open pdf externally
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'helm-bibtex
(defun tdehaeze/open-pdf-externally (key)
(call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
@ -295,40 +300,40 @@
)
#+END_SRC
*** Special Commands
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Special Commands
#+BEGIN_SRC emacs-lisp
(defun helm-bibtex-favorites (&optional arg)
"Search Favorite BibTeX entries"
(interactive "P")
(helm-bibtex arg nil "favorite "))
#+END_SRC
* Auto Complete
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** Auto Complete
#+BEGIN_SRC emacs-lisp
(global-company-mode)
#+END_SRC
* Yas Snippets
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** Yas Snippets
#+BEGIN_SRC emacs-lisp
(setq yas-indent-line "fixed")
#+END_SRC
* Org-Mode
** Org-Mode
- http://cachestocaches.com/2016/9/my-workflow-org-agenda/
- http://doc.norang.ca/org-mode.html#TodoKeywords
- https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
** Org Tagging
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Tagging
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
;; Tags with fast selection keys
(setq org-tag-alist (quote (("@christophe" . ?c)
("@muriel" . ?m))))
)
#+END_SRC
** Org Gcal
*** Org Gcal
- 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
(setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"
org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9"
@ -340,15 +345,15 @@
)
#+END_SRC
** Org Refile
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Refile
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
)
#+END_SRC
** Org Todos
*** Org Todos
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
;; Tags with fast selection keys
(setq org-todo-keywords '(
@ -377,9 +382,9 @@ http://sachachua.com/blog/2014/04/thinking-todo-keywords/
("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
)
#+END_SRC
** Org Agenda
*** General configuration
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Agenda
**** General configuration
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
;; File to save todo items
(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
*** Org Agenda Custom Views
**** Org Agenda Custom Views
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
(defun tdehaeze/org-agenda-skip-scheduled ()
(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
*** TODO Add Custom Views for the bibliography
**** TODO Add Custom Views for the bibliography
- Things reading (BOOKMARS)
- Things to read
- 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
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq appt-message-warning-time 5)
(defun my-org-agenda-to-appt ()
@ -466,7 +471,7 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
)
#+END_SRC
*** appt-notification script
**** appt-notification script
:PROPERTIES:
:header-args: :tangle ~/bin/appt-notification
: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"
#+end_src
** Org Structure Template
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Structure Template
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq org-structure-template-alist
'(("a" . "export ascii")
@ -497,8 +502,8 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
)
#+END_SRC
** Org Capture
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Capture
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq org-directory "~/MEGA/These/TODOs/")
(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
** TODO Org Publish
*** TODO Org Publish
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
(setq org-publish-project-alist
'(
@ -570,9 +575,9 @@ https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
)
#+END_SRC
** Org Babel
*** Main configuration
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Babel
**** Main configuration
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
;; Don't ask for confirmation when evalutating latex blocs
(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
*** Library of Babel
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Library of Babel
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(org-babel-lob-ingest "~/MEGA/These/org-mode/org-babel-tutorial/org-babel-library.org")
)
#+END_SRC
*** Matlab
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Matlab
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(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
*** Asynchronous execution
**** Asynchronous execution
https://github.com/astahlman/ob-async
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(require 'ob-async)
#+end_src
*** Theme
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Theme
#+BEGIN_SRC emacs-lisp
(require 'color)
(set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))
#+end_src
** Org Export
*** Basic
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org Export
**** Basic
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
;; How many levels of headline to export
(setq org-export-headline-levels 4)
@ -657,18 +662,18 @@ https://github.com/astahlman/ob-async
(ox-extras-activate '(ignore-headlines))
)
#+END_SRC
*** Ox Latex Subfigure package
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Ox Latex Subfigure package
#+BEGIN_SRC emacs-lisp
(use-package ox-latex-subfigure
:init
(setq org-latex-prefer-user-labels t)
:config (require 'ox-latex-subfigure))
#+END_SRC
*** Clear page before heading
**** Clear page before heading
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 'ox-latex
(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)
))
#+END_SRC
*** TODO HTML Export
**** Export with css class instead of inline css
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** TODO HTML Export
***** Export with css class instead of inline css
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq org-html-htmlize-output-type 'css)
)
#+END_SRC
**** TODO MP4 movies
#+BEGIN_SRC emacs-lisp
***** TODO MP4 movies
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(setq org-html-html5-fancy t)
(setq org-html-doctype "xhtml-strict")
)
#+END_SRC
**** TODO MathJax with SIunix
#+BEGIN_SRC emacs-lisp
***** TODO MathJax with SIunix
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(setq org-html-mathjax-template
"<script type=\"text/x-mathjax-config\">
@ -736,9 +741,9 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
)
#+END_SRC
** Org LaTeX
*** LaTeX Classes
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org LaTeX
**** LaTeX Classes
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(with-eval-after-load 'ox-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
*** Basic
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Basic
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(with-eval-after-load 'ox-latex
;; Add packages by default
@ -823,12 +828,12 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
)
#+END_SRC
*** Beamer
**** TODO Make a custom environment for columns with title
**** Beamer
***** TODO Make a custom environment for columns with title
#+beamer: \csubtitle{title}\vspace{1em}
**** Custom Environments
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
***** Custom Environments
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(with-eval-after-load 'ox-beamer
(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
**** Beamer export options
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
***** Beamer export options
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(with-eval-after-load 'ox-beamer
(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
*** Latex Fragments
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Latex Fragments
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(with-eval-after-load 'ox-latex
;; 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
*** 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
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(defcustom tdehaeze/org-property-mapping
'((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
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(defun tdehaeze/replace-org-property (backend)
"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
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(defun tdehaeze/insert-org-label-latex (label)
"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
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(with-eval-after-load 'org
(defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info)
"Default format function for a headline.
@ -987,22 +992,22 @@ https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbit
)
#+END_SRC
** TODO Org-Bibtex
*** TODO Org-Bibtex
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)
;; (with-eval-after-load 'org
;; )
#+END_SRC
** TODO Org-pomodoro
** Org Ref
*** TODO Org-pomodoro
*** Org Ref
Ressources:
- https://github.com/tmalsburg/helm-bibtex
- https://github.com/jkitchin/org-ref
- 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
;; Folder where the notes files are located (or file if just one Note file)
(setq org-ref-notes-directory "~/MEGA/These/Ressources/notes")
@ -1028,10 +1033,10 @@ Ressources:
)
#+END_SRC
** Org Noter
*** 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
;; Fraction of the frame that the document window will occupy when split
(setq org-noter-doc-split-fraction '(0.6 . 0.6))
@ -1044,8 +1049,8 @@ Ressources:
)
#+END_SRC
** TODO Custom key bindings
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** TODO Custom key bindings
#+BEGIN_SRC emacs-lisp
;; Export to LaTeX
(evil-define-key 'normal org-mode-map (kbd ", l") 'org-latex-export-to-latex)
;; 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)))))
#+END_SRC
** Org-Contacts
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Org-Contacts
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
(setq org-contacts-files (list (format "%s/%s" dropbox-base-path "org/contacts.org")))
)
#+END_SRC
** Org-Wunderlist
#+BEGIN_SRC emacs-lisp
*** Org-Wunderlist
#+BEGIN_SRC emacs-lisp :tangle no
(require 'org-wunderlist)
(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641"
org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"
@ -1069,8 +1074,8 @@ Ressources:
org-wunderlist-dir "~/.emacs.d/org-wunderlist/")
#+END_SRC
** More Config
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** More Config
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org
;; Highligh latex parts in org mode
(setq org-highlight-latex-and-related '(latex))
@ -1084,31 +1089,23 @@ Ressources:
)
#+END_SRC
** NOTE Cheatsheet
*** View current TODOs of the file
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
** Projectile
#+BEGIN_SRC emacs-lisp
(setq projectile-generic-command "fd -H --ignore-file .projectile -t f -0")
#+END_SRC
* TODO [#A] Matlab
** TODO [#A] Matlab
- https://github.com/yuhonglin/matlab-mode
- https://github.com/pronobis/matlab-mode
** Setup Matlab Mode
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Setup Matlab Mode
#+BEGIN_SRC emacs-lisp
(setq matlab-shell-command "/usr/local/bin/matlab")
(setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
(setq mlint-programs '("mlint" "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint"))
#+END_SRC
** Setup Flycheck
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Setup Flycheck
#+BEGIN_SRC emacs-lisp
(defvar mlint-executable "/usr/local/MATLAB/R2018a/bin/glnxa64/mlint")
(flycheck-define-command-checker 'matlab-mlint
@ -1124,19 +1121,19 @@ From the file:
(add-hook 'matlab-mode-hook 'flycheck-mode)
#+END_SRC
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
(let ((file-name (buffer-file-name))) ;; (1)
ad-do-it ;; (2)
(setq buffer-file-name file-name))) ;; (3)
#+END_SRC
** Setup Company - not working
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Setup Company - not working
#+BEGIN_SRC emacs-lisp
;; (add-to-list 'company-backends 'company-matlab)
#+END_SRC
* Mails With Mu4e
** Mails With Mu4e
- https://github.com/kzar/davemail
- http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/
- http://spacemacs.org/layers/+email/mu4e/README.html
@ -1146,14 +1143,14 @@ From the file:
- http://www.brool.com/post/using-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
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Set default mail user agent to mu4e
#+BEGIN_SRC emacs-lisp
(setq mail-user-agent 'mu4e-user-agent)
#+END_SRC
** Default config
*** Default behavior
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Default config
**** Default behavior
#+BEGIN_SRC emacs-lisp
(setq mu4e-maildir "~/.mail"
mu4e-update-interval nil
mu4e-compose-signature-auto-include t
@ -1161,8 +1158,8 @@ From the file:
mu4e-view-show-addresses t)
#+END_SRC
*** Default folders
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Default folders
#+BEGIN_SRC emacs-lisp
(setq mu4e-sent-folder "/gmail/Sent"
mu4e-drafts-folder "/gmail/Drafts"
mu4e-trash-folder "/gmail/Trash"
@ -1171,24 +1168,24 @@ From the file:
user-mail-address "dehaeze.thomas@gmail.com")
#+END_SRC
*** Default signature and email address
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Default signature and email address
#+BEGIN_SRC emacs-lisp
(setq mu4e-compose-signature "Thomas Dehaeze\n"
user-mail-address "dehaeze.thomas@gmail.com")
#+END_SRC
*** Saving the attachment to Downloads directory
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Saving the attachment to Downloads directory
#+BEGIN_SRC emacs-lisp
(setq mu4e-attachment-dir "~/Downloads")
#+END_SRC
*** A list of user's e-mail addresses
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** A list of user's e-mail addresses
#+BEGIN_SRC emacs-lisp
(setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr" "thomas.dehaeze@doct.ulg.ac.be"))
#+END_SRC
*** Mail directory shortcuts
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** Mail directory shortcuts
#+BEGIN_SRC emacs-lisp
(setq mu4e-maildir-shortcuts
'(
("/gmail/Inbox" . ?g)
@ -1197,8 +1194,8 @@ From the file:
))
#+END_SRC
** Contexts - Email accounts
#+BEGIN_SRC emacs-lisp
*** Contexts - Email accounts
#+BEGIN_SRC emacs-lisp :tangle no
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "gmail"
@ -1259,8 +1256,8 @@ From the file:
(setq mu4e-context-policy 'pick-first)
#+END_SRC
** Receiving emails - Mbsync
#+BEGIN_SRC emacs-lisp
*** Receiving emails - Mbsync
#+BEGIN_SRC emacs-lisp :tangle no
(setq mu4e-get-mail-command "mbsync -a"
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
@ -1268,17 +1265,17 @@ From the file:
#+END_SRC
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")
#+end_src
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)
#+end_src
** Sending emails - Msmtp
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Sending emails - Msmtp
#+BEGIN_SRC emacs-lisp
(setq smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
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")
#+END_SRC
** Bookmarks
#+BEGIN_SRC emacs-lisp
*** Bookmarks
#+BEGIN_SRC emacs-lisp :tangle no
(setq mu4e-bookmarks
`(("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
("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)))
#+END_SRC
** Notifications
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Notifications
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'mu4e-alert
(mu4e-alert-set-default-style 'libnotify))
(mu4e-alert-enable-notifications)
#+END_SRC
** TODO Mode-line notifications
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
**** TODO Mode-line notifications
#+BEGIN_SRC emacs-lisp
(setq mu4e-enable-mode-line t)
#+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?
** 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.>
Should check this variable: mu4e-sent-messages-behavior
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(setq mu4e-sent-messages-behavior 'delete)
#+END_SRC
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]].
** TODO Cheatsheet
*** TODO Cheatsheet
| Command | Usage |
|---------+-----------------------|
| =C-j= | Next mail |
@ -1339,22 +1336,22 @@ Check [[https://github.com/djcb/mu/issues/179][here]].
| =t= | Move to Archive |
| =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.
Org simply =C-c l= to store the link to the email and then =C-c C-l= and paste the link.
* PDF-Tools
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** PDF-Tools
#+BEGIN_SRC emacs-lisp
(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
#+END_SRC
* Custom command and leader keys
** Watch LaTeX file using latexmk
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
** Custom command and leader keys
*** Watch LaTeX file using latexmk
#+BEGIN_SRC emacs-lisp
(defun latex/watch ()
"Watch LaTeX file using latexmk"
(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)
#+END_SRC
** Helm-Bibtex
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Helm-Bibtex
#+BEGIN_SRC emacs-lisp
(spacemacs/set-leader-keys "ob" 'helm-bibtex)
(spacemacs/set-leader-keys "of" 'helm-bibtex-favorites)
(spacemacs/set-leader-keys "or" 'helm-resume)
#+END_SRC
** Eshell
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
*** Eshell
#+BEGIN_SRC emacs-lisp
(spacemacs/set-leader-keys "os" 'eshell)
#+END_SRC
* Other Config
** 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)))
#+END_SRC
** Path for Shell
#+BEGIN_SRC emacs-lisp :tangle ~/.spacemacs.d/user-config.el
#+BEGIN_SRC emacs-lisp
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize))
#+END_SRC
** Proxy
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(setq url-proxy-services
'(("http" . "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
** 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)
#+END_SRC