fixed lsp, orderless, corfu

irrelevant elements are now correctly filtered out of lsp by
orderless,corfu.

fixed some whitespace, indentation
This commit is contained in:
2026-08-12 00:12:21 +02:00
parent 811637003b
commit e82959cc66
9 changed files with 687 additions and 666 deletions
+125 -121
View File
@@ -4,9 +4,9 @@
;; Custom & Packages Loading ;; Custom & Packages Loading
;; ============================================================ ;; ============================================================
(let ((custom-dir (expand-file-name "custom/" user-emacs-directory))) (let ((custom-dir (expand-file-name "custom/" user-emacs-directory)))
(when (file-directory-p custom-dir) (when (file-directory-p custom-dir)
(dolist (file (directory-files custom-dir nil "\\.el$")) (dolist (file (directory-files custom-dir nil "\\.el$"))
(load (expand-file-name (file-name-sans-extension file) custom-dir))))) (load (expand-file-name (file-name-sans-extension file) custom-dir)))))
(add-to-list 'load-path (expand-file-name "packages/" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "packages/" user-emacs-directory))
(add-to-list 'custom-theme-load-path (expand-file-name "themes/" user-emacs-directory)) (add-to-list 'custom-theme-load-path (expand-file-name "themes/" user-emacs-directory))
@@ -14,81 +14,84 @@
(add-hook (add-hook
'after-init-hook 'after-init-hook
(lambda () (lambda ()
(require 'visuals-packages) ; ui, eye candy (with-demoted-errors "Error in after-init-hook: %S"
(require 'editing-packages) ; text editing (require 'visuals-packages) ; ui, eye candy
(require 'system-packages) ; emacs itself (require 'editing-packages) ; text editing
(require 'tutilities-packages) ; tertiary utilities (require 'system-packages) ; emacs itself
(require 'completion-packages) ; ui, functional (require 'tutilities-packages) ; tertiary utilities
(require 'dev-packages) ; lsp, treesitter (require 'completion-packages) ; ui, functional
) (require 'dev-packages) ; lsp, treesitter
))
) )
;; ============================================================ ;; ============================================================
;; Keybindings ;; Keybindings
;; ============================================================ ;; ============================================================
(use-package general (use-package general
:config :config
(general-define-key (general-define-key
:keymaps 'global :keymaps 'global
"C-l" nil ; recenter "C-l" nil ; recenter
"C-n" nil ; next line "C-n" nil ; next line
"C-p" nil ; previous line "C-p" nil ; previous line
"C-f" nil ; forward chard "C-f" nil ; forward chard
"C-o" nil ; idk "C-o" nil ; idk
"C-t" nil ; transpose "C-t" nil ; transpose
;"C-m" nil can't be rebound because is same as ret ;"C-m" nil can't be rebound because is same as ret
"C->" nil ;end of buffer "C->" nil ;end of buffer
"C-<" nil ;start of buffer "C-<" nil ;start of buffer
) "C-<right>" nil
"C-<left>" nil
)
(general-def (general-def
:keymaps 'global :keymaps 'global
"C-S-c" #'my/system-copy "C-S-c" #'my/system-copy
"C-S-x" #'my/system-cut "C-S-x" #'my/system-cut
"C-S-v" #'my/system-paste "C-S-v" #'my/system-paste
"C-z" #'undo "C-z" #'undo
"C-M-z" #'undo-redo "C-M-z" #'undo-redo
"C-k" #'avy-kill-whole-line "C-k" #'avy-kill-whole-line
"C-r" #'recenter-top-bottom "C-r" #'recenter-top-bottom
"C-b" #'scroll-down-command "C-b" #'scroll-down-command
"C-<backspace>" #'my/delete-word-backward "C-<backspace>" #'my/delete-word-backward
"M-<backspace>" #'my/delete-word-backward "M-<backspace>" #'my/delete-word-backward
"M-s M-s" #'scroll-lock-mode "M-s M-s" #'scroll-lock-mode
"C-w" #'delete-window "C-w" #'delete-window
"C-x m" #'switch-to-minibuffer "C-x m" #'switch-to-minibuffer
"M-w" #'clipetty-kill-ring-save "M-w" #'clipetty-kill-ring-save
; "C-x S-v" #'shrink-window ; "C-x S-v" #'shrink-window
; "C-x v" #'enlarge-window ; "C-x v" #'enlarge-window
) )
(general-def (general-def
:keymaps 'override :keymaps 'override
"C-s C-s C-f" #'my/avy-char-region ; search select find "C-s C-s C-f" #'my/avy-char-region ; search select find
"C-s C-s C-l" #'my/avy-line-region ; search select line "C-s C-s C-l" #'my/avy-line-region ; search select line
"C-s C-e" #'expreg-expand ; selection expand "C-s C-e" #'expreg-expand ; selection expand
"C-s C-c" #'expreg-contract ; selection contract "C-s C-c" #'expreg-contract ; selection contract
"C-s f" #'kirigami-toggle-fold ; fold "C-s f" #'kirigami-toggle-fold ; fold
) )
(general-def (general-def
:keymaps 'override :keymaps 'override
"C-f C-r" #'buffer-table ; recent buffer "C-f C-r" #'buffer-table ; recent buffer
"C-f C-f" #'avy-goto-char-timer ; find "C-f C-f" #'avy-goto-char-timer ; find
"C-f C-l" #'consult-line ; line "C-f C-l" #'consult-line ; line
"C-f g" #'avy-goto-line ; goto "C-f g" #'avy-goto-line ; goto
)
(general-def
:keymaps 'override
"C-s s" #'shell-pop ; shell
)
) )
(general-def
:keymaps 'override
"C-s s" #'shell-pop ; shell
)
)
;; 1. Make single ';' trigger Control for the very next keypress ;; 1. Make single ';' trigger Control for the very next keypress
(define-key key-translation-map (kbd ";") 'event-apply-control-modifier) (define-key key-translation-map (kbd ";") 'event-apply-control-modifier)
@@ -101,28 +104,29 @@
;; ============================================================ ;; ============================================================
(use-package emacs (use-package emacs
:ensure nil :ensure nil
:custom :custom
;; --- Completion & Search --- ;; --- Completion & Search ---
(completion-ignore-case t) (completion-ignore-case t)
(read-file-name-completion-ignore-case t) (read-file-name-completion-ignore-case t)
(read-buffer-completion-ignore-case t) (read-buffer-completion-ignore-case t)
(text-mode-ispell-word-completion nil) (text-mode-ispell-word-completion nil)
(completion-category-overrides '((point (styles orderless basic))))
;; --- Backup & Auto-save --- ;; --- Backup & Auto-save ---
;; Centralize all backup files to a single directory to avoid cluttering projects ;; Centralize all backup files to a single directory to avoid cluttering projects
(backup-directory-alist '(("." . "~/MyEmacsBackups"))) (backup-directory-alist '(("." . "~/MyEmacsBackups/")))
(auto-save-list-file-prefix "~/MyEmacsBackups") (auto-save-list-file-prefix "~/MyEmacsBackups/")
(backup-by-copying t) (backup-by-copying t)
(create-lockfiles nil) (create-lockfiles nil)
(make-backup-files nil) (make-backup-files nil)
;; --- Miscellaneous --- ;; --- Miscellaneous ---
(tab-always-indent 'complete) (tab-always-indent 'complete)
:hook :hook
(prog-mode . hs-minor-mode) (prog-mode . hs-minor-mode)
) )
;; ============================================================ ;; ============================================================
;; 3. Core Settings & UI ;; 3. Core Settings & UI
@@ -144,7 +148,7 @@
truncate-lines nil ; Enable line wrapping truncate-lines nil ; Enable line wrapping
fast-but-imprecise-scrolling t fast-but-imprecise-scrolling t
ring-bell-function 'ignore ; Silence the system bell ring-bell-function 'ignore ; Silence the system bell
;; --- File & Buffer Handling --- ;; --- File & Buffer Handling ---
find-file-visit-truename t find-file-visit-truename t
@@ -187,52 +191,52 @@
;; 5. Hooks, Modes & Theming ;; 5. Hooks, Modes & Theming
;; ============================================================ ;; ============================================================
(add-hook 'text-mode-hook #'jit-spell-mode)
(add-hook (add-hook
'after-init-hook 'after-init-hook
(lambda () (lambda ()
;; --- Modes --- ;; --- Modes ---
(recentf-mode t) ; save/load recent files (recentf-mode t) ; save/load recent files
(global-display-line-numbers-mode 1) ; always display line numbers (global-display-line-numbers-mode 1) ; always display line numbers
(global-hl-line-mode 0) (hl-line-mode 0) ; handled by god mode toggle (global-hl-line-mode 0) (hl-line-mode 0) ; handled by god mode toggle
(savehist-mode 1) (savehist-mode 1)
(global-clipetty-mode t) ; copy-paste in terminal (global-clipetty-mode t) ; copy-paste in terminal
(global-auto-revert-mode t) ; automatically refresh buffer (global-auto-revert-mode t) ; automatically refresh buffer
(yas-global-mode t) ; yasnippets (yas-global-mode t) ; yasnippets
(repeat-mode 1) ; repeat key without modifier (repeat-mode 1) ; repeat key without modifier
(electric-pair-mode t) ; automatically handle pairs (electric-pair-mode t) ; automatically handle pairs
(jit-spell-mode t) ; spellcheck (fringe-mode '(0 . 8)) ; fringe only on right edge
(fringe-mode '(0 . 8)) ; fringe only on right edge (delete-selection-mode 1)
(delete-selection-mode 1)
(auto-revert-mode t)
;; --- Special UI Settings --- ;; --- Special UI Settings ---
(setq ispell-program-name "hunspell" (setq ispell-program-name "hunspell"
ispell-dictionary "en_US,nl_NL") ispell-dictionary "en_US,nl_NL")
;; Ensure help opens in a side window rather than replacing current buffer ;; Ensure help opens in a side window rather than replacing current buffer
(setq display-buffer-alist (setq display-buffer-alist
(cons '("Help" . (display-buffer-in-side-window (cons '("Help" . (display-buffer-in-side-window
:side 'bottom :side 'bottom
:style 'overriding :style 'overriding
:window-height 0.3)) :window-height 0.3))
display-buffer-alist)) display-buffer-alist))
(setq minibuffer-prompt-properties (setq minibuffer-prompt-properties
'(read-only t intangible t cursor-intangible t face minibuffer-prompt)) '(read-only t intangible t cursor-intangible t face minibuffer-prompt))
) )
) )
;; Dired Customization ;; Dired Customization
(with-eval-after-load 'dired (with-eval-after-load 'dired
(add-hook 'dired-mode-hook (add-hook 'dired-mode-hook
(lambda () (lambda ()
(define-key dired-mode-map (kbd "a") 'dired-up-directory) (define-key dired-mode-map (kbd "a") 'dired-up-directory)
(define-key dired-mode-map (kbd "v") 'dirvish-move)))) (define-key dired-mode-map (kbd "v") 'dirvish-move))))
;; Recentf Maintenance ;; Recentf Maintenance
(with-eval-after-load 'recentf (with-eval-after-load 'recentf
(run-at-time nil 600 #'recentf-cleanup) (run-at-time nil 600 #'recentf-cleanup)
(setq recentf-exclude '(".*/$"))) (setq recentf-exclude '(".*/$")))
;; General Hooks ;; General Hooks
(add-hook 'find-file-hook #'recentf-save-list) (add-hook 'find-file-hook #'recentf-save-list)
@@ -240,7 +244,7 @@
;; Mode-specific fonts ;; Mode-specific fonts
(dolist (hook '(markdown-mode-hook org-mode-hook json-mode-hook)) (dolist (hook '(markdown-mode-hook org-mode-hook json-mode-hook))
(add-hook hook (lambda () (buffer-face-set '(:family "Noto Sans" :height 140))))) (add-hook hook (lambda () (buffer-face-set '(:family "Noto Sans" :height 140)))))
;; File Associations ;; File Associations
(add-to-list 'auto-mode-alist '("\\.qd$" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.qd$" . markdown-mode))
@@ -252,10 +256,10 @@
(add-hook (add-hook
'window-setup-hook 'window-setup-hook
(lambda () (lambda ()
(set-face-attribute 'default nil :family "Noto Sans Mono" :height 110) (set-face-attribute 'default nil :family "Noto Sans Mono" :height 110)
(set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 120) (set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 120)
(load-theme 'cutarv42 t) (load-theme 'cutarv42 t)
) )
) )
(setq nerd-icons-font-family "Symbols Nerd Font Mono") (setq nerd-icons-font-family "Symbols Nerd Font Mono")
+230 -230
View File
@@ -31,14 +31,14 @@
;; Temporarily raise the garbage collection threshold to its maximum value. ;; Temporarily raise the garbage collection threshold to its maximum value.
;; It will be restored later to controlled values. ;; It will be restored later to controlled values.
(if noninteractive (if noninteractive
(setq gc-cons-threshold 268435456) ; 256 Mb (setq gc-cons-threshold 268435456) ; 256 Mb
(setq gc-cons-threshold most-positive-fixnum)) (setq gc-cons-threshold most-positive-fixnum))
(setq gc-cons-percentage 1.0) (setq gc-cons-percentage 1.0)
;;; Variables ;;; Variables
(defvar minimal-emacs-ui-features '() (defvar minimal-emacs-ui-features '()
"List of user interface features to enable in minimal Emacs setup. "List of user interface features to enable in minimal Emacs setup.
This variable holds a list of Emacs UI features that can be enabled: This variable holds a list of Emacs UI features that can be enabled:
- context-menu (Enables the context menu in graphical environments.) - context-menu (Enables the context menu in graphical environments.)
- tool-bar (Enables the tool bar in graphical environments.) - tool-bar (Enables the tool bar in graphical environments.)
@@ -47,123 +47,123 @@ This variable holds a list of Emacs UI features that can be enabled:
- tooltips (Enables tooltips.)") - tooltips (Enables tooltips.)")
(defvar minimal-emacs-frame-title-format "%b Emacs" (defvar minimal-emacs-frame-title-format "%b Emacs"
"Template for displaying the title bar of visible and iconified frame.") "Template for displaying the title bar of visible and iconified frame.")
(defvar minimal-emacs-debug (bound-and-true-p init-file-debug) (defvar minimal-emacs-debug (bound-and-true-p init-file-debug)
"Non-nil to enable debug.") "Non-nil to enable debug.")
(defvar minimal-emacs-optimize-startup-gc t (defvar minimal-emacs-optimize-startup-gc t
"If non-nil, increase `gc-cons-threshold' during startup to reduce pauses. "If non-nil, increase `gc-cons-threshold' during startup to reduce pauses.
After Emacs finishes loading, `gc-cons-threshold' is restored to the value After Emacs finishes loading, `gc-cons-threshold' is restored to the value
stored in `minimal-emacs-gc-cons-threshold'.") stored in `minimal-emacs-gc-cons-threshold'.")
(defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024) (defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024)
"Value to which `gc-cons-threshold' is set after Emacs startup. "Value to which `gc-cons-threshold' is set after Emacs startup.
Ignored if `minimal-emacs-optimize-startup-gc' is nil.") Ignored if `minimal-emacs-optimize-startup-gc' is nil.")
(defvar minimal-emacs-gc-cons-percentage gc-cons-percentage (defvar minimal-emacs-gc-cons-percentage gc-cons-percentage
"Value to which `gc-cons-percentage' is set after Emacs startup. "Value to which `gc-cons-percentage' is set after Emacs startup.
Ignored if `minimal-emacs-optimize-startup-gc' is nil.") Ignored if `minimal-emacs-optimize-startup-gc' is nil.")
(defvar minimal-emacs-gc-cons-threshold-restore-delay nil (defvar minimal-emacs-gc-cons-threshold-restore-delay nil
"Number of seconds to wait before restoring `gc-cons-threshold'.") "Number of seconds to wait before restoring `gc-cons-threshold'.")
(defvar minimal-emacs-optimize-file-name-handler-alist t (defvar minimal-emacs-optimize-file-name-handler-alist t
"Enable optimization of `file-name-handler-alist'. "Enable optimization of `file-name-handler-alist'.
When non-nil, this variable activates optimizations to reduce file name handler When non-nil, this variable activates optimizations to reduce file name handler
lookups during Emacs startup.") lookups during Emacs startup.")
(defvar minimal-emacs-disable-mode-line-during-startup t (defvar minimal-emacs-disable-mode-line-during-startup t
"Disable the mode line during startup. "Disable the mode line during startup.
This reduces visual clutter and slightly enhances startup performance. The This reduces visual clutter and slightly enhances startup performance. The
tradeoff is that the mode line is hidden during the startup phase.") tradeoff is that the mode line is hidden during the startup phase.")
(defvar minimal-emacs-package-initialize-and-refresh nil (defvar minimal-emacs-package-initialize-and-refresh nil
"Whether to automatically initialize and refresh packages. "Whether to automatically initialize and refresh packages.
When set to non-nil, Emacs will automatically call `package-initialize' and When set to non-nil, Emacs will automatically call `package-initialize' and
`package-refresh-contents' to set up and update the package system.") `package-refresh-contents' to set up and update the package system.")
(defvar minimal-emacs-inhibit-redisplay-during-startup nil (defvar minimal-emacs-inhibit-redisplay-during-startup nil
"Suppress redisplay during startup to improve performance. "Suppress redisplay during startup to improve performance.
This prevents visual updates while Emacs initializes. The tradeoff is that you This prevents visual updates while Emacs initializes. The tradeoff is that you
won't see the progress or activities during the startup process.") won't see the progress or activities during the startup process.")
(defvar minimal-emacs-inhibit-message-during-startup nil (defvar minimal-emacs-inhibit-message-during-startup nil
"Suppress startup messages for a cleaner experience. "Suppress startup messages for a cleaner experience.
This slightly enhances performance. The tradeoff is that you won't be informed This slightly enhances performance. The tradeoff is that you won't be informed
of the progress or any relevant activities during startup.") of the progress or any relevant activities during startup.")
(defvar minimal-emacs-user-directory user-emacs-directory (defvar minimal-emacs-user-directory user-emacs-directory
"Directory beneath minimal-emacs.d files are placed. "Directory beneath minimal-emacs.d files are placed.
Note that this should end with a directory separator.") Note that this should end with a directory separator.")
(defvar minimal-emacs-load-pre-early-init t (defvar minimal-emacs-load-pre-early-init t
"If non-nil, attempt to load `pre-early-init.el`.") "If non-nil, attempt to load `pre-early-init.el`.")
(defvar minimal-emacs-load-post-early-init t (defvar minimal-emacs-load-post-early-init t
"If non-nil, attempt to load `post-early-init.el`.") "If non-nil, attempt to load `post-early-init.el`.")
(defvar minimal-emacs-load-pre-init t (defvar minimal-emacs-load-pre-init t
"If non-nil, attempt to load `pre-init.el`.") "If non-nil, attempt to load `pre-init.el`.")
(defvar minimal-emacs-load-post-init t (defvar minimal-emacs-load-post-init t
"If non-nil, attempt to load `post-init.el`.") "If non-nil, attempt to load `post-init.el`.")
;;; Load pre-early-init.el ;;; Load pre-early-init.el
;; Prefer loading newer compiled files ;; Prefer loading newer compiled files
(setq load-prefer-newer t) (setq load-prefer-newer t)
(when minimal-emacs-debug (when minimal-emacs-debug
(setq debug-on-error minimal-emacs-debug)) (setq debug-on-error minimal-emacs-debug))
(defvar minimal-emacs--success nil) (defvar minimal-emacs--success nil)
(defun minimal-emacs--check-success () (defun minimal-emacs--check-success ()
"Verify that the Emacs configuration has loaded successfully." "Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success (unless minimal-emacs--success
(cond (cond
((or (file-exists-p (expand-file-name "~/.emacs.el")) ((or (file-exists-p (expand-file-name "~/.emacs.el"))
(file-exists-p (expand-file-name "~/.emacs"))) (file-exists-p (expand-file-name "~/.emacs")))
(error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file")) (error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file"))
(t (t
(error "Configuration error. Debug by starting Emacs with: --debug-init"))))) (error "Configuration error. Debug by starting Emacs with: --debug-init")))))
(unless noninteractive (unless noninteractive
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)) (add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102))
(defvar minimal-emacs-load-compiled-init-files nil (defvar minimal-emacs-load-compiled-init-files nil
"If non-nil, attempt to load byte-compiled .elc for init files. "If non-nil, attempt to load byte-compiled .elc for init files.
This will enable minimal-emacs to load byte-compiled or possibly native-compiled This will enable minimal-emacs to load byte-compiled or possibly native-compiled
init files for the following initialization files: pre-init.el, post-init.el, init files for the following initialization files: pre-init.el, post-init.el,
pre-early-init.el, and post-early-init.el.") pre-early-init.el, and post-early-init.el.")
(defun minimal-emacs--remove-el-file-suffix (filename) (defun minimal-emacs--remove-el-file-suffix (filename)
"Remove the Elisp file suffix from FILENAME and return it (.el, .el.gz...)." "Remove the Elisp file suffix from FILENAME and return it (.el, .el.gz...)."
(let ((suffixes (mapcar (lambda (ext) (concat ".el" ext)) (let ((suffixes (mapcar (lambda (ext) (concat ".el" ext))
load-file-rep-suffixes))) load-file-rep-suffixes)))
(catch 'done (catch 'done
(dolist (suffix suffixes filename) (dolist (suffix suffixes filename)
(when (string-suffix-p suffix filename) (when (string-suffix-p suffix filename)
(setq filename (substring filename 0 (- (length suffix)))) (setq filename (substring filename 0 (- (length suffix))))
(throw 'done t)))) (throw 'done t))))
filename)) filename))
(defun minimal-emacs-load-user-init (filename) (defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME." "Execute a file of Lisp code named FILENAME."
(let ((init-file (expand-file-name filename (let ((init-file (expand-file-name filename
minimal-emacs-user-directory))) minimal-emacs-user-directory)))
(if (not minimal-emacs-load-compiled-init-files) (if (not minimal-emacs-load-compiled-init-files)
(load init-file :no-error (not minimal-emacs-debug) :nosuffix) (load init-file :no-error (not minimal-emacs-debug) :nosuffix)
;; Remove the file suffix (.el, .el.gz, etc.) to let the `load' function ;; Remove the file suffix (.el, .el.gz, etc.) to let the `load' function
;; select between .el and .elc files. ;; select between .el and .elc files.
(setq init-file (minimal-emacs--remove-el-file-suffix init-file)) (setq init-file (minimal-emacs--remove-el-file-suffix init-file))
(load init-file :no-error (not minimal-emacs-debug))))) (load init-file :no-error (not minimal-emacs-debug)))))
(when minimal-emacs-load-pre-early-init (when minimal-emacs-load-pre-early-init
(minimal-emacs-load-user-init "pre-early-init.el")) (minimal-emacs-load-user-init "pre-early-init.el"))
(setq custom-theme-directory (setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory)) (expand-file-name "themes/" minimal-emacs-user-directory))
(setq custom-file (expand-file-name "custom.el" minimal-emacs-user-directory)) (setq custom-file (expand-file-name "custom.el" minimal-emacs-user-directory))
@@ -172,43 +172,43 @@ pre-early-init.el, and post-early-init.el.")
;; garbage collection during startup but will be reset later. ;; garbage collection during startup but will be reset later.
(defun minimal-emacs--restore-gc-values () (defun minimal-emacs--restore-gc-values ()
"Restore garbage collection values to minimal-emacs.d values." "Restore garbage collection values to minimal-emacs.d values."
(setq gc-cons-threshold minimal-emacs-gc-cons-threshold) (setq gc-cons-threshold minimal-emacs-gc-cons-threshold)
(setq gc-cons-percentage minimal-emacs-gc-cons-percentage)) (setq gc-cons-percentage minimal-emacs-gc-cons-percentage))
(defun minimal-emacs--restore-gc () (defun minimal-emacs--restore-gc ()
"Restore garbage collection settings." "Restore garbage collection settings."
(if (and (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay) (if (and (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay)
;; In noninteractive mode, the event loop does not run ;; In noninteractive mode, the event loop does not run
(not noninteractive)) (not noninteractive))
;; Defer garbage collection during initialization to avoid 2 collections. ;; Defer garbage collection during initialization to avoid 2 collections.
(run-with-timer minimal-emacs-gc-cons-threshold-restore-delay nil (run-with-timer minimal-emacs-gc-cons-threshold-restore-delay nil
#'minimal-emacs--restore-gc-values) #'minimal-emacs--restore-gc-values)
(minimal-emacs--restore-gc-values))) (minimal-emacs--restore-gc-values)))
(if minimal-emacs-optimize-startup-gc (if minimal-emacs-optimize-startup-gc
;; `gc-cons-threshold' is managed by minimal-emacs.d ;; `gc-cons-threshold' is managed by minimal-emacs.d
(add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc 105) (add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc 105)
;; gc-cons-threshold is not managed by minimal-emacs.d. ;; gc-cons-threshold is not managed by minimal-emacs.d.
(when (= gc-cons-threshold most-positive-fixnum) (when (= gc-cons-threshold most-positive-fixnum)
(setq gc-cons-threshold minimal-emacs--backup-gc-cons-threshold) (setq gc-cons-threshold minimal-emacs--backup-gc-cons-threshold)
(setq gc-cons-percentage minimal-emacs--backup-gc-cons-percentage))) (setq gc-cons-percentage minimal-emacs--backup-gc-cons-percentage)))
;;; Native compilation and Byte compilation ;;; Native compilation and Byte compilation
(unless (and (featurep 'native-compile) (unless (and (featurep 'native-compile)
(fboundp 'native-comp-available-p) (fboundp 'native-comp-available-p)
(native-comp-available-p)) (native-comp-available-p))
;; Deactivate the `native-compile' feature if it is not available ;; Deactivate the `native-compile' feature if it is not available
(setq native-comp-jit-compilation nil) (setq native-comp-jit-compilation nil)
(setq features (delq 'native-compile features))) (setq features (delq 'native-compile features)))
(setq native-comp-warning-on-missing-source minimal-emacs-debug (setq native-comp-warning-on-missing-source minimal-emacs-debug
native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent)) native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent))
(setq jka-compr-verbose minimal-emacs-debug) (setq jka-compr-verbose minimal-emacs-debug)
(setq byte-compile-warnings minimal-emacs-debug (setq byte-compile-warnings minimal-emacs-debug
byte-compile-verbose minimal-emacs-debug) byte-compile-verbose minimal-emacs-debug)
;;; Miscellaneous ;;; Miscellaneous
@@ -235,7 +235,7 @@ pre-early-init.el, and post-early-init.el.")
(setq warning-inhibit-types '((files missing-lexbind-cookie))) (setq warning-inhibit-types '((files missing-lexbind-cookie)))
(when minimal-emacs-debug (when minimal-emacs-debug
(setq message-log-max 16384)) (setq message-log-max 16384))
;; Disable warnings from the legacy advice API. They aren't useful. ;; Disable warnings from the legacy advice API. They aren't useful.
(setq ad-redefinition-action 'accept) (setq ad-redefinition-action 'accept)
@@ -247,225 +247,225 @@ pre-early-init.el, and post-early-init.el.")
(setq auto-mode-case-fold nil) (setq auto-mode-case-fold nil)
(unless minimal-emacs-debug (unless minimal-emacs-debug
;; Unset command line options irrelevant to the current OS. These options ;; Unset command line options irrelevant to the current OS. These options
;; are still processed by `command-line-1` but have no effect. ;; are still processed by `command-line-1` but have no effect.
(unless (eq system-type 'darwin) (unless (eq system-type 'darwin)
(setq command-line-ns-option-alist nil)) (setq command-line-ns-option-alist nil))
(unless (memq initial-window-system '(x pgtk)) (unless (memq initial-window-system '(x pgtk))
(setq command-line-x-option-alist nil))) (setq command-line-x-option-alist nil)))
(unless noninteractive (unless noninteractive
;; In PGTK, this timeout introduces latency. Reducing it from the default 0.1 ;; In PGTK, this timeout introduces latency. Reducing it from the default 0.1
;; improves responsiveness of childframes and related packages. ;; improves responsiveness of childframes and related packages.
(when (boundp 'pgtk-wait-for-event-timeout) (when (boundp 'pgtk-wait-for-event-timeout)
(setq pgtk-wait-for-event-timeout 0.001)) (setq pgtk-wait-for-event-timeout 0.001))
;; Font compacting can be very resource-intensive, especially when rendering ;; Font compacting can be very resource-intensive, especially when rendering
;; icon fonts on Windows. This will increase memory usage. ;; icon fonts on Windows. This will increase memory usage.
(setq inhibit-compacting-font-caches t) (setq inhibit-compacting-font-caches t)
;; Resizing the Emacs frame can be costly when changing the font. Disable this ;; Resizing the Emacs frame can be costly when changing the font. Disable this
;; to improve startup times with fonts larger than the system default. ;; to improve startup times with fonts larger than the system default.
(setq frame-resize-pixelwise t) (setq frame-resize-pixelwise t)
;; Without this, Emacs will try to resize itself to a specific column size ;; Without this, Emacs will try to resize itself to a specific column size
(setq frame-inhibit-implied-resize t) (setq frame-inhibit-implied-resize t)
;; Reduce *Message* noise at startup. An empty scratch buffer (or the ;; Reduce *Message* noise at startup. An empty scratch buffer (or the
;; dashboard) is more than enough, and faster to display. ;; dashboard) is more than enough, and faster to display.
(setq inhibit-startup-screen t (setq inhibit-startup-screen t
inhibit-startup-echo-area-message user-login-name) inhibit-startup-echo-area-message user-login-name)
(setq initial-buffer-choice nil (setq initial-buffer-choice nil
inhibit-startup-buffer-menu t inhibit-startup-buffer-menu t
inhibit-x-resources t) inhibit-x-resources t)
;; Disable startup screens and messages ;; Disable startup screens and messages
(setq inhibit-splash-screen t) (setq inhibit-splash-screen t)
;; Disable bidirectional text scanning for a modest performance boost. ;; Disable bidirectional text scanning for a modest performance boost.
(setq-default bidi-display-reordering 'left-to-right (setq-default bidi-display-reordering 'left-to-right
bidi-paragraph-direction 'left-to-right) bidi-paragraph-direction 'left-to-right)
;; Give up some bidirectional functionality for slightly faster re-display. ;; Give up some bidirectional functionality for slightly faster re-display.
(setq bidi-inhibit-bpa t) (setq bidi-inhibit-bpa t)
;; Remove "For information about GNU Emacs..." message at startup ;; Remove "For information about GNU Emacs..." message at startup
(advice-add 'display-startup-echo-area-message :override #'ignore) (advice-add 'display-startup-echo-area-message :override #'ignore)
;; Suppress the vanilla startup screen completely. We've disabled it with ;; Suppress the vanilla startup screen completely. We've disabled it with
;; `inhibit-startup-screen', but it would still initialize anyway. ;; `inhibit-startup-screen', but it would still initialize anyway.
(advice-add 'display-startup-screen :override #'ignore)) (advice-add 'display-startup-screen :override #'ignore))
;;; Performance: File-name-handler-alist ;;; Performance: File-name-handler-alist
(defvar minimal-emacs--old-file-name-handler-alist (default-toplevel-value (defvar minimal-emacs--old-file-name-handler-alist (default-toplevel-value
'file-name-handler-alist)) 'file-name-handler-alist))
(defun minimal-emacs--respect-file-handlers (fn args-left) (defun minimal-emacs--respect-file-handlers (fn args-left)
"Respect file handlers. "Respect file handlers.
FN is the function and ARGS-LEFT is the same argument as `command-line-1'. FN is the function and ARGS-LEFT is the same argument as `command-line-1'.
Emacs processes command-line files very early in startup. These files may Emacs processes command-line files very early in startup. These files may
include special paths like TRAMP paths, so restore `file-name-handler-alist' for include special paths like TRAMP paths, so restore `file-name-handler-alist' for
this stage of initialization." this stage of initialization."
(let ((file-name-handler-alist (if args-left (let ((file-name-handler-alist (if args-left
minimal-emacs--old-file-name-handler-alist minimal-emacs--old-file-name-handler-alist
file-name-handler-alist))) file-name-handler-alist)))
(funcall fn args-left))) (funcall fn args-left)))
(defun minimal-emacs--restore-file-name-handler-alist () (defun minimal-emacs--restore-file-name-handler-alist ()
"Restore `file-name-handler-alist'." "Restore `file-name-handler-alist'."
(set-default-toplevel-value (set-default-toplevel-value
'file-name-handler-alist 'file-name-handler-alist
;; Merge instead of overwrite to preserve any changes made since startup. ;; Merge instead of overwrite to preserve any changes made since startup.
(delete-dups (append file-name-handler-alist (delete-dups (append file-name-handler-alist
minimal-emacs--old-file-name-handler-alist)))) minimal-emacs--old-file-name-handler-alist))))
(when (and minimal-emacs-optimize-file-name-handler-alist (when (and minimal-emacs-optimize-file-name-handler-alist
(not minimal-emacs-debug) (not minimal-emacs-debug)
(not noninteractive)) (not noninteractive))
;; Determine the state of bundled libraries using calc-loaddefs.el. If ;; Determine the state of bundled libraries using calc-loaddefs.el. If
;; compressed, retain the gzip handler in `file-name-handler-alist`. If ;; compressed, retain the gzip handler in `file-name-handler-alist`. If
;; compiled or neither, omit the gzip handler during startup for improved ;; compiled or neither, omit the gzip handler during startup for improved
;; startup and package load time. ;; startup and package load time.
(set-default-toplevel-value (set-default-toplevel-value
'file-name-handler-alist 'file-name-handler-alist
(if (locate-file-internal "calc-loaddefs.el" load-path) (if (locate-file-internal "calc-loaddefs.el" load-path)
nil nil
(list (rassq 'jka-compr-handler (list (rassq 'jka-compr-handler
minimal-emacs--old-file-name-handler-alist)))) minimal-emacs--old-file-name-handler-alist))))
;; Ensure the new value persists through any current let-binding. ;; Ensure the new value persists through any current let-binding.
(put 'file-name-handler-alist 'initial-value (put 'file-name-handler-alist 'initial-value
minimal-emacs--old-file-name-handler-alist) minimal-emacs--old-file-name-handler-alist)
;; Emacs processes command-line files very early in startup. These files may ;; Emacs processes command-line files very early in startup. These files may
;; include special paths TRAMP. Restore `file-name-handler-alist'. ;; include special paths TRAMP. Restore `file-name-handler-alist'.
(advice-add 'command-line-1 :around #'minimal-emacs--respect-file-handlers) (advice-add 'command-line-1 :around #'minimal-emacs--respect-file-handlers)
(add-hook 'emacs-startup-hook #'minimal-emacs--restore-file-name-handler-alist (add-hook 'emacs-startup-hook #'minimal-emacs--restore-file-name-handler-alist
101)) 101))
;;; Performance: Inhibit redisplay ;;; Performance: Inhibit redisplay
(defun minimal-emacs--reset-inhibit-redisplay () (defun minimal-emacs--reset-inhibit-redisplay ()
"Reset inhibit redisplay." "Reset inhibit redisplay."
(setq-default inhibit-redisplay nil) (setq-default inhibit-redisplay nil)
(remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay)) (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay))
(when (and minimal-emacs-inhibit-redisplay-during-startup (when (and minimal-emacs-inhibit-redisplay-during-startup
(not noninteractive) (not noninteractive)
(not minimal-emacs-debug)) (not minimal-emacs-debug))
;; Suppress redisplay and redraw during startup to avoid delays and ;; Suppress redisplay and redraw during startup to avoid delays and
;; prevent flashing an unstyled Emacs frame. ;; prevent flashing an unstyled Emacs frame.
(setq-default inhibit-redisplay t) (setq-default inhibit-redisplay t)
(add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay -100)) (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay -100))
;;; Performance: Inhibit message ;;; Performance: Inhibit message
(defun minimal-emacs--reset-inhibit-message () (defun minimal-emacs--reset-inhibit-message ()
"Reset inhibit message." "Reset inhibit message."
(setq-default inhibit-message nil) (setq-default inhibit-message nil)
(remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message)) (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message))
(when (and minimal-emacs-inhibit-message-during-startup (when (and minimal-emacs-inhibit-message-during-startup
(not noninteractive) (not noninteractive)
(not minimal-emacs-debug)) (not minimal-emacs-debug))
(setq-default inhibit-message t) (setq-default inhibit-message t)
(add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message -100)) (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message -100))
;;; Performance: Disable mode-line during startup ;;; Performance: Disable mode-line during startup
(defvar-local minimal-emacs--hidden-mode-line nil (defvar-local minimal-emacs--hidden-mode-line nil
"Store the buffer-local value of `mode-line-format' during startup.") "Store the buffer-local value of `mode-line-format' during startup.")
(when (and minimal-emacs-disable-mode-line-during-startup (when (and minimal-emacs-disable-mode-line-during-startup
(not noninteractive) (not noninteractive)
(not minimal-emacs-debug)) (not minimal-emacs-debug))
(put 'mode-line-format (put 'mode-line-format
'initial-value (default-toplevel-value 'mode-line-format)) 'initial-value (default-toplevel-value 'mode-line-format))
(setq-default mode-line-format nil) (setq-default mode-line-format nil)
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
(with-current-buffer buf (with-current-buffer buf
(when (local-variable-p 'mode-line-format) (when (local-variable-p 'mode-line-format)
(setq minimal-emacs--hidden-mode-line mode-line-format) (setq minimal-emacs--hidden-mode-line mode-line-format)
(setq mode-line-format nil))))) (setq mode-line-format nil)))))
;;; Restore values ;;; Restore values
(defun minimal-emacs--startup-load-user-init-file (fn &rest args) (defun minimal-emacs--startup-load-user-init-file (fn &rest args)
"Advice to reset `mode-line-format'. FN and ARGS are the function and args." "Advice to reset `mode-line-format'. FN and ARGS are the function and args."
(unwind-protect (unwind-protect
;; Start up as normal ;; Start up as normal
(apply fn args) (apply fn args)
;; If we don't undo inhibit-{message, redisplay} and there's an error, we'll ;; If we don't undo inhibit-{message, redisplay} and there's an error, we'll
;; see nothing but a blank Emacs frame. ;; see nothing but a blank Emacs frame.
(when minimal-emacs-inhibit-message-during-startup (when minimal-emacs-inhibit-message-during-startup
(setq-default inhibit-message nil)) (setq-default inhibit-message nil))
(when minimal-emacs-inhibit-redisplay-during-startup (when minimal-emacs-inhibit-redisplay-during-startup
(setq-default inhibit-redisplay nil)) (setq-default inhibit-redisplay nil))
;; Restore the mode-line ;; Restore the mode-line
(when minimal-emacs-disable-mode-line-during-startup (when minimal-emacs-disable-mode-line-during-startup
(unless (default-toplevel-value 'mode-line-format) (unless (default-toplevel-value 'mode-line-format)
(setq-default mode-line-format (get 'mode-line-format (setq-default mode-line-format (get 'mode-line-format
'initial-value))) 'initial-value)))
(dolist (buf (buffer-list)) (dolist (buf (buffer-list))
(with-current-buffer buf (with-current-buffer buf
(when (local-variable-p 'minimal-emacs--hidden-mode-line) (when (local-variable-p 'minimal-emacs--hidden-mode-line)
(setq mode-line-format minimal-emacs--hidden-mode-line) (setq mode-line-format minimal-emacs--hidden-mode-line)
(kill-local-variable 'minimal-emacs--hidden-mode-line))))))) (kill-local-variable 'minimal-emacs--hidden-mode-line)))))))
(advice-add 'startup--load-user-init-file :around (advice-add 'startup--load-user-init-file :around
#'minimal-emacs--startup-load-user-init-file) #'minimal-emacs--startup-load-user-init-file)
;;; UI elements ;;; UI elements
(defun minimal-emacs--setup-toolbar (&rest _) (defun minimal-emacs--setup-toolbar (&rest _)
"Setup the toolbar." "Setup the toolbar."
(when (fboundp 'tool-bar-setup) (when (fboundp 'tool-bar-setup)
(advice-remove 'tool-bar-setup #'ignore) (advice-remove 'tool-bar-setup #'ignore)
(when (bound-and-true-p tool-bar-mode) (when (bound-and-true-p tool-bar-mode)
(funcall 'tool-bar-setup)))) (funcall 'tool-bar-setup))))
(unless noninteractive (unless noninteractive
(setq frame-title-format minimal-emacs-frame-title-format (setq frame-title-format minimal-emacs-frame-title-format
icon-title-format minimal-emacs-frame-title-format) icon-title-format minimal-emacs-frame-title-format)
;; I intentionally avoid calling `menu-bar-mode', `tool-bar-mode', and ;; I intentionally avoid calling `menu-bar-mode', `tool-bar-mode', and
;; `scroll-bar-mode' because manipulating frame parameters can trigger or queue ;; `scroll-bar-mode' because manipulating frame parameters can trigger or queue
;; a superfluous and potentially expensive frame redraw at startup, depending ;; a superfluous and potentially expensive frame redraw at startup, depending
;; on the window system. The variables must also be set to `nil' so users don't ;; on the window system. The variables must also be set to `nil' so users don't
;; have to call the functions twice to re-enable them. ;; have to call the functions twice to re-enable them.
(unless (memq 'menu-bar minimal-emacs-ui-features) (unless (memq 'menu-bar minimal-emacs-ui-features)
(push '(menu-bar-lines . 0) default-frame-alist) (push '(menu-bar-lines . 0) default-frame-alist)
(unless (memq window-system '(mac ns)) (unless (memq window-system '(mac ns))
(setq menu-bar-mode nil))) (setq menu-bar-mode nil)))
(when (fboundp 'tool-bar-setup) (when (fboundp 'tool-bar-setup)
;; Temporarily override the tool-bar-setup function to prevent it from ;; Temporarily override the tool-bar-setup function to prevent it from
;; running during the initial stages of startup ;; running during the initial stages of startup
(advice-add 'tool-bar-setup :override #'ignore) (advice-add 'tool-bar-setup :override #'ignore)
(advice-add 'startup--load-user-init-file :after (advice-add 'startup--load-user-init-file :after
#'minimal-emacs--setup-toolbar)) #'minimal-emacs--setup-toolbar))
(unless (memq 'tool-bar minimal-emacs-ui-features) (unless (memq 'tool-bar minimal-emacs-ui-features)
(push '(tool-bar-lines . 0) default-frame-alist) (push '(tool-bar-lines . 0) default-frame-alist)
(setq tool-bar-mode nil)) (setq tool-bar-mode nil))
(setq default-frame-scroll-bars 'right) (setq default-frame-scroll-bars 'right)
(push '(vertical-scroll-bars) default-frame-alist) (push '(vertical-scroll-bars) default-frame-alist)
(push '(horizontal-scroll-bars) default-frame-alist) (push '(horizontal-scroll-bars) default-frame-alist)
(setq scroll-bar-mode nil) (setq scroll-bar-mode nil)
(unless (memq 'tooltips minimal-emacs-ui-features) (unless (memq 'tooltips minimal-emacs-ui-features)
(when (bound-and-true-p tooltip-mode) (when (bound-and-true-p tooltip-mode)
(tooltip-mode -1))) (tooltip-mode -1)))
;; Disable GUIs because they are inconsistent across systems, desktop ;; Disable GUIs because they are inconsistent across systems, desktop
;; environments, and themes, and they don't match the look of Emacs. ;; environments, and themes, and they don't match the look of Emacs.
(unless (memq 'dialogs minimal-emacs-ui-features) (unless (memq 'dialogs minimal-emacs-ui-features)
(setq use-file-dialog nil) (setq use-file-dialog nil)
(setq use-dialog-box nil))) (setq use-dialog-box nil)))
;;; Security ;;; Security
(setq gnutls-verify-error t) ; Prompts if there are cert issues (setq gnutls-verify-error t) ; Prompts if there are cert issues
@@ -496,7 +496,7 @@ this stage of initialization."
;;; Load post-early-init.el ;;; Load post-early-init.el
(when minimal-emacs-load-post-early-init (when minimal-emacs-load-post-early-init
(minimal-emacs-load-user-init "post-early-init.el")) (minimal-emacs-load-user-init "post-early-init.el"))
;; Local variables: ;; Local variables:
;; byte-compile-warnings: (not obsolete free-vars) ;; byte-compile-warnings: (not obsolete free-vars)
+65 -63
View File
@@ -5,37 +5,37 @@
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory)) (defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil :depth 1 :inherit ignore :ref nil :depth 1 :inherit ignore
:files (:defaults "elpaca-test.el" (:exclude "extensions")) :files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca-activate))) :build (:not elpaca-activate)))
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory)) (let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory)) (build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order)) (order (cdr elpaca-order))
(default-directory repo)) (default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo)) (add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo) (unless (file-exists-p repo)
(make-directory repo t) (make-directory repo t)
(when (<= emacs-major-version 28) (require 'subr-x)) (when (<= emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err (condition-case-unless-debug err
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone" ((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let* ((depth (plist-get order :depth))) ,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch")) (list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo)))) ,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout" ((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--")))) (or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name)) (emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)"))) "--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca)) ((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo))) ((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer)) (progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string)))) (error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive)))) ((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t) (unless (require 'elpaca-autoloads nil t)
(require 'elpaca) (require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo) (elpaca-generate-autoloads "elpaca" repo)
(let ((load-source-file-function nil)) (load "./elpaca-autoloads")))) (let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues) (add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order)) (elpaca `(,@elpaca-order))
(elpaca benchmark-init) (elpaca benchmark-init)
@@ -52,7 +52,7 @@
(elpaca compat) (elpaca compat)
(elpaca general) ;Keybindings (elpaca general) ;Keybindings
(elpaca vertico) ;vertical minibuffer (elpaca vertico) ;vertical minibuffer
(elpaca vertico-posframe) ;hover (elpaca vertico-posframe) ;hover
(elpaca orderless) ;Filtering for Consult/Vertico (elpaca orderless) ;Filtering for Consult/Vertico
(elpaca marginalia) ;Annotations in the minibuffer (elpaca marginalia) ;Annotations in the minibuffer
(elpaca corfu) ;In-buffer completion (elpaca corfu) ;In-buffer completion
@@ -63,42 +63,42 @@
(elpaca nerd-icons-dired) (elpaca nerd-icons-dired)
(elpaca nerd-icons-corfu) (elpaca nerd-icons-corfu)
(elpaca doom-modeline) (elpaca doom-modeline)
(elpaca base16-theme)
;; ============================================================================== ;; ==============================================================================
;; EDITING & NAVIGATION ;; EDITING & NAVIGATION
;; ============================================================================== ;; ==============================================================================
;;(elpaca meow) ; Modal editing ;;(elpaca meow) ; Modal editing
(elpaca god-mode) ; psuedo modal editing (elpaca god-mode) ; psuedo modal editing
(elpaca multiple-cursors) (elpaca multiple-cursors)
(elpaca avy) ; Fast jumping (elpaca avy) ; Fast jumping
(elpaca surround) ; utilties around surround selection (elpaca surround) ; utilties around surround selection
(elpaca expreg) ; expand selection (elpaca expreg) ; expand selection
(elpaca undo-fu) (elpaca undo-fu)
(elpaca vundo) ; Visual undo tree (elpaca vundo) ; Visual undo tree
(elpaca xclip) (elpaca xclip)
(elpaca clipetty) ; clipboard stuff TUI-GUI-Wayland (elpaca clipetty) ; clipboard stuff TUI-GUI-Wayland
(elpaca embark) ; Contextual actions (elpaca embark) ; Contextual actions
(elpaca embark-consult) (elpaca embark-consult)
(elpaca wgrep) ; allow writeable grep buffers (elpaca wgrep) ; allow writeable grep buffers
;(elpaca lsp-embark) ;(elpaca lsp-embark)
(elpaca kirigami) ; folding meta utility (elpaca kirigami) ; folding meta utility
(elpaca pcre2el) ; fix regex (elpaca pcre2el) ; fix regex
;; ============================================================================== ;; ==============================================================================
;; CODE ANALYSIS & VISUALS ;; CODE ANALYSIS & VISUALS
;; ============================================================================== ;; ==============================================================================
(elpaca treesit-auto) ; automatically install treesitter grammars (elpaca treesit-auto) ; automatically install treesitter grammars
(elpaca treesit-fold) ; folding based on treesit (elpaca treesit-fold) ; folding based on treesit
(elpaca highlight-quoted) ; emacs (elpaca highlight-quoted) ; emacs
(elpaca highlight-defined) ; emacs (elpaca highlight-defined) ; emacs
(elpaca color-identifiers-mode) ; emacs (elpaca color-identifiers-mode) ; emacs
(elpaca highlight-parentheses) ; delimiters around point (elpaca highlight-parentheses) ; delimiters around point
(elpaca rainbow-delimiters) ; rainbow colours for pairs (elpaca rainbow-delimiters) ; rainbow colours for pairs
(elpaca outline-indent) ; (elpaca outline-indent) ;
(elpaca (svg-margin :repo "chiply/svg-margin" (elpaca (svg-margin
:host github)) :repo "chiply/svg-margin"
:host github))
;; ============================================================================== ;; ==============================================================================
;; LSP & DEVELOPMENT ;; LSP & DEVELOPMENT
;; ============================================================================== ;; ==============================================================================
@@ -125,19 +125,21 @@
;; UTILITIES ;; UTILITIES
;; ============================================================================== ;; ==============================================================================
(elpaca consult) ; Enhanced search/navigation (elpaca consult) ; Enhanced search/navigation
(elpaca ghostel) ; terminal (elpaca ghostel) ; terminal
(elpaca shell-pop) (elpaca shell-pop)
(elpaca colorful-mode) ; colourise color codes (elpaca colorful-mode) ; colourise color codes
(elpaca (dirvish :repo "latiagertrutis/dirvish" (elpaca (dirvish
:host github)) ; broken on emacs 30, fixed by using fork :repo "latiagertrutis/dirvish"
(elpaca (dired-clipboard :repo "kn66/dired-clipboard.el" ;system clipboard in dired :host github)) ; broken on emacs 30, fixed by using fork
:host github)) (elpaca (dired-clipboard
(elpaca transient) ; bindings in modes :repo "kn66/dired-clipboard.el" ;system clipboard in dired
(elpaca magit) ; git client :host github))
(elpaca transpose-frame) ; edit frame layout (elpaca transient) ; bindings in modes
(elpaca jit-spell) ; spellcheck (elpaca magit) ; git client
(elpaca sudo-edit) ; sudo util (elpaca transpose-frame) ; edit frame layout
(elpaca jit-spell) ; spellcheck
(elpaca sudo-edit) ; sudo util
;; ============================================================================== ;; ==============================================================================
;; KNOWLEDGE MANAGEMENT (ZK/DENOTE) ;; KNOWLEDGE MANAGEMENT (ZK/DENOTE)
;; ============================================================================== ;; ==============================================================================
@@ -151,9 +153,9 @@
;; ============================================================================== ;; ==============================================================================
(elpaca elpaca-use-package (elpaca elpaca-use-package
;; Automatically adds :ensure t and :defer t to use-package declarations ;; Automatically adds :ensure t and :defer t to use-package declarations
(elpaca-use-package-mode) (elpaca-use-package-mode)
(setq elpaca-use-package-by-default t)) (setq elpaca-use-package-by-default t))
(load (expand-file-name "config.el" user-emacs-directory)) (load (expand-file-name "config.el" user-emacs-directory))
(custom-set-variables (custom-set-variables
@@ -162,7 +164,7 @@
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(custom-safe-themes '(custom-safe-themes
'())) '()))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
@@ -174,4 +176,4 @@
(setq minimal-emacs--success t) (setq minimal-emacs--success t)
(setq initial-major-mode 'fundamental-mode (setq initial-major-mode 'fundamental-mode
initial-scratch-message nil) initial-scratch-message nil)
+52 -43
View File
@@ -1,60 +1,69 @@
;;; completion-packages.el --- Completion stack configuration -*- lexical-binding: t; -*- ;;; completion-packages.el --- Completion stack configuration -*- lexical-binding: t; -*-
(use-package corfu (use-package corfu
:config :config
(global-corfu-mode) (global-corfu-mode)
(corfu-popupinfo-mode) (corfu-popupinfo-mode)
(setq corfu-quit-at-boundary 'seperator (setq corfu-quit-at-boundary 'separator
corfu-quit-no-match 'seperator) corfu-quit-no-match 'separator)
:custom :custom
(corfu-auto t) (corfu-auto t)
(corfu-auto-delay 0.2) (corfu-auto-delay 0.1)
(corfu-auto-prefix 2) (corfu-auto-prefix 1)
(corfu-popupinfo-delay '(0.5 . 0.3))) (corfu-popupinfo-delay '(0.5 . 0.3)))
(use-package vertico (use-package vertico
:init :init
(vertico-mode) (vertico-mode)
:config :config
(vertico-multiform-mode t) (vertico-multiform-mode t)
(setq vertico-multiform-commands (setq vertico-multiform-commands
'( '(
(consult-imenu posframe indexed) (consult-imenu posframe indexed)
(consult-completion-in-region grid))) (consult-completion-in-region grid)))
) )
(use-package vertico-posframe (use-package vertico-posframe
:after vertico :after vertico
:config :config
(vertico-posframe-mode t) (vertico-posframe-mode t)
(setq vertico-posframe-width 150 (setq vertico-posframe-width 150
vertico-posframe-min-width 90 vertico-posframe-min-width 90
vertico-posframe-border-width 3 vertico-posframe-border-width 3
vertico-count 15 vertico-count 15
vertico-scroll-margin 4) vertico-scroll-margin 4)
) )
;use consult + vertico instead of corfu if in terminal ;use consult + vertico instead of corfu if in terminal
(use-package consult (use-package consult
:defer t :defer t
:init :init
(setq completion-in-region-function #'consult-completion-in-region (setq completion-in-region-function #'consult-completion-in-region
consult-fd-args '("fd" "--color=never" "--hidden" )) consult-fd-args '("fd" "--color=never" "--hidden" ))
:config :config
(add-hook 'after-change-major-mode-hook (add-hook 'after-change-major-mode-hook
(lambda () (lambda ()
(setq completion-in-region-function #'consult-completion-in-regionc))) (setq completion-in-region-function #'consult-completion-in-region)))
) )
(use-package marginalia (use-package marginalia
:init :init
(marginalia-mode)) (marginalia-mode))
(use-package orderless (use-package orderless
:custom :custom
(completion-styles '(orderless basic)) (completion-styles '(orderless basic))
(completion-pcm-leading-wildcard t)) (completion-pcm-leading-wildcard t)
(completion-category-defaults nil)
(orderless-matching-styles '(orderless-prefixes orderless-literal))
:config
;;necessary to force filtering of lsp-mode candidates
(add-to-list 'completion-category-overrides
'(lsp-capf (styles orderless)
(orderless-matching-styles orderless-prefixes orderless-literal)))
)
(provide 'completion-packages) (provide 'completion-packages)
+114 -106
View File
@@ -1,130 +1,138 @@
;; Tree-sitter & LSP tweaks (Core transformative changes) ;; Tree-sitter & LSP tweaks (Core transformative changes)
(use-package treesit-auto (use-package treesit-auto
:functions global-treesit-auto-mode :functions global-treesit-auto-mode
:config :config
(treesit-auto-add-to-auto-mode-alist 'all) (treesit-auto-add-to-auto-mode-alist 'all)
:hook (after-init . global-treesit-auto-mode) :hook (after-init . global-treesit-auto-mode)
:custom :custom
(treesit-auto-install 'prompt) (treesit-auto-install 'prompt)
) )
(use-package treesit-fold (use-package treesit-fold
:defer t :defer t
:commands (treesit-fold-close :commands (treesit-fold-close
treesit-fold-close-all treesit-fold-close-all
treesit-fold-open treesit-fold-open
treesit-fold-toggle treesit-fold-toggle
treesit-fold-open-all treesit-fold-open-all
treesit-fold-mode treesit-fold-mode
global-treesit-fold-mode global-treesit-fold-mode
treesit-fold-open-recursively treesit-fold-open-recursively
treesit-fold-line-comment-mode) treesit-fold-line-comment-mode)
:custom :custom
(treesit-fold-line-count-show t) (treesit-fold-line-count-show t)
(treesit-fold-line-count-format "--▼--") (treesit-fold-line-count-format "--▼--")
:config :config
(set-face-attribute 'treesit-fold-replacement-face nil (set-face-attribute 'treesit-fold-replacement-face nil
:foreground "#808080" :foreground "#808080"
:box nil :box nil
:weight 'bold)) :weight 'bold))
;; Tree-sitter hooks ;; Tree-sitter hooks
(dolist (hook '(c-ts-mode-hook c++-ts-mode-hook java-ts-mode-hook rust-ts-mode-hook go-ts-mode-hook ruby-ts-mode-hook js-ts-mode-hook typescript-ts-mode-hook tsx-ts-mode-hook css-ts-mode-hook html-ts-mode-hook bash-ts-mode-hook cmake-ts-mode-hook dockerfile-ts-mode-hook json-ts-mode-hook toml-ts-mode-hook yaml-ts-mode-hook)) (dolist (hook '(c-ts-mode-hook c++-ts-mode-hook java-ts-mode-hook rust-ts-mode-hook go-ts-mode-hook ruby-ts-mode-hook js-ts-mode-hook typescript-ts-mode-hook tsx-ts-mode-hook css-ts-mode-hook html-ts-mode-hook bash-ts-mode-hook cmake-ts-mode-hook dockerfile-ts-mode-hook json-ts-mode-hook toml-ts-mode-hook yaml-ts-mode-hook))
(add-hook hook #'treesit-fold-mode)) (add-hook hook #'treesit-fold-mode))
(with-eval-after-load 'treesit (with-eval-after-load 'treesit
(setq treesit-font-lock-level 4)) (setq treesit-font-lock-level 4))
(use-package mason (use-package mason
:defer t :defer t
:config :config
(mason-setup)) (mason-setup))
(defvar my/lsp-mode-hooks (defvar my/lsp-mode-hooks
'(c-mode-hook '(c-mode-hook
c++-mode-hook c++-mode-hook
c-ts-mode-hook c-ts-mode-hook
c++-ts-mode-hook c++-ts-mode-hook
typescript-ts-mode-hook typescript-ts-mode-hook
js-ts-mode-hook js-ts-mode-hook
tsx-ts-mode-hook tsx-ts-mode-hook
arduino-mode-hook arduino-mode-hook
toml-ts-mode-hook toml-ts-mode-hook
json-ts-mode-hook json-ts-mode-hook
python-mode-hook) python-mode-hook)
"List of major mode hooks to enable LSP.") "List of major mode hooks to enable LSP.")
(dolist (hook my/lsp-mode-hooks) (dolist (hook my/lsp-mode-hooks)
(add-hook hook #'lsp-deferred)) (add-hook hook #'lsp-deferred))
(use-package lsp-mode (use-package lsp-mode
:defer t :defer t
:commands lsp :commands lsp
:init :init
(setq lsp-keymap-prefix "C-l") (setq lsp-keymap-prefix "C-l")
:config :config
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)) (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
(setq lsp-clients-clangd-executable "clangd" (setq lsp-clients-clangd-executable "clangd"
lsp-clangd-binary-path "/usr/bin/clangd" lsp-clangd-binary-path "/usr/bin/clangd"
lsp-clients--clangd-default-executable "/usr/bind/clangd" lsp-clients--clangd-default-executable "/usr/bin/clangd"
lsp-completion-provider :none lsp-completion-provider :none
lsp-clients-clangd-args '("--header-insertion=iwyu" "--fallback-style=LLVM") lsp-completion-enable-filtering nil
) lsp-completion-sort-initial-results t
lsp-clients-clangd-args '("--header-insertion=iwyu"
"--fallback-style=LLVM"
"-query-driver=/usr/bin/c++"
"--header-insertion-decorators")
(with-eval-after-load 'lsp-mode lsp-enable-indentation t
(define-key lsp-command-map (kbd "a") #'lsp-execute-code-action) lsp-enable-on-type-formatting nil
(define-key lsp-command-map (kbd "d") #'lsp-ui-doc-glance) ))
(define-key lsp-command-map (kbd "r") #'lsp-rename)
;; Safe Capability Filter: Handles both association list (alist) and hash-table formats
(advice-add 'lsp--client-capabilities :filter-return
(lambda (caps)
(cond
;; If it's a hash table
((hash-table-p caps)
(when-let ((text-doc (gethash "textDocument" caps)))
(if (hash-table-p text-doc)
(remhash "inlineCompletion" text-doc)
(setcdr (assoc "inlineCompletion" text-doc) nil))))
;; If it's an association list (alist)
((listp caps)
(when-let ((text-doc (cdr (assoc 'textDocument caps))))
(setcdr (assoc 'textDocument caps)
(assq-delete-all 'inlineCompletion text-doc)))))
caps))
;; Set up arduino-mode safely after lsp-mode is loaded
(add-to-list 'lsp-language-id-configuration '(arduino-mode . "cpp"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("clangd" "--header-insertion=never"))
:activation-fn (lsp-activate-on "arduino")
:server-id 'lsp-arduino-clangd
))))
(use-package lsp-ui
:defer t
:after lsp-mode
:commands lsp-ui-mode
:init
(setq lsp-ui-sideline-show-symbol t
lsp-ui-side-show-code-actions t
lsp-ui-sideline-show-hover t
lsp-ui-doc-enable t
lsp-ui-doc-delay 1
lsp-ui-doc-position 'at-point
lsp-ui-sideline-show-hover t
lsp-ui-sideline-show-diagnostics t
lsp-ui-side-show-code-actions t
lsp-ui-sideline-delay 0.25
)
)
(with-eval-after-load 'lsp-mode (with-eval-after-load 'lsp-mode
(add-to-list 'lsp-disabled-clients 'tailwindcss)) (define-key lsp-command-map (kbd "a") #'lsp-execute-code-action)
(define-key lsp-command-map (kbd "d") #'lsp-ui-doc-glance)
(define-key lsp-command-map (kbd "r") #'lsp-rename)
;; Safe Capability Filter: Handles both association list (alist) and hash-table formats
(advice-add 'lsp--client-capabilities :filter-return
(lambda (caps)
(cond
;; If it's a hash table
((hash-table-p caps)
(when-let ((text-doc (gethash "textDocument" caps)))
(if (hash-table-p text-doc)
(remhash "inlineCompletion" text-doc)
(setcdr (assoc "inlineCompletion" text-doc) nil))))
;; If it's an association list (alist)
((listp caps)
(when-let ((text-doc (cdr (assoc 'textDocument caps))))
(setcdr (assoc 'textDocument caps)
(assq-delete-all 'inlineCompletion text-doc)))))
caps))
;; Set up arduino-mode safely after lsp-mode is loaded
(add-to-list 'lsp-language-id-configuration '(arduino-mode . "cpp"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("clangd" "--header-insertion=never"))
:activation-fn (lsp-activate-on "arduino")
:server-id 'lsp-arduino-clangd
)))
(use-package lsp-ui
:defer t
:after lsp-mode
:commands lsp-ui-mode
:init
(setq lsp-ui-sideline-show-symbol t
lsp-ui-side-show-code-actions t
lsp-ui-sideline-show-hover t
lsp-ui-doc-enable t
lsp-ui-doc-delay 1
lsp-ui-doc-position 'at-point
lsp-ui-sideline-show-hover t
lsp-ui-sideline-show-diagnostics t
lsp-ui-side-show-code-actions t
lsp-ui-sideline-delay 0.25
)
)
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-disabled-clients 'tailwindcss))
(provide 'dev-packages) (provide 'dev-packages)
+28 -28
View File
@@ -1,40 +1,40 @@
;;; editing-packages.el --- Editing and navigation configuration -*- lexical-binding: t; -*- ;;; editing-packages.el --- Editing and navigation configuration -*- lexical-binding: t; -*-
(use-package avy (use-package avy
:defer t :defer t
:config :config
(setq avy-timeout-seconds 0.25 (setq avy-timeout-seconds 0.25
avy-style 'at-full avy-style 'at-full
avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?A ?S ?D ?F ?G ?H ?J ?K ?L) avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
avy-orders-alist nil) avy-orders-alist nil)
) )
(use-package surround (use-package surround
:defer t :defer t
:bind-keymap ("M-'" . surround-keymap)) :bind-keymap ("M-'" . surround-keymap))
(use-package kirigami (use-package kirigami
:defer t :defer t
:commands (kirigami-open-fold :commands (kirigami-open-fold
kirigami-open-fold-rec kirigami-open-fold-rec
kirigami-close-fold kirigami-close-fold
kirigami-toggle-fold kirigami-toggle-fold
kirigami-open-folds kirigami-open-folds
kirigami-close-folds-except-current kirigami-close-folds-except-current
kirigami-close-folds)) kirigami-close-folds))
(use-package embark (use-package embark
:defer t :defer t
:bind :bind
(("M-m" . embark-act) (("M-m" . embark-act)
("C-h B" . embark-bindings) ("C-h B" . embark-bindings)
) )
:config :config
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil nil
(window-parameters (mode-line-format . none)))) (window-parameters (mode-line-format . none))))
) )
(provide 'editing-packages) (provide 'editing-packages)
+28 -28
View File
@@ -1,44 +1,44 @@
;;; system-packages.el --- System and utility package configuration -*- lexical-binding: t; -*- ;;; system-packages.el --- System and utility package configuration -*- lexical-binding: t; -*-
(use-package clipetty (use-package clipetty
:hook (after-init . global-clipetty-mode)) :hook (after-init . global-clipetty-mode))
(use-package dirvish (use-package dirvish
:config :config
(dirvish-peek-mode) (dirvish-peek-mode)
(dirvish-side-follow-mode) (dirvish-side-follow-mode)
(add-hook 'dirvish-directory-view-mode 'diredfl-mode) (add-hook 'dirvish-directory-view-mode 'diredfl-mode)
(with-eval-after-load 'dirvish (with-eval-after-load 'dirvish
(define-key dirvish-mode-map (kbd "a") #'dirvish-setup-menu) (define-key dirvish-mode-map (kbd "a") #'dirvish-setup-menu)
(define-key dirvish-mode-map (kbd "v") #'dirvish-move)) (define-key dirvish-mode-map (kbd "v") #'dirvish-move))
) )
(use-package shell-pop (use-package shell-pop
:defer t :defer t
:custom :custom
;(shell-pop-universal-key "C-s s") ;(shell-pop-universal-key "C-s s")
(shell-pop-window-position "bottom") (shell-pop-window-position "bottom")
(shell-pop-term-shell shell-file-name) (shell-pop-term-shell shell-file-name)
(shell-pop-window-size 50) (shell-pop-window-size 50)
) )
(with-eval-after-load 'shell-pop (with-eval-after-load 'shell-pop
(setopt shell-pop-shell-type '("ghostel" "*ghostel*" (setopt shell-pop-shell-type '("ghostel" "*ghostel*"
(lambda () (lambda ()
(when (fboundp 'ghostel) (when (fboundp 'ghostel)
(let ((ghostel-shell shell-pop-term-shell)) (let ((ghostel-shell shell-pop-term-shell))
(ghostel))))))) (ghostel)))))))
(use-package dired-clipboard (use-package dired-clipboard
:hook (dired-mode . dired-clipboard-mode) :hook (dired-mode . dired-clipboard-mode)
:config :config
(setq dired-clipboard-use-wl-copy t (setq dired-clipboard-use-wl-copy t
dired-clipboard-wayland-target 'uri-list) dired-clipboard-wayland-target 'uri-list)
) )
(use-package benchmark-init (use-package benchmark-init
:hook :hook
(after-init . benchmark-init/deactivate)) (after-init . benchmark-init/deactivate))
(provide 'system-packages) (provide 'system-packages)
+6 -7
View File
@@ -1,10 +1,9 @@
(use-package denote (use-package denote
:defer t :defer t
:config :config
(setq denote-directory (list (expand-file-name "~/lyrinv/SOR/Notes/")) (setq denote-directory (list (expand-file-name "~/lyrinv/SOR/Notes/"))
denote-file-type 'markdown-yaml denote-file-type 'markdown-yaml
denote-prompts '(title subdirectory keywords)) denote-prompts '(title subdirectory keywords))
) )
(provide 'tutilities-packages) (provide 'tutilities-packages)
+39 -40
View File
@@ -1,68 +1,67 @@
;;; visuals-packages.el --- Visual and structural configuration -*- lexical-binding: t; -*- ;;; visuals-packages.el --- Visual and structural configuration -*- lexical-binding: t; -*-
t t
(use-package highlight-quoted (use-package highlight-quoted
:hook (emacs-lisp-mode . highlight-quoted-mode)) :hook (emacs-lisp-mode . highlight-quoted-mode))
(use-package highlight-defined (use-package highlight-defined
:hook (emacs-lisp-mode . highlight-defined-mode)) :hook (emacs-lisp-mode . highlight-defined-mode))
(use-package color-identifiers-mode (use-package color-identifiers-mode
:hook (emacs-lisp-mode . color-identifiers-mode)) :hook (emacs-lisp-mode . color-identifiers-mode))
(use-package rainbow-delimiters (use-package rainbow-delimiters
:hook :hook
(prog-mode . rainbow-delimiters-mode) (prog-mode . rainbow-delimiters-mode)
(inferior-ess-mode . rainbow-delimiters-mode)) (inferior-ess-mode . rainbow-delimiters-mode))
(use-package highlight-parentheses (use-package highlight-parentheses
:hook (prog-mode . highlight-parentheses-mode) :hook (prog-mode . highlight-parentheses-mode)
:config :config
(setq highlight-parentheses-colors (setq highlight-parentheses-colors
'("grey95" "#111" "#333" "#666") '("grey95" "#111" "#333" "#666")
highlight-parentheses-background-colors highlight-parentheses-background-colors
'("pink" "blue" "green" "red") '("pink" "blue" "green" "red")
) )
) )
(use-package colorful-mode (use-package colorful-mode
:defer t :defer t
:config (setq colorful-allow-mouse-clicks nil)) :config (setq colorful-allow-mouse-clicks nil))
(use-package doom-modeline (use-package doom-modeline
:defer t :defer t
:hook :hook
(window-setup . doom-modeline-mode) (window-setup . doom-modeline-mode)
:config :config
(setq (setq
;doom-modeline-minor-modes t ;doom-modeline-minor-modes t
doom-modeline-indent-info t doom-modeline-indent-info t
doom-modeline-column-zero-based t doom-modeline-column-zero-based t
doom-modeline-position-column-line-format '("%l:%c")) doom-modeline-position-column-line-format '("%l:%c"))
) )
;;--- ;;---
;; icons ;; icons
;;--- ;;---
(use-package nerd-icons-completion (use-package nerd-icons-completion
:defer t :defer t
:after marginalia :after marginalia
:config :config
(nerd-icons-completion-mode) (nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)) (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
(use-package nerd-icons-corfu (use-package nerd-icons-corfu
:defer t :defer t
:after corfu :after corfu
:config :config
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(use-package nerd-icons-dired (use-package nerd-icons-dired
:defer t :defer t
:config :config
(nerd-icons-dired-mode) (nerd-icons-dired-mode)
(add-hook 'dired-mode-hook #'nerd-icons-dired-mode)) (add-hook 'dired-mode-hook #'nerd-icons-dired-mode))
(provide 'visuals-packages) (provide 'visuals-packages)