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 --- alacritty/alacritty.yml | 4 +-- doom/abbrev-defs | 11 +++++++ doom/config.org | 81 ++++++++++++++++++++++++++++++++----------------- doom/init.el | 14 ++++++--- doom/packages.el | 6 +++- 5 files changed, 81 insertions(+), 35 deletions(-) create mode 100644 doom/abbrev-defs diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index d4e4a6b..5eb81a8 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -1,5 +1,5 @@ font: - size: 14 + size: 11 normal: family: Iosevka YMHG style: Medium @@ -115,7 +115,7 @@ schemes: cyan: '#6ae4b9' white: '#110b11' -colors: *light +colors: *dark key_bindings: - { key: A, mods: Command, chars: "\x1ba" } diff --git a/doom/abbrev-defs b/doom/abbrev-defs new file mode 100644 index 0000000..2f5eafe --- /dev/null +++ b/doom/abbrev-defs @@ -0,0 +1,11 @@ +;;-*-coding: utf-8;-*- +(define-abbrev-table 'global-abbrev-table + '( + ("T" "The" nil :count 4) + ("alth" "although" nil :count 1) + ("bc" "because" nil :count 0) + ("t" "the" nil :count 1) + ("th" "though" nil :count 0) + ("vc" "Vericert" nil :count 0) + )) + 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) diff --git a/doom/init.el b/doom/init.el index d89b630..0e27669 100644 --- a/doom/init.el +++ b/doom/init.el @@ -14,6 +14,10 @@ ;; Alternatively, press 'gd' (or 'C-c g d') on a module to browse its ;; directory (for easy access to its source code). +(setq native-comp-deferred-compilation nil) +(after! (doom-packages straight) + (setq straight--native-comp-available t)) + (doom! :input ;;chinese ;;japanese @@ -34,7 +38,7 @@ ;;hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hydra ;;indent-guides ; highlighted in dent columns - modeline ; snazzy, Atom-inspired modeline, plus API + (modeline +light) ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink the current line after jumping ;;neotree ; a project drawer, like NERDTree for vim ;;ophints ; highlight the region an operation acts on @@ -90,10 +94,10 @@ (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - lsp + (lsp +eglot) magit ; a git porcelain for Emacs make ; run make tasks from Emacs - pass ; password manager for nerds + (pass +auth) ; password manager for nerds pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings @@ -103,9 +107,9 @@ :lang ;;agda ; types of types of types of types... - assembly ; assembly for fun or debugging + ;;assembly ; assembly for fun or debugging cc ; C/C++/Obj-C madness - clojure ; java with a lisp + ;;clojure ; java with a lisp common-lisp ; if you've seen one lisp, you've seen them all coq ; proofs-as-programs ;;crystal ; ruby at the speed of c diff --git a/doom/packages.el b/doom/packages.el index 230da05..5207016 100644 --- a/doom/packages.el +++ b/doom/packages.el @@ -21,7 +21,8 @@ (package! org-transclusion :recipe (:host github :repo "nobiot/org-transclusion")) (package! org-zettelkasten - :recipe (:host github :repo "ymherklotz/emacs-zettelkasten")) + :recipe (:host github :repo "ymherklotz/emacs-zettelkasten") + :pin "7278052cb451178a2f1ffc61569156ca0adcc34a") (package! org-auto-tangle :recipe (:host github :repo "yilkalargaw/org-auto-tangle") :pin "bce665c79fc29f1e80f1eae7db7e91c56b0788fc") @@ -65,4 +66,7 @@ (package! color-theme-sanityinc-tomorrow) (package! modus-themes) +(package! ef-themes + :recipe (:host nil :repo "https://git.sr.ht/~protesilaos/ef-themes")) + (package! mmm-mode) -- cgit