diff --git a/config.el b/config.el index 5b8f398..c71391f 100644 --- a/config.el +++ b/config.el @@ -175,10 +175,10 @@ (setq-default ;; Standardize indentation across major modes - tab-width 4 - js-indent-level 4 - typescript-indent-level 4 - typescript-ts-mode-indent-offset 4 + tab-width 2 + js-indent-level 2 + typescript-indent-level 2 + typescript-ts-mode-indent-offset 2 selection-coding-system 'utf-8 cursor-type 'bar ) @@ -252,8 +252,10 @@ (add-hook 'window-setup-hook (lambda () - (set-face-attribute 'default nil :family "Noto Sans Mono" :height 120) - (set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 140) - (my/apply-theme (selected-frame)))) + (set-face-attribute 'default nil :family "Noto Sans Mono" :height 110) + (set-face-attribute 'variable-pitch nil :family "Noto Sans" :height 120) + (load-theme 'cutarv42 t) + ) + ) -(setq nerd-icons-font-family "Symbols Nerd Font Mono") + (setq nerd-icons-font-family "Symbols Nerd Font Mono") diff --git a/custom/system.el b/custom/system.el index 6a56990..cfc2c0e 100644 --- a/custom/system.el +++ b/custom/system.el @@ -76,46 +76,6 @@ Never falls back to or checks the Emacs kill ring." (message "System clipboard staged to kill ring.")) (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 () "Copy all active multiple-cursors regions joined by newlines into the kill ring." (interactive) diff --git a/custom/ui.el b/custom/ui.el deleted file mode 100644 index 521505b..0000000 --- a/custom/ui.el +++ /dev/null @@ -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) diff --git a/custom/utils.el b/custom/utils.el index d08f1ea..5d51782 100644 --- a/custom/utils.el +++ b/custom/utils.el @@ -1,13 +1,5 @@ ;;; 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 () "Delete the previous 'block' of characters without killing them. 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))))) -(defun my/toggle-quote-wrap-all-in-region (beg end) - "Toggle wrapping all items in region with double quotes." - ;;https://xenodium.com/emacs-quote-wrap-all-in-region - (interactive (list (mark) (point))) - (unless (region-active-p) - (user-error "no region to wrap")) - (let ((deactivate-mark nil) - (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 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/column-align-regexp () "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 ;; (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) "Extract and display all single-key (no-prefix) bindings from KEYMAP. Outputs a clean list into a dedicated buffer." diff --git a/init.el b/init.el index 8b409cc..ae98230 100644 --- a/init.el +++ b/init.el @@ -96,7 +96,6 @@ (elpaca color-identifiers-mode) ; emacs (elpaca highlight-parentheses) ; delimiters around point (elpaca rainbow-delimiters) ; rainbow colours for pairs -(elpaca indent-bars) ; show indentation bars (elpaca outline-indent) ; (elpaca (svg-margin :repo "chiply/svg-margin" :host github)) @@ -146,10 +145,6 @@ (elpaca denote) (elpaca consult-denote) (elpaca denote-menu) -(elpaca zk) -(elpaca zk-index) - - ;; ============================================================================== ;; ELPACA CONFIGURATION @@ -167,7 +162,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes - '("312bc908e53b07c97cbe1e09521e44c560d457c34399fe19f2dbf5a052104207"))) + '())) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/packages/completion-packages.el b/packages/completion-packages.el index 04b44a8..92fe37d 100644 --- a/packages/completion-packages.el +++ b/packages/completion-packages.el @@ -12,12 +12,6 @@ (corfu-auto-prefix 2) (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 :init (vertico-mode) @@ -30,18 +24,6 @@ (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 :after vertico :config diff --git a/packages/dev-packages.el b/packages/dev-packages.el index 449a2a0..a361b25 100644 --- a/packages/dev-packages.el +++ b/packages/dev-packages.el @@ -30,10 +30,7 @@ :weight 'bold)) ;; 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)) (with-eval-after-load 'treesit @@ -44,23 +41,31 @@ :config (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 :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 :init (setq lsp-keymap-prefix "C-l") :config + (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)) (setq lsp-clients-clangd-executable "clangd" lsp-clangd-binary-path "/usr/bin/clangd" lsp-clients--clangd-default-executable "/usr/bind/clangd" diff --git a/packages/editing-packages.el b/packages/editing-packages.el index dc47533..bb522d1 100644 --- a/packages/editing-packages.el +++ b/packages/editing-packages.el @@ -11,14 +11,17 @@ (use-package surround :defer t - :bind-keymap ("M-'" . surround-keymap)) ; Or bind to a prefix in general-def + :bind-keymap ("M-'" . surround-keymap)) (use-package kirigami :defer t - :commands (kirigami-open-fold kirigami-open-fold-rec kirigami-close-fold - kirigami-toggle-fold kirigami-open-folds - kirigami-close-folds-except-current - kirigami-close-folds)) + :commands (kirigami-open-fold + kirigami-open-fold-rec + kirigami-close-fold + kirigami-toggle-fold + kirigami-open-folds + kirigami-close-folds-except-current + kirigami-close-folds)) (use-package embark :defer t diff --git a/packages/visuals-packages.el b/packages/visuals-packages.el index b086428..5729749 100644 --- a/packages/visuals-packages.el +++ b/packages/visuals-packages.el @@ -20,23 +20,10 @@ t (setq highlight-parentheses-colors '("grey95" "#111" "#333" "#666") 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 :defer t :config (setq colorful-allow-mouse-clicks nil)) @@ -47,7 +34,7 @@ t (window-setup . doom-modeline-mode) :config (setq - doom-modeline-minor-modes t + ;doom-modeline-minor-modes t doom-modeline-indent-info t doom-modeline-column-zero-based t doom-modeline-position-column-line-format '("%l:%c")) diff --git a/themes/cutarv42-theme.el b/themes/cutarv42-theme.el index 6fd641f..738bba1 100644 --- a/themes/cutarv42-theme.el +++ b/themes/cutarv42-theme.el @@ -167,6 +167,9 @@ `(org-code ((,class (:foreground ,status-info :background ,bg-main)))) `(org-block ((,class (:background ,bg-main :foreground ,fg-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