Add installation scripts

This commit is contained in:
2026-04-15 10:54:48 +02:00
parent 20c3536ae5
commit 49ab682669
21 changed files with 1002 additions and 1936 deletions

View File

@@ -14,6 +14,50 @@
#+property: header-args:emacs-lisp :tangle ~/.config/doom/config.el :results none :padline no
:END:
* Installation
:PROPERTIES:
:header-args:bash: :tangle scripts/install-emacs.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
#+begin_src bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
DOOM="${HOME}/.config/emacs/bin/doom"
#+end_src
** Packages
#+begin_src bash
echo "==> Emacs packages"
paru -S --needed emacs aspell aspell-en aspell-fr
#+end_src
** Doom Emacs
#+begin_src bash
echo "==> Installing Doom Emacs"
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
"${DOOM}" install --no-config
#+end_src
** Tangle Configuration
Tangle =doom.org= to generate =config.el=, =init.el= and =packages.el=:
#+begin_src bash
echo "==> Tangling doom.org"
emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" \
|| emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")"
#+end_src
** Sync
#+begin_src bash
echo "==> Running doom sync"
"${DOOM}" sync
#+end_src
* Introduction and Resources
https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b
https://noelwelsh.com/posts/2019-01-10-doom-emacs.html
@@ -1273,7 +1317,7 @@ https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-
(counter -1)
(numberp))
(setq results (loop for (begin . env) in
(setq results (cl-loop for (begin . env) in
(org-element-map (org-element-parse-buffer) 'latex-environment
(lambda (env)
(cons
@@ -1283,20 +1327,20 @@ https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-
(cond
((and (string-match "\\\\begin{equation}" env)
(not (string-match "\\\\tag{" env)))
(incf counter)
(cl-incf counter)
(cons begin counter))
((string-match "\\\\begin{align}" env)
(prog2
(incf counter)
(cl-incf counter)
(cons begin counter)
(with-temp-buffer
(insert env)
(goto-char (point-min))
;; \\ is used for a new line. Each one leads to a number
(incf counter (count-matches "\\\\$"))
(cl-incf counter (count-matches "\\\\$"))
;; unless there are nonumbers.
(goto-char (point-min))
(decf counter (count-matches "\\nonumber")))))
(cl-decf counter (count-matches "\\nonumber")))))
(t
(cons begin nil)))))
@@ -3019,12 +3063,38 @@ Provides nice functions such as:
)
#+end_src
* Claude Code
#+begin_src emacs-lisp
(use-package! agent-shell
:config
(setq agent-shell-anthropic-authentication
(agent-shell-anthropic-make-authentication :login t))
(setq agent-shell-preferred-agent-config (agent-shell-anthropic-make-claude-code-config))
;; Evil state-specific RET behavior: insert mode = newline, normal mode = send
(evil-define-key 'insert agent-shell-mode-map (kbd "M-RET") #'newline)
(evil-define-key 'insert agent-shell-mode-map (kbd "RET") #'comint-send-input)
(evil-define-key 'normal agent-shell-mode-map (kbd "RET") #'comint-send-input)
;; n and p are bound in agent-shell-mode-map; restore self-insert in insert mode
(evil-define-key 'insert agent-shell-mode-map (kbd "n") #'self-insert-command)
(evil-define-key 'insert agent-shell-mode-map (kbd "p") #'self-insert-command)
(evil-define-key 'normal agent-shell-diff-mode-map (kbd "C-c C-o") #'agent-shell-diff-open-file)
(evil-define-key 'normal agent-shell-diff-mode-map (kbd "C-c C-a") #'agent-shell-diff-accept-all)
;; Configure *agent-shell-diff* buffers to start in Emacs state
(add-hook 'diff-mode-hook
(lambda ()
(when (string-match-p "\\*agent-shell-diff\\*" (buffer-name))
(evil-emacs-state)))))
#+end_src
* Doom =init.el=
#+begin_src emacs-lisp :tangle ~/.config/doom/init.el
(doom! :completion
company ; the ultimate code completion backend
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
helm ; the *other* search engine for love and life
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
@@ -3209,6 +3279,8 @@ https://github.com/doomemacs/doomemacs/issues/6478
#+begin_src emacs-lisp
;; Org-mode modules for citations, cross-references, bibliographies
(package! org-ref)
;; helm-bibtex (declared explicitly since the helm Doom module is not used)
(package! helm-bibtex)
#+end_src
#+begin_src emacs-lisp
@@ -3261,6 +3333,13 @@ https://github.com/doomemacs/doomemacs/issues/6478
:files ("resources" "*.el")))
#+end_src
** Claude Code
#+begin_src emacs-lisp
(package! shell-maker)
(package! acp)
(package! agent-shell)
#+end_src
** Not used anymore :noexport:
:PROPERTIES:
:header-args:emacs-lisp: :tangle no