emacs: clean up config

This commit is contained in:
Julian Mutter 2023-05-11 14:44:03 +02:00
parent e13f9ec3a3
commit 185e20fe1a

View File

@ -4,9 +4,7 @@
#+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
;; - `after!' for running code after a package has loaded
@ -14,47 +12,21 @@
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
#+end_src
** Overall config
*** Doom specific settings
#+begin_src emacs-lisp :tangle yes
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Julian Mutter"
user-mail-address "julian.mutter@comumail.de")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
;; (setq doom-font (font-spec :family "monospace" :size 13 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
(setq doom-font (font-spec :family "Source Code Pro" :size 14))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'relative)
#+end_src
*** My custom keybindings
#+begin_src emacs-lisp :tangle yes
;; Open external terminal
@ -90,25 +62,15 @@
** Org
#+begin_src emacs-lisp :tangle yes
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/Nextcloud/org"
org-roam-directory "~/Nextcloud/org/roam")
;; Make all org files agenda files
(setq org-agenda-files (list org-directory))
;; (custom-set-variables
;; '(org-directory "~/org")
;; '(org-agenda-files (list org-directory)))
;; (add-to-list 'org-agenda-files "~/org/anothertest.org" 'append)
;; Adding my org-agenda files
;; (after! org
;; (setq org-agenda-files (expand-file-name "org-agenda-files" doom-private-dir)))
(setq org-export-allow-bind-keywords t)
;; Insert timestamp when marking task as done
(setq org-log-done #'time)
(after! org
@ -144,6 +106,8 @@
(map! :map doom-leader-notes-map "r t" #'org-roam-buffer-toggle)
(setq org-roam-preview-function #'fd-my-org-roam-preview-function)
;; Custom preview function including subheadings
(defun fd-my-org-roam-preview-function ()
"Return the preview content at point.
@ -166,15 +130,15 @@ headline, up to the next headline."
** TeX
#+begin_src emacs-lisp :tangle yes
;; Enable org mode like header navigation
(map! :map TeX-mode-map :nvi "<backtab>" #'outline-cycle-buffer)
;; (map! :map TeX-mode-map :nvi "<tab>" #'outline-cycle)
(map! :map TeX-mode-map :nvi "C-k" #'outline-backward-same-level)
(map! :map TeX-mode-map :nvi "C-j" #'outline-forward-same-level)
(map! :map TeX-mode-map :nvi "C-h" #'outline-up-heading)
(map! :map TeX-mode-map :nvi "C-l" #'outline-next-heading)
(map! :map TeX-mode-map :nv "C-k" #'outline-backward-same-level)
(map! :map TeX-mode-map :nv "C-j" #'outline-forward-same-level)
(map! :map TeX-mode-map :nv "C-h" #'outline-up-heading)
(map! :map TeX-mode-map :nv "C-l" #'outline-next-heading)
(add-hook 'LaTeX-mode-hook 'langtool-ignore-fonts-minor-mode)
(setq langtool-default-language "de-DE")
(use-package! langtool-ignore-fonts
:config
(langtool-ignore-fonts-add 'latex-mode '(font-lock-comment-face
@ -189,20 +153,6 @@ headline, up to the next headline."
;; Fixes latexindent not finding perl libraries
(setenv "PERL5LIB" "~/perl5/lib/perl5")
;; (setenv "GOPATH" "~/go")
;; Configuratoin proposed by jupyter notebook replacement tutorial
;; (org-babel-do-load-languages
;; 'org-babel-load-languages
;; '((emacs-lisp . t) ;; Other languages
;; (shell . t)
;; ;; Python & Jupyter
;; (python . t)
;; (ein . t)
;; (jupyter . t)))
;; (org-babel-jupyter-override-src-block "python")
;; (setq ob-async-no-async-languages-alist '("python" "jupyter-python"))
#+end_src
** Spell Checking
@ -210,8 +160,8 @@ headline, up to the next headline."
(use-package! langtool
:init
(setq langtool-language-tool-jar "~/git/languagetool/languagetool-standalone/target/LanguageTool-6.1-SNAPSHOT/LanguageTool-6.1-SNAPSHOT/languagetool-commandline.jar"))
(setq langtool-language-tool-jar "~/git/languagetool/languagetool-standalone/target/LanguageTool-6.1-SNAPSHOT/LanguageTool-6.1-SNAPSHOT/languagetool-commandline.jar")
(setq langtool-default-language "de-DE"))
;; TODO make toggling of spell checking ('SPC t s') use flyspell-mode in text modesm and flyspell-prog-mode in programming modes (see hooks below)
@ -282,7 +232,6 @@ 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
@ -341,16 +290,7 @@ Return nil if on a link url, markup, html, or references."
(add-hook 'tetris-mode-hook #'turn-off-evil-mode)
#+end_src
** Company
#+begin_src emacs-lisp :tangle yes
;; Add company-quickhelp
;; Now already included
;; (company-quickhelp-mode)
;; (map! :map company-active-map "TAB" nil)
;; (map! :map company-active-map "<tab>" nil)
#+end_src
** Projectile
#+begin_src emacs-lisp :tangle yes
(map! :map 'doom-leader-project-map :desc "Repeat last command" "SPC" #'projectile-repeat-last-command)
@ -365,20 +305,6 @@ Return nil if on a link url, markup, html, or references."
(insert new-buffer-contents)
(evil-indent (buffer-end -1) (buffer-end +1)))
)
;; (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
;; (add-to-list
;; 'auto-mode-alist
;; '("\\.m$" . matlab-mode))
;; (setq matlab-indent-function t)
;; (setq matlab-shell-command "matlab")
(defun fd-inventory-transfer()
(interactive)
())
(with-eval-after-load 'lsp-rust
(require 'dap-cpptools))
#+end_src
** Inventory
@ -430,15 +356,6 @@ Return nil if on a link url, markup, html, or references."
** Python
#+begin_src emacs-lisp :tangle yes
;; Python settings
;; (add-hook 'python-mode-hook (lambda ()
;; (setq flycheck-checker 'python-pylint)))
;; (add-hook 'pyhon-mode-local-vars-hook
;; (lambda ()
;; (when (flycheck-may-enable-checker 'lsp)
;; (flycheck-select-checker 'python-pylint))))
(defun fd-python-to-latex(regionBegin regionEnd)
(interactive (if (use-region-p)
(list (region-beginning) (region-end))
@ -450,18 +367,8 @@ Return nil if on a link url, markup, html, or references."
(set-docsets! 'haskell-mode "Haskell")
#+end_src
** Rss
#+begin_src emacs-lisp :tangle yes
(setq elfeed-feeds
'(("https://heise.de/rss/heise-atom.xml" tech)
("https://blog.fefe.de/rss.xml?html" news)
("https://itsfoss.com/feed" news))
)
#+end_src
** Citations
#+begin_src emacs-lisp :tangle yes
(setq! citar-bibliography '("~/Nextcloud/zotero-sources.bib"))
#+end_src