From 6c766f3cf6388b5a66749691dc264251ab52bb9f Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 2 Nov 2024 20:33:07 +0200 Subject: Merge in work config --- .gitignore | 7 +++- init.el | 126 ++++++++++++++++++++++++++++--------------------------- shared/custom.el | 3 +- 3 files changed, 73 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index d3326d6..daaa2be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ .cache/ auto-save-list/ +eln-cache/ local/ -straight/ \ No newline at end of file +straight/ +transient/ +*~ +projectile-bookmarks.eld +recentf diff --git a/init.el b/init.el index ed8b35f..67e1cdc 100644 --- a/init.el +++ b/init.el @@ -44,8 +44,8 @@ ;; Improve Emacs security somewhat (setq gnutls-min-prime-bits 3072 gnutls-verify-error (and (fboundp 'gnutls-available-p) - (gnutls-available-p) - (not (getenv-internal "INSECURE"))) + (gnutls-available-p) + (not (getenv-internal "INSECURE"))) tls-checktrust gnutls-verify-error tls-program '("openssl s_client -connect %h:%p -CAfile %t -nbio -no_ssl3 -no_tls1 -no_tls1_1 -ign_eof" "gnutls-cli -p %p --dh-bits=3072 --ocsp --x509cafile=%t --strict-tofu --priority='SECURE128:+SECURE192:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3' %h" @@ -83,7 +83,7 @@ (setq read-process-output-max (* 64 1024)) -;; Don't fontify if stuck on reading input anyways +;; Don't fontify if stuck on reading input (setq redisplay-skip-fontification-on-input t) (when +windows+ @@ -103,9 +103,9 @@ (bootstrap-version 6)) (unless (file-exists-p bootstrap-file) (message "This might take a long time...") - (with-current-buffer (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'inhibit-cookies) + (with-current-buffer + (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" + 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file)) @@ -119,14 +119,16 @@ (let ((name (intern (concat "set-" (symbol-name name))))) `(defun ,name (value &optional default) (if default - (progn - ,@(mapcar (lambda (name) `(setq-default ,name value)) emacs-names)) - ,@(mapcar (lambda (name) `(setq ,name value)) emacs-names))))) + (progn + ,@(mapcar (lambda (name) `(setq-default ,name value)) emacs-names)) + ,@(mapcar (lambda (name) `(setq ,name value)) emacs-names))))) (defsetter fill-width fill-column) (defsetter tab-usage indent-tabs-mode) (defsetter tab-width c-basic-offset nasm-offset standard-indent tab-width) +;; Miscellany + (set-face-attribute 'default nil :font (if +mac+ "Fira Code Retina" "Fira Code") @@ -174,9 +176,8 @@ (use-package centaur-tabs :straight t - ;; Demanded because we have a hook to disable the mode locally but we want it to be global ASAP - :demand t - :hook ((dashboard-mode . (lambda () (centaur-tabs-local-mode +1)))) + :hook ((after-init . (lambda () (centaur-tabs-mode +1))) + (dashboard-mode . (lambda () (centaur-tabs-local-mode +1)))) :bind (("C-x " . centaur-tabs-forward) ("C-x " . centaur-tabs-forward) ("C-x " . centaur-tabs-backward) @@ -184,16 +185,14 @@ :custom (centaur-tabs-style "alternate") (centaur-tabs-height 35) + (centaur-tabs-icon-type 'nerd-icons) (centaur-tabs-set-icons t) (centaur-tabs-gray-out-icons 'buffer) - (centaur-tabs-icon-type 'nerd-icons) (centaur-tabs-set-bar 'over) (centaur-tabs-set-close-button nil) (centaur-tabs-set-modified-marker t) (centaur-tabs-modified-marker "●") - (centaur-tabs-cycle-scope 'tabs) - :config - (centaur-tabs-mode +1)) + (centaur-tabs-cycle-scope 'tabs)) (use-package cmake-ts-mode :after treesit @@ -266,19 +265,13 @@ (use-package display-fill-column-indicator :straight '(display-fill-column-indicator :type built-in) - ;; Demanded because we have a hook to disable the mode locally but we want it to be global ASAP - :demand t - :hook (dashboard-mode . (lambda () (display-fill-column-indicator-mode -1))) - :config - (global-display-fill-column-indicator-mode +1)) + :hook ((after-init . (lambda () (global-display-fill-column-indicator-mode +1))) + (dashboard-mode . (lambda () (display-fill-column-indicator-mode -1))))) (use-package display-line-numbers :straight '(display-line-numbers :type built-in) - ;; Demanded because we have a hook to disable the mode locally but we want it to be global ASAP - :demand t - :hook (help-mode . (lambda () (display-line-numbers-mode -1))) - :config - (global-display-line-numbers-mode +1)) + :hook ((after-init . (lambda () (global-display-line-numbers-mode +1))) + (help-mode . (lambda () (display-line-numbers-mode -1))))) (use-package dockerfile-ts-mode :after treesit @@ -293,24 +286,11 @@ :config (doom-modeline-mode +1)) -(use-package doom-themes +(use-package catppuccin-theme :straight t - :custom - (doom-themes-enable-bold t) - (doom-themes-enable-italic t) :config - (load-theme 'doom-opera t) - - (use-package doom-themes-ext-org - :after org - :straight doom-themes - :config - (doom-themes-org-config)) - - (use-package doom-themes-ext-visual-bell - :straight doom-themes - :config - (doom-themes-visual-bell-config))) + (setq catppuccin-flavor 'latte) + (load-theme 'catppuccin t)) (use-package ebuild-mode :straight t @@ -368,7 +348,7 @@ :custom (gcmh-idle-delay 'auto) (gcmh-auto-idle-delay-factor 10) - (gcmh-high-cons-threshold 16777216) + (gcmh-high-cons-threshold (* 16 1024 1024)) :config (gcmh-mode +1)) @@ -387,6 +367,12 @@ :mode "\\.go\\'" :hook (go-ts-mode . (lambda () (add-hook 'before-save-hook #'gofmt-before-save nil t)))) +(use-package groovy-mode + :straight t + :mode ("Jenkinsfile\\'" + "\\.gradle\\'" + "\\.groovy\\'")) + (use-package haskell-mode :straight t :mode "\\.hs\\'") @@ -409,16 +395,13 @@ (use-package ivy :after (counsel swiper) :straight t - ;; Demanded to enable ivy-mode globally ASAP. - :demand t + :hook (after-init . (lambda () (ivy-mode +1))) :bind (("C-c r" . ivy-resume) ("C-c v" . ivy-push-view) ("C-c V" . ivy-pop-view)) :custom (ivy-use-virtual-buffers t) - (ivy-count-format "(%d/%d) ") - :config - (ivy-mode +1)) + (ivy-count-format "(%d/%d) ")) (use-package java-ts-mode :after treesit @@ -445,9 +428,11 @@ ;; TODO: Do some proper setup :straight t) -(use-package make-mode - :straight '(make-mode :type built-in) - :mode ("Makefile\\'" . makefile-gmake-mode)) +(use-package makefile-mode + :straight '(makefile-mode :type built-in) + :mode (("Makefile\\'" . makefile-gmake-mode) + "GNUmakefile\\'" + "\\.mk\\(\\.template\\)?\\'")) (use-package markdown-mode :straight t @@ -480,6 +465,7 @@ (use-package htmlize :straight t) :custom + (org-agenda-files '("~/TODO.org")) (org-log-done t)) (use-package php-mode @@ -502,10 +488,32 @@ (prepend-prettify '((">=" . ?≥) ("<=" . ?≤)))) (defun prettify-cc-modes () - (prepend-prettify '(("->" . ?→)))) + (prepend-prettify '(("->" . ?→) + ("<<" . ?≪) + (">>" . ?≫) + ("==" . (?= (tc . bc) ??)) + ("!=" . (?≠ (tc . bc) ??)) + ("^" . ?⊕) + ("&&" . ?∧) + ("||" . ?∨) + ("<<=" . (?≪ (cr . cl) ?=)) + (">>=" . (?≫ (cr . cl) ?=)) + ("&=" . (?∩ (cr . cl) ?=)) + ("|=" . (?∪ (cr . cl) ?=)) + ("^=" . (?⊕ (cr . cl) ?=)) + ("bool" . ?𝔹) + ("_Bool" . ?𝔹) + ("int" . ?ℤ) + ("float" . ?ℚ) + ("true" . ?𝕋) + ("_True" . ?𝕋) + ("false" . ?𝔽) + ("_False" . ?𝔽)))) (defun prettify-lisp-modes () (prepend-prettify '(("lambda" . ?λ) - ("lambda*" . (?λ (cr . Bc) ?⋆))))) + ("lambda*" . (?λ (cr . Bc) ?⋆)) + ("->" . ?→) + ("=>" . ?⇒)))) :hook (c-mode-common . prettify-cc-modes) :hook (c-ts-base-mode . prettify-cc-modes) :hook (emacs-lisp-mode . prettify-lisp-modes) @@ -668,10 +676,6 @@ A thin wrapper around `xref-references-in-directory'." :straight t :hook (prog-mode . (lambda () (rainbow-mode +1)))) -(use-package ripgrep - :straight t - :commands (ripgrep-regexp)) - (use-package ruby-ts-mode :after treesit :straight '(ruby-ts-mode :type built-in) @@ -784,11 +788,11 @@ A thin wrapper around `xref-references-in-directory'." :straight t :mode "\\.typ\\'") -(use-package zig-mode - :straight t - :mode "\\.zig\\'") - (use-package yaml-ts-mode :after treesit :straight '(yaml-ts-mode :type built-in) :mode "\\.ya?ml\\'") + +(use-package zig-mode + :straight t + :mode "\\.zig\\'") diff --git a/shared/custom.el b/shared/custom.el index 42627c3..9af1d9f 100644 --- a/shared/custom.el +++ b/shared/custom.el @@ -4,7 +4,8 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes - '("7964b513f8a2bb14803e717e0ac0123f100fb92160dcf4a467f530868ebaae3e" default))) + '("7964b513f8a2bb14803e717e0ac0123f100fb92160dcf4a467f530868ebaae3e" default)) + '(auth-source-save-behavior nil)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. -- cgit v1.2.3