From 4f9ad294fd92ff9365f5adf1d1da48fd5d701ff6 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 10 May 2024 21:10:15 +0200 Subject: [PATCH] feat(emacs): Update doom emacs config --- home/alex/programs/emacs/doom/config.el | 202 ++++++++++++------------ home/alex/programs/emacs/doom/init.el | 44 +++--- 2 files changed, 123 insertions(+), 123 deletions(-) diff --git a/home/alex/programs/emacs/doom/config.el b/home/alex/programs/emacs/doom/config.el index 356afe6..6298c9b 100644 --- a/home/alex/programs/emacs/doom/config.el +++ b/home/alex/programs/emacs/doom/config.el @@ -7,11 +7,11 @@ ;; Some functionality uses this to identify you, e.g. GPG configuration, email ;; clients, file templates and snippets. -(setq user-full-name "Alexander Kobjolke" - user-mail-address "me@failco.de") +(setq! user-full-name "Alexander Kobjolke" + user-mail-address "me@failco.de") (when ak/at-work? - (setq user-mail-address "alexander.kobjolke@atlas-elektronik.com") + (setq! user-mail-address "alexander.kobjolke@atlas-elektronik.com") (add-to-list 'lsp-disabled-clients 'cmakels) ;; exclude cmake from formatting on save @@ -35,19 +35,21 @@ ;; 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-gruvbox) +(setq! doom-theme 'doom-gruvbox) +(setq! doom-localleader-key ",") +(setq! doom-localleader-alt-key "M-,") (require 're-builder) -(setq reb-re-syntax 'string) +(setq! reb-re-syntax 'string) ;; 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 "~/org/" - org-log-into-drawer t) +(setq! org-directory "~/org/" + org-log-into-drawer t) ;; do not create a new workspace for each emacsclient (after! persp-mode -   (setq persp-emacsclient-init-frame-behaviour-override "main")) +   (setq! persp-emacsclient-init-frame-behaviour-override "main")) (defun my/org-id-update-id-current-file () @@ -55,16 +57,26 @@ (interactive) (org-id-update-id-locations (list (buffer-file-name (current-buffer))))) -(setq undo-limit 80000000 ; Raise undo-limit to 80Mb - evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular - auto-save-default t ; Nobody likes to loose work, I certainly don't - evil-escape-key-sequence "qq" ; define an escape sequence - evil-escape-delay 0.175 - ) +(setq! undo-limit 80000000 ; Raise undo-limit to 80Mb + auto-save-default t ; Nobody likes to loose work, I certainly don't + ) + +;; tweak some VI defaults +(after! evil + (setq! evil-ex-substitute-global t ; I like my s/../.. to be global by default + evil-move-cursor-back nil ; Don't move the block cursor when toggling insert mode + evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular + evil-want-Y-yank-to-eol t + evil-escape-key-sequence "qq" ; define an escape sequence + evil-escape-delay 0.175 + evil-move-beyond-eol t ; let the cursor move beyond eol just as in regular emacs + evil-kill-on-visual-paste nil ; Don't put overwritten text in the kill ring + evil-snipe-override-evil-repeat-keys nil)) + ;; 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) +(setq! display-line-numbers-type 'relative) ;; mouse ;; enable mouse reporting for terminal emulators @@ -77,32 +89,29 @@ (interactive) (scroll-up 1)))) -(setq haskell-process-type 'cabal-new-repl) +(after! haskell-mode + (setq haskell-process-type 'cabal-repl)) -(add-hook! 'org-mode-hook #'+org-init-keybinds-h) -(setq evil-snipe-override-evil-repeat-keys nil) -(setq doom-localleader-key ",") -(setq doom-localleader-alt-key "M-,") +(after! org + (setq! org-log-into-drawer t + org-todo-keywords '( + (sequence "NEXT(n)" "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CNCL(k@)") + (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)") + )) + (use-package! org-ql) + (use-package! org-bookmark-heading) -(use-package! org - :config (setq org-log-into-drawer t - org-todo-keywords '( - (sequence "NEXT(n)" "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CNCL(k@)") - (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)") - ))) - -(use-package! org-ql) -(use-package! org-bookmark-heading) - -(defun ak/activities-define--with-prefix-arg () - "Call 'C-u activities-define' in order to save the current activity." - (interactive) - (let ((current-prefix-arg '(4))) - (call-interactively #'activities-define))) + (add-hook! 'org-mode-hook #'+org-init-keybinds-h)) (use-package! activities :demand t :config + (defun ak/activities-define--with-prefix-arg () + "Call 'C-u activities-define' in order to save the current activity." + (interactive) + (let ((current-prefix-arg '(4))) + (call-interactively #'activities-define))) + (activities-mode) (activities-tabs-mode) (map! @@ -121,13 +130,11 @@ (use-package! elfeed-web) (when ak/at-work? - (use-package! forge - :config + (after! forge (add-to-list 'forge-alist '("gitlab.atlas.de" "gitlab.atlas.de/api/v4" "gitlab.atlas.de" forge-gitlab-repository)) ) - (use-package! code-review - :config + (after! code-review (setq code-review-auth-login-marker 'forge) ;; (setq code-review-gitlab-host "gitlab.atlas.de/api") ;; (setq code-review-gitlab-graphql-host "gitlab.atlas.de/api") @@ -141,9 +148,8 @@ (setq! bibtex-completion-bibliography ak/bibliography) (setq! citar-bibliography ak/bibliography) -(use-package! ledger-mode - :config - (setq +(after! ledger-mode + (setq! ;; Use an ISO date format for ledger entries ledger-default-date-format "%Y-%m-%d" ledger-binary-path "hledger" @@ -154,11 +160,11 @@ ledger-report-native-highlighting-arguments '("--color=always") ledger-highlight-xact-under-point t) - (setq ledger-reports - '(("bal" "%(binary) -f %(ledger-file) bal -B") - ("reg" "%(binary) -f %(ledger-file) reg -B") - ("payee" "%(binary) -f %(ledger-file) reg -B @%(payee)") - ("account" "%(binary) -f %(ledger-file) reg -B %(account)"))) ) + (setq! ledger-reports + '(("bal" "%(binary) -f %(ledger-file) bal -B") + ("reg" "%(binary) -f %(ledger-file) reg -B") + ("payee" "%(binary) -f %(ledger-file) reg -B @%(payee)") + ("account" "%(binary) -f %(ledger-file) reg -B %(account)"))) ) (after! lsp-haskell @@ -180,22 +186,17 @@ ;; (define-key haskell-mode-map (kbd "C-c a") #'lsp-wingman-split-func-args) ) -;; tweak some VI defaults -(after! evil - (setq evil-ex-substitute-global t ; I like my s/../.. to be global by default - evil-move-cursor-back nil ; Don't move the block cursor when toggling insert mode - evil-kill-on-visual-paste nil)) ; Don't put overwritten text in the kill ring - -(setq org-gtd-update-ack "3.0.0") - ;; Org GTD support (use-package! org-gtd :after org :demand t + :init + (setq! org-gtd-update-ack "3.0.0") + :config - (setq org-gtd-directory org-directory) - (setq org-gtd-default-file-name "actionable") - (setq org-edna-use-inheritance t) + (setq! org-gtd-directory org-directory) + (setq! org-gtd-default-file-name "actionable") + (setq! org-edna-use-inheritance t) ;; (setq org-gtd-areas-of-focus '("house" "haskell" "foss")) ;; (setq org-gtd-organize-hooks '(org-gtd-set-area-of-focus org-set-tags-command)) (org-edna-mode) @@ -224,11 +225,10 @@ :desc "Stuck actions" "a" #'org-gtd-review-stuck-single-action-items :desc "Stuck habits" "h" #'org-gtd-review-stuck-habit-items)))) -(use-package! org-habit - :after org - :config (setq org-habit-show-habits t - org-habit-preceding-days 35 - org-habit-following-days 7)) +(after! org-habit + (setq org-habit-show-habits t + org-habit-preceding-days 35 + org-habit-following-days 7)) (use-package! org-edna :after org-gtd @@ -254,9 +254,9 @@ (use-package! denote :after org :config - (setq denote-directory (concat org-directory "/notes")) + (setq! denote-directory (concat org-directory "/notes")) (require 'denote-journal-extras) - (setq denote-journal-extras-title-format 'day-date-month-year) + (setq! denote-journal-extras-title-format 'day-date-month-year) (map! :leader (:prefix ("n" . "notes") :desc "Denote" "d" #'denote-open-or-create-with-command @@ -269,57 +269,55 @@ (use-package! org-super-agenda :after org-agenda :init - (setq org-agenda-skip-deadline-if-done t - org-agenda-skip-scheduled-if-done t - org-agenda-include-deadlines t - org-agenda-block-separator nil - org-agenda-compact-blocks t - org-agenda-start-day nil - org-agenda-span 1 - org-agenda-start-on-weekday nil - ) - (setq org-agenda-custom-commands - '(("a" "Getting Things done" - ((agenda "" ((org-agenda-overriding-header "") - (org-super-agenda-groups - '((:name "Today" - :time-grid t - :date today - :order 1))))) - (alltodo "" ((org-agenda-overriding-header "") + (setq! org-agenda-skip-deadline-if-done t + org-agenda-skip-scheduled-if-done t + org-agenda-include-deadlines t + org-agenda-block-separator nil + org-agenda-compact-blocks t + org-agenda-start-day nil + org-agenda-span 1 + org-agenda-start-on-weekday nil + ) + (setq! org-agenda-custom-commands + '(("a" "Getting Things done" + ((agenda "" ((org-agenda-overriding-header "") (org-super-agenda-groups - '(;(:log t) - (:name "Waiting for..." - :todo "WAIT" - :order 1) - (:discard (:not (:todo ("NEXT" "STRT")))) - (:name "Next actions" - :auto-parent (:todo ("NEXT" "STRT")) - :order 2 - ) - (:discard (:anything t) - :order 99) - )))) - )))) + '((:name "Today" + :time-grid t + :date today + :order 1))))) + (alltodo "" ((org-agenda-overriding-header "") + (org-super-agenda-groups + '(;(:log t) + (:name "Waiting for..." + :todo "WAIT" + :order 1) + (:discard (:not (:todo ("NEXT" "STRT")))) + (:name "Next actions" + :auto-parent (:todo ("NEXT" "STRT")) + :order 2 + ) + (:discard (:anything t) + :order 99) + )))) + )))) :config (org-super-agenda-mode) ) (use-package! org-fc :after org - :init - (setq org-fc-directories (concat org-directory "/cards")) - (setq org-fc-source-path (concat straight-base-dir "repos/org-fc")) + :config + (setq! org-fc-directories (concat org-directory "/cards")) + (setq! org-fc-source-path (concat straight-base-dir "repos/org-fc")) ) -(use-package! vterm - :config +(after! vterm (setq vterm-min-window-width 50) ) (map! :desc "Move workspace to the left" :leader :n "TAB <" #'+workspace/swap-left) (map! :desc "Move workspace to the left" :leader :n "TAB >" #'+workspace/swap-right) -(map! :desc "Denote" :leader :n "n d" #'denote) ;; Here are some additional functions/macros that could help you configure Doom: ;; diff --git a/home/alex/programs/emacs/doom/init.el b/home/alex/programs/emacs/doom/init.el index 71b9a25..7e79c76 100644 --- a/home/alex/programs/emacs/doom/init.el +++ b/home/alex/programs/emacs/doom/init.el @@ -24,13 +24,14 @@ ;;helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... ;;ivy ; a search engine for love and life - (vertico +icons) ; the search engine of the future + (vertico +orderless +icons) ; the search engine of the future + (corfu +orderless +icons +dabbrev) :ui ;;deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does doom-dashboard ; a nifty splash screen for Emacs - ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + doom-quit ; DOOM quit-message prompts when you quit Emacs (emoji +unicode +github +ascii) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra @@ -45,7 +46,7 @@ ;;tabs ; a tab bar for Emacs ;;treemacs ; a project drawer, like neotree but cooler unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe + (vc-gutter +diff-hl) ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB (window-select +numbers) ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces @@ -57,10 +58,11 @@ fold ; (nigh) universal code folding (format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys - ;;lispy ; vim for lisp, for people who don't like vim - multiple-cursors ; editing in many places at once + ;; lispy ; vim for lisp, for people who don't like vim + multiple-cursors + ; editing in many places at once ;;objed ; text object editing for the innocent - ;;parinfer ; turn lisp into python, sort of + ;; parinfer ; turn lisp into python, sort of rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to word-wrap ; soft wrapping with language-aware indent @@ -88,7 +90,7 @@ biblio ; Writes a PhD for you (citation needed) (debugger +lsp) ; FIXME stepping through code, to help you add bugs direnv - ;;docker + docker editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) @@ -102,9 +104,9 @@ ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects - ;;terraform ; infrastructure as code tmux ; an API for interacting with tmux tree-sitter + (terraform +lsp) ; infrastructure as code ;;upload ; map local to remote projects via ssh/ftp :os @@ -114,31 +116,31 @@ :lang ;;agda ; types of types of types of types... ;;beancount ; mind the GAAP - (cc +lsp) ; C > C++ == 1 + (cc +lsp +tree-sitter) ; C > C++ == 1 ;;clojure ; java with a lisp - ;;common-lisp ; if you've seen one lisp, you've seen them all + common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;dhall - ;;elixir ; erlang done right - (elm +lsp) ; care for a cup of TEA? + (elixir +lsp +tree-sitter) ; erlang done right + (elm +lsp +tree-sitter) ; care for a cup of TEA? emacs-lisp ; drown in parentheses - ;;erlang ; an elegant language for a more civilized age + (erlang +lsp +tree-sitter) ; an elegant language for a more civilized age ;;ess ; emacs speaks statistics ;;factor ;;faust ; dsp, but you get to keep your soul ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - (go +lsp) ; the hipster dialect + (go +lsp +tree-sitter) ; the hipster dialect (graphql +lsp) ; Give queries a REST - (haskell +lsp) ; a language that's lazier than I am + (haskell +lsp +tree-sitter) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on - json ; At least it ain't XML + (json +lsp +tree-sitter) ; At least it ain't XML (java +lsp +tree-sitter) ; the poster child for carpal tunnel syndrome javascript ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB @@ -149,7 +151,7 @@ lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" + (nix +lsp +tree-sitter) ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org +pandoc +present +gnuplot +noter) ; organize your plain life in plain text ;;php ; perl's insecure younger brother @@ -162,16 +164,16 @@ rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;(scheme +guile) ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor + (sh +lsp +tree-sitter) ; she sells {ba,z,fi}sh shells on the C xor ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - ;;web ; the tubes - yaml ; JSON, but readable + (web +lsp +tree-sitter) ; the tubes + (yaml +lsp +tree-sitter) ; JSON, but readable ;;zig ; C, but simpler :email