simplified config a bit

This commit is contained in:
2026-07-30 20:21:27 +02:00
parent 93ff4a2e36
commit 811637003b
10 changed files with 51 additions and 182 deletions
+10 -8
View File
@@ -175,10 +175,10 @@
(setq-default (setq-default
;; Standardize indentation across major modes ;; Standardize indentation across major modes
tab-width 4 tab-width 2
js-indent-level 4 js-indent-level 2
typescript-indent-level 4 typescript-indent-level 2
typescript-ts-mode-indent-offset 4 typescript-ts-mode-indent-offset 2
selection-coding-system 'utf-8 selection-coding-system 'utf-8
cursor-type 'bar cursor-type 'bar
) )
@@ -252,8 +252,10 @@
(add-hook (add-hook
'window-setup-hook 'window-setup-hook
(lambda () (lambda ()
(set-face-attribute 'default nil :family "Noto Sans Mono" :height 120) (set-face-attribute 'default nil :family "Noto Sans Mono" :height 110)
(set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 140) (set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 120)
(my/apply-theme (selected-frame)))) (load-theme 'cutarv42 t)
)
)
(setq nerd-icons-font-family "Symbols Nerd Font Mono") (setq nerd-icons-font-family "Symbols Nerd Font Mono")
-40
View File
@@ -76,46 +76,6 @@ Never falls back to or checks the Emacs kill ring."
(message "System clipboard staged to kill ring.")) (message "System clipboard staged to kill ring."))
(user-error "System clipboard is empty")))) (user-error "System clipboard is empty"))))
(defun dired-wayland-copy-marked-files ()
"Copy marked files in Dired to the Wayland clipboard as text/uri-list."
(interactive)
(let* ((files (dired-get-marked-files))
;; Convert paths to file:// URIs and join with newlines
(uri-list (mapconcat (lambda (file) (concat "file://" file)) files "\n")))
(when files
(let ((process-connection-type nil))
(let ((proc (start-process "wl-copy-uri" nil "wl-copy" "-t" "text/uri-list")))
(process-send-string proc uri-list)
(process-send-eof proc)))
(message "Copied %d file(s) to Wayland clipboard." (length files)))))
(defun dired-wayland-paste-files ()
"Paste files from the Wayland clipboard (text/uri-list) into the current Dired directory."
(interactive)
(let ((default-directory (dired-current-directory)))
(with-temp-buffer
;; Call wl-paste to get the uri-list
(call-process "wl-paste" nil t nil "-t" "text/uri-list")
(goto-char (point-min))
(let ((files '()))
;; Parse file:// URIs line by line
(while (re-search-forward "^file://\\(.*\\)$" nil t)
(push (match-string 1) files))
(if files
(progn
;; Copy files to the current directory using dired's native copying
(dolist (file files)
(when (file-exists-p file)
(dired-copy-file file default-directory t)))
(revert-buffer) ; Refresh dired buffer
(message "Pasted %d file(s)." (length files)))
(message "No files found in Wayland clipboard."))))))
;; Bind keys in dired-mode
(with-eval-after-load 'dired
(define-key dired-mode-map (kbd "Y") #'dired-wayland-copy-marked-files)
(define-key dired-mode-map (kbd "P") #'dired-wayland-paste-files))
(defun my/mc-copy-regions-as-block () (defun my/mc-copy-regions-as-block ()
"Copy all active multiple-cursors regions joined by newlines into the kill ring." "Copy all active multiple-cursors regions joined by newlines into the kill ring."
(interactive) (interactive)
-31
View File
@@ -1,31 +0,0 @@
;;; ../../lyfi/configs/apps/doom/custom/ui.el -*- lexical-binding: t; -*-
(defun my-set-buffer-font ()
"Set a specific font for the current buffer only."
(buffer-face-set '(:family "Noto Sans" :height 140)))
(defun my/apply-theme (frame)
"Apply a specific theme and update package colors based on whether the FRAME is graphic or TUI."
(select-frame frame)
(if (display-graphic-p frame)
(progn
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'cutarv42 t)
;; Update rainbow-delimiters colors for Light theme
(setq rainbow-delimiters-rainbow-colors
'("#007cbf" "#cf3f29" "#2374de" "#c75e10" "#b05197" "#429e66" "#129cc9" "#a64dd6")))
(progn
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'cutarv42 t)
;; Update rainbow-delimiters colors for Dark theme
;; (setq rainbow-delimiters-rainbow-colors
;; '("#4da6ff" "#ff6b6b" "#6da6ff" "#ffb347" "#d18ecb" "#8fbc8f" "#80daeb" "#c8a0f2"))
))
(custom-set-faces
`(meow-insert-cursor ((t (:inherit unspecified :background ,(face-attribute 'font-lock-builtin-face :foreground)))))
`(meow-normal-cursor ((t (:foreground ,(face-attribute 'mode-line-inactive :background), :background ,(face-attribute 'mode-line :foreground)))))
)
)
(provide 'ui)
+7 -44
View File
@@ -1,13 +1,5 @@
;;; utils.el --- General utility functions -*- lexical-binding: t; -*- ;;; utils.el --- General utility functions -*- lexical-binding: t; -*-
(defun dired-follow-symlink ()
"In dired, visit the file or directory at point by its true physical path."
(interactive)
(let ((filename (dired-get-file-for-visit)))
(if filename
(find-file (file-truename filename))
(message "No file at point"))))
(defun my/delete-word-backward () (defun my/delete-word-backward ()
"Delete the previous 'block' of characters without killing them. "Delete the previous 'block' of characters without killing them.
Blocks are defined by: whitespace, alphanumerics, or groups of symbols." Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
@@ -39,22 +31,13 @@ Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
(delete-region (point) end))))) (delete-region (point) end)))))
(defun my/toggle-quote-wrap-all-in-region (beg end) (defun dired-follow-symlink ()
"Toggle wrapping all items in region with double quotes." "In dired, visit the file or directory at point by its true physical path."
;;https://xenodium.com/emacs-quote-wrap-all-in-region (interactive)
(interactive (list (mark) (point))) (let ((filename (dired-get-file-for-visit)))
(unless (region-active-p) (if filename
(user-error "no region to wrap")) (find-file (file-truename filename))
(let ((deactivate-mark nil) (message "No file at point"))))
(replacement (string-join
(mapcar (lambda (item)
(if (string-match-p "^\".*\"$" item)
(string-trim item "\"" "\"")
(format "\"%s\"" item)))
(split-string (buffer-substring beg end)))
" ")))
(delete-region beg end)
(insert replacement)))
(defun my/column-align-regexp () (defun my/column-align-regexp ()
"Aligns the matched regexp to `comment-column`. "Aligns the matched regexp to `comment-column`.
@@ -101,26 +84,6 @@ it ensures exactly one space of separation."
;; Optional: Bind it to a key for easier access ;; Optional: Bind it to a key for easier access
;; (global-set-key (kbd "C-c a l") 'my/column-align-regexp) ;; (global-set-key (kbd "C-c a l") 'my/column-align-regexp)
(defun diff-buffers (buffer-a buffer-b)
"Generate a diff between BUFFER-A and BUFFER-B using standard diff.
Prompts for the two buffers, defaulting to the current buffer and the
most recently active one."
(interactive
(let* ((current (current-buffer))
(other (other-buffer current t))
(buf-a (read-buffer "New buffer (to diff): " current t))
(buf-b (read-buffer "Old buffer (against): " other t)))
(list (get-buffer buf-a) (get-buffer buf-b))))
(let ((name-a (buffer-name buffer-a))
(name-b (buffer-name buffer-b)))
(diff buffer-b buffer-a nil t)
;; Rename the diff output buffer to make it clear what was diffed
(when (get-buffer "*Diff*")
(with-current-buffer "*Diff*"
(rename-buffer (format "*Diff: %s vs %s*" name-b name-a) t)))))
(defun my/list-no-prefix-bindings (keymap &optional map-name) (defun my/list-no-prefix-bindings (keymap &optional map-name)
"Extract and display all single-key (no-prefix) bindings from KEYMAP. "Extract and display all single-key (no-prefix) bindings from KEYMAP.
Outputs a clean list into a dedicated buffer." Outputs a clean list into a dedicated buffer."
+1 -6
View File
@@ -96,7 +96,6 @@
(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 indent-bars) ; show indentation bars
(elpaca outline-indent) ; (elpaca outline-indent) ;
(elpaca (svg-margin :repo "chiply/svg-margin" (elpaca (svg-margin :repo "chiply/svg-margin"
:host github)) :host github))
@@ -146,10 +145,6 @@
(elpaca denote) (elpaca denote)
(elpaca consult-denote) (elpaca consult-denote)
(elpaca denote-menu) (elpaca denote-menu)
(elpaca zk)
(elpaca zk-index)
;; ============================================================================== ;; ==============================================================================
;; ELPACA CONFIGURATION ;; ELPACA CONFIGURATION
@@ -167,7 +162,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
'("312bc908e53b07c97cbe1e09521e44c560d457c34399fe19f2dbf5a052104207"))) '()))
(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.
-18
View File
@@ -12,12 +12,6 @@
(corfu-auto-prefix 2) (corfu-auto-prefix 2)
(corfu-popupinfo-delay '(0.5 . 0.3))) (corfu-popupinfo-delay '(0.5 . 0.3)))
;; (use-package corfu-terminal
;; :after corfu
;; :init
;; (unless (display-graphic-p)
;; (corfu-terminal-mode +1)))
(use-package vertico (use-package vertico
:init :init
(vertico-mode) (vertico-mode)
@@ -30,18 +24,6 @@
(consult-completion-in-region grid))) (consult-completion-in-region grid)))
) )
;; Configure directory extension.
(use-package vertico-directory
:after vertico
:ensure nil
;; More convenient directory navigation commands
:bind (:map vertico-map
("RET" . vertico-directory-enter)
("DEL" . vertico-directory-delete-char)
("M-DEL" . vertico-directory-delete-word))
;; Tidy shadowed file names
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
(use-package vertico-posframe (use-package vertico-posframe
:after vertico :after vertico
:config :config
+20 -15
View File
@@ -30,10 +30,7 @@
: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 (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))
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
@@ -44,23 +41,31 @@
:config :config
(mason-setup)) (mason-setup))
(defvar my/lsp-mode-hooks
'(c-mode-hook
c++-mode-hook
c-ts-mode-hook
c++-ts-mode-hook
typescript-ts-mode-hook
js-ts-mode-hook
tsx-ts-mode-hook
arduino-mode-hook
toml-ts-mode-hook
json-ts-mode-hook
python-mode-hook)
"List of major mode hooks to enable LSP.")
(dolist (hook my/lsp-mode-hooks)
(add-hook hook #'lsp-deferred))
(use-package lsp-mode (use-package lsp-mode
:defer t :defer t
:hook ((c-mode . lsp-deferred)
(c++-mode . lsp-deferred)
(c-ts-mode . lsp-deferred)
(c++-ts-mode . lsp-deferred)
(typescript-ts-mode . lsp-deferred)
(js-ts-mode . lsp-deferred)
(tsx-ts-mode . lsp-deferred)
(arduino-mode . lsp-deferred)
(toml-ts-mode . lsp-deferred)
(json-ts-mode . lsp-deferred)
(lsp-mode . lsp-enable-which-key-integration))
: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))
(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/bind/clangd"
+8 -5
View File
@@ -11,14 +11,17 @@
(use-package surround (use-package surround
:defer t :defer t
:bind-keymap ("M-'" . surround-keymap)) ; Or bind to a prefix in general-def :bind-keymap ("M-'" . surround-keymap))
(use-package kirigami (use-package kirigami
:defer t :defer t
:commands (kirigami-open-fold kirigami-open-fold-rec kirigami-close-fold :commands (kirigami-open-fold
kirigami-toggle-fold kirigami-open-folds kirigami-open-fold-rec
kirigami-close-folds-except-current kirigami-close-fold
kirigami-close-folds)) kirigami-toggle-fold
kirigami-open-folds
kirigami-close-folds-except-current
kirigami-close-folds))
(use-package embark (use-package embark
:defer t :defer t
+2 -15
View File
@@ -20,23 +20,10 @@ t
(setq highlight-parentheses-colors (setq highlight-parentheses-colors
'("grey95" "#111" "#333" "#666") '("grey95" "#111" "#333" "#666")
highlight-parentheses-background-colors highlight-parentheses-background-colors
'("#111" "blue" "green" "red") '("pink" "blue" "green" "red")
) )
) )
(use-package indent-bars
:config
(setq indent-bars-prefer-character ?.
indent-bars-pattern "true"
indent-bars-width-frac 1
indent-bars-pad-frac 0.2
indent-bars-color-by-depth '(:regexp "outline-\\([0-9]+\\)" :blend 0.9)
indent-bars-highlight-current-depth '(:face default :blend 0.4))
;(add-hook 'prog-mode-hook #'indent-bars-mode)
:hook (prog-mode . indent-bars-mode))
(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))
@@ -47,7 +34,7 @@ t
(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"))
+3
View File
@@ -167,6 +167,9 @@
`(org-code ((,class (:foreground ,status-info :background ,bg-main)))) `(org-code ((,class (:foreground ,status-info :background ,bg-main))))
`(org-block ((,class (:background ,bg-main :foreground ,fg-main :extend t)))) `(org-block ((,class (:background ,bg-main :foreground ,fg-main :extend t))))
`(org-block-begin-line ((,class (:foreground ,status-highlight :background ,bg-main :extend t)))) `(org-block-begin-line ((,class (:foreground ,status-highlight :background ,bg-main :extend t))))
`(rainbow-delimiters-depth-1-face ((,class (:foreground ,ui-selection :background ,light-grey))))
;`(rainbow-delimiters-depth-2-face ((,class (:foreground ,dark-grey :background ,ui-hl-line))))
)) ))
;;;###autoload ;;;###autoload