Prefer setopt to :custom from use-package
All checks were successful
/ Test config on 20 (push) Successful in 26s

The following does not provide completion for variables:

  (use-package thing :custom (thing-thing :ok))
This commit is contained in:
Maciej 2024-10-31 14:36:47 +02:00
parent ba82470bea
commit a68257ee41
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
24 changed files with 313 additions and 266 deletions

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,8 @@
(require 'icejam-keys-mode)
(use-package avy :ensure t :defer t
:custom (avy-timeout-seconds 1 "Wait for 1 second for candidates")
:config
(setopt avy-timeout-seconds 1) ;; Wait for 1 second for candidates
:bind (:map icejam-keys-mode-map
;; Jump to text in sight with CMD-j
([(hyper j)] . avy-goto-char-timer)))

View file

@ -49,10 +49,11 @@
;; Garbage collection magic hack
(use-package gcmh :ensure t
:custom ((gcmh-verbose nil "Do not log GC messages.")
(gcmh-idle-delay 'auto "Compute GC delay based on gcmh-auto-idle-delay-factor")
(gcmh-auto-idle-delay-factor 10 "Original value was 10"))
:config
(declare-function gcmh-mode "gcmh")
(setopt gcmh-verbose nil) ;; Do not log GC messages
(setopt gcmh-idle-delay 'auto) ;; Compute GC delay based on gcmh-auto-idle-delay-factor
(setopt gcmh-auto-idle-delay-factor 10) ;; Original value was 10
(gcmh-mode t))
;; #====================== Backup config #==============================
@ -99,10 +100,11 @@
:if (memq window-system '(x mac ns))
:ensure t
:config
(declare-function exec-path-from-shell-initialize "exec-path-from-shell")
(add-to-list 'exec-path "/usr/local/bin")
(dolist (var '("DEFT_PATH" "LANG" "LC_CTYPE"))
(add-to-list 'exec-path-from-shell-variables var))
(exec-path-from-shell-initialize))
(dolist (var '("DEFT_PATH" "LANG" "LC_CTYPE"))
(add-to-list 'exec-path-from-shell-variables var))
(exec-path-from-shell-initialize))
(use-package direnv :ensure t
:config
@ -142,8 +144,10 @@
;;;;;;;;;;;;;;;;; Show hints about key combinations
(use-package which-key :ensure t
:custom (which-key-idle-delay 0.5)
:config (which-key-mode t))
:config
(declare-function which-key-mode "which-key")
(which-key-mode t)
(setopt which-key-idle-delay 0.5))
;;;;;;;;;;;;;;;;; Use C-n to create a new line
(setopt next-line-add-newlines t)

View file

@ -32,28 +32,39 @@
;; Actual orderless
(use-package vertico :ensure t
:custom ((vertico-scroll-margin 1 "Scroll on N-1")
(vertico-count 15 "Show 5 more candidates")
(vertico-resize t "Grow and shrink the vertico minibufffer")
(vertico-cycle t "Cycle completion"))
:config
(setopt vertico-scroll-margin 1) ;; Scroll on N-1
(setopt vertico-count 15) ;; Show 5 more candidates
(setopt vertico-resize t) ;; Grow and shrink the vertico minibufffer
(setopt vertico-cycle t) ;; Cycle completion
(declare-function vertico-mode "vertico")
(vertico-mode t))
(use-package orderless :ensure t
:custom ((completion-styles '(orderless partial-completion basic)
"Fallback to basic if orderless does not work.")
(completion-category-defaults nil)
(completion-category-overrides
'((file (styles partial-completion))))))
:config
(setopt completion-styles '(orderless partial-completion basic)) ;; Fallback to basic if orderless does not work.
(setopt completion-category-defaults nil)
(setopt completion-category-overrides '((file (styles partial-completion)))))
(use-package marginalia :ensure t
:config (marginalia-mode t))
:config
(declare-function marginalia-mode "marginalia")
(marginalia-mode t))
(use-package consult :ensure t
:config
;; Using ripgrep, show hidden files but ignore contents of .git
(setopt consult-ripgrep-args
"rg --null --line-buffered --color=never --max-columns=1000 \
--path-separator / --smart-case --no-heading --with-filename --line-number \
--search-zip --hidden --glob \"!.git/*\"")
:bind (:map icejam-keys-mode-map
("C-c t" . find-file)
("M-g" . consult-goto-line)
("C-c a" . consult-ripgrep)))
(use-package helpful :ensure t)
(provide 'icejam-completing-read)

View file

@ -26,6 +26,7 @@
(use-package gptel :ensure t :defer t
:config
(declare-function gptel-make-anthropic "gptel")
(setq
gptel-model 'claude-3-5-sonnet-20241022
gptel-backend (gptel-make-anthropic "Claude"
@ -33,9 +34,10 @@
;; Pretend to be 'AI editor'.
(use-package elysium :ensure t :defer t
:custom
((elysium-window-size 0.33 "The elysium buffer will be 1/3 your screen")
(elysium-window-style 'vertical "Elysium buffer will be vertical")))
:config
(setopt elysium-window-size 0.33) ;; The elysium buffer will be 1/3 your screen
(setopt elysium-window-style 'vertical) ;; Elysium buffer will be vertical
)
;; Merging with SMerge
(use-package smerge-mode :ensure nil

View file

@ -14,15 +14,15 @@
:commands dashboard-setup-startup-hook
:hook
((elpaca-after-init . dashboard-open))
:custom
((dashboard-footer-messages '("Happy coding!" "I showed you my source code, pls respond"))
(dashboard-startup-banner 'logo)
(dashboard-items '((recents . 5)
;; (bookmarks . 5)
;; (agenda . 5)
;; (registers . 5)
(projects . 5))))
:config (dashboard-setup-startup-hook))
:config
(setopt dashboard-footer-messages '("Happy coding!" "I showed you my source code, pls respond"))
(setopt dashboard-startup-banner 'logo)
(setopt dashboard-items '((recents . 5)
;; (bookmarks . 5)
;; (agenda . 5)
;; (registers . 5)
(projects . 5)))
(dashboard-setup-startup-hook))
(provide 'icejam-dashboard)
;;; icejam-dashboard.el ends here

View file

@ -7,20 +7,20 @@
(require 'icejam-transient)
(use-package deft :ensure t
:custom
((deft-directory (substitute-in-file-name "$DEFT_PATH"))
(deft-default-extension "md")
(deft-ignore-file-regexp "\\._[0-9-A-Z_]+\\.md$")
(deft-strip-summary-regexp (concat "\\("
"[\n\t]" ;; blank
"\\|^:[[:ascii:]]+:.*$" ;; org-mode properties string
"\\|^Title:.*$" ;; Title string
"\\|^title:.*$" ;; title string
"\\|^\\[\\[file:.*$" ;; org-mode inline-images
;; org-mode properties
;; "\\|:PROPERTIES:\n\\(.+\n\\)+:END:\n" ;;
"\\)"))
(deft-auto-save-interval 30.0)))
:config
(setopt deft-directory (substitute-in-file-name "$DEFT_PATH")
deft-default-extension "md"
deft-ignore-file-regexp "\\._[0-9-A-Z_]+\\.md$"
deft-strip-summary-regexp (concat "\\("
"[\n\t]" ;; blank
"\\|^:[[:ascii:]]+:.*$" ;; org-mode properties string
"\\|^Title:.*$" ;; Title string
"\\|^title:.*$" ;; title string
"\\|^\\[\\[file:.*$" ;; org-mode inline-images
;; org-mode properties
;; "\\|:PROPERTIES:\n\\(.+\n\\)+:END:\n" ;;
"\\)")
deft-auto-save-interval 30.0))
(provide 'icejam-deft)
;;; icejam-deft.el ends here

View file

@ -3,27 +3,43 @@
;;; Code:
;; Use flycheck globally to check syntax and compile languages
(use-package flycheck :ensure t
:custom ((flycheck-emacs-lisp-load-path 'inherit))
(use-package flymake-flycheck :ensure t :defer t :config
(setq-default
flycheck-disabled-checkers
(append (default-value 'flycheck-disabled-checkers)
'(emacs-lisp emacs-lisp-checkdoc
emacs-lisp-package sh-shellcheck))))
(use-package flymake :ensure nil
:config
(global-flycheck-mode t)
(setopt flycheck-emacs-lisp-load-path 'inherit)
(unbind-key "C-c ! C-c" flycheck-mode-map)
(unbind-key "C-c ! C-w" flycheck-mode-map)
(unbind-key "C-c ! ?" flycheck-mode-map)
(unbind-key "C-c ! C" flycheck-mode-map)
(unbind-key "C-c ! H" flycheck-mode-map)
(unbind-key "C-c ! V" flycheck-mode-map)
(unbind-key "C-c ! c" flycheck-mode-map)
(unbind-key "C-c ! e" flycheck-mode-map)
(unbind-key "C-c ! h" flycheck-mode-map)
(unbind-key "C-c ! i" flycheck-mode-map)
(unbind-key "C-c ! l" flycheck-mode-map)
(unbind-key "C-c ! n" flycheck-mode-map)
(unbind-key "C-c ! p" flycheck-mode-map)
(unbind-key "C-c ! s" flycheck-mode-map)
(unbind-key "C-c ! v" flycheck-mode-map)
(unbind-key "C-c ! x" flycheck-mode-map))
(setopt flymake-mode-line-lighter "Fly") ;; Show 'Fly' in mode line
(setopt elisp-flymake-byte-compile-load-path load-path) ;; Use the same load-path as normal configuration
:hook ((prog-mode . flymake-mode)
(text-mode . flymake-mode)
(flymake-mode . flymake-flycheck-auto)))
;; (use-package flycheck :ensure t
;; :custom ((flycheck-emacs-lisp-load-path 'inherit))
;; :config
;; (global-flycheck-mode t)
;; (setopt flycheck-emacs-lisp-load-path 'inherit)
;; (unbind-key "C-c ! C-c" flycheck-mode-map)
;; (unbind-key "C-c ! C-w" flycheck-mode-map)
;; (unbind-key "C-c ! ?" flycheck-mode-map)
;; (unbind-key "C-c ! C" flycheck-mode-map)
;; (unbind-key "C-c ! H" flycheck-mode-map)
;; (unbind-key "C-c ! V" flycheck-mode-map)
;; (unbind-key "C-c ! c" flycheck-mode-map)
;; (unbind-key "C-c ! e" flycheck-mode-map)
;; (unbind-key "C-c ! h" flycheck-mode-map)
;; (unbind-key "C-c ! i" flycheck-mode-map)
;; (unbind-key "C-c ! l" flycheck-mode-map)
;; (unbind-key "C-c ! n" flycheck-mode-map)
;; (unbind-key "C-c ! p" flycheck-mode-map)
;; (unbind-key "C-c ! s" flycheck-mode-map)
;; (unbind-key "C-c ! v" flycheck-mode-map)
;; (unbind-key "C-c ! x" flycheck-mode-map))
(provide 'icejam-flycheck)
;;; icejam-flycheck.el ends here

View file

@ -3,12 +3,10 @@
;;; Highlight misspelled words
;;; Code:
(use-package ispell :ensure nil
:custom
((ispell-program-name "aspell")
(ispell-extra-args '("--run-together" "--run-together-limit=5" "--run-together-min=2"))))
:config
(setopt ispell-program-name "aspell")
(setopt ispell-extra-args '("--run-together" "--run-together-limit=5" "--run-together-min=2")))
(use-package flyspell :ensure nil
:hook ((prog-mode . flyspell-mode)

View file

@ -11,6 +11,7 @@
lsp-completion-provider :capf
lsp-server-trace nil
lsp-lens-enable nil
lsp-diagnostics-provider :flymake
lsp-lens-mode nil
read-process-output-max (* 1024 1024 4)
;; Disable the piece of shit vue LSP server. It activates itself in every

View file

@ -13,16 +13,20 @@
;; Revert tag tables without asking
(use-package etags :ensure nil
:custom (tags-revert-without-query t "Revert tag tables without asking"))
:config
(setopt tags-revert-without-query t) ;; Revert tags without query
)
;;; Show trailing whitespace and remove whitespace on save
(use-package whitespace :ensure nil
:custom ((whitespace-style #'(face trailing empty) "New whitespace style.")
(require-final-newline 't "Insert newline on save"))
:hook ((prog-mode . whitespace-mode)
(text-mode . whitespace-mode)
(conf-mode . whitespace-mode)
(before-save . whitespace-cleanup)))
(before-save . whitespace-cleanup))
:config
(setopt whitespace-style #'(face trailing empty)) ;; New whitespace style
(setopt require-final-newline 't) ;; Insert newline on save
)
(setq-default indent-tabs-mode nil)
@ -66,8 +70,10 @@
(use-package pcre2el :ensure t)
;; Visual regexp
(use-package visual-regexp-steroids :ensure t :requires (pcre2el)
:custom (vr/engine 'pcre2el "Use pcre2el for regexes"))
(use-package visual-regexp-steroids :ensure t :after (pcre2el)
:config
(setopt vr/engine 'pcre2el) ;; Use pcre2el for regexes
)
(provide 'icejam-prog-mode)
;;; icejam-prog-mode.el ends here

View file

@ -55,6 +55,7 @@
;; My own theme modifications:
(with-eval-after-load 'base16-theme
(setopt base16-theme-256-color-source 'colors)
(load-theme 'base16-gruvbox-dark-pale t t)
(require 'icejam-base16-zenburn)
(require 'icejam-base16-harmonic-light)

View file

@ -79,7 +79,7 @@
("i" "Indent" icejam-mark-and-indent-whole-buffer)]
["Other"
("m" "iMenu" lsp-ui-imenu)
("e" "Show Errors" flycheck-list-errors)]])
("e" "Show Errors" flymake-show-buffer-diagnostics)]])
(transient-define-prefix icejam-history-menu ()
"Buffer History Commands."

View file

@ -32,7 +32,7 @@
("r" "Reload" icejam-revert-buffer-no-confirm)
("f" "Format" cider-format-buffer)
("l" "Load" cider-load-buffer)
("e" "Show Errors" flycheck-list-errors)]]
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])
@ -41,7 +41,6 @@
(icejam-set-indent 2) ;; Default indentation of 2 characters
(column-enforce-n 80)
(cider-mode 1)
(setq-local indent-tabs-mode nil)
(define-key
clojure-mode-map (kbd "C-c l") 'icejam-lang-cider-context-menu)
@ -58,7 +57,7 @@
(setq-local cider-show-error-buffer 'except-in-repl))
(add-hook 'cider-repl-mode-hook 'icejam-lang-clojure-repl-config)
(add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion)
(add-hook 'cider-mode-hook 'cider-enable-flex-completion)
(provide 'icejam-lang-clojure)
;;; icejam-lang-clojure.el ends here

View file

@ -5,7 +5,7 @@
(require 'icejam-prog-mode)
(require 'icejam-transient)
(use-package lispy :ensure t)
(use-package lispy :ensure t :defer t)
(declare-function column-enforce-n "column-enforce-mode" (number))
(add-to-list 'auto-mode-alist '("/Eask\\'" . emacs-lisp-mode))
@ -17,28 +17,26 @@
("r" "Reload" icejam-revert-buffer-no-confirm)
("i" "Indent" icejam-mark-and-indent-whole-buffer)
("d" "Explain" helpful-at-point)
("e" "Show Errors" flycheck-list-errors)]]
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])
(add-to-list
'icejam-language-transient-alist '(emacs-lisp-mode . icejam-elisp-lang-menu))
(with-eval-after-load 'lispy
(declare-function lispy-mode "lispy")
(defun icejam-activate-emacs-lisp-mode ()
"Goodies for editing Emacs files."
(icejam-set-indent 2) ;; Default indentation of 2 characters
(column-enforce-n 80)
(declare-function lispy-mode "lispy")
(defun icejam-activate-emacs-lisp-mode ()
"Goodies for editing Emacs files."
(icejam-set-indent 2) ;; Default indentation of 2 characters
(column-enforce-n 80)
(lispy-mode t)
(setq-default indent-tabs-mode nil)
(lispy-mode t)
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-yasnippet company-capf)))
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-yasnippet company-capf)))
(add-hook 'emacs-lisp-mode-hook 'icejam-activate-emacs-lisp-mode))
(add-hook 'emacs-lisp-mode-hook 'icejam-activate-emacs-lisp-mode)
(provide 'icejam-lang-elisp)
;;; icejam-lang-elisp.el ends here

View file

@ -9,8 +9,10 @@
(declare-function lsp "lsp-mode" nil)
(declare-function column-enforce-n "column-enforce-mode" (number))
(use-package elixir-mode :ensure t)
(use-package elixir-ts-mode :ensure t :requires (elixir-mode lsp-mode lsp-ui))
(use-package elixir-mode :ensure t :defer t)
(use-package elixir-ts-mode :ensure t
:after (elixir-mode lsp-mode lsp-ui)
:defer t)
(with-eval-after-load 'elixir-ts-mode
(add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode))
@ -25,7 +27,7 @@
("r" "Reload" icejam-revert-buffer-no-confirm)
("f" "Format" elixir-format)
("i" "Indent" icejam-mark-and-indent-whole-buffer)
("e" "Show Errors" flycheck-list-errors)]]
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])

View file

@ -11,8 +11,9 @@
;;; Code:
(require 'icejam-prog-mode)
(require 'icejam-lsp)
(use-package gleam-ts-mode
(use-package gleam-ts-mode :defer t :after (lsp)
:ensure (:type git
:host github
:repo "gleam-lang/gleam-mode"

View file

@ -11,6 +11,7 @@
;;; Code:
(require 'icejam-prog-mode)
(require 'icejam-lsp)
(use-package haskell-mode
:ensure t
@ -19,7 +20,7 @@
(use-package lsp-haskell
:ensure t
:defer t
:requires (lsp-mode lsp-ui haskell-mode))
:after (lsp-mode lsp-ui haskell-mode))
(defun icejam-activate-haskell-mode ()
"Run this in haskell-mode."

View file

@ -6,11 +6,10 @@
(require 'icejam-flycheck)
(require 'icejam-lsp)
(use-package js2-mode
:requires (web-mode company-web lsp-mode lsp-ui)
:ensure t)
(use-package js2-mode :ensure t :defer t
:after (web-mode company lsp-mode lsp-ui))
(use-package typescript-mode :ensure t)
(use-package typescript-mode :ensure t :defer t)
;; (use-package vue-mode
;; :ensure t

View file

@ -22,7 +22,7 @@
("i" "Indent" icejam-mark-and-indent-whole-buffer)]
[""
("f" "Format" lsp-format-buffer)
("e" "Errors" flycheck-list-errors)
("e" "Errors" flymake-show-buffer-diagnostics)
("o" "Opam Env" opam-switch-set-switch)]]
[""
("q" "Quit" keyboard-quit)])

View file

@ -14,9 +14,8 @@
(require 'icejam-flycheck)
(require 'icejam-transient)
(use-package php-mode
:requires (lsp-mode lsp-ui)
:ensure t)
(use-package php-mode :ensure t :defer t
:requires (lsp-mode lsp-ui))
(transient-define-prefix icejam-lang-php/context-menu ()
"PHP Buffer Commands."
@ -27,7 +26,7 @@
("r" "Reload" icejam-revert-buffer-no-confirm)
("f" "Format" lsp-format-buffer)
("i" "Indent" icejam-mark-and-indent-whole-buffer)
("e" "Show Errors" flycheck-list-errors)]]
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])

View file

@ -6,12 +6,15 @@
;;; Commentary:
;; purescript does a thing.
;; Configuration for purescript.
;;; Code:
(use-package purescript-mode
:requires (lsp-mode lsp-ui)
:ensure t)
(require 'icejam-prog-mode)
(use-package purescript-mode :ensure t :defer t
:after (lsp-mode lsp-ui))
(declare-function purescript-indentation-mode "purescript-mode")
(defun icejam-activate-purescript-mode ()
"All things Purescript."

View file

@ -17,7 +17,7 @@
("r" "Reload" icejam-revert-buffer-no-confirm)
("f" "Format" lsp-format-buffer)
("i" "Indent" icejam-mark-and-indent-whole-buffer)
("e" "Show Errors" flycheck-list-errors)]]
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])

View file

@ -5,9 +5,7 @@
(require 'icejam-lsp)
(require 'icejam-flycheck)
(use-package web-mode
:requires (lsp-mode flycheck)
:ensure t)
(use-package web-mode :after (lsp flycheck) :ensure t :defer t)
;; Eex Web mode
(add-to-list 'auto-mode-alist '("\\.eex\\'" . web-mode))