;; ;;; Misc ;; (setq frame-title-format '("GNU Emacs")) (setq-hook! 'prog-mode-hook display-line-numbers-type 'relative scroll-margin 10 hscroll-margin 10) (when IS-LINUX (setq browse-url-generic-program (executable-find "firefox") browse-url-browser-function 'browse-url-generic)) ;; ;;; Doom-specific ;; (setq doom-theme 'doom-tomorrow-night doom-modeline-icon nil doom-modeline-indent-info t doom-modeline-total-line-number t doom-modeline-height 30) ;; ;;; LSP ;; (setq lsp-enable-suggest-server-download nil lsp-enable-file-watchers t lsp-file-watch-threshold 2048 lsp-modeline-code-actions-enable nil) ;; ;;; Org ;; (after! org (setq org-directory "~/doc/org/" org-todo-keywords '((sequence "TODO(t)" "LOOP(r)" "STRT(s@)" "WAIT(w@/!)" "HOLD(h@/!)" "IDEA(i)" "PROJ(p)" "|" "DONE(d@/!)" "KILL(k@/!)")) org-todo-keyword-faces '(("STRT" . +org-todo-active) ("WAIT" . +org-todo-onhold) ("HOLD" . +org-todo-onhold) ("PROJ" . +org-todo-project) ("KILL" . +org-todo-cancel)) org-capture-templates '(("t" "Personal todo" entry (file+headline +org-capture-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t) ("n" "Personal notes" entry (file+headline +org-capture-notes-file "Inbox") "* %u %?\n%i\n%a" :prepend t) ("j" "Journal" entry (file+olp+datetree +org-capture-journal-file) "* %U %?\n%i\n%a" :prepend t) ("p" "Templates for projects") ("pt" "Project-local todo" entry (file+headline +org-capture-project-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t) ("pn" "Project-local notes" entry (file+headline +org-capture-project-notes-file "Inbox") "* %U %?\n%i\n%a" :prepend t) ("pc" "Project-local changelog" entry (file+headline +org-capture-project-changelog-file "Unreleased") "* %U %?\n%i\n%a" :prepend t) ("o" "Centralized templates for projects") ("ot" "Project todo" entry (function +org-capture-central-project-todo-file) "* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil) ("on" "Project notes" entry (function +org-capture-central-project-notes-file) "* %U %?\n %i\n %a" :heading "Notes" :prepend t) ("oc" "Project changelog" entry (function +org-capture-central-project-changelog-file) "* %U %?\n %i\n %a" :heading "Changelog" :prepend t)))) (add-hook! 'org-mode-hook 'auto-fill-mode) (setq-hook! 'org-mode-hook fill-column 80) (setq org-roam-directory "~/doc/roam/" org-roam-db-location (concat org-roam-directory ".db")) (use-package! org-roam-ui :requires websocket :after org-roam :config (setq org-roam-ui-sync-theme t org-roam-ui-follow t org-roam-ui-update-on-save t org-roam-ui-open-on-start t)) ;; ;;; PlantUML ;; (setq plantuml-default-exec-mode 'executable org-plantuml-exec-mode 'plantuml) ;; ;;; Elisp ;; (after! flycheck (pushnew! flycheck-disabled-checkers 'emacs-lisp-checkdoc)) ;; Turn this off because it leaves face artifacts when changing indentation. (add-hook! 'emacs-lisp-mode-hook (highlight-indent-guides-mode -1)) ;; ;;; Haskell ;; (setq lsp-haskell-formatting-provider "ormolu") ;; ;;; YAML ;; ;; There's no optimal solution to properly deal with Go templates inside YAML. I ;; have to turn this off to save myself the headache of dealing with syntax ;; errors up my ass. (add-hook! 'yaml-mode-hook (defun nixfiles/disable-flycheck-for-helm-templates-h () (when (and buffer-file-name (string-match-p "/templates/" buffer-file-name) (or (string-suffix-p ".yaml" buffer-file-name) (string-suffix-p ".yml" buffer-file-name))) (remove-hook! 'yaml-mode-local-vars-hook #'lsp!) (pushnew! flycheck-disabled-checkers 'yaml-jsyaml 'yaml-ruby 'yaml-yamllint)))) (setq-hook! 'yaml-mode-hook +format-with-lsp nil) ;; ;;; Elfeed ;; (setq elfeed-db-directory "~/.elfeed" elfeed-enclosure-default-dir (concat elfeed-db-directory "/enclosures") rmh-elfeed-org-files (list (concat elfeed-db-directory "/index.org")) elfeed-goodies/powerline-default-separator nil elfeed-goodies/entry-pane-size 0.75 elfeed-goodies/entry-pane-position 'bottom) ;; ;;; mu4e ;; (setq-hook! 'mu4e-main-mode-hook mu4e-update-interval 30 message-send-mail-function #'message-send-mail-with-sendmail message-sendmail-extra-arguments '("--read-envelope-from") message-sendmail-f-is-evil t send-mail-function #'sendmail-send-it sendmail-program (executable-find "msmtp")) ;; ;;; Circe ;; (setq circe-network-options (mapcar (lambda (server) `(,server :server-buffer-name ,server :host "shire.net" :port 6667 :user ,(concat circe-default-user "/" server) :pass ,(lambda (&rest _) (+pass-get-secret "server/soju.manwe.shire.net/azahi")))) '("libera" "oftc" "hackint" "rizon"))) ;; ;;; Hledger ;; (use-package! hledger-mode :disabled :mode ("\\.journal\\'") :hook ((hledger-view-mode . hl-line-mode) (hledger-view-mode . center-text-for-reading)) :init (setq hledger-jfile "~/doc/accounting/current.journal") :config (set-company-backend! 'hledger-mode 'hledger-company) (add-hook! 'hledger-mode-hook (lambda (&rest _) (make-local-variable 'company-backends) (add-to-list 'company-backends 'hledger-company)))) (use-package! hledger-input :disabled :hook ((hledger-input-post-commit . hledger-show-new-balances) (hledger-input-mode . auto-fill-mode) (hledger-input-mode . (lambda (&rest _) (make-local-variable 'compay-idle-delay) (setq-local company-idle-delay 0.1)))) :init (setq hledger-input-buffer-height 20)) ;; ;;; Kubernetes ;; (use-package! kubernetes :defer t :commands (kubernetes-overview) :init (setq kubernetes-poll-frequency 3600 kubernetes-redraw-frequency 3600)) (use-package! kubernetes-evil :after kubernetes-overview)