;; -*- lexical-binding: t; -*- (add-to-list 'load-path "~/.emacs.d/elisp") (fset 'yes-or-no-p 'y-or-n-p) (setq default-frame-alist '((font . "Iosevka SS13 Extended") (height . 150) (line-spacing . 0.5)) ;; undo undo-limit 10000000 undo-outer-limit 20000000 tab-always-indent 'complete text-mode-ispell-word-completion nil ;; Package list package-list '(almost-mono-themes avy corfu devdocs diminish ednc eldoc-box elfeed elfeed-protocol enwc emms expand-region exwm geiser geiser-guile git-gutter git-gutter-fringe go-mode guix pdf-tools magit markdown-mode mastodon nix-mode nov org-remark pass pinentry rec-mode tldr transpose-frame yasnippet yasnippet-snippets ws-butler) package-archives '(("elpa" . "https://elpa.gnu.org") ("gnu" . "http://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/") ("non-gnu" . "https://elpa.nongnu.org/nongnu/") ("melpa-stable" . "https://stable.melpa.org/packages/"))) (read-extended-command-predicate #'command-completion-default-include-p) ;; UI (menu-bar-mode -1) (tool-bar-mode -1) (setq-default fill-column 80 line-spacing 5 cursor-type 'box frame-title-format '("%b")) (set-cursor-color "#ff0000") (package-initialize) (unless package-archive-contents (package-refresh-contents)) ;; install the missing packages (dolist (package package-list) (unless (package-installed-p package) (package-install package))) (use-package exwm :init (setq exwm-workspace-number 1 exwm-input-global-keys `(([?\s-r] . exwm-reset) ;; s-r: Reset (to line-mode). ;; s-N: Switch to certain workspace. ,@(mapcar (lambda (i) `(,(kbd (format "s-%d" i)) . (lambda () (interactive) (tab-bar-select-tab ,i)))) (number-sequence 0 9)))) (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) (exwm-input-set-key (kbd "") (lambda () (interactive) (shell-command "scrot -F '/home/mccd/screenshots/%Y-%m-%d_$wx$h.png'"))) (exwm-input-set-key (kbd "C-") (lambda () (interactive) (shell-command "scrot -s -F '/home/mccd/screenshots/%Y-%m-%d_$wx$h.png'"))) (exwm-input-set-key (kbd "") (lambda () (interactive) (let ((inhibit-message t)) (shell-command "amixer set Master toggle 1> /dev/null")))) (exwm-input-set-key (kbd "") (lambda () (interactive) (let ((inhibit-message t)) (shell-command "amixer set Master 10%+ 1> /dev/null")))) (exwm-input-set-key (kbd "") (lambda () (interactive) (let ((inhibit-message t)) (shell-command "amixer set Master 10%- 1> /dev/null")))) (exwm-input-set-key (kbd "") (lambda () (interactive) (let ((inhibit-message t)) (shell-command "brightnessctl set 5%-")))) (exwm-input-set-key (kbd "") (lambda () (interactive) (let ((inhibit-message t)) (shell-command "brightnessctl set +5%")))) (exwm-input-set-key (kbd "s-") (lambda (cmd) ;; s-&: Launch application. (interactive (list (read-shell-command "$ "))) (start-process-shell-command cmd nil cmd))) (shell-command "xrdb ~/.Xresources") (shell-command "dbus-update-activation-environment DISPLAY") ;; Sticky keys ;;(shell-command "xkbset -feedback sticky -twokey latchlock") ;;(shell-command "xkbset exp 64 '=sticky' '=twokey' '=latchlock'") (push ?\C-\\ exwm-input-prefix-keys) :config (setq ring-bell-function 'ignore default-directory "/home/mccd/" focus-follows-mouse t mouse-autoselect-window t) :hook (;; Make sure titles match X window (exwm-update-title . (lambda () (exwm-workspace-rename-buffer (concat exwm-class-name ":" (if (<= (length exwm-title) 50) exwm-title (concat (substring exwm-title 0 49) "...")))))) (exwm-update-class . (lambda () (exwm-workspace-rename-buffer (concat exwm-class-name ":" (if (<= (length exwm-title) 50) exwm-title (concat (substring exwm-title 0 49) "...")))))))) (use-package exwm-randr :after exwm :config (exwm-randr-mode)) (use-package diminish :ensure t) (use-package tab-bar :init (tab-bar-mode) (setq tab-bar-new-tab-choice "*scratch*")) (use-package project :ensure t :config (add-to-list 'project-switch-commands '(project-list-buffers "Buffers")) (define-key project-prefix-map (kbd "b") 'project-list-buffers) (add-to-list 'project-switch-commands '(project-kill-buffers "Kill Buffers")) (add-to-list 'project-switch-commands '(project-shell "Shell"))) (use-package exwm-systemtray :after exwm :config (exwm-systemtray-mode) (setq exwm-systemtray-height 30)) (use-package transpose-frame :ensure t :defer t :bind (("C-x 5 t" . 'transpose-frame))) (use-package ffap :demand t :bind (("C-x C-f" . find-file-at-point)) :init (ffap-bindings) :config (setq ffap-require-prefix nil)) (use-package time :init (display-time-mode) :config (setq display-time-format "%a, %d/%m/%Y %H:%M")) (use-package geiser :ensure t :init (with-eval-after-load 'geiser-guile (add-to-list 'geiser-guile-load-path "~/builds/nonguix"))) (use-package pixel-scroll :init (pixel-scroll-precision-mode)) (use-package corfu ;; Optional customizations :custom (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' ;; (corfu-auto t) ;; Enable auto completion ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match ;; (corfu-preview-current nil) ;; Disable current candidate preview ;; (corfu-preselect 'prompt) ;; Preselect the prompt ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches ;; Recommended: Enable Corfu globally. This is recommended since Dabbrev can ;; be used globally (M-/). See also the customization variable ;; `global-corfu-modes' to exclude certain modes. :init (global-corfu-mode)) (use-package dabbrev ;; Swap M-/ and C-M-/ :bind (("M-/" . dabbrev-completion) ("C-M-/" . dabbrev-expand)) :config (add-to-list 'dabbrev-ignored-buffer-regexps "\\` ") ;; Since 29.1, use `dabbrev-ignored-buffer-regexps' on older. (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode) (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode) (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode)) (use-package scroll-bar :init (scroll-bar-mode -1)) (use-package delsel :init (delete-selection-mode)) (use-package frame :config (window-divider-mode)) (use-package files :config (setq delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t auto-save-default nil)) (use-package minibuffer :defer t :config (setq completion-cycle-threshold 5 completion-ignore-case t)) (use-package pass :defer t :ensure t) (use-package select :config (setq x-select-enable-clipboard t x-select-enable-primary t)) (use-package pdf-tools) (use-package imenu :defer t :config (setq imenu-auto-rescan t)) (defun sudo-shell-command (command) (interactive "MShell command (root): ") (with-temp-buffer (cd "/sudo::/") (async-shell-command command))) (use-package nov :defer t :ensure t :init (add-to-list 'auto-mode-alist '("\\.epub'" . nov-mode))) (use-package ednc :after exwm :diminish ednc-mode :ensure t :config (ednc-mode)) (use-package scheme :bind (:map scheme-mode-map ("C-." . nil))) (use-package org-remark :diminish org-remark-mode :diminish org-remark-global-tracking-mode :bind (;; :bind keyword also implicitly defers org-remark itself. ;; Keybindings before :map is set for global-map. ("C-c n m" . org-remark-mark) ("C-c n l" . org-remark-mark-line) ; new in v1.3 :map org-remark-mode-map ("C-c n o" . org-remark-open) ("C-c n ]" . org-remark-view-next) ("C-c n [" . org-remark-view-prev) ("C-c n r" . org-remark-remove) ("C-c n d" . org-remark-delete)) ;; Alternative way to enable `org-remark-global-tracking-mode' in ;; `after-init-hook'. ;; :hook (after-init . org-remark-global-tracking-mode) :init ;; It is recommended that `org-remark-global-tracking-mode' be ;; enabled when Emacs initializes. Alternatively, you can put it to ;; `after-init-hook' as in the comment above (org-remark-global-tracking-mode +1) :config (defun mccd/store-remarks () (concat "~/personal-db/notes/" (file-name-base (org-remark-notes-file-name-function)) "-remark.org")) (setq org-remark-icon-notes nil org-remark-use-org-id t org-remark-notes-file-name #'mccd/store-remarks) (use-package org-remark-info :after info :config (org-remark-info-mode +1)) (use-package org-remark-eww :after eww :config (org-remark-eww-mode +1)) (use-package org-remark-nov :after nov :config (org-remark-nov-mode +1))) (use-package battery :init (display-battery-mode t)) (use-package comint :bind ((:repeat-map repeat-hist-line-map ("n" . comint-next-input) ("p" . comint-previous-input)))) (use-package repeat :demand t :bind (("C-z" . repeat) :repeat-map repeat-basic-movement-map ("n" . next-line) ("p" . previous-line) ("f" . forward-char) ("M-f" . forward-word) ("M-b" . backward-word) ("o" . avy-goto-char-timer) ("b" . backward-char) ("e" . move-end-of-line) ("v" . scroll-up-command) ("M-v" . scroll-down-command) ("M-e" . forward-sentence) ("a" . move-beginning-of-line) :repeat-map repeat-repeat-map ("z" . repeat) :repeat-map repeat-undo-map ("/" . undo) ("?" . undo-redo) :repeat-map repeat-kill-map ("d" . delete-char) ("M-d" . kill-word) ("k" . kill-line) :repeat-map repeat-movement-map ("e" . end-of-defun) ("f" . forward-sexp) ("n" . forward-list) ("p" . backward-list) ("d" . down-list) ("u" . up-list) ("b" . backward-sexp) ("a" . beginning-of-defun)) :config (setq repeat-on-final-keystroke t set-mark-command-repeat-pop t repeat-exit-key (kbd "")) (repeat-mode 1)) (use-package eww :config (setq eww-auto-rename-buffer t eww-buffer-name-length 20) :bind ((:map eww-mode-map ("+" . image-increase-size)))) (use-package enwc :ensure t :init (setq enwc-default-backend 'nm enwc-wired-device "lo" enwc-wireless-device "wlp61s0") (defun list-notifications () (mapconcat #'ednc-format-notification (ednc-notifications) "")) (nconc global-mode-string '((:eval (list-notifications)))) ; or stack (add-hook 'ednc-notification-presentation-functions (lambda (&rest _) (force-mode-line-update t)))) (use-package git-gutter :diminish git-gutter-mode :hook (go-mode . git-gutter-mode) (prog-mode . git-gutter-mode) :bind (("C-c g p" . git-gutter:previous-hunk) ("C-c g n" . git-gutter:next-hunk) ("C-c g s" . git-gutter:stage-hunk) ("C-c g r" . git-gutter:revert-hunk) ("C-c g =" . git-gutter:popup-hunk) :repeat-map git-gutter-repeat-map ("n" . git-gutter:next-hunk) ("=" . git-gutter:popup-hunk) ("s" . git-gutter:stage-hunk) ("r" . git-gutter:revert-hunk) ("p" . git-gutter:previous-hunk)) :config :ensure t) (use-package git-gutter-fringe :ensure t) (use-package org-crypt :ensure nil :init (setenv "GPG_AGENT_INFO" nil) (setq auth-source-debug t epg-gpg-program "gpg2") (org-crypt-use-before-save-magic)) (use-package grep :config (setq-default grep-template (string-join '("ugrep" "--color=never" "--ignore-binary" "--ignore-case" "--include=" "--line-number" "--null" "--recursive" "--regexp=") " "))) (use-package pinentry :ensure t :init (pinentry-start)) (use-package epa-file :init (epa-file-enable) (setq epa-pinentry-mode 'loopback)) (use-package exwm-mff :demand t :load-path "elisp" :hook ((server-after-make-frame . exwm-mff-mode))) (use-package isearch :defer t :bind ((:repeat-map repeat-isearch-map ("o" . avy-isearch) ("s" . isearch-repeat-forward) ("r" . isearch-repeat-backward)))) (use-package avy :ensure t :config (setq avy-timeout-seconds 0.2) (global-set-key (kbd "M-o") 'avy-goto-char-timer) (set-face-attribute 'avy-lead-face nil :inherit 'fixed-pitch) (set-face-attribute 'avy-lead-face-0 nil :inherit 'fixed-pitch) (set-face-attribute 'avy-lead-face-1 nil :inherit 'fixed-pitch) (set-face-attribute 'avy-lead-face-2 nil :inherit 'fixed-pitch) (setf (alist-get ? avy-dispatch-alist) 'avy-action-mark-to-char) (define-key isearch-mode-map (kbd "M-o") 'avy-isearch) (defun avy-action-kill-whole-line (pt) (save-excursion (goto-char pt) (kill-whole-line)) (select-window (cdr (ring-ref avy-ring 0))) t) (setf (alist-get ?k avy-dispatch-alist) 'avy-action-kill-stay (alist-get ?K avy-dispatch-alist) 'avy-action-kill-whole-line) (defun avy-action-copy-whole-line (pt) (save-excursion (goto-char pt) (cl-destructuring-bind (start . end) (bounds-of-thing-at-point 'line) (copy-region-as-kill start end))) (select-window (cdr (ring-ref avy-ring 0))) t) (defun avy-action-yank-whole-line (pt) (avy-action-copy-whole-line pt) (save-excursion (yank)) t) (setf (alist-get ?y avy-dispatch-alist) 'avy-action-yank (alist-get ?w avy-dispatch-alist) 'avy-action-copy (alist-get ?W avy-dispatch-alist) 'avy-action-copy-whole-line (alist-get ?Y avy-dispatch-alist) 'avy-action-yank-whole-line) (defun avy-action-copy-whole-line (pt) (save-excursion (goto-char pt) (cl-destructuring-bind (start . end) (bounds-of-thing-at-point 'line) (copy-region-as-kill start end))) (select-window (cdr (ring-ref avy-ring 0))) t) (defun avy-action-yank-whole-line (pt) (avy-action-copy-whole-line pt) (save-excursion (yank)) t) (setf (alist-get ?y avy-dispatch-alist) 'avy-action-yank (alist-get ?w avy-dispatch-alist) 'avy-action-copy (alist-get ?W avy-dispatch-alist) 'avy-action-copy-whole-line (alist-get ?Y avy-dispatch-alist) 'avy-action-yank-whole-line) (defun avy-action-teleport-whole-line (pt) (avy-action-kill-whole-line pt) (save-excursion (yank)) t) (setf (alist-get ?t avy-dispatch-alist) 'avy-action-teleport (alist-get ?T avy-dispatch-alist) 'avy-action-teleport-whole-line) (defun avy-action-mark-to-char (pt) (activate-mark) (goto-char pt)) (setf (alist-get ? avy-dispatch-alist) 'avy-action-mark-to-char)) (use-package flymake :defer t :bind (:repeat-map flymake-repeat-map ("]" . flymake-goto-next-error) ("[" . flymake-goto-prev-error)) :hook ((flymake-mode . (lambda () (define-key flymake-mode-map (kbd "C-c ]") 'flymake-goto-next-error) (define-key flymake-mode-map (kbd "C-c [") 'flymake-goto-prev-error))))) (use-package expand-region :ensure t :bind ("C-." . er/expand-region)) (use-package devdocs :ensure t :init (global-set-key (kbd "C-h D") 'devdocs-lookup)) (use-package custom-keymaps :load-path "elisp" :config (keymaps-mode) :bind (:map keymaps-mode-map ("C-." . er/expand-region))) (use-package guix :ensure t :bind (("C-c C-g g" . guix) ("C-c C-g o" . (lambda () (interactive) (sudo-shell-command "guix system reconfigure /home/mccd/system/os/config.scm"))) ("C-c C-g h" . (lambda () (interactive) (async-shell-command "guix home reconfigure ~/system/home/config.scm"))))) (use-package ws-butler :ensure t :diminish ws-butler-mode :hook ((prog-mode . ws-butler-mode))) (use-package sgml-mode :init (add-to-list 'auto-mode-alist '("\\.njk\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.tmpl\\'" . html-mode)) :config (define-key html-mode-map (kbd "M-") nil) (define-key html-mode-map (kbd "M-o") nil) :hook (css-mode . (lambda ((interactive) (setq-local tab-width 2) (setq sgml-basic-offset 2 indent-tabs-mode t)))) (html-mode . (lambda () (interactive) (setq-local tab-width 2) (setq sgml-basic-offset 2 indent-tabs-mode t)))) (use-package eldoc :ensure t :demand t :diminish eldoc-mode :config (setq eldoc-print-after-edit t echo-area-display-truncation-message nil eldoc-echo-area-prefer-doc-buffer 'maybe eldoc-echo-area-use-multiline-p nil) :hook (prog-mode . eldoc-mode)) (use-package eldoc-box :ensure t :demand t :hook (eglot-managed-mode . #'eldoc-box-hover-mode) :config (global-set-key (kbd "C-h .") #'eldoc-box-help-at-point)) (use-package markdown-mode :ensure t :config (set-face-attribute 'markdown-code-face nil :inherit 'fixed-pitch) :hook ((markdown-mode . variable-pitch-mode) (markdown-mode . markdown-toggle-url-hiding) (markdown-mode . markdown-toggle-markup-hiding) (markdown-mode . visual-line-mode))) (use-package elec-pair :init (electric-pair-mode 1) :config (global-set-key (kbd "M-{") 'insert-pair) (global-set-key (kbd "M-\"") 'insert-pair) (global-set-key (kbd "M-\'") 'insert-pair) (global-set-key (kbd "M-<") 'insert-pair) (global-set-key (kbd "M-[") 'insert-pair)) (use-package ido :init (ido-mode t)) (use-package calendar :defer t :hook ((diary-mode . variable-pitch-mode) (diary-fancy-display-mode . variable-pitch-mode)) :config (global-set-key (kbd "C-c d") 'calendar) (calendar-set-date-style 'european) (setq calendar-week-start-day 1)) (use-package nix-mode :ensure t :defer t :hook ((nix-mode . (lambda () (add-hook 'before-save-hook #'nix-format-buffer nil t))) (nix-mode . nix-prettify-mode))) (use-package eglot :config ;; Ensure `nil` is in your PATH. (add-to-list 'eglot-server-programs '(nix-mode . ("nil"))) (define-key eglot-mode-map (kbd "C-c r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c o") 'eglot-code-actions) :hook (css-mode . eglot-ensure) (html-mode . eglot-ensure) (javascript-mode . eglot-ensure) (nix-mode . eglot-ensure) (go-mode . eglot-ensure)) (use-package tab-line :config (setq tab-line-close-button nil tab-line-new-button-show nil) :bind (:map eww-mode-map ("M-" . eww-open-in-new-buffer)) :hook (eww-mode . tab-line-mode)) (use-package go-mode :ensure t :defer t :hook ((go-mode . (lambda () (add-hook 'before-save-hook 'eglot-format-buffer nil t))) (go-mode . (lambda () (setq-local compile-command "go build ."))))) (use-package rec-mode :ensure t :defer t :mode "\\.rec\\'" :config (define-key rec-edit-mode-map (kbd "") nil) (define-key rec-mode-map (kbd "") nil) :hook ((rec-mode . variable-pitch-mode) (rec-mode . flymake-mode) (rec-mode . eldoc-mode))) (use-package erc :ensure t :config (setq erc-autojoin-channels-alist '(("Libera.Chat" "#emacs" "#permacomputing" "#oldcomputerchallenge" "#go-nuts" "#netbsd" "#nonguix" "#guix"))) :init (global-set-key "\C-ceo" (lambda () "erc - join osm" (interactive) (erc :server "irc.oftc.net" :port "6667" :nick "mccd"))) (global-set-key "\C-cel" (lambda () "erc - join libera chat" (interactive) (erc :server "irc.libera.chat" :port "6667" :nick "mccd" :password (shell-command-to-string "pass show libera.chat"))))) (use-package ob-rec :ensure nil) (defun sync-org () (interactive) (async-shell-command "org-sync")) (add-to-list 'display-buffer-alist '("*Async Shell Command*" display-buffer-no-window (nil))) ;; Org (use-package org :ensure t :init (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (rec .t))) :config (setq org-refile-targets '((nil :maxlevel . 4) (org-agenda-files :maxlevel . 4)) org-default-notes-file "~/personal-db/notes/todo.org" org-hide-emphasis-markers t org-agenda-include-diary nil org-agenda-remove-tags t org-link-keep-stored-after-insertion t org-startup-folded t org-agenda-inhibit-startup nil ;; Add /New Heading at the end for use org-refile-allow-creating-parent-nodes 'confirm org-outline-path-complete-in-steps nil org-refile-use-outline-path 'file ;; Otherwise looks weird in variable-pitch-mode org-log-done 'time org-capture-templates '(("t" "Todo" entry (file "~/personal-db/notes/todo.org") "* TODO %?\n%i\n%a\n " :empty-lines 1) ("b" "Book" entry (file+headline "~/personal-db/notes/refs.org" "Books") "* %?\n:PROPERTIES:\n:AUTHOR:\n:STATE: unread\n:END:\n " :empty-lines 1) ("f" "Film" entry (file+headline "~/personal-db/notes/concepts.org" "Films") "* %?\n:PROPERTIES:\n:DIRECTOR:\n:STATE: unwatched\n:END:\n " :empty-lines 1) ("c" "Concept" entry (file "~/personal-db/notes/concepts.org") "* %?\n%i\n%a\n " :empty-lines 1) ("g" "Log Coffee" entry (file+headline "~/personal-db/notes/log.org" "Log") "* Brewed pour-over :coffee:\n:PROPERTIES:\n:WATER: 320g\n:COFFEE: 20g\n:ORIGIN:\n:NAME:\n:TEMP:\n:RATING:\n:PREHEAT: YES\n:END:\n%T\n*** Observations " :empty-lines 0 :prepend t) ("r" "Reference" entry (file "~/personal-db/notes/refs.org") "* %?\n%i\n%a\n " :empty-lines 1) ("s" "Schedule" entry (file "~/personal-db/notes/reminders.org") "* TODO %?\nSCHEDULED: %^T" :empty-lines 1) ("a" "Article" entry (file+headline "~/personal-db/notes/refs.org" "Articles") "* %?\n:PROPERTIES:\n:author:\n:END:\n " :empty-lines 1) ("l" "Log" entry (file+headline "~/personal-db/notes/log.org" "Log") "** %?\n%T" :prepend t :empty-lines 0) ("n" "Inbox" entry (file "~/personal-db/notes/inbox.org") "* %?\n%U\n" :empty-lines 1))) (set-face-attribute 'org-block nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit 'fixed-pitch) (set-face-attribute 'org-table nil :inherit 'fixed-pitch) (set-face-attribute 'org-date nil :inherit 'fixed-pitch) (set-face-attribute 'org-tag nil :inherit 'fixed-pitch) (set-face-attribute 'org-drawer nil :inherit 'fixed-pitch) (set-face-attribute 'org-property-value nil :inherit 'fixed-pitch) (set-face-attribute 'org-special-keyword nil :inherit 'fixed-pitch) (set-face-attribute 'org-meta-line nil :inherit 'fixed-pitch) (global-set-key (kbd "C-c l") #'org-store-link) (global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c j") #'org-goto) (global-set-key (kbd "C-c C-o") #'org-open-at-point-global) ;; Something errors out with capture logs and non-org files (add-to-list 'warning-suppress-log-types '(org-element)) (add-to-list 'warning-suppress-types '(org-element)) (advice-add 'org-agenda-quit :before (lambda () (interactive) (org-save-all-org-buffers) (sync-org))) :hook ((org-mode . org-indent-mode) (org-capture-after-finalize . sync-org) (org-mode . flyspell-mode) (org-mode . (lambda () (auto-revert-mode 1))) (org-mode . visual-line-mode) (org-mode . variable-pitch-mode))) (use-package org-id :after org :config (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) (use-package autorevert :diminish auto-revert-mode) (use-package org-agenda :demand t :ensure nil) (use-package appt :after org-agenda :demand t ;; Taken from https://igormelo.org/you_dont_need_org_alert.html ;; Enables notifications for org :config (setq appt-message-warning-time 15 appt-display-interval 5 appt-display-mode-line nil appt-disp-window-function (lambda (remaining new-time msg) (notifications-notify :title (format "Scheduled for %s minutes" remaining) :body msg :urgency 'critical))) (define-advice appt-activate (:after (&optional _arg) hold-your-horses) "`appt-activate' is too eager, rein it in." (remove-hook 'write-file-functions #'appt-update-list) (when (timerp appt-timer) (timer-set-time appt-timer (current-time) 600))) (define-advice appt-check (:before (&optional _force) from-org-agenda) "Read events from Org agenda if possible." (and (featurep 'org-agenda) (ignore-errors (let ((inhibit-message t)) (org-agenda-to-appt t))))) (appt-activate t)) (use-package rec-mode :ensure t) (use-package magit :ensure t :demand t :config (global-key-binding (kbd "C-x p m") 'magit-project-status) (define-key project-prefix-map (kbd "m") 'magit-project-status) (add-to-list 'project-switch-commands '(magit-project-status "magit"))) (use-package magit-extras :demand t :ensure magit) (use-package yasnippet :diminish yas-minor-mode :ensure t :init (yas-global-mode 1)) (defun marc/set-msmtp-account () (if (message-mail-p) (save-excursion (let* ((from (save-restriction (message-narrow-to-headers) (message-fetch-field "from"))) (account (cond ((string-match "marcc@fastmail.fr" from) "home") ((string-match "marc.coquand@sustainably.app" from) "work") ((string-match "marc@mccd.space" from) "home")))) (setq message-sendmail-extra-arguments (list '"-a" account)))))) (add-hook 'message-send-mail-hook #'marc/set-msmtp-account) (add-hook 'message-mode-hook #'flyspell-mode) (use-package flyspell :diminish flyspell-mode :defer t) (use-package face-remap :diminish buffer-face-mode) (use-package org-indent :diminish org-indent-mode) (use-package simple :diminish visual-line-mode) (use-package mu4e :ensure nil :config ;; This is set to 't' to avoid mail syncing issues when using mbsync (setq mu4e-change-filenames-when-moving t) ;; don't keep message compose buffers around after sending: (setq message-kill-buffer-on-exit t) (setq mu4e-notification-support t) ;; send function: (setq send-mail-function 'sendmail-send-it message-send-mail-function 'sendmail-send-it) ;; send program: ;; this is exeranal. remember we installed it before. (setq sendmail-program (executable-find "msmtp")) ;; select the right sender email from the context. (setq message-sendmail-envelope-from 'header) ;; Refresh mail using isync every 10 minutes (setq mu4e-update-interval (* 10 60) mu4e-get-mail-command "mbsync -a" mu4e-view-show-images t mu4e-view-show-addresses t mu4e-attachment-dir "~/Downloads" mu4e-view-prefer-html t mu4e-maildir "~/mail") (setq mu4e-contexts (list ;; Home (make-mu4e-context :name "home" :enter-func (lambda () (mu4e-message "Entering personal context")) :leave-func (lambda () (mu4e-message "Leaving personal context")) :match-func (lambda (msg) (when msg (string-prefix-p "/home" (mu4e-message-field msg :maildir)))) :vars '((user-mail-address . "marc@mccd.space") (user-full-name . "Marc Coquand") (mu4e-drafts-folder . "/home/Drafts") (mu4e-sent-folder . "/home/Sent") (mu4e-refile-folder . "/home/Archive") (mu4e-trash-folder . "/home/Trash") (mu4e-sent-messages-behavior . sent) (mu4e-maildir-shortcuts . (("/home/INBOX" . ?i) ("/home/Archive/Done" . ?d) ("/home/Archive" . ?a) ("/home/Archive/Todo" . ?t))))) ;; Work account (make-mu4e-context :name "work" :enter-func (lambda () (mu4e-message "Entering work context")) :leave-func (lambda () (mu4e-message "Leaving work context")) :match-func (lambda (msg) (when msg (string-prefix-p "/work" (mu4e-message-field msg :maildir)))) :vars '((user-mail-address . "marc.coquand@sustainably.app") (user-full-name . "Marc Coquand") (mu4e-drafts-folder . "/work/[Gmail]/Drafts") (mu4e-sent-folder . "/work/[Gmail]/Sent Mail") (mu4e-refile-folder . "/work/[Gmail]/All Mail") (mu4e-sent-messages-behavior . delete) (mu4e-trash-folder . "/work/[Gmail]/Trash") (mu4e-maildir-shortcuts . (("/work/[Gmail]/All Mail" . ?a) ("/work/INBOX" . ?i)))))))) (use-package elfeed-protocol :ensure t :init (elfeed-protocol-enable)) (use-package elfeed :ensure t :config (setq elfeed-use-curl t ;; setup feeds elfeed-protocol-fever-update-unread-only t elfeed-protocol-fever-fetch-category-as-tag t elfeed-protocol-feeds '(("fever+https://freshrss@rss.mccd.space" :api-url "https://rss.mccd.space/api/fever.php" :password (shell-command-to-string "pass show mccd/freshrss"))) ;; enable elfeed-protocol elfeed-protocol-enabled-protocols '(fever) elfeed-curl-extra-arguments '("--insecure")) ; necessary for https without a trust certificate (elfeed-set-timeout 36000) (global-set-key (kbd "C-x w") 'elfeed)) (use-package mastodon :defer t :config (setq mastodon-active-user "marcc" mastodon-instance-url "https://fosstodon.org")) (use-package eww :config (setq browse-url-browser-function 'eww-browse-url ; Use eww as the default browser eww-search-prefix "https://lite.duckduckgo.com/lite/?q=" shr-max-image-proportion 0.3 shr-width 70)) ;; Can play youtube urls and music. ;; Requires mpv (use-package emms :ensure t :init (add-hook 'emms-player-started-hook 'emms-show) :config (setq emms-shop-format "on: %s") (emms-all) (emms-default-players)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:inherit nil :extend nil :stipple nil :background "#fffff8" :foreground "#111111" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 150 :width expanded :foundry "UKWN" :family "Iosevka SS13 Extended")))) '(avy-lead-face ((t (:inherit fixed-pitch :background "dark red" :foreground "white")))) '(calendar-weekend-header ((t (:inherit nil)))) '(comint-highlight-prompt ((t ()))) '(custom-group-subtitle ((t (:weight bold :inherit variable-pitch)))) '(diary ((t (:inherit fixed-pitch :foreground "red1")))) '(eglot-highlight-symbol-face ((t (:weight bold)))) '(eglot-mode-line ((t (:weight regular)))) '(erc-timestamp-face ((t (:foreground "blue" :weight bold)))) '(eshell-prompt ((t (:weight bold)))) '(eww-valid-certificate ((t (:foreground "#111111" :weight bold)))) '(fixed-pitch ((t (:family "Iosevka SS13 Extended")))) '(font-lock-builtin-face ((t (:weight regular)))) '(font-lock-comment-face ((t (:foreground "gray40")))) '(font-lock-constant-face ((t (:slant italic)))) '(git-gutter:added ((t ()))) '(git-gutter:modified ((t ()))) '(git-gutter:deleted ((t (:foreground "red")))) '(font-lock-function-name-face ((t ()))) '(font-lock-keyword-face ((t ()))) '(font-lock-string-face ((t (:foreground "#111111" :slant italic)))) '(font-lock-type-face ((t (:foreground "#111111")))) '(magit-section-heading ((t (:weight bold)))) '(font-lock-variable-name-face ((t (:foreground "#111111")))) '(fringe ((t ()))) '(header-line ((t (:inherit default :foreground "grey20" :box (:line-width (12 . 12) :color "#fffff8") :underline (:color "#e0e0e0" :style line :position 0) :inherit variable-pitch)))) '(highlight ((t (:background "azure2")))) '(info-header-xref ((t (:inherit info-xref :underline (:color "RoyalBlue3" :style line :position t))))) '(info-node ((t (:foreground "brown" :box (:line-width (4 . 4) :color "#fffff8") :slant italic :weight bold)))) '(enwc-connected ((t (:foreground "dark green" :weight bold)))) '(link ((t (:foreground "#111111" :underline t)))) '(magit-branch-remote ((t (:foreground "royalblue")))) '(markdown-inline-code-face ((t (:inherit markdown-code-face)))) '(markdown-pre-face ((t (:inherit markdown-code-face)))) '(ido-only-match ((t (:foreground "forest green" :weight bold)))) '(mastodon-display-name-face ((t (:inherit nil :weight bold)))) '(message-header-name ((t (:weight bold)))) '(message-header-subject ((t (:slant italic)))) '(message-separator ((t (:foreground "red")))) '(message-cited-text-1 ((t (:foreground "gray50")))) '(gnus-header-name ((t (:weight bold)))) '(gnus-header-content ((t ()))) '(gnus-header-subject ((t (:slant italic)))) '(gnus-header-from ((t (:weight bold)))) '(minibuffer-prompt ((t ()))) '(mode-line ((t (:background "#EEEEE8" :foreground "#111111" :box (:line-width (8 . 8) :style flat-button) :overline "white" :underline (:color "#fffff8" :style line :position t) :inherit variable-pitch)))) '(mode-line-emphasis ((t ()))) '(mode-line-buffer-id ((t ()))) '(magit-section-highlight ((t (:background "#EEEEE8")))) '(magit-diff-file-heading-highlight ((t (:inherit magit-section-highlight)))) '(magit-diff-file-heading ((t ()))) '(mode-line-inactive ((t (:inherit mode-line :background "#f9f9f3" :foreground "grey60" :overline "#f9f9f9" :underline (:color "#f9f9f9" :style line :position 0) :weight light)))) '(mu4e-header-highlight-face ((t (:inherit hl-line :extend t :weight bold)))) '(mu4e-header-key-face ((t (:weight bold)))) '(mu4e-highlight-face ((t (:inherit highlight)))) '(org-date ((t (:inherit fixed-pitch :foreground "gray60")))) '(org-agenda-structure ((t ()))) '(org-upcoming-deadline ((t ()))) '(org-imminent-deadline ((t (:foreground "orangered" :weight bold)))) '(org-agenda-date-today ((t (:weight bold)))) '(org-agenda-date-weekend ((t ()))) '(help-key-binding ((t (:weight semibold :background "#EEEEE8" :box (:line-width (1 . -1) :color "#AAAAA8"))))) '(org-agenda-done ((t (:strike-through t :inherit org-time-grid :extend nil)))) '(org-agenda-structure-filter ((t (:slant italic)))) '(org-scheduled ((t ()))) '(org-done ((t (:strike-through t :weight bold :inherit org-agenda-dimmed-todo-face :extend nil)))) '(org-drawer ((t (:inherit org-tag)))) '(org-todo ((t (:weight bold)))) '(org-headline-done ((t (:strike-through t :inherit org-agenda-dimmed-todo-face :extend nil)))) '(org-level-1 ((t (:inherit outline-1 :extend nil :weight regular)))) '(org-tag ((t (:inherit fixed-pitch :foreground "gray50")))) '(org-time-grid ((t (:foreground "gray")))) '(org-meta-line ((t (:foreground "gray" :inherit fixed-pitch)))) '(org-quote ((t (:inherit org-block :slant italic)))) '(outline-4 ((t (:inherit outline-2)))) '(tab-line ((t (:box (:line-width (4 . 4) :style flat-button) :weight semi-light :inherit variable-pitch)))) '(tab-line ((t (:box (:line-width (4 . 4) :style flat-button) :weight semi-light :inherit variable-pitch)))) '(tab-line-highlight ((t (:box (:line-width (4 . 4) :style flat-button) :weight semi-light :inherit variable-pitch)))) '(tab-line-tab-current ((t (:box (:line-width (4 . 4) :style flat-button) :weight semi-light :inherit variable-pitch)))) '(tab-line-tab-inactive ((t (:box (:line-width (4 . 4) :style flat-button) :weight semi-light :foreground "gray70" :inherit variable-pitch)))) '(tab-bar ((t (:box (:line-width (12 . 24) :style flat-button) :weight semi-light :inherit variable-pitch)))) '(tab-bar-tab ((t (:inherit tab-bar :foreground "#111111" :box (:line-width (20 . 1) :color "#fffff8"))))) '(tab-bar-tab-inactive ((t (:inherit tab-bar-tab :background "#fffff8" :foreground "#999999" :weight semi-light)))) '(tldr-code-block ((t (:background "cornsilk" :foreground "#111111")))) '(tldr-description ((t ()))) '(tldr-command-argument ((t (:background "cornsilk" :foreground "#111111")))) '(tldr-command-itself ((t (:background "khaki" :foreground "#111111" :weight bold)))) '(tldr-introduction ((t (:foreground "#111111" :slant italic)))) '(tldr-title ((t (:inherit variable-pitch :foreground "#111111" :weight bold)))) '(variable-pitch ((t (:family "Iosevka Aile")))) '(window-divider ((t (:foreground "gray90"))))) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes '("cbd85ab34afb47003fa7f814a462c24affb1de81ebf172b78cb4e65186ba59d2" default)) '(erc-mode-line-format "") '(erc-modules '(autojoin button completion fill irccontrols list match menu move-to-prompt netsplit networks noncommands notifications readonly ring services stamp spelling)) '(magit-section-visibility-indicator '("..." . t)) '(markdown-list-item-bullets '("-")) '(mastodon-tl--enable-proportional-fonts t) '(mastodon-use-emojify t) '(mode-line-compact 'long) '(mode-line-format '("%e" mode-line-front-space (:propertize ("" mode-line-modified " ")) mode-line-modes mode-line-buffer-identification)) '(mode-line-percent-position nil) '(mode-line-position-line-format '(" ")) '(mu4e-bookmarks '((:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119) (:name "Messages with images" :query "mime:image/*" :key 112))) '(org-agenda-files '("/home/mccd/personal-db/notes/cal-ios.org" "/home/mccd/personal-db/notes/reminders.org" "/home/mccd/builds/sustainably/piva.org" "/home/mccd/personal-db/notes/inbox.org" "/home/mccd/personal-db/notes/todo.org" "/home/mccd/system/guix.org" "/home/mccd/personal-db/notes/log.org" "/home/mccd/personal-db/notes/refs.org" "/home/mccd/personal-db/notes/formulas.org" "/home/mccd/personal-db/notes/concepts.org" "/home/mccd/personal-db/notes/drafts.org")) '(org-fold-core-style 'overlays) '(package-selected-packages '(nov eldoc-box hide-mode-line exwm-mff eat pinentry exwm emms company orglink web-mode flycheck nix-mode nix-ts-mode avy pdf-tools elfeed-protocol yasnippet-snippets elfeed yasnippet smartparens markdown-mode mastodon tldr almost-mono-themes rec-mode magit go-mode expand-region devdocs)) '(tab-bar-auto-width t) '(tab-bar-close-button-show nil) '(tab-bar-format '(tab-bar-format-tabs tab-bar-format-align-right tab-bar-format-global)) '(tab-bar-position nil) '(tab-bar-tab-hints t) '(window-divider-default-right-width 2) '(yank-from-kill-ring-rotate t)) (put 'secrets-mode 'disabled nil)