From 110196dafef29ef476aa78429a2677f928571241 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 10 Oct 2022 13:31:44 +0100 Subject: Add more for doom emacs --- doom/config.org | 81 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 27 deletions(-) (limited to 'doom/config.org') diff --git a/doom/config.org b/doom/config.org index be25a27..db10133 100644 --- a/doom/config.org +++ b/doom/config.org @@ -30,8 +30,7 @@ ;;(add-hook 'text-mode-hook #'+word-wrap-mode) ;;(add-hook 'text-mode-hook #'visual-fill-column-mode) ;;;; Removes performance problems with opening coq files. -(after! core-editor - (add-to-list 'doom-detect-indentation-excluded-modes 'coq-mode)) +(add-to-list 'doom-detect-indentation-excluded-modes 'coq-mode) ;; Projectile compilation buffer not there anymore for some reason (setq compilation-buffer-name-function #'compilation--default-buffer-name) @@ -40,9 +39,21 @@ (setq-default bidi-paragraph-direction 'left-to-right) (if (version<= "27.1" emacs-version) (setq bidi-inhibit-bpa t)) + +(setq abbrev-file-name + "~/.config/doom/abbrev-defs") +(add-hook 'text-mode-hook #'abbrev-mode) #+end_src #+begin_src emacs-lisp +(use-package ef-themes + :defer nil + :config + (custom-theme-set-faces! ef-themes-collection + '(proof-locked-face :inherit hl-line) + '(proof-queue-face :inherit region)) + (setq doom-theme 'ef-autumn)) + (use-package modus-themes :init ;; Add all your customizations prior to loading the themes @@ -55,8 +66,9 @@ '(proof-queue-face :inherit modus-themes-nuanced-magenta)) :config ;; Load the theme of your choice: - (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) - :bind ("" . modus-themes-toggle)) + ;;(modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) + ;;:bind ("" . modus-themes-toggle)) + ) #+end_src #+begin_src emacs-lisp @@ -68,6 +80,12 @@ (add-hook 'text-mode-hook (lambda () (company-mode -1))) #+end_src +#+begin_src emacs-lisp +(use-package! projectile + :config + (add-to-list 'projectile-globally-ignored-directories ".direnv")) +#+end_src + ** Key Binding Customisations #+begin_src emacs-lisp @@ -128,6 +146,7 @@ (global-set-key (kbd "C-c y") 'y-map) (define-key y-map (kbd "p") #'password-store-copy) +(define-key y-map (kbd "q") #'password-store-otp-token-copy) (define-key y-map (kbd "i") #'password-store-insert) (define-key y-map (kbd "g") #'password-store-generate) ;(define-key y-map (kbd "r") #'toggle-rot13-mode) @@ -149,9 +168,7 @@ "~/Dropbox/zk/hardware.org"))) (org-search-view)))) (setq browse-url-handlers - '(("\\`mailto:" . browse-url--mailto) - ("\\`man:" . browse-url--man) - ("wikipedia\\.org" . eww-browse-url) + '(("wikipedia\\.org" . eww-browse-url) ("yannherklotz\\.com" . eww-browse-url) ("ymhg\\.org" . eww-browse-url) ("archlinux\\.org" . eww-browse-url) @@ -161,8 +178,7 @@ ("wordpress\\.com" . eww-browse-url) ("mathbabe\\.org" . eww-browse-url) ("ethz\\.ch" . eww-browse-url) - ("pragmaticemacs\\.com" . eww-browse-url) - (browse-url--non-html-file-url-p . browse-url-emacs))) + ("pragmaticemacs\\.com" . eww-browse-url))) (defun y/insert-date () "Insert a timestamp according to locale's date and time format." @@ -183,8 +199,10 @@ "Load theme, taking current system APPEARANCE into consideration." (mapc #'disable-theme custom-enabled-themes) (pcase appearance - ('light (load-theme 'modus-operandi t)) - ('dark (load-theme 'modus-vivendi t)))) + ;;('light (load-theme 'modus-operandi t)) + ;;('dark (load-theme 'modus-vivendi t)) + ('light (load-theme 'ef-spring t)) + ('dark (load-theme 'ef-autumn t)))) (add-hook 'ns-system-appearance-change-functions #'ymhg/apply-theme))) #+end_src @@ -264,6 +282,16 @@ #+end_src * Language Settings +** Flycheck + +#+begin_src emacs-lisp +(use-package! flycheck + :config + (setq flycheck-idle-change-delay 1) + (setq flycheck-display-errors-delay 1.0) + (setq-default flycheck-disabled-checkers '(haskell-stack-ghc)) + (remove-hook 'flycheck-mode-hook #'+syntax-init-popups-h)) +#+end_src ** Magit @@ -333,10 +361,10 @@ (setq org-tags-exclude-from-inheritance '("crypt")) (setq org-crypt-key "8CEF4104683551E8")) -(use-package! org-contacts - :after org - :init - (setq org-contacts-files '("~/Dropbox/org/contacts.org"))) +;;(use-package! org-contacts +;; :after org +;; :init +;; (setq org-contacts-files '("~/Dropbox/org/contacts.org"))) (use-package org-auto-tangle :hook (org-mode . org-auto-tangle-mode)) @@ -374,6 +402,9 @@ org-agenda-start-on-week 1) (setq org-agenda-include-diary t) + (setq org-icalendar-include-todo t) + (setq org-icalendar-include-bbdb-anniversaries t) + (setq org-capture-templates `(("t" "Todo" entry (file "inbox.org") "* TODO %? @@ -1225,9 +1256,6 @@ https://yannherklotz.com") (advice-add #'register-preview :override #'consult-register-window) - ;; Optionally replace `completing-read-multiple' with an enhanced version. - (advice-add #'completing-read-multiple :override #'consult-completing-read-multiple) - ;; Use Consult to select xref locations with preview (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) @@ -1260,12 +1288,6 @@ https://yannherklotz.com") #+begin_src emacs-lisp (use-package! emacs :init - ;; Add prompt indicator to `completing-read-multiple'. - ;; Alternatively try `consult-completing-read-multiple'. - (defun crm-indicator (args) - (cons (concat "[CRM] " (car args)) (cdr args))) - (advice-add #'completing-read-multiple :filter-args #'crm-indicator) - ;; Do not allow the cursor in the minibuffer prompt (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt)) @@ -1304,9 +1326,14 @@ https://yannherklotz.com") (define-key y-map (kbd "o") #'ymhg/reset-coq-windows) -(use-package! browse-url - :config - (setq browse-url-chrome-program "brave")) +(defun ymhg--reset-coq-indentation () + "Reset slow indentation." + (setq-local indent-line-function #'indent-relative)) + +(after! coq-mode + (add-hook 'coq-mode-hook #'ymhg--reset-coq-indentation t) + (define-key coq-mode-map (kbd "C-c TAB") #'smie-indent-line) + (setq coq-indent-modulestart 0)) (use-package! alectryon :hook (coq-mode . alectryon-mode) -- cgit