doom: move config to .el format

This commit is contained in:
Julian Mutter 2024-01-26 10:16:13 +01:00
parent 10524de915
commit 77fee14469
2 changed files with 18 additions and 72 deletions

View File

@ -1,9 +1,3 @@
#+title: Doom Emacs Config
* Main
#+PROPERTY: header-args :results silent
** Help
#+begin_src emacs-lisp :tangle yes
;; Here are some additional functions/macros that could help you configure Doom:
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
@ -12,22 +6,26 @@
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
#+end_src
** Overall config
*** Doom specific settings
#+begin_src emacs-lisp :tangle yes
(setq user-full-name "Julian Mutter"
user-mail-address "julian.mutter@comumail.de")
(setq doom-font (font-spec :family "Source Code Pro" :size 14))
(setq doom-theme 'doom-one)
(setq doom-theme 'doom-one
doom-font (font-spec :family "Source Code Pro" :size 14)
doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 15))
;; (setq doom-font (font-spec :family "Source Code Pro" :size 14))
;; (setq doom-theme 'doom-dracula)
;; (setq display-line-numbers-type nil)
(setq display-line-numbers-type 'relative)
#+end_src
*** My custom keybindings
#+begin_src emacs-lisp :tangle yes
;; (after! company
;; (setq company-idle-delay nil))
;;; :ui modeline
;; An evil mode indicator is redundant with cursor shape
;; (setq doom-modeline-modal nil)
;; Open external terminal
(map! :leader :desc "Open external terminal" "o t" (cmd! (call-process-shell-command "alacritty &" nil 0)))
@ -75,14 +73,10 @@
;; Do not ask before exiting emacs
(setq confirm-kill-emacs nil)
#+end_src
*** Openwith
#+begin_src emacs-lisp :tangle yes
(openwith-mode t)
(setq openwith-associations '(("\\.pdf\\'" "evince" (file))))
#+end_src
** Org
#+begin_src emacs-lisp :tangle yes
(setq org-directory "~/Nextcloud/org"
org-roam-directory "~/Nextcloud/org/roam")
@ -158,16 +152,10 @@
(let ((current-prefix-arg '(16)))
(call-interactively 'org-latex-preview)
))
#+end_src
*** Time display
#+begin_src emacs-lisp :tangle yes
(setq-default org-display-custom-times t)
(setq org-time-stamp-custom-formats '("<%d.%m.%Y %a>" . "<%d.%m.%Y %a %H:%M>"))
#+end_src
** TeX
#+begin_src emacs-lisp :tangle yes
;; Enable org mode like header navigation
(map! :map TeX-mode-map :nvi "<backtab>" #'outline-cycle-buffer)
@ -180,12 +168,9 @@
(setenv "PERL5LIB" "~/perl5/lib/perl5")
(setq +latex-viewers '(evince))
#+end_src
** Spell Checking
#+begin_src emacs-lisp :tangle yes
(use-package! lsp-ltex
:after latex
:init
(setq lsp-ltex-enabled t)
(setq lsp-ltex-language "en-US")
@ -244,16 +229,9 @@ Return nil if on a link url, markup, html, or references."
for face in faces
if (memq face unsafe-faces)
return t)))))
#+end_src
** Flutter
#+begin_src emacs-lisp :tangle yes
;; (setq lsp-dart-flutter-sdk-dir "~/snap/flutter/common/flutter")
;; (map! :mode dart-mode :leader "r" #'flutter-run-or-hot-reload)
#+end_src
** Evil snipe
#+begin_src emacs-lisp :tangle yes
;; Make sniping simpler for german keyboard
(setq evil-snipe-scope 'visible)
@ -261,10 +239,7 @@ Return nil if on a link url, markup, html, or references."
(map! :map evil-snipe-override-mode-map :m ";" #'evil-snipe-repeat-reverse)
(map! :map evil-snipe-parent-transient-map "," #'evil-snipe-repeat)
(map! :map evil-snipe-parent-transient-map ";" #'evil-snipe-repeat-reverse)
#+end_src
** Matlab
#+begin_src emacs-lisp :tangle yes
(add-hook 'matlab-mode-hook (lambda () (add-to-list 'quickrun-file-alist '("\\.m\\'" . "octave"))))
;; (assq-delete-all "objc" quickrun-file-alist)
@ -284,11 +259,6 @@ Return nil if on a link url, markup, html, or references."
'("\\.m$" . matlab-mode))
;; (setq matlab-indent-function t)
;; (setq matlab-shell-command "/urs/local/bin/matlab")
#+end_src
** Features
*** Toggle word case
#+begin_src elisp :tangle yes
(map! :desc "Toggle case of word" :nv "g C" #'toggle-word-case)
@ -312,21 +282,11 @@ Return nil if on a link url, markup, html, or references."
((string= "Lu" first-char-prop) ; Upper case
(downcase-region $p1 (+ $p1 1)))
(t (message "Word does not start with a alphabetic character"))))))
#+end_src
*** Tetris
#+begin_src emacs-lisp :tangle yes
(add-hook 'tetris-mode-hook #'turn-off-evil-mode)
#+end_src
** Projectile
#+begin_src emacs-lisp :tangle yes
(map! :map 'doom-leader-project-map :desc "Repeat last command" "SPC" #'projectile-repeat-last-command)
#+end_src
** More
#+begin_src emacs-lisp :tangle yes
(defun fd-pretty-print-dirty-json()
(interactive)
(let ((new-buffer-contents (shell-command-to-string (format "echo '%s' | newliner" (buffer-string)))))
@ -334,10 +294,7 @@ Return nil if on a link url, markup, html, or references."
(insert new-buffer-contents)
(evil-indent (buffer-end -1) (buffer-end +1)))
)
#+end_src
** Inventory
#+begin_src emacs-lisp :tangle yes
(defun fd-inventory-transfer()
(interactive)
(fd-inventory-transfer-check-if-valid-table)
@ -380,24 +337,13 @@ Return nil if on a link url, markup, html, or references."
(let ((message (concat "- " (format-time-string "%d.%m.%Y") ": *" (number-to-string amount) "* =" item-name "= from " from-location " to " to-location "\n")))
(insert message))
)))
#+end_src
** Python
#+begin_src emacs-lisp :tangle yes
(defun fd-python-to-latex(regionBegin regionEnd)
(interactive (if (use-region-p)
(list (region-beginning) (region-end))
(list (point-min) (point-max))))
(shell-command-on-region regionBegin regionEnd "python2latex"))
#+end_src
** Haskell
#+begin_src emacs-lisp :tangle yes
(set-docsets! 'haskell-mode "Haskell")
#+end_src
** Citations
#+begin_src emacs-lisp :tangle yes
(set-docsets! 'haskell-mode "Haskell")
(setq! citar-bibliography '("~/Nextcloud/zotero-sources.bib"))
#+end_src

View File

@ -190,5 +190,5 @@
;;twitter ; twitter client https://twitter.com/vnought
:config
literate
;; literate
(default +bindings +smartparens))