107 lines
3.1 KiB
Org Mode
107 lines
3.1 KiB
Org Mode
#+title: My Org-mode Emacs Config
|
|
#+author: Samuel ORTION
|
|
#+date: 2023-08-10
|
|
|
|
* Doom theme
|
|
** Use nerd-font in Emacs (for better support in vterm to liquidprompt)
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq doom-font (font-spec :family "Blex Mono Nerd Font" :size 12)
|
|
doom-big-font (font-spec :family "Blex Mono Nerd Font" :size 24)
|
|
doom-variable-pitch-font (font-spec :family "Blex Mono Nerd Font" :size 12)
|
|
doom-unicode-font (font-spec :family "Blex Mono Nerd Font")
|
|
doom-serif-font (font-spec :family "Blex Mono Nerd Font" :size 12 :weight 'light))
|
|
#+end_src
|
|
* UI
|
|
|
|
* Edition modes
|
|
|
|
** Quarto
|
|
|
|
** LaTeX
|
|
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq TeX-quote-after-quote t)
|
|
#+end_src
|
|
|
|
*** Fix =cdlatex= back quote binding
|
|
#+begin_quote
|
|
I want my back quotes back.
|
|
#+end_quote
|
|
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq cdlatex-math-symbol-prefix [f12])
|
|
#+end_src
|
|
|
|
Add srcartcl to ox-latex class
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(eval-after-load "ox-latex"
|
|
'(add-to-list 'org-latex-classes
|
|
'("scrartcl" "\\documentclass{scrartcl}"
|
|
("\\section{%s}" . "\\section*{%s}")
|
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
|
|
#+end_src
|
|
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq org-latex-compiler "lualatex")
|
|
#+end_src
|
|
|
|
Use minted for code listings:
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq org-latex-listings 'minted
|
|
org-latex-packages-alist '(("" "minted"))
|
|
org-latex-pdf-process
|
|
'("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
|
"lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
|
#+end_src
|
|
Disable LateX preview in Org-mode by default
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(setq org-startup-with-latex-preview nil)
|
|
#+end_src
|
|
|
|
** Expand initial Frame
|
|
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
|
#+end_src
|
|
|
|
** Enable conda environment in a Org-mode
|
|
|
|
#+begin_src emacs-lisp :tangle yes
|
|
(require 'conda)
|
|
(conda-env-initialize-interactive-shells)
|
|
#+end_src
|
|
|
|
* Emacs Server & Emacs Client
|
|
|
|
Emacs can be a little slow to startup: it might come useful to use Emacs server to share the initialization cost between instances.
|
|
|
|
|
|
Let's add an entry to our applications launcher, in client mode:
|
|
#+begin_src desktop :tangle no
|
|
# In ~/.local/share/applications/emacs-client.desktop
|
|
[Desktop Entry]
|
|
Name=Emacs (Client)
|
|
GenericName=Text Editor
|
|
Comment=Edit text
|
|
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
|
Exec=emacsclient -fs -c -a "emacs" %F
|
|
Icon=emacs
|
|
Type=Application
|
|
Terminal=false
|
|
Categories=Development;TextEditor;Utility;
|
|
StartupWMClass=Emacs
|
|
#+end_src
|
|
|
|
the =-fs= option enable to launch Emacs in full-screen mode at startup.
|
|
|
|
Then we start the Emacs daemon:
|
|
#+begin_src bash :tangle no
|
|
systemctl --user enable --now emacs
|
|
#+end_src
|
|
|
|
#+RESULTS:
|
|
|