diff options
| author | cashmere <cashmere@autistici.org> | 2025-10-07 21:37:07 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2025-10-07 21:37:07 +0200 |
| commit | f2b2a113c666c93d59e51bb03ef17ffd8b879301 (patch) | |
| tree | 19e981796fe382961774d10c8ad5f27e86001907 | |
| parent | 0203386788d435d4d7eaa934f42a6f99163656ec (diff) | |
| download | emacs-f2b2a113c666c93d59e51bb03ef17ffd8b879301.tar.gz | |
FIX
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | config.el | 502 | ||||
| -rw-r--r-- | config.org | 931 | ||||
| -rw-r--r-- | early-init.el | 0 |
4 files changed, 629 insertions, 805 deletions
@@ -57,3 +57,4 @@ p/.extension/ savehist straight/ var/ +dirvish/thumbnails/962 @@ -4,7 +4,7 @@ (setq read-process-output-max (* 1024 1024 4)) -;; (setq package-enable-at-startup nil) +;; (setq package-enable-at-startup nil) (when (boundp 'pgtk-wait-for-event-timeout) (setq pgtk-wait-for-event-timeout 0.001)) @@ -34,8 +34,6 @@ (add-to-list 'default-frame-alist '(alpha-background . 90)) -;; (add-to-list 'default-frame-alist '(internal-border-width . 16)) - ;; (setq straight-check-for-modifications nil) ;; (defvar bootstrap-version) ;; (let ((bootstrap-file @@ -52,14 +50,15 @@ ;; (goto-char (point-max)) ;; (eval-print-last-sexp))) ;; (load bootstrap-file nil 'nomessage)) -;; +;; ;; (straight-use-package '(project :type built-in)) ;; (straight-use-package 'use-package) -;; +;; ;; (setq straight-use-package-by-default t) ;;; EMACS ;; This is biggest one. Keep going, plugins (oops, I mean packages) will be shorter :) +(setq debug-on-error t) (use-package emacs :straight nil :ensure nil @@ -91,7 +90,8 @@ :hook ;; Add hooks to enable specific features in certain modes. (prog-mode . display-line-numbers-mode) - (org-mode . (lambda () (display-line-numbers-mode -1))) + (org-mode . display-line-numbers-mode) + ;; (org-mode . (lambda () (display-line-numbers-mode -1))) :config @@ -147,19 +147,19 @@ ;; Add a hook to run code after Emacs has fully initialized. (add-hook 'after-init-hook - (lambda () - (message "Emacs has fully loaded. This code runs after startup.") +(lambda () + (message "Emacs has fully loaded. This code runs after startup.") - ;; Insert a welcome message in the *scratch* buffer displaying loading time and activated packages. - (with-current-buffer (get-buffer-create "*scratch*") - (insert (format - ";; Welcome to Emacs! + ;; Insert a welcome message in the *scratch* buffer displaying loading time and activated packages. + (with-current-buffer (get-buffer-create "*scratch*") +(insert (format + ";; Welcome to Emacs! ;; ;; Loading time : %s ;; Packages : %s " - (emacs-init-time) - (length (hash-table-keys straight--recipe-cache)))))))) + (emacs-init-time) + (length (hash-table-keys straight--recipe-cache)))))))) (defcustom ek-use-nerd-fonts t "Configuration for using Nerd Fonts Symbols." @@ -176,39 +176,39 @@ ;; Emacs journey later on. These configurations can be useful for displaying ;; other types of buffers in side windows, allowing for a more organized workspace. (use-package window -:straight nil - :ensure nil ;; This is built-in, no need to fetch it. - :custom - (display-buffer-alist - '( - ;; ("\\*.*e?shell\\*" - ;; (display-buffer-in-side-window) - ;; (window-height . 0.25) - ;; (side . bottom) - ;; (slot . -1)) + :straight nil + :ensure nil ;; This is built-in, no need to fetch it. + :custom + (display-buffer-alist + '( + ;; ("\\*.*e?shell\\*" + ;; (display-buffer-in-side-window) + ;; (window-height . 0.25) + ;; (side . bottom) + ;; (slot . -1)) - ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|[Hh]elp\\|Messages\\|Bookmark List\\|Ibuffer\\|Occur\\|eldoc.*\\)\\*" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 0)) + ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|[Hh]elp\\|Messages\\|Bookmark List\\|Ibuffer\\|Occur\\|eldoc.*\\)\\*" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 0)) - ;; Example configuration for the LSP help buffer, - ;; keeps it always on bottom using 25% of the available space: - ("\\*\\(lsp-help\\)\\*" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 0)) + ;; Example configuration for the LSP help buffer, + ;; keeps it always on bottom using 25% of the available space: + ("\\*\\(lsp-help\\)\\*" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 0)) - ;; Configuration for displaying various diagnostic buffers on - ;; bottom 25%: - ("\\*\\(Flymake diagnostics\\|xref\\|ivy\\|Swiper\\|Completions\\)" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 1)) - ))) + ;; Configuration for displaying various diagnostic buffers on + ;; bottom 25%: + ("\\*\\(Flymake diagnostics\\|xref\\|ivy\\|Swiper\\|Completions\\)" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 1)) + ))) (use-package dired :straight nil @@ -218,14 +218,14 @@ (dired-dwim-target t) ;; Enable "do what I mean" for target directories. (dired-guess-shell-alist-user '(("\\.\\(png\\|jpe?g\\|tiff\\)" "feh" "xdg-open" "open") ;; Open image files with `feh' or the default viewer. - ("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open" "open") ;; Open audio and video files with `mpv'. - (".*" "open" "xdg-open"))) ;; Default opening command for other files. +("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open" "open") ;; Open audio and video files with `mpv'. +(".*" "open" "xdg-open"))) ;; Default opening command for other files. (dired-kill-when-opening-new-dired-buffer t) ;; Close the previous buffer when opening a new `dired' instance. :config (when (eq system-type 'darwin) (let ((gls (executable-find "gls"))) ;; Use GNU ls on macOS if available. - (when gls - (setq insert-directory-program gls))))) +(when gls +(setq insert-directory-program gls))))) (use-package erc :straight nil @@ -265,7 +265,7 @@ (setq lazy-count-suffix-format nil) ;; Disable suffix formatting for match count. (setq search-whitespace-regexp ".*?") ;; Allow searching across whitespace. :bind (("C-s" . isearch-forward) ;; Bind C-s to forward isearch. - ("C-r" . isearch-backward))) ;; Bind C-r to backward isearch. + ("C-r" . isearch-backward))) ;; Bind C-r to backward isearch. (use-package vc :straight nil @@ -279,20 +279,20 @@ :config ;; Better colors for <leader> g b (blame file) (setq vc-annotate-color-map - '((20 . "#f5e0dc") - (40 . "#f2cdcd") - (60 . "#f5c2e7") - (80 . "#cba6f7") - (100 . "#f38ba8") - (120 . "#eba0ac") - (140 . "#fab387") - (160 . "#f9e2af") - (180 . "#a6e3a1") - (200 . "#94e2d5") - (220 . "#89dceb") - (240 . "#74c7ec") - (260 . "#89b4fa") - (280 . "#b4befe")))) +'((20 . "#f5e0dc") + (40 . "#f2cdcd") + (60 . "#f5c2e7") + (80 . "#cba6f7") + (100 . "#f38ba8") + (120 . "#eba0ac") + (140 . "#fab387") + (160 . "#f9e2af") + (180 . "#a6e3a1") + (200 . "#94e2d5") + (220 . "#89dceb") + (240 . "#74c7ec") + (260 . "#89b4fa") + (280 . "#b4befe")))) @@ -301,10 +301,10 @@ :ensure nil ;; This is built-in, no need to fetch it. :defer t :bind (:map smerge-mode-map - ("C-c ^ u" . smerge-keep-upper) ;; Keep the changes from the upper version. - ("C-c ^ l" . smerge-keep-lower) ;; Keep the changes from the lower version. - ("C-c ^ n" . smerge-next) ;; Move to the next conflict. - ("C-c ^ p" . smerge-previous))) ;; Move to the previous conflict. +("C-c ^ u" . smerge-keep-upper) ;; Keep the changes from the upper version. +("C-c ^ l" . smerge-keep-lower) ;; Keep the changes from the lower version. +("C-c ^ n" . smerge-next) ;; Move to the next conflict. +("C-c ^ p" . smerge-previous))) ;; Move to the previous conflict. (use-package eldoc :straight nil @@ -312,9 +312,9 @@ :config (setq eldoc-idle-delay 0) ;; Automatically fetch doc help (setq eldoc-echo-area-use-multiline-p t) ;; We use the "K" floating help instead - ;; set to t if you want docs on the echo area - (setq eldoc-help-at-pt t) - (setq eldoc-echo-area-display-truncation-message nil) +;; set to t if you want docs on the echo area +(setq eldoc-help-at-pt t) +(setq eldoc-echo-area-display-truncation-message nil) :init (global-eldoc-mode)) @@ -326,7 +326,7 @@ :custom (flymake-margin-indicators-string '((error "!»" compilation-error) (warning "»" compilation-warning) - (note "»" compilation-info)))) +(note "»" compilation-info)))) (use-package xref :straight nil @@ -336,62 +336,59 @@ :straight nil :ensure nil) -(use-package org - :straight nil - :ensure nil - :defer t - :config -(setq org-directory "~/org/") - (require 'org-tempo) - - (custom-set-faces - '(org-document-title ((t (:height 1.6)))) - '(outline-1 ((t (:height 1.25)))) - '(outline-2 ((t (:height 1.2)))) - '(outline-3 ((t (:height 1.2)))) - '(outline-4 ((t (:height 1.2)))) - '(outline-5 ((t (:height 1.2)))) - '(outline-6 ((t (:height 1.2)))) - '(outline-7 ((t (:height 1.2)))) - '(outline-8 ((t (:height 1.2)))) - '(outline-9 ((t (:height 1.2))))) - (org-indent-mode -1) - (setq org-startup-folded 'content) - (setq org-adapt-indentation t - org-hide-leading-stars t - org-pretty-entities t - org-ellipsis " ") - (setq org-src-fontify-natively t - org-src-tab-acts-natively t - org-edit-src-content-indentation 0) - (setq org-log-done t - org-auto-align-tags t - org-tags-column -80 - org-fold-catch-invisible-edits 'show-and-error - org-special-ctrl-a/e t - org-insert-heading-respect-content t) + (use-package org + :straight nil + :ensure nil + :defer t + :config + (custom-set-faces + '(org-document-title ((t (:height 1.6)))) + '(outline-1 ((t (:height 1.25)))) + '(outline-2 ((t (:height 1.2)))) + '(outline-3 ((t (:height 1.2)))) + '(outline-4 ((t (:height 1.2)))) + '(outline-5 ((t (:height 1.2)))) + '(outline-6 ((t (:height 1.2)))) + '(outline-7 ((t (:height 1.2)))) + '(outline-8 ((t (:height 1.2)))) + '(outline-9 ((t (:height 1.2))))) + (org-indent-mode -1) + (setq org-startup-folded 'content) + (setq org-adapt-indentation t + org-hide-leading-stars t + org-pretty-entities t + org-ellipsis " ") + (setq org-src-fontify-natively t + org-src-tab-acts-natively t + org-edit-src-content-indentation 0) + (setq org-log-done t + org-auto-align-tags t + org-tags-column -80 + org-fold-catch-invisible-edits 'show-and-error + org-special-ctrl-a/e t + org-insert-heading-respect-content t) - ;; (my-local-leader - ;; ) - - (add-hook 'org-mode-hook 'variable-pitch-mode) - (add-to-list 'font-lock-extra-managed-props 'display) - (font-lock-add-keywords 'org-mode - `(("^.*?\( \)\(:[[:alnum:]_@#%:]+:\)$" - (1 `(face nil - display (space :align-to (- right ,(org-string-width (match-string 2)) 3))) - prepend))) t)) - ;; (setq org-blank-before-new-entry '((heading . nil) - ;; (plain-list-item . nil))) + ;; (my-local-leader + ;; ) + + (add-hook 'org-mode-hook 'variable-pitch-mode) + (add-to-list 'font-lock-extra-managed-props 'display) + (font-lock-add-keywords 'org-mode + `(("^.*?\( \)\(:[[:alnum:]_@#%:]+:\)$" + (1 `(face nil + display (space :align-to (- right ,(org-string-width (match-string 2)) 3))) + prepend))) t) + (setq org-blank-before-new-entry '((heading . nil) + (plain-list-item . nil)))) -(use-package org-appear - :commands (org-appear-mode) - :hook (org-mode . org-appear-mode) - :config - (setq org-hide-emphasis-markers t) ;; Must be activated for org-appear to work - (setq org-appear-autoemphasis t ;; Show bold, italics, verbatim, etc. - org-appear-autolinks t ;; Show links - org-appear-autosubmarkers t)) ;; Show sub- and superscripts +;; (use-package org-appear +;; :commands (org-appear-mode) +;; :hook (org-mode . org-appear-mode) +;; :config +;; (setq org-hide-emphasis-markers t) ;; Must be activated for org-appear to work +;; (setq org-appear-autoemphasis t ;; Show bold, italics, verbatim, etc. +;; org-appear-autolinks t ;; Show links +;; org-appear-autosubmarkers t)) ;; Show sub- and superscripts (setq org-agenda-start-on-weekday nil org-agenda-block-separator nil @@ -400,7 +397,7 @@ (use-package org-super-agenda :after org :config - (setq org-super-agenda-header-prefix "\n❯ ") + (setq org-super-agenda-header-prefix "\n ") ;; Hide the thin width char glyph (add-hook 'org-agenda-mode-hook #'(lambda () (setq-local nobreak-char-display nil))) @@ -411,48 +408,29 @@ :after org) (add-to-list 'org-agenda-custom-commands - '("d" "Day View" - ((agenda "" ((org-agenda-overriding-header "Day View") + '("d" "Day View" + ((agenda "" ((org-agenda-overriding-header "Day View") (org-agenda-span 'day) (org-super-agenda-groups regular-view-groups))) - (org-ql-block '(todo "PROG") ((org-ql-block-header "\n❯ In Progress"))) - (org-ql-block '(todo "NEXT") ((org-ql-block-header "\n❯ Next Up"))) - (org-ql-block '(todo "WAIT") ((org-ql-block-header "\n❯ Backlog"))) - (org-ql-block '(priority "A") ((org-ql-block-header "\n❯ Important")))))) + (org-ql-block '(todo "PROG") ((org-ql-block-header "\n In Progress"))) + (org-ql-block '(todo "NEXT") ((org-ql-block-header "\n Next Up"))) + (org-ql-block '(todo "WAIT") ((org-ql-block-header "\n Backlog"))) + (org-ql-block '(priority "A") ((org-ql-block-header "\n Important")))))) (add-to-list 'org-agenda-custom-commands - '("e" "Three-Day View" +'("e" "Three-Day View" ((agenda "" ((org-agenda-span 3) (org-agenda-start-on-weekday nil) (org-deadline-warning-days 0)))))) -(org-babel-do-load-languages - 'org-babel-load-languages - '((python . t))) -(defun sloth/org-babel-edit-prep (info) - (setq buffer-file-name (or (alist-get :file (caddr info)) - "org-src-babel-tmp")) - (eglot-ensure)) -(advice-add 'org-edit-src-code - :before (defun sloth/org-edit-src-code/before (&rest args) - (when-let* ((element (org-element-at-point)) - (type (org-element-type element)) - (lang (org-element-property :language element)) - (mode (org-src-get-lang-mode lang)) - ((eglot--lookup-mode mode)) - (edit-pre (intern - (format "org-babel-edit-prep:%s" lang)))) - (if (fboundp edit-pre) - (advice-add edit-pre :after #'sloth/org-babel-edit-prep) - (fset edit-pre #'sloth/org-babel-edit-prep))))) (use-package denote :ensure t :hook (dired-mode . denote-dired-mode) :config (setq denote-rename-buffer-mode 1 - denote-directory (expand-file-name "~/org/"))) +denote-directory (expand-file-name "~/org/"))) (use-package denote-agenda :ensure t @@ -461,10 +439,13 @@ (denote-agenda-insinuate)) (use-package denote-menu - :ensure t) +:ensure t +:config +(setq denote-menu-title-column-width 40 +denote-menu-show-file-type nil)) (use-package denote-org - :ensure t) + :ensure t) (use-package which-key :straight nil @@ -493,13 +474,13 @@ ("C-k" . vertico-previous)) :config (advice-add #'vertico--format-candidate :around - (lambda (orig cand prefix suffix index _start) - (setq cand (funcall orig cand prefix suffix index _start)) - (concat - (if (= vertico--index index) - (propertize "» " 'face '(:foreground "#80adf0" :weight bold)) - " ") - cand)))) +(lambda (orig cand prefix suffix index _start) +(setq cand (funcall orig cand prefix suffix index _start)) +(concat + (if (= vertico--index index) +(propertize "» " 'face '(:foreground "#80adf0" :weight bold)) + " ") + cand)))) ;; (use-package vertico-posframe ;; :init @@ -528,7 +509,7 @@ ;; (setq xref-show-xrefs-function #'consult-xref ;; xref-show-definitions-function #'consult-xref) - + :config (setq consult-buffer-filter '("\\` " @@ -625,8 +606,8 @@ :after vertico ;; Ensure Vertico is loaded before Orderless. :init (setq completion-styles '(orderless basic) ;; Set the completion styles. - completion-category-defaults nil ;; Clear default category settings. - completion-category-overrides '((file (styles partial-completion))))) ;; Customize file completion styles. +completion-category-defaults nil ;; Clear default category settings. +completion-category-overrides '((file (styles partial-completion))))) ;; Customize file completion styles. ;; Marginalia enhances the completion experience in Emacs by adding ;; additional context to the completion candidates. This includes @@ -649,28 +630,28 @@ :ensure nil :straight nil :hook ((rust-mode . eglot-ensure) - (nix-mode . eglot-ensure) - (python-mode . eglot-ensure) - (eglot-managed-mode . (lambda () (eldoc-mode -1)))) + (nix-mode . eglot-ensure) + (python-mode . eglot-ensure) + (eglot-managed-mode . (lambda () (eldoc-mode -1)))) :bind (:map eglot-mode-map - ("M-<return>" . eglot-code-actions) - ("C-M-." . xref-find-references) - ("C-c r" . eglot-rename)) +("M-<return>" . eglot-code-actions) +("C-M-." . xref-find-references) +("C-c r" . eglot-rename)) :config (add-to-list 'eglot-server-programs - `(python-mode - . ,(eglot-alternatives '(("basedpyright-langserver" "--stdio") - ("pyright-langserver" "--stdio") - "jedi-language-server" - "pylsp")))) + `(python-mode + . ,(eglot-alternatives '(("basedpyright-langserver" "--stdio") + ("pyright-langserver" "--stdio") + "jedi-language-server" + "pylsp")))) (setq eldoc-echo-area-use-multiline-p nil - eglot-inlay-hints-mode -1) + eglot-inlay-hints-mode -1) (add-to-list 'eglot-server-programs '(nix-mode . ("nixd")))) (use-package eglot-booster - :straight ( eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster") - :after eglot - :config (eglot-booster-mode)) +:straight ( eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster") +:after eglot +:config (eglot-booster-mode)) (use-package consult-eglot :straight t @@ -687,23 +668,23 @@ :ensure t :hook (find-file . (lambda () - (global-diff-hl-mode) ;; Enable Diff-HL mode for all files. - (diff-hl-flydiff-mode) ;; Automatically refresh diffs. - (diff-hl-margin-mode))) ;; Show diff indicators in the margin. + (global-diff-hl-mode) ;; Enable Diff-HL mode for all files. + (diff-hl-flydiff-mode) ;; Automatically refresh diffs. + (diff-hl-margin-mode))) ;; Show diff indicators in the margin. :custom (diff-hl-side 'left) ;; Set the side for diff indicators. (diff-hl-margin-symbols-alist '((insert . "┃") ;; Customize symbols for each change type. - (delete . "-") - (change . "┃") - (unknown . "┆") - (ignored . "i")))) + (delete . "-") + (change . "┃") + (unknown . "┆") + (ignored . "i")))) (use-package magit :ensure t :straight t :config (if ek-use-nerd-fonts ;; Check if nerd fonts are being used - (setopt magit-format-file-function #'magit-format-file-nerd-icons)) ;; Turns on magit nerd-icons + (setopt magit-format-file-function #'magit-format-file-nerd-icons)) ;; Turns on magit nerd-icons :defer t) (use-package indent-guide @@ -758,14 +739,14 @@ evil-want-C-u-scroll t evil-want-C-u-delete t evil-want-C-i-jump nil) - + :config (evil-set-undo-system 'undo-tree) (setq evil-leader/in-all-states t evil-want-fine-undo t) - + (evil-mode 1) - + (define-key evil-normal-state-map (kbd "SPC") nil) (define-key evil-motion-state-map (kbd "SPC") nil) (define-key evil-normal-state-map (kbd ",") nil) @@ -779,7 +760,7 @@ :general ;; (general-nmap "s" 'avy-goto-char-timer) ;; (general-omap "s" 'evil-avy-goto-char-timer) - + :config (setq avy-all-windows t avy-all-windows-alt t @@ -788,7 +769,7 @@ avy-timeout-seconds 0.3 avy-style 'at-full avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?t ?y ?u ?i ?o ?p)) - + (evil-define-avy-motion evil-avy-goto-char-timer inclusive)) @@ -828,14 +809,14 @@ (after-init . global-undo-tree-mode) :init (setq undo-tree-visualizer-timestamps t - undo-tree-visualizer-diff t - ;; Increase undo limits to avoid losing history due to Emacs' garbage collection. - ;; These values can be adjusted based on your needs. - ;; 10X bump of the undo limits to avoid issues with premature - ;; Emacs GC which truncates the undo history very aggressively. - undo-limit 800000 ;; Limit for undo entries. - undo-strong-limit 12000000 ;; Strong limit for undo entries. - undo-outer-limit 120000000) ;; Outer limit for undo entries. +undo-tree-visualizer-diff t +;; Increase undo limits to avoid losing history due to Emacs' garbage collection. +;; These values can be adjusted based on your needs. +;; 10X bump of the undo limits to avoid issues with premature +;; Emacs GC which truncates the undo history very aggressively. +undo-limit 800000 ;; Limit for undo entries. +undo-strong-limit 12000000 ;; Strong limit for undo entries. +undo-outer-limit 120000000) ;; Outer limit for undo entries. :config ;; Set the directory where `undo-tree' will save its history files. ;; This keeps undo history across sessions, stored in a cache directory. @@ -984,15 +965,15 @@ (provide 'init) ;;; init.el ends here -(use-package org-modern - :ensure t - :straight t) -(with-eval-after-load 'org (global-org-modern-mode)) - -(setq org-modern-star 'fold) -(setq org-modern-fold-stars '(("◉" . "○"))) -(setq org-modern-star 'replace) -(setq org-modern-replace-stars "◉○◉○◉") +;; (use-package org-modern +;; :ensure t +;; :straight t) +;; (with-eval-after-load 'org (global-org-modern-mode)) +;; +;; (setq org-modern-star 'fold) +;; (setq org-modern-fold-stars '(("◉" . "○"))) +;; (setq org-modern-star 'replace) +;; (setq org-modern-replace-stars "◉○◉○◉") (require 'battery) (require 'nerd-icons) @@ -1111,32 +1092,32 @@ (setq-default header-line-format '("%e" - (:propertize " " display (raise +0.4)) - (:propertize " " display (raise -0.4)) +(:propertize " " display (raise +0.4)) +(:propertize " " display (raise -0.4)) - (:propertize "λ " face font-lock-comment-face) - mode-line-frame-identification - mode-line-buffer-identification +(:propertize "λ " face font-lock-comment-face) +mode-line-frame-identification +mode-line-buffer-identification - (:eval (when-let (vc vc-mode) - (list (propertize " " 'face 'font-lock-comment-face) - (propertize (truncate-string-to-width +(:eval (when-let (vc vc-mode) + (list (propertize " " 'face 'font-lock-comment-face) + (propertize (truncate-string-to-width (substring vc 5) 50) - 'face 'font-lock-comment-face)))) + 'face 'font-lock-comment-face)))) - (:propertize " %4l:%c" face mode-line-buffer-id) +(:propertize " %4l:%c" face mode-line-buffer-id) - (:eval (propertize - " " 'display - `((space :align-to - (- (+ right right-fringe right-margin) - ,(+ 3 +(:eval (propertize + " " 'display + `((space :align-to + (- (+ right right-fringe right-margin) + ,(+ 3 (string-width (or my-battery-string "")) (string-width (or display-time-string "")))))))) (:eval my-battery-string) - " " - (:eval display-time-string))) +" " +(:eval display-time-string))) (setq-default mode-line-format nil) @@ -1154,20 +1135,20 @@ (blink-cursor-mode 0) (setq-default cursor-type 'bar) -(setq my-whitespace-style '(face tabs lines-tail) - whitespace-style my-whitespace-style - whitespace-line-column 120 - fill-column 120 - whitespace-display-mappings - '((space-mark 32 [183] [46]) - (newline-mark 10 [36 10]) - (tab-mark 9 [9655 9] [92 9]))) +;; (setq my-whitespace-style '(face tabs lines-tail) ;; ⚠️ DEAKTIVIERT +;; whitespace-style my-whitespace-style ;; ⚠️ DEAKTIVIERT +;; whitespace-line-column 120 ;; ⚠️ DEAKTIVIERT +;; fill-column 120 ;; ⚠️ DEAKTIVIERT +;; whitespace-display-mappings ;; ⚠️ DEAKTIVIERT +;; '((space-mark 32 [183] [46]) ;; ⚠️ DEAKTIVIERT +;; (newline-mark 10 [36 10]) ;; ⚠️ DEAKTIVIERT +;; (tab-mark 9 [9655 9] [92 9]))) ;; ⚠️ DEAKTIVIERT ;; in e.g. clojure-mode-hook ;; (whitespace-mode 1) ;; or globally ;; (global-whitespace-mode 1) -(add-hook 'prog-mode 'whitespace-mode) +;; (add-hook 'prog-mode 'whitespace-mode) ;; ⚠️ DEAKTIVIERT - verursacht Whitespace-Anzeige (defvar cashmere/font-height 170) @@ -1212,24 +1193,24 @@ :straight t :init (dirvish-override-dired-mode) - + :custom (dirvish-quick-access-entries '(("h" "~/" "Home") ("d" "~/Downloads/" "Downloads") ("p" "~/projects/" "Projects"))) - + (dirvish-reuse-session 'open) (dirvish-attributes '(file-size)) (dirvish-mode-line-format '(:left (sort file-time symlink) :right (omit yank index))) - + (dirvish-hide-details '(dirvish dirvish-side)) (dirvish-hide-cursor '(dirvish dirvish-side)) - + (dired-listing-switches "-l --almost-all --human-readable --group-directories-first --no-group") - + :config (setq dired-dwim-target t) (setq delete-by-moving-to-trash t) @@ -1242,11 +1223,6 @@ (use-package olivetti :defer t) -(setq-default olivetti-body-width 95) -(define-globalized-minor-mode my-global-olivetti-mode olivetti-mode - (lambda () (olivetti-mode 1))) -(my-global-olivetti-mode) - (setq ibuffer-never-show-predicates '(;; System buffers "^\\*Messages\\*$" @@ -1307,7 +1283,7 @@ "SPC" '(my/smart-find-file :wk "find file/buffer") ":" (lambda () (interactive) (execute-extended-command nil)) -"d" '(:ignore t :wk "denote") +"d" '(:ignore t :wk "denote") "dd" '(denote-menu-list-notes t :wk "List all notes") "dg" '(denote-grep t :wk "Search") "dn" '(denote t :wk "Create a new note") @@ -1319,14 +1295,14 @@ "fr" '(consult-recent-file :wk "recent files") "ff" '(find-file :wk "find file") "fs" '(save-buffer :wk "save file") - + "b" '(:ignore t :wk "buffers") "bb" '(consult-buffer :wk "switch buffer") "bi" '(ibuffer :wk "ibuffer") "bd" '(kill-current-buffer :wk "kill buffer") "bk" '(kill-current-buffer :wk "kill buffer") "bs" '(save-buffer :wk "save buffer") - + "p" '(:ignore t :wk "project") "pp" '(projectile-switch-project :wk "switch project") "pf" '(projectile-find-file :wk "find file") @@ -1339,31 +1315,31 @@ "pc" '(projectile-compile-project :wk "compile") "pt" '(projectile-test-project :wk "test") "pi" '(projectile-invalidate-cache :wk "invalidate cache") - + "g" '(:ignore t :wk "git/goto") "gg" '(magit-status :wk "status") "gl" '(magit-log-current :wk "log") "gd" '(xref-find-definitions :wk "go to definition") ; sowohl hier als auch unter code "gs" '(magit-status :wk "status") "gb" '(vc-annotate :wk "blame") - + "o" '(:ignore t :wk "open") "op" '(neotree-toggle :wk "neotree") "oP" '(dired-jump :wk "dired") "od" '(dirvish :wk "dirvish") - + "h" '(:ignore t :wk "help") "hm" '(describe-mode :wk "mode") "hf" '(describe-function :wk "function") "hv" '(describe-variable :wk "variable") - "hk" '(describe-key :wk "key") - + "hk" '(describe-key :wk "key") + "w" '(:ignore t :wk "windows") "wv" '(split-window-right :wk "split right") "ws" '(split-window-below :wk "split below") "wd" '(delete-window :wk "delete") "wo" '(delete-other-windows :wk "delete others") - + "c" '(:ignore t :wk "code") "ca" '(eglot-code-actions :wk "code actions") "cd" '(xref-find-definitions :wk "go to definition") ; sowohl hier als auch unter g @@ -1376,19 +1352,19 @@ "cs" '(consult-eglot-symbols :wk "workspace symbols") "cS" '(eglot-shutdown :wk "shutdown lsp") "cR" '(eglot-reconnect :wk "restart lsp") - + "m" '(:ignore t :wk "mode") "mp" (list (lambda () (interactive) - (shell-command (concat "prettier --write " + (shell-command (concat "prettier --write " (shell-quote-argument (buffer-file-name)))) (revert-buffer t t t)) :wk "format prettier") - + "q" '(:ignore t :wk "quit") "qq" '(save-buffers-kill-terminal :wk "quit emacs") "qr" '(restart-emacs :wk "restart") - + "a" '(embark-act :wk "embark") "u" '(undo-tree-visualize :wk "undo tree") "P" '(consult-yank-from-kill-ring :wk "paste history")) @@ -1410,8 +1386,8 @@ "gcc" (lambda () (interactive) (unless (use-region-p) - (comment-or-uncomment-region - (line-beginning-position) + (comment-or-uncomment-region + (line-beginning-position) (line-end-position))))) ;; Global K binding für alle Modi mit eglot @@ -1420,8 +1396,8 @@ "gc" (lambda () (interactive) (when (use-region-p) - (comment-or-uncomment-region - (region-beginning) + (comment-or-uncomment-region + (region-beginning) (region-end))))) (general-def '(normal visual) 'override @@ -1,41 +1,16 @@ #+PROPERTY: header-args :tangle yes #+startup: content -* early init -#+begin_src emacs-lisp :tangle ~/.emacs.d/early-init.el -;; -*- lexical-binding: t; -*- -;; Native Compilation Setup -(when (and (fboundp 'native-comp-available-p) - (native-comp-available-p)) - (setq native-comp-deferred-compilation t) - (setq native-comp-async-report-warnings-errors nil) - (setq native-comp-async-jobs-number 6) ; 8 cores - 2 reserved = 6 - (setq native-comp-warning-on-missing-source nil) - - ;; Cache Setup - (let ((path (expand-file-name "eln-cache/" user-emacs-directory))) - (setq native-comp-eln-load-path (list path)) - (when (fboundp 'startup-redirect-eln-cache) - (startup-redirect-eln-cache path)))) +#+begin_src emacs-lisp :tangle ~/emacs.d/early-init.el -;; Package Management -(setq package-enable-at-startup nil) -(setq package-quickstart nil) -(setq load-prefer-newer t) -(setq gc-cons-threshold #x40000000) -#+end_src - -* performance - -#+begin_src emacs-lisp ;;; config.el --- Emacs-Kick --- A feature rich Emacs config for (neo)vi(m)mers -*- lexical-binding: t; -*- ;; (setenv "LSP_USE_PLISTS" "true") ;; (setq gc-cons-threshold #x40000000) (setq read-process-output-max (* 1024 1024 4)) -;; (setq package-enable-at-startup nil) +;; (setq package-enable-at-startup nil) (when (boundp 'pgtk-wait-for-event-timeout) (setq pgtk-wait-for-event-timeout 0.001)) @@ -63,27 +38,18 @@ (setq kept-new-versions 5) (setq kept-old-versions 5) #+end_src - * Visual Optimizations Let's define some visual optimizations to change the appearnce of Emacs. - ** Opacity To change the appearance of Emacs, lets start with the opacity. Setting it to 90% changes Emacs to a whole new level, as the colors of your theme and your background image harmonize with each other. - #+begin_src emacs-lisp +#+begin_src emacs-lisp (add-to-list 'default-frame-alist '(alpha-background . 90)) - #+end_src - -* Small frame border - - #+begin_src emacs-lisp - ;; (add-to-list 'default-frame-alist '(internal-border-width . 16)) - #+end_src - +#+end_src * straight.el #+begin_src emacs-lisp @@ -103,121 +69,121 @@ ;; (goto-char (point-max)) ;; (eval-print-last-sexp))) ;; (load bootstrap-file nil 'nomessage)) -;; +;; ;; (straight-use-package '(project :type built-in)) ;; (straight-use-package 'use-package) -;; +;; ;; (setq straight-use-package-by-default t) #+end_src - * emacs #+begin_src emacs-lisp -;;; EMACS -;; This is biggest one. Keep going, plugins (oops, I mean packages) will be shorter :) -(use-package emacs - :straight nil - :ensure nil - :custom ;; Set custom variables to configure Emacs behavior. - (column-number-mode t) ;; Display the column number in the mode line. - (auto-save-default nil) ;; Disable automatic saving of buffers. - (create-lockfiles nil) ;; Prevent the creation of lock files when editing. - (delete-by-moving-to-trash t) ;; Move deleted files to the trash instead of permanently deleting them. - (delete-selection-mode 1) ;; Enable replacing selected text with typed text. - (display-line-numbers-type 'relative) ;; Use relative line numbering in programming modes. - (global-auto-revert-non-file-buffers t) ;; Automatically refresh non-file buffers. - (history-length 25) ;; Set the length of the command history. - (inhibit-startup-message t) ;; Disable the startup message when Emacs launches. - (initial-scratch-message "") ;; Clear the initial message in the *scratch* buffer. - (ispell-dictionary "en_US") ;; Set the default dictionary for spell checking. - (make-backup-files nil) ;; Disable creation of backup files. - ;; (pixel-scroll-precision-mode t) ;; Enable precise pixel scrolling. - (pixel-scroll-precision-use-momentum nil) ;; Disable momentum scrolling for pixel precision. - (ring-bell-function 'ignore) ;; Disable the audible bell. - (split-width-threshold 300) ;; Prevent automatic window splitting if the window width exceeds 300 pixels. - (switch-to-buffer-obey-display-actions t) ;; Make buffer switching respect display actions. - (tab-always-indent 'complete) ;; Make the TAB key complete text instead of just indenting. - (tab-width 4) ;; Set the tab width to 4 spaces. - (treesit-font-lock-level 4) ;; Use advanced font locking for Treesit mode. - (truncate-lines t) ;; Enable line truncation to avoid wrapping long lines. - (use-dialog-box nil) ;; Disable dialog boxes in favor of minibuffer prompts. - (use-short-answers t) ;; Use short answers in prompts for quicker responses (y instead of yes) - (warning-minimum-level :emergency) ;; Set the minimum level of warnings to display. + ;;; EMACS + ;; This is biggest one. Keep going, plugins (oops, I mean packages) will be shorter :) + (setq debug-on-error t) + (use-package emacs + :straight nil + :ensure nil + :custom ;; Set custom variables to configure Emacs behavior. + (column-number-mode t) ;; Display the column number in the mode line. + (auto-save-default nil) ;; Disable automatic saving of buffers. + (create-lockfiles nil) ;; Prevent the creation of lock files when editing. + (delete-by-moving-to-trash t) ;; Move deleted files to the trash instead of permanently deleting them. + (delete-selection-mode 1) ;; Enable replacing selected text with typed text. + (display-line-numbers-type 'relative) ;; Use relative line numbering in programming modes. + (global-auto-revert-non-file-buffers t) ;; Automatically refresh non-file buffers. + (history-length 25) ;; Set the length of the command history. + (inhibit-startup-message t) ;; Disable the startup message when Emacs launches. + (initial-scratch-message "") ;; Clear the initial message in the *scratch* buffer. + (ispell-dictionary "en_US") ;; Set the default dictionary for spell checking. + (make-backup-files nil) ;; Disable creation of backup files. + ;; (pixel-scroll-precision-mode t) ;; Enable precise pixel scrolling. + (pixel-scroll-precision-use-momentum nil) ;; Disable momentum scrolling for pixel precision. + (ring-bell-function 'ignore) ;; Disable the audible bell. + (split-width-threshold 300) ;; Prevent automatic window splitting if the window width exceeds 300 pixels. + (switch-to-buffer-obey-display-actions t) ;; Make buffer switching respect display actions. + (tab-always-indent 'complete) ;; Make the TAB key complete text instead of just indenting. + (tab-width 4) ;; Set the tab width to 4 spaces. + (treesit-font-lock-level 4) ;; Use advanced font locking for Treesit mode. + (truncate-lines t) ;; Enable line truncation to avoid wrapping long lines. + (use-dialog-box nil) ;; Disable dialog boxes in favor of minibuffer prompts. + (use-short-answers t) ;; Use short answers in prompts for quicker responses (y instead of yes) + (warning-minimum-level :emergency) ;; Set the minimum level of warnings to display. - :hook ;; Add hooks to enable specific features in certain modes. - (prog-mode . display-line-numbers-mode) - (org-mode . (lambda () (display-line-numbers-mode -1))) + :hook ;; Add hooks to enable specific features in certain modes. + (prog-mode . display-line-numbers-mode) + (org-mode . display-line-numbers-mode) + ;; (org-mode . (lambda () (display-line-numbers-mode -1))) - :config - (add-to-list 'custom-theme-load-path user-emacs-directory) - ;; (load-theme 'rose-pine t) + :config + (add-to-list 'custom-theme-load-path user-emacs-directory) + ;; (load-theme 'rose-pine t) - ;; By default emacs gives you access to a lot of *special* buffers, while navigating with [b and ]b, - ;; this might be confusing for newcomers. This settings make sure ]b and [b will always load a - ;; file buffer. To see all buffers use <leader> SPC, <leader> b l, or <leader> b i. - (defun skip-these-buffers (_window buffer _bury-or-kill) - "Function for `switch-to-prev-buffer-skip'." - (string-match "\\*[^*]+\\*" (buffer-name buffer))) - (setq switch-to-prev-buffer-skip 'skip-these-buffers) + ;; By default emacs gives you access to a lot of *special* buffers, while navigating with [b and ]b, + ;; this might be confusing for newcomers. This settings make sure ]b and [b will always load a + ;; file buffer. To see all buffers use <leader> SPC, <leader> b l, or <leader> b i. + (defun skip-these-buffers (_window buffer _bury-or-kill) + "Function for `switch-to-prev-buffer-skip'." + (string-match "\\*[^*]+\\*" (buffer-name buffer))) + (setq switch-to-prev-buffer-skip 'skip-these-buffers) - ;; Configure font settings based on the operating system. - ;; Ok, this kickstart is meant to be used on the terminal, not on GUI. - ;; But without this, I fear you could start Graphical Emacs and be sad :( - (set-face-attribute 'default nil :family "Fragment Mono" :height 160) - ;; (when (eq system-type 'darwin) ;; Check if the system is macOS. - ;; (setq mac-command-modifier 'meta) ;; Set the Command key to act as the Meta key. - ;; (set-face-attribute 'default nil :family "Fragment Mono" :height 130)) + ;; Configure font settings based on the operating system. + ;; Ok, this kickstart is meant to be used on the terminal, not on GUI. + ;; But without this, I fear you could start Graphical Emacs and be sad :( + (set-face-attribute 'default nil :family "Fragment Mono" :height 160) + ;; (when (eq system-type 'darwin) ;; Check if the system is macOS. + ;; (setq mac-command-modifier 'meta) ;; Set the Command key to act as the Meta key. + ;; (set-face-attribute 'default nil :family "Fragment Mono" :height 130)) - ;; Save manual customizations to a separate file instead of cluttering `init.el'. - ;; You can M-x customize, M-x customize-group, or M-x customize-themes, etc. - ;; The saves you do manually using the Emacs interface would overwrite this file. - ;; The following makes sure those customizations are in a separate file. - (setq custom-file (locate-user-emacs-file "custom-vars.el")) ;; Specify the custom file path. - (load custom-file 'noerror 'nomessage) ;; Load the custom file quietly, ignoring errors. + ;; Save manual customizations to a separate file instead of cluttering `init.el'. + ;; You can M-x customize, M-x customize-group, or M-x customize-themes, etc. + ;; The saves you do manually using the Emacs interface would overwrite this file. + ;; The following makes sure those customizations are in a separate file. + (setq custom-file (locate-user-emacs-file "custom-vars.el")) ;; Specify the custom file path. + (load custom-file 'noerror 'nomessage) ;; Load the custom file quietly, ignoring errors. - ;; Makes Emacs vertical divisor the symbol │ instead of |. - (set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?│)) + ;; Makes Emacs vertical divisor the symbol │ instead of |. + (set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?│)) - :init ;; Initialization settings that apply before the package is loaded. - (tool-bar-mode -1) ;; Disable the tool bar for a cleaner interface. - (menu-bar-mode -1) ;; Disable the menu bar for a more streamlined look. + :init ;; Initialization settings that apply before the package is loaded. + (tool-bar-mode -1) ;; Disable the tool bar for a cleaner interface. + (menu-bar-mode -1) ;; Disable the menu bar for a more streamlined look. - (when scroll-bar-mode - (scroll-bar-mode -1)) ;; Disable the scroll bar if it is active. + (when scroll-bar-mode + (scroll-bar-mode -1)) ;; Disable the scroll bar if it is active. - (global-hl-line-mode -1) ;; Disable highlight of the current line - (global-auto-revert-mode 1) ;; Enable global auto-revert mode to keep buffers up to date with their corresponding files. - (indent-tabs-mode -1) ;; Disable the use of tabs for indentation (use spaces instead). - (recentf-mode 1) ;; Enable tracking of recently opened files. - (savehist-mode 1) ;; Enable saving of command history. - (save-place-mode 1) ;; Enable saving the place in files for easier return. - (winner-mode 1) ;; Enable winner mode to easily undo window configuration changes. - (xterm-mouse-mode 1) ;; Enable mouse support in terminal mode. - (file-name-shadow-mode 1) ;; Enable shadowing of filenames for clarity. + (global-hl-line-mode -1) ;; Disable highlight of the current line + (global-auto-revert-mode 1) ;; Enable global auto-revert mode to keep buffers up to date with their corresponding files. + (indent-tabs-mode -1) ;; Disable the use of tabs for indentation (use spaces instead). + (recentf-mode 1) ;; Enable tracking of recently opened files. + (savehist-mode 1) ;; Enable saving of command history. + (save-place-mode 1) ;; Enable saving the place in files for easier return. + (winner-mode 1) ;; Enable winner mode to easily undo window configuration changes. + (xterm-mouse-mode 1) ;; Enable mouse support in terminal mode. + (file-name-shadow-mode 1) ;; Enable shadowing of filenames for clarity. - ;; Set the default coding system for files to UTF-8. - (modify-coding-system-alist 'file "" 'utf-8) + ;; Set the default coding system for files to UTF-8. + (modify-coding-system-alist 'file "" 'utf-8) - ;; Add a hook to run code after Emacs has fully initialized. - (add-hook 'after-init-hook - (lambda () - (message "Emacs has fully loaded. This code runs after startup.") + ;; Add a hook to run code after Emacs has fully initialized. + (add-hook 'after-init-hook + (lambda () + (message "Emacs has fully loaded. This code runs after startup.") - ;; Insert a welcome message in the *scratch* buffer displaying loading time and activated packages. - (with-current-buffer (get-buffer-create "*scratch*") - (insert (format - ";; Welcome to Emacs! -;; -;; Loading time : %s -;; Packages : %s -" - (emacs-init-time) - (length (hash-table-keys straight--recipe-cache)))))))) + ;; Insert a welcome message in the *scratch* buffer displaying loading time and activated packages. + (with-current-buffer (get-buffer-create "*scratch*") + (insert (format + ";; Welcome to Emacs! + ;; + ;; Loading time : %s + ;; Packages : %s + " + (emacs-init-time) + (length (hash-table-keys straight--recipe-cache)))))))) #+end_src - * emacs-kickstart font #+begin_src emacs-lisp @@ -226,56 +192,54 @@ :type 'boolean :group 'appearance) #+end_src - * window #+begin_src emacs-lisp -;;; WINDOW -;; This section configures window management in Emacs, enhancing the way buffers -;; are displayed for a more efficient workflow. The `window' use-package helps -;; streamline how various buffers are shown, especially those related to help, -;; diagnostics, and completion. -;; -;; Note: I have left some commented-out code below that may facilitate your -;; Emacs journey later on. These configurations can be useful for displaying -;; other types of buffers in side windows, allowing for a more organized workspace. -(use-package window -:straight nil + ;;; WINDOW + ;; This section configures window management in Emacs, enhancing the way buffers + ;; are displayed for a more efficient workflow. The `window' use-package helps + ;; streamline how various buffers are shown, especially those related to help, + ;; diagnostics, and completion. + ;; + ;; Note: I have left some commented-out code below that may facilitate your + ;; Emacs journey later on. These configurations can be useful for displaying + ;; other types of buffers in side windows, allowing for a more organized workspace. + (use-package window + :straight nil :ensure nil ;; This is built-in, no need to fetch it. :custom (display-buffer-alist - '( - ;; ("\\*.*e?shell\\*" - ;; (display-buffer-in-side-window) - ;; (window-height . 0.25) - ;; (side . bottom) - ;; (slot . -1)) + '( + ;; ("\\*.*e?shell\\*" + ;; (display-buffer-in-side-window) + ;; (window-height . 0.25) + ;; (side . bottom) + ;; (slot . -1)) - ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|[Hh]elp\\|Messages\\|Bookmark List\\|Ibuffer\\|Occur\\|eldoc.*\\)\\*" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 0)) + ("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|[Hh]elp\\|Messages\\|Bookmark List\\|Ibuffer\\|Occur\\|eldoc.*\\)\\*" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 0)) - ;; Example configuration for the LSP help buffer, - ;; keeps it always on bottom using 25% of the available space: - ("\\*\\(lsp-help\\)\\*" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 0)) + ;; Example configuration for the LSP help buffer, + ;; keeps it always on bottom using 25% of the available space: + ("\\*\\(lsp-help\\)\\*" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 0)) - ;; Configuration for displaying various diagnostic buffers on - ;; bottom 25%: - ("\\*\\(Flymake diagnostics\\|xref\\|ivy\\|Swiper\\|Completions\\)" - (display-buffer-in-side-window) - (window-height . 0.25) - (side . bottom) - (slot . 1)) - ))) + ;; Configuration for displaying various diagnostic buffers on + ;; bottom 25%: + ("\\*\\(Flymake diagnostics\\|xref\\|ivy\\|Swiper\\|Completions\\)" + (display-buffer-in-side-window) + (window-height . 0.25) + (side . bottom) + (slot . 1)) + ))) #+end_src - * dired #+begin_src emacs-lisp @@ -287,16 +251,15 @@ (dired-dwim-target t) ;; Enable "do what I mean" for target directories. (dired-guess-shell-alist-user '(("\\.\\(png\\|jpe?g\\|tiff\\)" "feh" "xdg-open" "open") ;; Open image files with `feh' or the default viewer. - ("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open" "open") ;; Open audio and video files with `mpv'. - (".*" "open" "xdg-open"))) ;; Default opening command for other files. +("\\.\\(mp[34]\\|m4a\\|ogg\\|flac\\|webm\\|mkv\\)" "mpv" "xdg-open" "open") ;; Open audio and video files with `mpv'. +(".*" "open" "xdg-open"))) ;; Default opening command for other files. (dired-kill-when-opening-new-dired-buffer t) ;; Close the previous buffer when opening a new `dired' instance. :config (when (eq system-type 'darwin) (let ((gls (executable-find "gls"))) ;; Use GNU ls on macOS if available. - (when gls - (setq insert-directory-program gls))))) +(when gls +(setq insert-directory-program gls))))) #+end_src - * erc #+begin_src emacs-lisp @@ -309,10 +272,9 @@ (erc-timestamp-format "[%H:%M]") ;; Format for timestamps in messages. (erc-autojoin-channels-alist '((".*\\.libera\\.chat" "#emacs"))));; Automatically join the #emacs channel on Libera.Chat. #+end_src - * centered-cursor -[[https://entropicthoughts.com/centered-cursor-mode-in-vanilla-emacs][Centered Cursor Mode in Vanilla Emacs]] +[[https://entropicthoughts.com/centered-cursor-mode-in-vanilla-emacs][Centered Cursor Mode in Vanilla Emacs]] #+begin_src emacs-lisp (defvar my/centered-cursor-enabled nil) @@ -335,7 +297,6 @@ (setq my/centered-cursor-enabled t) (message "centered-cursor on")))) #+end_src - * isearch #+begin_src emacs-lisp @@ -348,9 +309,8 @@ (setq lazy-count-suffix-format nil) ;; Disable suffix formatting for match count. (setq search-whitespace-regexp ".*?") ;; Allow searching across whitespace. :bind (("C-s" . isearch-forward) ;; Bind C-s to forward isearch. - ("C-r" . isearch-backward))) ;; Bind C-r to backward isearch. + ("C-r" . isearch-backward))) ;; Bind C-r to backward isearch. #+end_src - * vc #+begin_src emacs-lisp @@ -366,26 +326,25 @@ :config ;; Better colors for <leader> g b (blame file) (setq vc-annotate-color-map - '((20 . "#f5e0dc") - (40 . "#f2cdcd") - (60 . "#f5c2e7") - (80 . "#cba6f7") - (100 . "#f38ba8") - (120 . "#eba0ac") - (140 . "#fab387") - (160 . "#f9e2af") - (180 . "#a6e3a1") - (200 . "#94e2d5") - (220 . "#89dceb") - (240 . "#74c7ec") - (260 . "#89b4fa") - (280 . "#b4befe")))) +'((20 . "#f5e0dc") + (40 . "#f2cdcd") + (60 . "#f5c2e7") + (80 . "#cba6f7") + (100 . "#f38ba8") + (120 . "#eba0ac") + (140 . "#fab387") + (160 . "#f9e2af") + (180 . "#a6e3a1") + (200 . "#94e2d5") + (220 . "#89dceb") + (240 . "#74c7ec") + (260 . "#89b4fa") + (280 . "#b4befe")))) #+end_src #+begin_src emacs-lisp #+end_src - * smerge #+begin_src emacs-lisp @@ -394,12 +353,11 @@ :ensure nil ;; This is built-in, no need to fetch it. :defer t :bind (:map smerge-mode-map - ("C-c ^ u" . smerge-keep-upper) ;; Keep the changes from the upper version. - ("C-c ^ l" . smerge-keep-lower) ;; Keep the changes from the lower version. - ("C-c ^ n" . smerge-next) ;; Move to the next conflict. - ("C-c ^ p" . smerge-previous))) ;; Move to the previous conflict. +("C-c ^ u" . smerge-keep-upper) ;; Keep the changes from the upper version. +("C-c ^ l" . smerge-keep-lower) ;; Keep the changes from the lower version. +("C-c ^ n" . smerge-next) ;; Move to the next conflict. +("C-c ^ p" . smerge-previous))) ;; Move to the previous conflict. #+end_src - * eldoc #+begin_src emacs-lisp @@ -409,16 +367,15 @@ :config (setq eldoc-idle-delay 0) ;; Automatically fetch doc help (setq eldoc-echo-area-use-multiline-p t) ;; We use the "K" floating help instead - ;; set to t if you want docs on the echo area - (setq eldoc-help-at-pt t) - (setq eldoc-echo-area-display-truncation-message nil) +;; set to t if you want docs on the echo area +(setq eldoc-help-at-pt t) +(setq eldoc-echo-area-display-truncation-message nil) :init (global-eldoc-mode)) #+end_src - * flymake - Disabled because nix is managing the flymake configuration. +Disabled because nix is managing the flymake configuration. #+begin_src emacs-lisp (use-package flymake @@ -429,17 +386,15 @@ :custom (flymake-margin-indicators-string '((error "!»" compilation-error) (warning "»" compilation-warning) - (note "»" compilation-info)))) +(note "»" compilation-info)))) #+end_src - * xref - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package xref :straight nil :ensure nil) - #+end_src - +#+end_src * project #+begin_src emacs-lisp @@ -447,7 +402,6 @@ :straight nil :ensure nil) #+end_src - * org mode #+begin_src emacs-lisp @@ -456,9 +410,6 @@ :ensure nil :defer t :config - (setq org-directory "~/org/") - (require 'org-tempo) - (custom-set-faces '(org-document-title ((t (:height 1.6)))) '(outline-1 ((t (:height 1.25)))) @@ -473,18 +424,18 @@ (org-indent-mode -1) (setq org-startup-folded 'content) (setq org-adapt-indentation t - org-hide-leading-stars t - org-pretty-entities t - org-ellipsis " ") + org-hide-leading-stars t + org-pretty-entities t + org-ellipsis " ") (setq org-src-fontify-natively t - org-src-tab-acts-natively t - org-edit-src-content-indentation 0) + org-src-tab-acts-natively t + org-edit-src-content-indentation 0) (setq org-log-done t - org-auto-align-tags t - org-tags-column -80 - org-fold-catch-invisible-edits 'show-and-error - org-special-ctrl-a/e t - org-insert-heading-respect-content t) + org-auto-align-tags t + org-tags-column -80 + org-fold-catch-invisible-edits 'show-and-error + org-special-ctrl-a/e t + org-insert-heading-respect-content t) ;; (my-local-leader ;; ) @@ -495,140 +446,111 @@ `(("^.*?\( \)\(:[[:alnum:]_@#%:]+:\)$" (1 `(face nil display (space :align-to (- right ,(org-string-width (match-string 2)) 3))) - prepend))) t)) - ;; (setq org-blank-before-new-entry '((heading . nil) - ;; (plain-list-item . nil))) + prepend))) t) + (setq org-blank-before-new-entry '((heading . nil) + (plain-list-item . nil)))) #+end_src - ** org-appear - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package org-appear :commands (org-appear-mode) :hook (org-mode . org-appear-mode) - :config + :config (setq org-hide-emphasis-markers t) ;; Must be activated for org-appear to work (setq org-appear-autoemphasis t ;; Show bold, italics, verbatim, etc. org-appear-autolinks t ;; Show links org-appear-autosubmarkers t)) ;; Show sub- and superscripts - #+end_src +#+end_src ** org agenda - We will start of with setting some sane configuration for org agenda. +We will start of with setting some sane configuration for org agenda. - #+begin_src emacs-lisp +#+begin_src emacs-lisp (setq org-agenda-start-on-weekday nil org-agenda-block-separator nil org-agenda-remove-tags t) - #+end_src - +#+end_src *** org super agenda - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package org-super-agenda :after org :config - (setq org-super-agenda-header-prefix "\n❯ ") + (setq org-super-agenda-header-prefix "\n ") ;; Hide the thin width char glyph (add-hook 'org-agenda-mode-hook #'(lambda () (setq-local nobreak-char-display nil))) (org-super-agenda-mode)) - #+end_src - +#+end_src *** org-ql - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package org-ql :ensure t :after org) - #+end_src - +#+end_src *** agenda views let us disable the predefined org agenda commands. #+begin_src emacs-lisp (add-to-list 'org-agenda-custom-commands - '("d" "Day View" - ((agenda "" ((org-agenda-overriding-header "Day View") + '("d" "Day View" + ((agenda "" ((org-agenda-overriding-header "Day View") (org-agenda-span 'day) (org-super-agenda-groups regular-view-groups))) - (org-ql-block '(todo "PROG") ((org-ql-block-header "\n❯ In Progress"))) - (org-ql-block '(todo "NEXT") ((org-ql-block-header "\n❯ Next Up"))) - (org-ql-block '(todo "WAIT") ((org-ql-block-header "\n❯ Backlog"))) - (org-ql-block '(priority "A") ((org-ql-block-header "\n❯ Important")))))) + (org-ql-block '(todo "PROG") ((org-ql-block-header "\n In Progress"))) + (org-ql-block '(todo "NEXT") ((org-ql-block-header "\n Next Up"))) + (org-ql-block '(todo "WAIT") ((org-ql-block-header "\n Backlog"))) + (org-ql-block '(priority "A") ((org-ql-block-header "\n Important")))))) (add-to-list 'org-agenda-custom-commands - '("e" "Three-Day View" +'("e" "Three-Day View" ((agenda "" ((org-agenda-span 3) (org-agenda-start-on-weekday nil) (org-deadline-warning-days 0)))))) #+end_src - ** org-babel - #+begin_src emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((python . t))) - (defun sloth/org-babel-edit-prep (info) - (setq buffer-file-name (or (alist-get :file (caddr info)) - "org-src-babel-tmp")) - (eglot-ensure)) - - (advice-add 'org-edit-src-code - :before (defun sloth/org-edit-src-code/before (&rest args) - (when-let* ((element (org-element-at-point)) - (type (org-element-type element)) - (lang (org-element-property :language element)) - (mode (org-src-get-lang-mode lang)) - ((eglot--lookup-mode mode)) - (edit-pre (intern - (format "org-babel-edit-prep:%s" lang)))) - (if (fboundp edit-pre) - (advice-add edit-pre :after #'sloth/org-babel-edit-prep) - (fset edit-pre #'sloth/org-babel-edit-prep))))) - #+end_src - +#+begin_src emacs-lisp +#+end_src ** denote +Denote is objectively the best note taking extension, which you coul;d install. It has a very easy to parse file naming scheme and suports not only org files. It has also transclusion inclusive! if you are interested, then check it out yourself. - Denote is objectively the best note taking extension, which you coul;d install. It has a very easy to parse file naming scheme and suports not only org files. It has also transclusion inclusive! if you are interested, then check it out yourself. - - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package denote :ensure t :hook (dired-mode . denote-dired-mode) :config (setq denote-rename-buffer-mode 1 - denote-directory (expand-file-name "~/org/"))) - #+end_src - +denote-directory (expand-file-name "~/org/"))) +#+end_src *** denote-agenda +Denote itself focused on the last versions to have a core for note taking and to be independent of org. But of course you may extend it with your own extensions, functions and helper or even extensions by its developer. One of these extesions is =denote-agenda=, which allows you to dynamically add and remove org-agendas files based on a denote keyword. I set it to =task=, very simple. When we compare it with org-roam, It took me several days to achieve almost the same workflow, one or two external packages and around of 200 extra lines of code. - Denote itself focused on the last versions to have a core for note taking and to be independent of org. But of course you may extend it with your own extensions, functions and helper or even extensions by its developer. One of these extesions is =denote-agenda=, which allows you to dynamically add and remove org-agendas files based on a denote keyword. I set it to =task=, very simple. When we compare it with org-roam, It took me several days to achieve almost the same workflow, one or two external packages and around of 200 extra lines of code. - - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package denote-agenda :ensure t :config (setq denote-agenda-include-regexp "task") (denote-agenda-insinuate)) - #+end_src - -** denote-menu - - #+begin_src emacs-lisp - (use-package denote-menu - :ensure t) - #+end_src - -** denote-org +#+end_src +*** denote-menu - #+begin_src emacs-lisp - (use-package denote-org - :ensure t) - #+end_src +#+begin_src emacs-lisp +(use-package denote-menu +:ensure t +:config +(setq denote-menu-title-column-width 40 +denote-menu-show-file-type nil)) +#+end_src +*** denote-org +#+begin_src emacs-lisp +(use-package denote-org + :ensure t) +#+end_src * which-key #+begin_src emacs-lisp @@ -642,16 +564,14 @@ let us disable the predefined org agenda commands. :custom (which-key-idle-delay 0.3)) #+end_src - * gcmh gcmh is for garbage collection - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package gcmh :config (gcmh-mode 1)) - #+end_src - +#+end_src * vertico #+begin_src emacs-lisp @@ -669,18 +589,17 @@ let us disable the predefined org agenda commands. ("C-k" . vertico-previous)) :config (advice-add #'vertico--format-candidate :around - (lambda (orig cand prefix suffix index _start) - (setq cand (funcall orig cand prefix suffix index _start)) - (concat - (if (= vertico--index index) - (propertize "» " 'face '(:foreground "#80adf0" :weight bold)) - " ") - cand)))) +(lambda (orig cand prefix suffix index _start) +(setq cand (funcall orig cand prefix suffix index _start)) +(concat + (if (= vertico--index index) +(propertize "» " 'face '(:foreground "#80adf0" :weight bold)) + " ") + cand)))) #+end_src - ** vertico-posframe - #+begin_src emacs-lisp +#+begin_src emacs-lisp ;; (use-package vertico-posframe ;; :init ;; (setq vertico-posframe-parameters '((left-fringe . 12) ;; Fringes @@ -693,8 +612,7 @@ let us disable the predefined org agenda commands. ;; ;; Don't create posframe for these commands ;; vertico-multiform-commands '((consult-line (:not posframe)) ;; (consult-ripgrep (:not posframe))))) - #+end_src - +#+end_src * consult #+begin_src emacs-lisp @@ -712,7 +630,7 @@ let us disable the predefined org agenda commands. ;; (setq xref-show-xrefs-function #'consult-xref ;; xref-show-definitions-function #'consult-xref) - + :config (setq consult-buffer-filter '("\\` " @@ -730,7 +648,6 @@ let us disable the predefined org agenda commands. "\\`\\*Native-compile-Log\\*\\'" "\\`\\*Async-native-compile-log\\*\\'"))) #+end_src - * markdown-mode #+begin_src emacs-lisp @@ -746,7 +663,6 @@ let us disable the predefined org agenda commands. :mode ("README\\.md\\'" . gfm-mode) ;; Use gfm-mode for README.md files. :init (setq markdown-command "multimarkdown")) ;; Set the Markdown processing command. #+end_src - * consult #+begin_src emacs-lisp @@ -770,7 +686,6 @@ let us disable the predefined org agenda commands. (global-corfu-mode) (corfu-popupinfo-mode t)) #+end_src - * treesitter auto #+begin_src emacs-lisp @@ -784,7 +699,6 @@ let us disable the predefined org agenda commands. (treesit-auto-add-to-auto-mode-alist 'all) (global-treesit-auto-mode t)) #+end_src - * embark #+begin_src emacs-lisp @@ -809,7 +723,6 @@ let us disable the predefined org agenda commands. :defer t :after (:all corfu)) #+end_src - * embark consutl #+begin_src emacs-lisp @@ -822,10 +735,10 @@ let us disable the predefined org agenda commands. :hook (embark-collect-mode . consult-preview-at-point-mode)) ;; Enable preview in Embark collect mode. #+end_src - * orderless #+begin_src emacs-lisp + (use-package orderless :ensure t :straight t @@ -833,8 +746,8 @@ let us disable the predefined org agenda commands. :after vertico ;; Ensure Vertico is loaded before Orderless. :init (setq completion-styles '(orderless basic) ;; Set the completion styles. - completion-category-defaults nil ;; Clear default category settings. - completion-category-overrides '((file (styles partial-completion))))) ;; Customize file completion styles. +completion-category-defaults nil ;; Clear default category settings. +completion-category-overrides '((file (styles partial-completion))))) ;; Customize file completion styles. #+end_src * marginalia @@ -850,7 +763,6 @@ let us disable the predefined org agenda commands. :hook (after-init . marginalia-mode)) #+end_src - * nerd corfu icons #+begin_src emacs-lisp @@ -861,61 +773,56 @@ let us disable the predefined org agenda commands. :defer t :after (:all corfu)) #+end_src - * eglot - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package eglot :ensure nil :straight nil :hook ((rust-mode . eglot-ensure) - (nix-mode . eglot-ensure) - (python-mode . eglot-ensure) - (eglot-managed-mode . (lambda () (eldoc-mode -1)))) + (nix-mode . eglot-ensure) + (python-mode . eglot-ensure) + (eglot-managed-mode . (lambda () (eldoc-mode -1)))) :bind (:map eglot-mode-map - ("M-<return>" . eglot-code-actions) - ("C-M-." . xref-find-references) - ("C-c r" . eglot-rename)) + ("M-<return>" . eglot-code-actions) + ("C-M-." . xref-find-references) + ("C-c r" . eglot-rename)) :config (add-to-list 'eglot-server-programs - `(python-mode - . ,(eglot-alternatives '(("basedpyright-langserver" "--stdio") - ("pyright-langserver" "--stdio") - "jedi-language-server" - "pylsp")))) + `(python-mode + . ,(eglot-alternatives '(("basedpyright-langserver" "--stdio") + ("pyright-langserver" "--stdio") + "jedi-language-server" + "pylsp")))) (setq eldoc-echo-area-use-multiline-p nil - eglot-inlay-hints-mode -1) + eglot-inlay-hints-mode -1) (add-to-list 'eglot-server-programs '(nix-mode . ("nixd")))) - #+end_src - +#+end_src ** eglot shut up #+begin_src emacs-lisp (use-package eglot-booster - :straight ( eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster") - :after eglot - :config (eglot-booster-mode)) -#+end_src -** consult-eglot integration +:straight ( eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster") +:after eglot +:config (eglot-booster-mode)) +#+end_src** consult-eglot integration #+begin_src emacs-lisp (use-package consult-eglot :straight t :after (consult eglot)) #+end_src - * eldoc - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package eldoc-box :ensure t :straight t :defer t) - #+end_src - +#+end_src * diff-hl - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package diff-hl :defer t @@ -923,34 +830,32 @@ let us disable the predefined org agenda commands. :ensure t :hook (find-file . (lambda () - (global-diff-hl-mode) ;; Enable Diff-HL mode for all files. - (diff-hl-flydiff-mode) ;; Automatically refresh diffs. - (diff-hl-margin-mode))) ;; Show diff indicators in the margin. + (global-diff-hl-mode) ;; Enable Diff-HL mode for all files. + (diff-hl-flydiff-mode) ;; Automatically refresh diffs. + (diff-hl-margin-mode))) ;; Show diff indicators in the margin. :custom (diff-hl-side 'left) ;; Set the side for diff indicators. (diff-hl-margin-symbols-alist '((insert . "┃") ;; Customize symbols for each change type. - (delete . "-") - (change . "┃") - (unknown . "┆") - (ignored . "i")))) - #+end_src - + (delete . "-") + (change . "┃") + (unknown . "┆") + (ignored . "i")))) +#+end_src * ff - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package magit :ensure t :straight t :config (if ek-use-nerd-fonts ;; Check if nerd fonts are being used - (setopt magit-format-file-function #'magit-format-file-nerd-icons)) ;; Turns on magit nerd-icons + (setopt magit-format-file-function #'magit-format-file-nerd-icons)) ;; Turns on magit nerd-icons :defer t) - #+end_src - +#+end_src * indent guide - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package indent-guide :defer t @@ -960,11 +865,10 @@ let us disable the predefined org agenda commands. (prog-mode . indent-guide-mode) ;; Activate indent-guide in programming modes. :config (setq indent-guide-char "│")) ;; Set the character used for the indent guide. - #+end_src - +#+end_src * f - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package add-node-modules-path :ensure t @@ -981,11 +885,10 @@ let us disable the predefined org agenda commands. '(add-hook 'typescriptreact-mode-hook #'add-node-modules-path)) (eval-after-load 'js-mode '(add-hook 'js-mode-hook #'add-node-modules-path))) - #+end_src - +#+end_src * general - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package general :straight t :ensure t @@ -1002,11 +905,10 @@ let us disable the predefined org agenda commands. :states '(normal visual) :keymaps 'override :prefix ",")) - #+end_src - +#+end_src * evil - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package evil :ensure t :straight t @@ -1017,26 +919,25 @@ let us disable the predefined org agenda commands. evil-want-C-u-scroll t evil-want-C-u-delete t evil-want-C-i-jump nil) - + :config (evil-set-undo-system 'undo-tree) (setq evil-leader/in-all-states t evil-want-fine-undo t) - + (evil-mode 1) - + (define-key evil-normal-state-map (kbd "SPC") nil) (define-key evil-motion-state-map (kbd "SPC") nil) (define-key evil-normal-state-map (kbd ",") nil) (define-key evil-visual-state-map (kbd ",") nil) (define-key evil-motion-state-map (kbd ",") nil)) - - - #+end_src + +#+end_src * avy - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package avy :ensure t :straight t @@ -1044,7 +945,7 @@ let us disable the predefined org agenda commands. :general ;; (general-nmap "s" 'avy-goto-char-timer) ;; (general-omap "s" 'evil-avy-goto-char-timer) - + :config (setq avy-all-windows t avy-all-windows-alt t @@ -1053,21 +954,18 @@ let us disable the predefined org agenda commands. avy-timeout-seconds 0.3 avy-style 'at-full avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?t ?y ?u ?i ?o ?p)) - - (evil-define-avy-motion evil-avy-goto-char-timer inclusive)) - #+end_src - + (evil-define-avy-motion evil-avy-goto-char-timer inclusive)) +#+end_src ** avy flash behaviour - #+begin_src emacs-lisp - - #+end_src +#+begin_src emacs-lisp +#+end_src * evil packages - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package evil-collection :defer t @@ -1095,11 +993,10 @@ let us disable the predefined org agenda commands. :after evil-collection :config (global-evil-matchit-mode 1)) - #+end_src - +#+end_src * undo-tree - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package undo-tree :defer t :ensure t @@ -1108,50 +1005,46 @@ let us disable the predefined org agenda commands. (after-init . global-undo-tree-mode) :init (setq undo-tree-visualizer-timestamps t - undo-tree-visualizer-diff t - ;; Increase undo limits to avoid losing history due to Emacs' garbage collection. - ;; These values can be adjusted based on your needs. - ;; 10X bump of the undo limits to avoid issues with premature - ;; Emacs GC which truncates the undo history very aggressively. - undo-limit 800000 ;; Limit for undo entries. - undo-strong-limit 12000000 ;; Strong limit for undo entries. - undo-outer-limit 120000000) ;; Outer limit for undo entries. + undo-tree-visualizer-diff t + ;; Increase undo limits to avoid losing history due to Emacs' garbage collection. + ;; These values can be adjusted based on your needs. + ;; 10X bump of the undo limits to avoid issues with premature + ;; Emacs GC which truncates the undo history very aggressively. + undo-limit 800000 ;; Limit for undo entries. + undo-strong-limit 12000000 ;; Strong limit for undo entries. + undo-outer-limit 120000000) ;; Outer limit for undo entries. :config ;; Set the directory where `undo-tree' will save its history files. ;; This keeps undo history across sessions, stored in a cache directory. (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/.cache/undo")))) - #+end_src - +#+end_src * Rainbow Delimiter - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package rainbow-delimiters :defer t :straight t :ensure t :hook (prog-mode . rainbow-delimiters-mode)) - #+end_src - +#+end_src * dotenv-mode - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package dotenv-mode :defer t :straight t :ensure t :config) - #+end_src -* envrc +#+end_src* envrc - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package envrc :hook (after-init . envrc-global-mode)) - #+end_src - +#+end_src * pulsar /disabled/ - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package pulsar :defer t :straight t @@ -1174,12 +1067,10 @@ let us disable the predefined org agenda commands. (add-to-list 'pulsar-pulse-functions 'evil-jump-item) (add-to-list 'pulsar-pulse-functions 'diff-hl-next-hunk) (add-to-list 'pulsar-pulse-functions 'diff-hl-previous-hunk)) - #+end_src - - +#+end_src * doom modeline /disabled/ - #+begin_src emacs-lisp +#+begin_src emacs-lisp ;;; DOOM MODELINE ;; The `doom-modeline' package provides a sleek, modern mode-line that is visually appealing ;; and functional. It integrates well with various Emacs features, enhancing the overall user @@ -1199,11 +1090,10 @@ let us disable the predefined org agenda commands. ;; (setq doom-modeline-icon nil)) ;; Disable icons if nerd fonts are not being used. ;; :hook ;; (after-init . doom-modeline-mode)) - #+end_src - +#+end_src * evil-org - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package evil-org :ensure t :straight t @@ -1212,11 +1102,10 @@ let us disable the predefined org agenda commands. :config (require 'evil-org-agenda) (evil-org-agenda-set-keys)) - #+end_src - +#+end_src * nerd-icons - #+begin_src emacs-lisp +#+begin_src emacs-lisp ;;; NERD ICONS ;; The `nerd-icons' package provides a set of icons for use in Emacs. These icons can ;; enhance the visual appearance of various modes and packages, making it easier to @@ -1247,11 +1136,10 @@ let us disable the predefined org agenda commands. :config (nerd-icons-completion-mode) ;; Activate nerd icons for completion interfaces. (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)) ;; Setup icons in the marginalia mode for enhanced completion display. - #+end_src - +#+end_src * catppuccin theme - #+begin_src emacs-lisp +#+begin_src emacs-lisp ;;; CATPPUCCIN THEME ;; The `catppuccin-theme' package provides a visually pleasing color theme ;; for Emacs that is inspired by the popular Catppuccin color palette. @@ -1275,9 +1163,9 @@ let us disable the predefined org agenda commands. ;; ;; Load the Catppuccin theme without prompting for confirmation. ;; (load-theme 'catppuccin :no-confirm)) - #+end_src +#+end_src - #+begin_src emacs-lisp +#+begin_src emacs-lisp ;;; UTILITARY FUNCTION TO INSTALL EMACS-KICK (defun ek/first-install () "Install tree-sitter grammars and compile packages on first run..." @@ -1297,30 +1185,26 @@ let us disable the predefined org agenda commands. (provide 'init) ;;; init.el ends here - #+end_src - - #+begin_src emacs-lisp - (use-package org-modern - :ensure t - :straight t) - (with-eval-after-load 'org (global-org-modern-mode)) - - (setq org-modern-star 'fold) - (setq org-modern-fold-stars '(("◉" . "○"))) - (setq org-modern-star 'replace) - (setq org-modern-replace-stars "◉○◉○◉") - #+end_src - +#+end_src +#+begin_src emacs-lisp +;; (use-package org-modern +;; :ensure t +;; :straight t) +;; (with-eval-after-load 'org (global-org-modern-mode)) +;; +;; (setq org-modern-star 'fold) +;; (setq org-modern-fold-stars '(("◉" . "○"))) +;; (setq org-modern-star 'replace) +;; (setq org-modern-replace-stars "◉○◉○◉") +#+end_src * configuration/soph - ** soph-modeline - *** Battery Faces Extracted from doom modeline - #+begin_src emacs-lisp +#+begin_src emacs-lisp (require 'battery) (require 'nerd-icons) @@ -1347,13 +1231,12 @@ let us disable the predefined org agenda commands. (defface my-battery-error '((t :inherit error)) "Face for battery error.") - #+end_src - +#+end_src *** Battery Update Function Function that updates the battery string with nerd icons. - #+begin_src emacs-lisp +#+begin_src emacs-lisp (defvar my-battery-string nil) (defun my-update-battery () @@ -1429,7 +1312,6 @@ let us disable the predefined org agenda commands. (concat (propertize icon 'help-echo help-echo) (propertize text 'face face 'help-echo help-echo)))))) #+end_src - *** Battery Override Replaces the default battery display with the custom version. @@ -1443,7 +1325,6 @@ Replaces the default battery display with the custom version. (add-hook 'display-battery-mode-hook #'my-override-battery) #+end_src - *** Header Line Format The Modeline itself with Battery and Time on the right, Line:Column after VC on the left. @@ -1456,36 +1337,35 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on (setq-default header-line-format '("%e" - (:propertize " " display (raise +0.4)) - (:propertize " " display (raise -0.4)) +(:propertize " " display (raise +0.4)) +(:propertize " " display (raise -0.4)) - (:propertize "λ " face font-lock-comment-face) - mode-line-frame-identification - mode-line-buffer-identification +(:propertize "λ " face font-lock-comment-face) +mode-line-frame-identification +mode-line-buffer-identification - (:eval (when-let (vc vc-mode) - (list (propertize " " 'face 'font-lock-comment-face) - (propertize (truncate-string-to-width +(:eval (when-let (vc vc-mode) + (list (propertize " " 'face 'font-lock-comment-face) + (propertize (truncate-string-to-width (substring vc 5) 50) - 'face 'font-lock-comment-face)))) + 'face 'font-lock-comment-face)))) - (:propertize " %4l:%c" face mode-line-buffer-id) +(:propertize " %4l:%c" face mode-line-buffer-id) - (:eval (propertize - " " 'display - `((space :align-to - (- (+ right right-fringe right-margin) - ,(+ 3 +(:eval (propertize + " " 'display + `((space :align-to + (- (+ right right-fringe right-margin) + ,(+ 3 (string-width (or my-battery-string "")) (string-width (or display-time-string "")))))))) (:eval my-battery-string) - " " - (:eval display-time-string))) +" " +(:eval display-time-string))) (setq-default mode-line-format nil) #+end_src - ** hide modeline #+begin_src emacs-lisp @@ -1494,7 +1374,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :defer t :bind (:map custom-bindings-map ("C-c h m" . hide-mode-line-mode))) #+end_src - ** adaptive wrap #+begin_src emacs-lisp @@ -1502,39 +1381,35 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :defer t :hook (visual-line-mode . adaptive-wrap-prefix-mode)) #+end_src - ** gpg home #+begin_src emacs-lisp (setq package-gnupghome-dir "~/.gnupg") #+end_src - ** cursor #+begin_src emacs-lisp (blink-cursor-mode 0) (setq-default cursor-type 'bar) #+end_src - ** highlight long lines #+begin_src emacs-lisp -(setq my-whitespace-style '(face tabs lines-tail) - whitespace-style my-whitespace-style - whitespace-line-column 120 - fill-column 120 - whitespace-display-mappings - '((space-mark 32 [183] [46]) - (newline-mark 10 [36 10]) - (tab-mark 9 [9655 9] [92 9]))) +;; (setq my-whitespace-style '(face tabs lines-tail) ;; ⚠️ DEAKTIVIERT +;; whitespace-style my-whitespace-style ;; ⚠️ DEAKTIVIERT +;; whitespace-line-column 120 ;; ⚠️ DEAKTIVIERT +;; fill-column 120 ;; ⚠️ DEAKTIVIERT +;; whitespace-display-mappings ;; ⚠️ DEAKTIVIERT +;; '((space-mark 32 [183] [46]) ;; ⚠️ DEAKTIVIERT +;; (newline-mark 10 [36 10]) ;; ⚠️ DEAKTIVIERT +;; (tab-mark 9 [9655 9] [92 9]))) ;; ⚠️ DEAKTIVIERT ;; in e.g. clojure-mode-hook ;; (whitespace-mode 1) ;; or globally ;; (global-whitespace-mode 1) -(add-hook 'prog-mode 'whitespace-mode) +;; (add-hook 'prog-mode 'whitespace-mode) ;; ⚠️ KOMPLETT DEAKTIVIERT - verursacht org-mode Probleme #+end_src - ** default fixed, variable fonts #+begin_src emacs-lisp @@ -1547,7 +1422,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on (when (member "Open Sans" (font-family-list)) (set-face-attribute 'variable-pitch nil :family "Open Sans" :height cashmere/font-height)) #+end_src - ** mixed pitch fonts (package) #+begin_src emacs-lisp @@ -1555,9 +1429,8 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :straight t :defer t :hook ((org-mode . mixed-pitch-mode) - (LaTeX-mode . mixed-pitch-mode))) + (LaTeX-mode . mixed-pitch-mode))) #+end_src - * autothemer #+begin_src emacs-lisp @@ -1565,7 +1438,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :straight t :defer t) #+end_src - * doom-themes #+begin_src emacs-lisp @@ -1589,7 +1461,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on ;; Corrects (and improves) org-mode's native fontification. (doom-themes-org-config)) #+end_src - * dirvish #+begin_src emacs-lisp @@ -1597,30 +1468,29 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :straight t :init (dirvish-override-dired-mode) - + :custom (dirvish-quick-access-entries '(("h" "~/" "Home") ("d" "~/Downloads/" "Downloads") ("p" "~/projects/" "Projects"))) - + (dirvish-reuse-session 'open) (dirvish-attributes '(file-size)) (dirvish-mode-line-format '(:left (sort file-time symlink) :right (omit yank index))) - + (dirvish-hide-details '(dirvish dirvish-side)) (dirvish-hide-cursor '(dirvish dirvish-side)) - + (dired-listing-switches "-l --almost-all --human-readable --group-directories-first --no-group") - + :config (setq dired-dwim-target t) (setq delete-by-moving-to-trash t) - (setq dired-mouse-drag-files t)) + (setq dired-mouse-drag-files t)) #+end_src - * nix-mode #+begin_src emacs-lisp @@ -1628,28 +1498,18 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :ensure t :mode "\\.nix\\'") #+end_src - ** olivetti #+begin_src emacs-lisp (use-package olivetti :defer t) #+end_src - * olivetti global mode - -#+begin_src emacs-lisp -(setq-default olivetti-body-width 95) -(define-globalized-minor-mode my-global-olivetti-mode olivetti-mode - (lambda () (olivetti-mode 1))) -(my-global-olivetti-mode) -#+end_src - * declutter - ** ibuffer - #+begin_src emacs-lisp +#+begin_src emacs-lisp + (setq ibuffer-never-show-predicates '(;; System buffers "^\\*Messages\\*$" @@ -1666,17 +1526,15 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "^\\*clojure-lsp::stderr\\*$" "^\\*ts-ls\\*$" "^\\*ts-ls::stderr\\*$")) - #+end_src -* bufler +#+end_src* bufler - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package bufler :defer t) - #+end_src - +#+end_src * eat - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package eat :ensure t :defer t @@ -1684,11 +1542,10 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on (when (fboundp 'eat-global-mode) (eat-global-mode) (setq eat-kill-buffer-on-exit t))) - #+end_src - +#+end_src * projectile - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package projectile :ensure t :demand t @@ -1699,23 +1556,20 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on projectile-indexing-method 'alien projectile-sort-order 'recentf projectile-require-project-root nil)) - #+end_src - +#+end_src ** consult-projectile - #+begin_src emacs-lisp +#+begin_src emacs-lisp (use-package consult-projectile :ensure t :straight t :after (consult projectile) :config (setq consult-project-function #'projectile-project-root)) - #+end_src - +#+end_src * keybindings - ** global leader (SPC) kill ring - + #+begin_src emacs-lisp (defun my/smart-find-file () (interactive) @@ -1731,7 +1585,7 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "SPC" '(my/smart-find-file :wk "find file/buffer") ":" (lambda () (interactive) (execute-extended-command nil)) -"d" '(:ignore t :wk "denote") +"d" '(:ignore t :wk "denote") "dd" '(denote-menu-list-notes t :wk "List all notes") "dg" '(denote-grep t :wk "Search") "dn" '(denote t :wk "Create a new note") @@ -1743,14 +1597,14 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "fr" '(consult-recent-file :wk "recent files") "ff" '(find-file :wk "find file") "fs" '(save-buffer :wk "save file") - + "b" '(:ignore t :wk "buffers") "bb" '(consult-buffer :wk "switch buffer") "bi" '(ibuffer :wk "ibuffer") "bd" '(kill-current-buffer :wk "kill buffer") "bk" '(kill-current-buffer :wk "kill buffer") "bs" '(save-buffer :wk "save buffer") - + "p" '(:ignore t :wk "project") "pp" '(projectile-switch-project :wk "switch project") "pf" '(projectile-find-file :wk "find file") @@ -1763,31 +1617,31 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "pc" '(projectile-compile-project :wk "compile") "pt" '(projectile-test-project :wk "test") "pi" '(projectile-invalidate-cache :wk "invalidate cache") - + "g" '(:ignore t :wk "git/goto") "gg" '(magit-status :wk "status") "gl" '(magit-log-current :wk "log") "gd" '(xref-find-definitions :wk "go to definition") ; sowohl hier als auch unter code "gs" '(magit-status :wk "status") "gb" '(vc-annotate :wk "blame") - + "o" '(:ignore t :wk "open") "op" '(neotree-toggle :wk "neotree") "oP" '(dired-jump :wk "dired") "od" '(dirvish :wk "dirvish") - + "h" '(:ignore t :wk "help") "hm" '(describe-mode :wk "mode") "hf" '(describe-function :wk "function") "hv" '(describe-variable :wk "variable") - "hk" '(describe-key :wk "key") - + "hk" '(describe-key :wk "key") + "w" '(:ignore t :wk "windows") "wv" '(split-window-right :wk "split right") "ws" '(split-window-below :wk "split below") "wd" '(delete-window :wk "delete") "wo" '(delete-other-windows :wk "delete others") - + "c" '(:ignore t :wk "code") "ca" '(eglot-code-actions :wk "code actions") "cd" '(xref-find-definitions :wk "go to definition") ; sowohl hier als auch unter g @@ -1800,24 +1654,23 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "cs" '(consult-eglot-symbols :wk "workspace symbols") "cS" '(eglot-shutdown :wk "shutdown lsp") "cR" '(eglot-reconnect :wk "restart lsp") - + "m" '(:ignore t :wk "mode") "mp" (list (lambda () (interactive) - (shell-command (concat "prettier --write " + (shell-command (concat "prettier --write " (shell-quote-argument (buffer-file-name)))) (revert-buffer t t t)) :wk "format prettier") - + "q" '(:ignore t :wk "quit") "qq" '(save-buffers-kill-terminal :wk "quit emacs") "qr" '(restart-emacs :wk "restart") - + "a" '(embark-act :wk "embark") "u" '(undo-tree-visualize :wk "undo tree") "P" '(consult-yank-from-kill-ring :wk "paste history")) #+end_src - ** local leader (,) #+begin_src emacs-lisp @@ -1825,7 +1678,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "a" '(org-agenda :wk "org agen") "t" '(eat :wk "terminal")) #+end_src - ** normal state #+begin_src emacs-lisp @@ -1842,13 +1694,12 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "gcc" (lambda () (interactive) (unless (use-region-p) - (comment-or-uncomment-region - (line-beginning-position) + (comment-or-uncomment-region + (line-beginning-position) (line-end-position))))) ;; Global K binding für alle Modi mit eglot #+end_src - ** visual state #+begin_src emacs-lisp @@ -1856,11 +1707,10 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on "gc" (lambda () (interactive) (when (use-region-p) - (comment-or-uncomment-region - (region-beginning) + (comment-or-uncomment-region + (region-beginning) (region-end))))) #+end_src - ** avy #+begin_src emacs-lisp @@ -1873,7 +1723,6 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on (maximum-scroll-margin 0)) (call-interactively 'avy-goto-char-timer)))) #+end_src - ** dirvish #+begin_src emacs-lisp @@ -1915,15 +1764,13 @@ The Modeline itself with Battery and Time on the right, Line:Column after VC on :keymaps 'org-mode-map "h" '(consult-org-heading :wk "search headings")) #+end_src - ** minibuffer #+begin_src emacs-lisp + (define-key minibuffer-local-map [escape] 'abort-recursive-edit) (define-key minibuffer-local-ns-map [escape] 'abort-recursive-edit) (define-key minibuffer-local-completion-map [escape] 'abort-recursive-edit) (define-key minibuffer-local-must-match-map [escape] 'abort-recursive-edit) (define-key minibuffer-local-isearch-map [escape] 'abort-recursive-edit) #+end_src - - diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/early-init.el |
