[Emacs] Cleaner init file export, fix some elisp code
However, I currently have the issue of the packages `org' having two straight recipies and I cannot find the dependency that’s causing this.
This commit is contained in:
parent
644f96305b
commit
e30ca77fbe
@ -383,7 +383,7 @@ Doom-Emacs has some really nice macros that can come in really handy,
|
|||||||
but since I prefer to rely on my own configuration, I’ll instead just
|
but since I prefer to rely on my own configuration, I’ll instead just
|
||||||
copy their code here. First we get the ~after!~ macro:
|
copy their code here. First we get the ~after!~ macro:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'cl)
|
(require 'cl-lib)
|
||||||
(defmacro after! (package &rest body)
|
(defmacro after! (package &rest body)
|
||||||
"Evaluate BODY after PACKAGE have loaded.
|
"Evaluate BODY after PACKAGE have loaded.
|
||||||
|
|
||||||
@ -1403,7 +1403,7 @@ Paris 8 (my university).
|
|||||||
|
|
||||||
Next I need an inbox dedicated to the association I’m part of.
|
Next I need an inbox dedicated to the association I’m part of.
|
||||||
#+name: mu4e-bookmarks-filter-asso
|
#+name: mu4e-bookmarks-filter-asso
|
||||||
#+headers: tangle no :cache yes
|
#+headers: :tangle no :cache yes
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(let ((regex "/.*supran\\.fr/"))
|
(let ((regex "/.*supran\\.fr/"))
|
||||||
<<mu4e-bookmarks-from-copy-to-gen>>)
|
<<mu4e-bookmarks-from-copy-to-gen>>)
|
||||||
@ -1637,7 +1637,7 @@ Let’s enable them and set them:
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+name: mu4e-vertical-split
|
#+name: mu4e-vertical-split
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun my/set-mu4e-headers-width ()
|
(defun my/set-mu4e-headers-width ()
|
||||||
(let ((width (window-body-width))
|
(let ((width (window-body-width))
|
||||||
(threshold (+ 120 80)))
|
(threshold (+ 120 80)))
|
||||||
@ -2276,6 +2276,7 @@ since been archived. New implementations then appeared, one of them is
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package parinfer-rust-mode
|
(use-package parinfer-rust-mode
|
||||||
:defer t
|
:defer t
|
||||||
|
:straight (:build t)
|
||||||
:diminish parinfer-rust-mode
|
:diminish parinfer-rust-mode
|
||||||
:hook emacs-lisp-mode common-lisp-mode scheme-mode
|
:hook emacs-lisp-mode common-lisp-mode scheme-mode
|
||||||
:init
|
:init
|
||||||
@ -2407,7 +2408,8 @@ display the latest commit message and its age about a file in the file
|
|||||||
tree. And by default, I want ~dired-git-info~ to hide file details.
|
tree. And by default, I want ~dired-git-info~ to hide file details.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package dired-git-info
|
(use-package dired-git-info
|
||||||
:after dired
|
:after (dired)
|
||||||
|
:straight (:build t)
|
||||||
:hook (dired-after-reading . dired-git-info-auto-enable)
|
:hook (dired-after-reading . dired-git-info-auto-enable)
|
||||||
:general
|
:general
|
||||||
(:keymaps 'dired-mode-map
|
(:keymaps 'dired-mode-map
|
||||||
@ -2420,8 +2422,8 @@ tree. And by default, I want ~dired-git-info~ to hide file details.
|
|||||||
Diredfl makes dired colorful, and much more readable in my opinion.
|
Diredfl makes dired colorful, and much more readable in my opinion.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package diredfl
|
(use-package diredfl
|
||||||
|
:after (dired all-the-icons)
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
:after dired
|
|
||||||
:init
|
:init
|
||||||
(diredfl-global-mode 1))
|
(diredfl-global-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -2429,13 +2431,16 @@ Diredfl makes dired colorful, and much more readable in my opinion.
|
|||||||
And let’s add some fancy icons in dired!
|
And let’s add some fancy icons in dired!
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package all-the-icons-dired
|
(use-package all-the-icons-dired
|
||||||
|
:after (all-the-icons)
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
|
:defer t
|
||||||
:hook (dired-mode . all-the-icons-dired-mode))
|
:hook (dired-mode . all-the-icons-dired-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package image-dired+
|
(use-package image-dired+
|
||||||
:after image-dired
|
:after (image-dired)
|
||||||
|
:straight (:build t)
|
||||||
:init (image-diredx-adjust-mode 1))
|
:init (image-diredx-adjust-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -2485,19 +2490,27 @@ Eshell is a built-in shell available from Emacs which I use almost as
|
|||||||
often as fish. Some adjustments are necessary to make it fit my taste
|
often as fish. Some adjustments are necessary to make it fit my taste
|
||||||
though.
|
though.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(general-define-key
|
(use-package eshell
|
||||||
:keymaps 'eshell-mode-map
|
:defer t
|
||||||
|
:straight (:type built-in :build t)
|
||||||
|
:general
|
||||||
|
(:keymaps 'eshell-mode-map
|
||||||
:states 'normal
|
:states 'normal
|
||||||
"c" #'evil-backward-char
|
"c" #'evil-backward-char
|
||||||
"t" #'evil-next-line
|
"t" #'evil-next-line
|
||||||
"s" #'evil-previous-line
|
"s" #'evil-previous-line
|
||||||
"r" #'evil-forward-char)
|
"r" #'evil-forward-char)
|
||||||
|
(:keymaps 'eshell-mode-map
|
||||||
(general-define-key
|
|
||||||
:keymaps 'eshell-mode-map
|
|
||||||
:states 'insert
|
:states 'insert
|
||||||
"C-a" #'eshell-bol
|
"C-a" #'eshell-bol
|
||||||
"C-e" #'end-of-line)
|
"C-e" #'end-of-line)
|
||||||
|
:config
|
||||||
|
<<eshell-alias-file>>
|
||||||
|
<<eshell-concat-shell-command>>
|
||||||
|
<<eshell-alias-open>>
|
||||||
|
<<eshell-alias-buffers>>
|
||||||
|
<<eshell-alias-emacs>>
|
||||||
|
<<eshell-alias-mkcd>>)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Aliases
|
**** Aliases
|
||||||
@ -2506,14 +2519,16 @@ though.
|
|||||||
:END:
|
:END:
|
||||||
First, let’s declare our list of “dumb” aliases we’ll use in
|
First, let’s declare our list of “dumb” aliases we’ll use in
|
||||||
Eshell. You can find them here.
|
Eshell. You can find them here.
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-alias-file
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq eshell-aliases-file (expand-file-name "eshell-aliases" user-emacs-directory))
|
(setq eshell-aliases-file (expand-file-name "eshell-aliases" user-emacs-directory))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
A couple of other aliases will be defined through custom Elisp
|
A couple of other aliases will be defined through custom Elisp
|
||||||
functions, but first I’ll need a function for concatenating a shell
|
functions, but first I’ll need a function for concatenating a shell
|
||||||
command into a single string:
|
command into a single string:
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-concat-shell-command
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun phundrak/concatenate-shell-command (&rest command)
|
(defun phundrak/concatenate-shell-command (&rest command)
|
||||||
"Concatenate an eshell COMMAND into a single string.
|
"Concatenate an eshell COMMAND into a single string.
|
||||||
All elements of COMMAND will be joined in a single
|
All elements of COMMAND will be joined in a single
|
||||||
@ -2524,7 +2539,8 @@ space-separated string."
|
|||||||
I’ll also declare some aliases here, such as ~open~ and ~openo~ that
|
I’ll also declare some aliases here, such as ~open~ and ~openo~ that
|
||||||
respectively allow me to open a file in Emacs, and same but in another
|
respectively allow me to open a file in Emacs, and same but in another
|
||||||
window.
|
window.
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-alias-open
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defalias 'open 'find-file)
|
(defalias 'open 'find-file)
|
||||||
(defalias 'openo 'find-file-other-window)
|
(defalias 'openo 'find-file-other-window)
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -2535,7 +2551,8 @@ my aliases file for stuff that could work too with other shells were
|
|||||||
the syntax a bit different, and aliases related to Elisp are kept
|
the syntax a bit different, and aliases related to Elisp are kept
|
||||||
programmatically. I’ll also declare ~list-buffers~ an alias of ~ibuffer~
|
programmatically. I’ll also declare ~list-buffers~ an alias of ~ibuffer~
|
||||||
because naming it that way kind of makes more sense to me.
|
because naming it that way kind of makes more sense to me.
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-alias-buffers
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defalias 'list-buffers 'ibuffer)
|
(defalias 'list-buffers 'ibuffer)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -2543,7 +2560,8 @@ I still have some stupid muscle memory telling me to open ~emacs~, ~vim~
|
|||||||
or ~nano~ in Eshell, which is stupid: I’m already inside Emacs and I
|
or ~nano~ in Eshell, which is stupid: I’m already inside Emacs and I
|
||||||
have all its power available instantly. So, let’s open each file
|
have all its power available instantly. So, let’s open each file
|
||||||
passed to these commands.
|
passed to these commands.
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-alias-emacs
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun eshell/emacs (&rest file)
|
(defun eshell/emacs (&rest file)
|
||||||
"Open each FILE and kill eshell.
|
"Open each FILE and kill eshell.
|
||||||
Old habits die hard."
|
Old habits die hard."
|
||||||
@ -2556,7 +2574,8 @@ Finally, I’ll declare ~mkcd~ which allows the simultaneous creation of a
|
|||||||
directory and moving into this newly created directory. And of course,
|
directory and moving into this newly created directory. And of course,
|
||||||
it will also work if the directory also exists or if parent
|
it will also work if the directory also exists or if parent
|
||||||
directories don’t, similarly to the ~-p~ option passed to ~mkdir~.
|
directories don’t, similarly to the ~-p~ option passed to ~mkdir~.
|
||||||
#+begin_src emacs-lisp
|
#+name: eshell-alias-mkcd
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun eshell/mkcd (dir)
|
(defun eshell/mkcd (dir)
|
||||||
"Create the directory DIR and move there.
|
"Create the directory DIR and move there.
|
||||||
If the directory DIR doesn’t exist, create it and its parents
|
If the directory DIR doesn’t exist, create it and its parents
|
||||||
@ -2651,6 +2670,7 @@ I fire up a terminal. I haven’t found anything that does that the way
|
|||||||
I like it, so [[https://github.com/Phundrak/eshell-info-banner.el][I’ve written a package]]!
|
I like it, so [[https://github.com/Phundrak/eshell-info-banner.el][I’ve written a package]]!
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eshell-info-banner
|
(use-package eshell-info-banner
|
||||||
|
:after (eshell)
|
||||||
:defer t
|
:defer t
|
||||||
:straight (eshell-info-banner :build t
|
:straight (eshell-info-banner :build t
|
||||||
:type git
|
:type git
|
||||||
@ -2666,8 +2686,9 @@ Another feature I like is fish-like syntax highlight, which brings
|
|||||||
some more colors to Eshell.
|
some more colors to Eshell.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eshell-syntax-highlighting
|
(use-package eshell-syntax-highlighting
|
||||||
:after esh-mode
|
:after (esh-mode eshell)
|
||||||
:defer t
|
:defer t
|
||||||
|
:straight (:build t)
|
||||||
:config
|
:config
|
||||||
(eshell-syntax-highlighting-global-mode +1))
|
(eshell-syntax-highlighting-global-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -2699,36 +2720,19 @@ a more human-readable name, see [[https://protesilaos.com/codelog/2021-10-15-ema
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: Packages-Configuration-Emacs-built-ins-Info-r7x90j20c5j0
|
:CUSTOM_ID: Packages-Configuration-Emacs-built-ins-Info-r7x90j20c5j0
|
||||||
:END:
|
:END:
|
||||||
Something that irks me as I use evil and a leader key is that the
|
Let’s define some more intuitive keybinds for ~info-mode~.
|
||||||
space bar is already bound to a function, ~Info-scroll-up~. Same goes
|
|
||||||
for my local leader ~,~ which is bound to ~Info-index-next~. I don’t want
|
|
||||||
that, so let’s unbind them:
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(general-define-key
|
(use-package info
|
||||||
:keymaps '(Info-mode-map)
|
:defer t
|
||||||
"SPC" nil
|
:straight (info :type built-in :build t)
|
||||||
"," nil)
|
:general
|
||||||
(general-define-key
|
(:keymaps 'Info-mode-map
|
||||||
:keymaps '(Info-mode-map)
|
|
||||||
:states 'normal
|
|
||||||
"SPC" nil
|
|
||||||
"," nil)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Alright, now that we correctly unbound them, my global leader key
|
|
||||||
works again, and I’m free to use the comma as a local leader, so let’s
|
|
||||||
do that:
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(general-define-key
|
|
||||||
:keymaps 'Info-mode-map
|
|
||||||
:states 'normal
|
:states 'normal
|
||||||
"c" #'Info-prev
|
"c" #'Info-prev
|
||||||
"t" #'evil-scroll-down
|
"t" #'evil-scroll-down
|
||||||
"s" #'evil-scroll-up
|
"s" #'evil-scroll-up
|
||||||
"r" #'Info-next)
|
"r" #'Info-next)
|
||||||
|
(:keymaps 'Info-mode-map
|
||||||
(general-define-key
|
|
||||||
:keymaps 'Info-mode-map
|
|
||||||
:states 'normal
|
:states 'normal
|
||||||
:prefix ","
|
:prefix ","
|
||||||
"?" #'Info-toc
|
"?" #'Info-toc
|
||||||
@ -2736,7 +2740,7 @@ do that:
|
|||||||
"f" #'Info-history-forward
|
"f" #'Info-history-forward
|
||||||
"m" #'Info-menu
|
"m" #'Info-menu
|
||||||
"t" #'Info-top-node
|
"t" #'Info-top-node
|
||||||
"u" #'Info-up)
|
"u" #'Info-up))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Tramp
|
*** Tramp
|
||||||
@ -2749,6 +2753,10 @@ various hosts using various protocols, such as ~ssh~ and
|
|||||||
supported natively. I will describe them here.
|
supported natively. I will describe them here.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'tramp)
|
(require 'tramp)
|
||||||
|
(use-package tramp
|
||||||
|
:straight (tramp :type built-in :build t)
|
||||||
|
:init
|
||||||
|
<<tramp-add-yadm>>)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Yadm
|
**** Yadm
|
||||||
@ -2760,7 +2768,8 @@ loads of features I don’t use (the main one I like but don’t use is
|
|||||||
its [[https://yadm.io/docs/templates][Jinja-like host and OS-aware syntax]]), but unfortunately Magit
|
its [[https://yadm.io/docs/templates][Jinja-like host and OS-aware syntax]]), but unfortunately Magit
|
||||||
doesn’t play nice with it. Tramp to the rescue, and this page explains
|
doesn’t play nice with it. Tramp to the rescue, and this page explains
|
||||||
how! Let’s just insert in my config this code snippet:
|
how! Let’s just insert in my config this code snippet:
|
||||||
#+begin_src emacs-lisp
|
#+name: tramp-add-yadm
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(add-to-list 'tramp-methods
|
(add-to-list 'tramp-methods
|
||||||
'("yadm"
|
'("yadm"
|
||||||
(tramp-login-program "yadm")
|
(tramp-login-program "yadm")
|
||||||
@ -2844,6 +2853,15 @@ enhances a couple of built-in functions from Emacs, namely:
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: Packages-Configuration-Org-modedw35fl6184j0
|
:CUSTOM_ID: Packages-Configuration-Org-modedw35fl6184j0
|
||||||
:END:
|
:END:
|
||||||
|
Since recently, in order to make ~org-cite~ compile properly, we need
|
||||||
|
the ~citeproc~ package, a citation processor.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package citeproc
|
||||||
|
:after (org)
|
||||||
|
:defer t
|
||||||
|
:straight (:build t))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
Org is the main reason I am using Emacs. It is an extremely powerfu
|
Org is the main reason I am using Emacs. It is an extremely powerfu
|
||||||
tool when you want to write anything that is not necessarily primarily
|
tool when you want to write anything that is not necessarily primarily
|
||||||
programming-related, though it absolutely can be! Org can be a
|
programming-related, though it absolutely can be! Org can be a
|
||||||
@ -2906,7 +2924,9 @@ extended however we like!
|
|||||||
<<org-latex-listings>>
|
<<org-latex-listings>>
|
||||||
<<org-latex-default-packages>>
|
<<org-latex-default-packages>>
|
||||||
<<org-export-latex-hyperref-format>>
|
<<org-export-latex-hyperref-format>>
|
||||||
|
<<org-export-latex-minted-options>>
|
||||||
<<org-latex-pdf-process>>
|
<<org-latex-pdf-process>>
|
||||||
|
<<org-latex-logfiles-add-extensions>>
|
||||||
<<org-re-reveal-root>>
|
<<org-re-reveal-root>>
|
||||||
<<org-html-validation>>
|
<<org-html-validation>>
|
||||||
<<org-latex-classes>>
|
<<org-latex-classes>>
|
||||||
@ -2941,7 +2961,7 @@ comfortable than the default ones you get with evil and org naked.
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-org
|
(use-package evil-org
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
:after org
|
:after (org)
|
||||||
:hook (org-mode . evil-org-mode)
|
:hook (org-mode . evil-org-mode)
|
||||||
:config
|
:config
|
||||||
(setq-default evil-org-movement-bindings
|
(setq-default evil-org-movement-bindings
|
||||||
@ -2961,7 +2981,6 @@ trees, converting translitterated text to its native script, etc…
|
|||||||
(use-package conlanging
|
(use-package conlanging
|
||||||
:straight (conlanging :build t
|
:straight (conlanging :build t
|
||||||
:type git
|
:type git
|
||||||
:host nil
|
|
||||||
:repo "https://labs.phundrak.com/phundrak/conlanging.el")
|
:repo "https://labs.phundrak.com/phundrak/conlanging.el")
|
||||||
:after org
|
:after org
|
||||||
:defer t)
|
:defer t)
|
||||||
@ -2974,6 +2993,8 @@ it. The main reason I want ~org-contrib~ is due to ~ox-extra~ that allow
|
|||||||
the usage of the ~:ignore:~ tag in org.
|
the usage of the ~:ignore:~ tag in org.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-contrib
|
(use-package org-contrib
|
||||||
|
:after (org)
|
||||||
|
:defer t
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
:init
|
:init
|
||||||
(require 'ox-extra)
|
(require 'ox-extra)
|
||||||
@ -3011,7 +3032,7 @@ for org files that will be hosted and viewable on Github.
|
|||||||
|
|
||||||
~electric-mode~ also bothers me a lot when editing org files, so let’s deactivate it:
|
~electric-mode~ also bothers me a lot when editing org files, so let’s deactivate it:
|
||||||
#+name: org-behavior-electric
|
#+name: org-behavior-electric
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(add-hook 'org-mode-hook (lambda ()
|
(add-hook 'org-mode-hook (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(electric-indent-local-mode -1)))
|
(electric-indent-local-mode -1)))
|
||||||
@ -3046,6 +3067,7 @@ to easily convert a LaTeX snippet into a PNG, regardless of the
|
|||||||
exporter I use afterwards. Its installation is pretty simple:
|
exporter I use afterwards. Its installation is pretty simple:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ob-latex-as-png
|
(use-package ob-latex-as-png
|
||||||
|
:after (org)
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
:defer t)
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -3075,7 +3097,7 @@ activated. Here are the languages I activated in my Org-mode configuration:
|
|||||||
#+NAME: org-babel-languages-gen
|
#+NAME: org-babel-languages-gen
|
||||||
#+header: :cache yes :results replace
|
#+header: :cache yes :results replace
|
||||||
#+header: :var languages=org-babel-languages-table[,0]
|
#+header: :var languages=org-babel-languages-table[,0]
|
||||||
#+BEGIN_SRC emacs-lisp :exports none
|
#+BEGIN_SRC emacs-lisp :exports none :tangle no
|
||||||
(format "'(%s)"
|
(format "'(%s)"
|
||||||
(mapconcat (lambda ($language)
|
(mapconcat (lambda ($language)
|
||||||
(format "(%s . t)" $language))
|
(format "(%s . t)" $language))
|
||||||
@ -3121,7 +3143,6 @@ describing phonetics evolution. So, let’s disable it:
|
|||||||
(setq org-use-sub-superscripts (quote {}))
|
(setq org-use-sub-superscripts (quote {}))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
**** Epub
|
**** Epub
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: Packages-Configuration-Org-mode-File-export-Epub-w5ycfuz095j0
|
:CUSTOM_ID: Packages-Configuration-Org-mode-File-export-Epub-w5ycfuz095j0
|
||||||
@ -3130,7 +3151,7 @@ A backend for exporting files through org I like is ~ox-epub~ which, as
|
|||||||
you can guess, exports org files to the [[https://www.w3.org/publishing/epub32/][Epub format]].
|
you can guess, exports org files to the [[https://www.w3.org/publishing/epub32/][Epub format]].
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ox-epub
|
(use-package ox-epub
|
||||||
:after ox
|
:after (org ox)
|
||||||
:straight (:build t))
|
:straight (:build t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -3141,20 +3162,21 @@ you can guess, exports org files to the [[https://www.w3.org/publishing/epub32/]
|
|||||||
For Reveal.JS exports, I need to set where to find the framework by
|
For Reveal.JS exports, I need to set where to find the framework by
|
||||||
default:
|
default:
|
||||||
#+NAME: org-re-reveal-root
|
#+NAME: org-re-reveal-root
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-re-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
|
(setq org-re-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
On HTML exports, Org-mode tries to include a validation link for the
|
On HTML exports, Org-mode tries to include a validation link for the
|
||||||
exported HTML. Let’s disable that since I never use it.
|
exported HTML. Let’s disable that since I never use it.
|
||||||
#+NAME: org-html-validation
|
#+NAME: org-html-validation
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-html-validation-link nil)
|
(setq org-html-validation-link nil)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package htmlize
|
;; (use-package htmlize
|
||||||
:defer t)
|
;; :defer t
|
||||||
|
;; :straight (:build t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
This package allows for live-previewing the HTML export of an org
|
This package allows for live-previewing the HTML export of an org
|
||||||
@ -3164,7 +3186,7 @@ files.
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package preview-org-html-mode
|
(use-package preview-org-html-mode
|
||||||
:defer t
|
:defer t
|
||||||
:after org
|
:after (org)
|
||||||
:straight (preview-org-html-mode :build t
|
:straight (preview-org-html-mode :build t
|
||||||
:type git
|
:type git
|
||||||
:host github
|
:host github
|
||||||
@ -3189,14 +3211,14 @@ When it comes to exports, I want the LaTeX and PDF exports to be done
|
|||||||
with XeLaTeX only. This implies the modification of the following
|
with XeLaTeX only. This implies the modification of the following
|
||||||
variable:
|
variable:
|
||||||
#+NAME: org-latex-compiler
|
#+NAME: org-latex-compiler
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-latex-compiler "xelatex")
|
(setq org-latex-compiler "xelatex")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
I also want to get by default ~minted~ for LaTeX listings so I can have
|
I also want to get by default ~minted~ for LaTeX listings so I can have
|
||||||
syntax highlights:
|
syntax highlights:
|
||||||
#+NAME: org-latex-listings
|
#+NAME: org-latex-listings
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-latex-listings 'minted)
|
(setq org-latex-listings 'minted)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@ -3211,7 +3233,7 @@ packages:
|
|||||||
- ~booktabs~ for nicer tables
|
- ~booktabs~ for nicer tables
|
||||||
- and ~tabularx~ for tabulars with adjustable columns
|
- and ~tabularx~ for tabulars with adjustable columns
|
||||||
#+NAME: org-latex-default-packages
|
#+NAME: org-latex-default-packages
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(dolist (package '(("AUTO" "inputenc" t ("pdflatex"))
|
(dolist (package '(("AUTO" "inputenc" t ("pdflatex"))
|
||||||
("T1" "fontenc" t ("pdflatex"))
|
("T1" "fontenc" t ("pdflatex"))
|
||||||
("" "grffile" t)))
|
("" "grffile" t)))
|
||||||
@ -3230,13 +3252,13 @@ packages:
|
|||||||
By the way, reference links in LaTeX should be written in this format,
|
By the way, reference links in LaTeX should be written in this format,
|
||||||
since we are using ~cleveref~:
|
since we are using ~cleveref~:
|
||||||
#+NAME: org-export-latex-hyperref-format
|
#+NAME: org-export-latex-hyperref-format
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-export-latex-hyperref-format "\\ref{%s}")
|
(setq org-export-latex-hyperref-format "\\ref{%s}")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
And Minted should be default break lines if a line is too long:
|
And Minted should be default break lines if a line is too long:
|
||||||
#+name: org-export-latex-minted-options
|
#+name: org-export-latex-minted-options
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq org-latex-minted-options '(("breaklines")
|
(setq org-latex-minted-options '(("breaklines")
|
||||||
("tabsize" "2")
|
("tabsize" "2")
|
||||||
("frame" "single")
|
("frame" "single")
|
||||||
@ -3247,7 +3269,7 @@ When it comes to the export itself, the latex file needs to be
|
|||||||
processed several times through XeLaTeX in order to get some
|
processed several times through XeLaTeX in order to get some
|
||||||
references right. Don’t forget to also run bibtex!
|
references right. Don’t forget to also run bibtex!
|
||||||
#+NAME: org-latex-pdf-process
|
#+NAME: org-latex-pdf-process
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp :tangle no
|
||||||
(setq org-latex-pdf-process
|
(setq org-latex-pdf-process
|
||||||
'("xelatex -8bit -shell-escape -interaction nonstopmode -output-directory %o %f"
|
'("xelatex -8bit -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||||
"bibtex %b"
|
"bibtex %b"
|
||||||
@ -3258,7 +3280,8 @@ references right. Don’t forget to also run bibtex!
|
|||||||
Finally, org-mode is supposed to automatically clean logfiles after it
|
Finally, org-mode is supposed to automatically clean logfiles after it
|
||||||
exports an org file to LaTeX. However, it misses a few, so I need to
|
exports an org file to LaTeX. However, it misses a few, so I need to
|
||||||
add their extension like so:
|
add their extension like so:
|
||||||
#+begin_src emacs-lisp
|
#+name: org-latex-logfiles-add-extensions
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(dolist (ext '("bbl" "lot"))
|
(dolist (ext '("bbl" "lot"))
|
||||||
(add-to-list 'org-latex-logfiles-extensions ext t))
|
(add-to-list 'org-latex-logfiles-extensions ext t))
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -3275,7 +3298,7 @@ there’s a package for exporting my org files to Github-flavored
|
|||||||
Markdown!
|
Markdown!
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ox-gfm
|
(use-package ox-gfm
|
||||||
:after ox
|
:after (ox org)
|
||||||
:straight (:build t))
|
:straight (:build t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -3288,7 +3311,7 @@ Yet another exporter I enjoy is [[https://github.com/dantecatalfamo/ox-ssh][~ox-
|
|||||||
servers on my repos though.
|
servers on my repos though.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ox-ssh
|
(use-package ox-ssh
|
||||||
:after ox
|
:after (ox org)
|
||||||
:straight (:build t))
|
:straight (:build t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -3658,8 +3681,8 @@ The project is then defined like so:
|
|||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-ref
|
(use-package org-ref
|
||||||
|
:after (org ox-bibtex pdf-tools)
|
||||||
:straight (:build t)
|
:straight (:build t)
|
||||||
:after (org ox-bibtex)
|
|
||||||
:demand t
|
:demand t
|
||||||
:custom-face
|
:custom-face
|
||||||
(org-ref-cite-face ((t (:weight bold))))
|
(org-ref-cite-face ((t (:weight bold))))
|
||||||
@ -3746,7 +3769,7 @@ org-mode. ~mixed-pitch~ comes to the rescue!
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package mixed-pitch
|
(use-package mixed-pitch
|
||||||
:after org
|
:after org
|
||||||
:straight t
|
:straight (:build t)
|
||||||
:hook
|
:hook
|
||||||
(org-mode . mixed-pitch-mode)
|
(org-mode . mixed-pitch-mode)
|
||||||
:config
|
:config
|
||||||
@ -3838,8 +3861,8 @@ icons!
|
|||||||
/Org Outline Tree/ is a better way of managing my org files’ outline.
|
/Org Outline Tree/ is a better way of managing my org files’ outline.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-ol-tree
|
(use-package org-ol-tree
|
||||||
|
:after (org avy)
|
||||||
:defer t
|
:defer t
|
||||||
:after org
|
|
||||||
:straight (org-ol-tree :build t
|
:straight (org-ol-tree :build t
|
||||||
:host github
|
:host github
|
||||||
:type git
|
:type git
|
||||||
@ -4385,7 +4408,6 @@ comma.
|
|||||||
:hook (lua-mode . lsp-deferred)
|
:hook (lua-mode . lsp-deferred)
|
||||||
:config
|
:config
|
||||||
(setq lsp-lua-emmy-jar-path (expand-file-name "EmmyLua-LS-all.jar" user-emacs-directory)))
|
(setq lsp-lua-emmy-jar-path (expand-file-name "EmmyLua-LS-all.jar" user-emacs-directory)))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Python
|
**** Python
|
||||||
@ -4968,7 +4990,6 @@ either in Emacs or in an external web browser. I prefer the defaults.
|
|||||||
:defer t
|
:defer t
|
||||||
:straight (archwiki :build t
|
:straight (archwiki :build t
|
||||||
:type git
|
:type git
|
||||||
:host nil
|
|
||||||
:repo "https://labs.phundrak.com/phundrak/archwiki.el"))
|
:repo "https://labs.phundrak.com/phundrak/archwiki.el"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -5085,7 +5106,6 @@ which resolution to play a YouTube video in an external video player.
|
|||||||
:defer t
|
:defer t
|
||||||
:straight (ytplay :build t
|
:straight (ytplay :build t
|
||||||
:type git
|
:type git
|
||||||
:host nil
|
|
||||||
:repo "https://labs.phundrak.com/phundrak/ytplay.el"))
|
:repo "https://labs.phundrak.com/phundrak/ytplay.el"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -5097,6 +5117,7 @@ Undefining some stuff to make keybind prefixes work correctly.
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps '(Buffer-menu-mode-map
|
:keymaps '(Buffer-menu-mode-map
|
||||||
|
Info-mode-map
|
||||||
Man-mode-map
|
Man-mode-map
|
||||||
backtrace-mode-map
|
backtrace-mode-map
|
||||||
custom-mode-map
|
custom-mode-map
|
||||||
@ -5117,7 +5138,8 @@ Undefining some stuff to make keybind prefixes work correctly.
|
|||||||
splash-screen-keymap
|
splash-screen-keymap
|
||||||
undo-tree-visualizer-mode-map)
|
undo-tree-visualizer-mode-map)
|
||||||
:states '(emacs normal motion)
|
:states '(emacs normal motion)
|
||||||
"SPC" nil)
|
"SPC" nil
|
||||||
|
"," nil)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'global-map
|
:keymaps 'global-map
|
||||||
|
Loading…
Reference in New Issue
Block a user