Update
Some checks failed
/ Test config on 20 (push) Failing after 1m4s

This commit is contained in:
Maciej 2026-04-08 14:38:54 +03:00
parent c2e63a1fa6
commit 08cc760f1c
Signed by: maciej
GPG key ID: 28243AF437E32F99
8 changed files with 97 additions and 103 deletions

2
.gitignore vendored
View file

@ -12,8 +12,6 @@ eshell/history
tramp tramp
url/* url/*
transient/* transient/*
.lsp-session-*
lsp-cache
eshell/* eshell/*
.yas-compiled-snippets.el .yas-compiled-snippets.el
ac-comphist.dat ac-comphist.dat

View file

@ -24,6 +24,9 @@
bidi-paragraph-direction 'left-to-right bidi-paragraph-direction 'left-to-right
bidi-inhibit-bpa t) bidi-inhibit-bpa t)
;; Skip fontification when you are typing
(setopt redisplay-skip-fontification-on-input t)
;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions ;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions
;; in non-focused windows. ;; in non-focused windows.
(setq-default cursor-in-non-selected-windows nil) (setq-default cursor-in-non-selected-windows nil)
@ -63,18 +66,16 @@
(setopt gcmh-high-cons-threshold (* 256 1024 1024))) (setopt gcmh-high-cons-threshold (* 256 1024 1024)))
;; #====================== Backup config #============================== ;; #====================== Backup config #==============================
(setopt backup-directory-alist (setopt
`((".*" . "~/.emacs.d/backups/auto-save-list"))) backup-directory-alist `((".*" . "~/.emacs.d/backups/auto-save-list"))
(setopt auto-save-file-name-transforms auto-save-file-name-transforms `((".*" ,"~/.emacs.d/backups/auto-save-list" t))
`((".*", "~/.emacs.d/backups/auto-save-list" t))) backup-by-copying t
delete-old-versions t
(setopt backup-by-copying t)
(setopt delete-old-versions t
kept-new-versions 10 kept-new-versions 10
kept-old-versions 5 kept-old-versions 5
version-control t) version-control t)
; Do not create .#foo.file lock files ;; Do not create .#foo.file lock files
(setopt create-lockfiles nil) (setopt create-lockfiles nil)
;; Enable line numbers and show cursors position ;; Enable line numbers and show cursors position
@ -149,8 +150,7 @@
:hook ((elpaca-after-init . treemacs-follow-mode) :hook ((elpaca-after-init . treemacs-follow-mode)
(elpaca-after-init . treemacs-project-follow-mode)) (elpaca-after-init . treemacs-project-follow-mode))
:commands (treemacs-follow-mode treemacs-project-follow-mode treemacs) :commands (treemacs-follow-mode treemacs-project-follow-mode treemacs)
:bind (:map icejam-keys-mode-map :bind (:map icejam-keys-mode-map ([(hyper b)] . treemacs))
([(hyper b)] . treemacs))
:config (setopt treemacs-tag-follow-delay 1.0)) :config (setopt treemacs-tag-follow-delay 1.0))
(use-package treemacs-all-the-icons :ensure t :defer t (use-package treemacs-all-the-icons :ensure t :defer t

View file

@ -2,6 +2,17 @@
;;; Commentary: ;;; Commentary:
;;; Completion framework configuration ;;; Completion framework configuration
;;; Code: ;;; Code:
(eval-when-compile
(defvar corfu-terminal-mode 'corfu-terminal)
(declare-function cape-dabbrev 'cape)
(declare-function cape-file 'cape)
(declare-function cape-keyword 'cape)
(declare-function cape-elisp-symbol 'cape)
(declare-function cape-capf-super 'cape)
(declare-function yasnippet-capf 'yasnippet)
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
(declare-function eglot-completion-at-point 'eglot))
(use-package yasnippet :ensure t :defer t (use-package yasnippet :ensure t :defer t
:hook ((elpaca-after-init . yas-global-mode)) :hook ((elpaca-after-init . yas-global-mode))
:config :config
@ -19,7 +30,6 @@
;; Go up to go the the last item on the list ;; Go up to go the the last item on the list
(setopt corfu-cycle t (setopt corfu-cycle t
corfu-count 20 ;; Show 20 completion candidates corfu-count 20 ;; Show 20 completion candidates
corfu-max-width 100 ;; Max width of the corfu frame corfu-max-width 100 ;; Max width of the corfu frame
corfu-right-margin-width 0.5 corfu-right-margin-width 0.5
corfu-left-margin-width 0.5 corfu-left-margin-width 0.5
@ -45,12 +55,6 @@
;; These are actual completions ;; These are actual completions
(use-package cape :ensure t :after corfu (use-package cape :ensure t :after corfu
:config :config
(declare-function cape-dabbrev 'cape)
(declare-function cape-file 'cape)
(declare-function cape-keyword 'cape)
(declare-function cape-elisp-symbol 'cape)
(declare-function cape-capf-super 'cape)
;; Set default completion values: ;; Set default completion values:
(set-default 'completion-at-point-functions (set-default 'completion-at-point-functions
(list (cape-capf-super #'cape-dabbrev #'yasnippet-capf) (list (cape-capf-super #'cape-dabbrev #'yasnippet-capf)
@ -67,7 +71,8 @@
(defun icejam-set-eglot-capfs () (defun icejam-set-eglot-capfs ()
"Set `completion-at-point-function` to list where LSP is supported." "Set `completion-at-point-function` to list where LSP is supported."
(setq-local completion-at-point-functions (setq-local completion-at-point-functions
(list (cape-capf-super #'yasnippet-capf #'eglot-completion-at-point) (list
(cape-capf-super #'yasnippet-capf #'eglot-completion-at-point)
#'cape-dabbrev #'cape-dabbrev
#'cape-file))) #'cape-file)))
@ -82,13 +87,10 @@
(use-package yasnippet-capf :ensure t :after corfu :defer t (use-package yasnippet-capf :ensure t :after corfu :defer t
:config :config
(declare-function yasnippet-capf 'yasnippet)
(setopt yasnippet-capf-lookup-by 'name)) (setopt yasnippet-capf-lookup-by 'name))
(use-package nerd-icons-corfu :ensure t :defer 5 (use-package nerd-icons-corfu :ensure t :after corfu :defer 5
:after corfu
:config :config
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(provide 'icejam-complete-at-point) (provide 'icejam-complete-at-point)

View file

@ -1,4 +1,4 @@
;;; icejam-custom-init.el --- summary ;;; icejam-custom-init.el --- summary -*- lexical-binding: t; -*-
;; Author: Maciej Szlosarczyk ;; Author: Maciej Szlosarczyk
;; Maintainer: Maciej Szlosarczyk ;; Maintainer: Maciej Szlosarczyk
@ -9,16 +9,33 @@
;; custom-init does a thing. ;; custom-init does a thing.
;;; Code: ;;; Code:
(eval-when-compile
(declare-function elpaca 'elpaca)
(declare-function elpaca-process-queues 'elpaca)
(declare-function elpaca-generate-autoloads 'elpaca)
(declare-function elpaca-write-lock-file 'elpaca)
(declare-function elpaca-use-package-mode 'elpaca-use-package))
;; Set GC at 500 MB for startup ;; Set GC at 500 MB for startup
(setopt gc-cons-threshold 500000000) (setopt gc-cons-threshold 500000000)
(setopt gc-cons-percentage 5.0) (setopt gc-cons-percentage 5.0)
(add-hook 'after-init-hook (lambda () (add-hook 'elpaca-after-init-hook (lambda ()
;; Restore GC to normal, but still high ;; Restore GC to normal, but still high
(setopt gc-cons-threshold 204800000) (setopt gc-cons-threshold (* 100 1024 1024 2))
(setopt gc-cons-percentage 0.2))) (setopt gc-cons-percentage 0.2)))
;; Increase how much data emacs reads from processes to 4 MB.
(setopt read-process-output-max (* 4 1024 1024))
;; Change file handler for startup
(defvar last-file-name-handler-alist file-name-handler-alist)
(setopt file-name-handler-alist nil)
(add-hook 'after-init-hook (lambda ()
;; Restore to normal file handler
(setopt file-name-handler-alist
last-file-name-handler-alist)))
;; Allow for deeper stacktraces / recursion ;; Allow for deeper stacktraces / recursion
;; (setopt max-lisp-eval-depth 10000) ;; (setopt max-lisp-eval-depth 10000)
@ -88,7 +105,9 @@
(add-to-list 'load-path (concat user-emacs-directory "lisp/themes")) (add-to-list 'load-path (concat user-emacs-directory "lisp/themes"))
(add-to-list 'load-path (concat user-emacs-directory "lisp/langs")) (add-to-list 'load-path (concat user-emacs-directory "lisp/langs"))
(defgroup :icejam nil "My customisation group.") (defgroup icejam nil
"My customisation group."
:group 'local)
;; General configuration files. ;; General configuration files.
(use-package icejam-keys-mode :ensure nil) (use-package icejam-keys-mode :ensure nil)

View file

@ -26,13 +26,15 @@
;; (defconst icejam-font "Iosevka Term" "Default font.") ;; (defconst icejam-font "Iosevka Term" "Default font.")
(defconst icejam-default-font-family "Iosevka Term" "Default font.") (defconst icejam-default-font-family "Iosevka Term" "Default font.")
(defconst icejam-variable-font-family "Lexica Ultralegible" "Variable pitch font.") (defconst icejam-variable-font-family "Lexica Ultralegible"
"Variable pitch font.")
(defconst icejam-markdown-font-family "Iosevka Comfy Motion" (defconst icejam-markdown-font-family "Iosevka Comfy Motion"
"Font used to render code blocks in markdown. "Font used to render code blocks in markdown.
It is different than default font to keep it visually distinct.") It is different than default font to keep it visually distinct.")
;; Require dash functions to be included: ;; Require dash functions to be included:
(declare-function -> "dash.el") (eval-when-compile
(declare-function -> "dash.el"))
(defconst icejam-font-height 14 (defconst icejam-font-height 14
"Default height of then font. "Default height of then font.
@ -61,20 +63,6 @@ in `icejam-set-font-to-screen`.")
:group 'icejam) :group 'icejam)
;;;;;;;;;;;;;;;;;;;;;; Font configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; Font configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; First, let's silence a warning about free variables
(defvar lsp-ui-doc-frame-hook)
(defun icejam-set-lsp-ui-font-hook ()
"Reset LSP IO font to specified `icejam-font` and `icejam-font-height`."
(setopt lsp-ui-doc-frame-hook nil)
(add-hook 'lsp-ui-doc-frame-hook
(lambda (frame _w)
(set-face-attribute 'default frame
:family icejam-mut-default-font-family
:height (-> icejam-mut-font-height
(- 2)
(* 10))))))
(defun icejam-set-font (family height) (defun icejam-set-font (family height)
"Set font to FAMILY and its HEIGHT to X. "Set font to FAMILY and its HEIGHT to X.
@ -89,52 +77,44 @@ two points smaller."
(setopt icejam-mut-variable-font-family icejam-variable-font-family) (setopt icejam-mut-variable-font-family icejam-variable-font-family)
;; Set default font. ;; Set default font.
(set-face-attribute 'default nil (dolist (face '(default))
(set-face-attribute face nil
:family family :family family
:height (-> height :height (-> height (* 10))))
(* 10)))
;; Set variable-pitch font ;; Set variable-pitch font
(set-face-attribute 'variable-pitch nil (dolist (face '(variable-pitch))
(set-face-attribute face nil
:family icejam-mut-variable-font-family :family icejam-mut-variable-font-family
:height (-> height :height (-> height (* 10))))
(* 10)))
;; Some font faces look better when they are 1 point smaller. ;; Tooltips look better when they are 1 point smaller.
(dolist (face '(tooltip)) (dolist (face '(tooltip))
(set-face-attribute face nil :height (-> height (set-face-attribute face nil :height (-> height
(- 1) (- 1)
(* 10)))) (* 10))))
;; And some, mainly in modeline with 2 points. ;; Modeline looks better when it is 2 points smaller.
(dolist (face '(mode-line (dolist (face '(mode-line
mode-line-inactive)) mode-line-inactive))
(set-face-attribute face nil :height (-> height (set-face-attribute face nil :height (-> height
(- 2) (- 2)
(* 10)))) (* 10)))))
;; Call LSP-UI hook
(icejam-set-lsp-ui-font-hook))
(defun icejam-set-font-to-screen () (defun icejam-set-font-to-screen ()
"Automatically set font height to suit the monitor." "Automatically set font height to suit the monitor."
(interactive) (interactive)
;; Only do anything if there's a display at all. ;; Only do anything if there's a display at all.
(if (x-display-list) (when (x-display-list)
(let ((pixel-height (x-display-pixel-height))) (let* ((pixel-height (x-display-pixel-height))
(cond (adjustment (cond
;; MacBook 14" built-in screen. ((>= 1080 pixel-height) 0) ;; Built-in 14" Macbook screen
((>= 1080 pixel-height) ((>= 1440 pixel-height) 3) ;; 27" screen connected to a Macbook
(icejam-set-font icejam-default-font-family icejam-font-height)) ((>= 2160 pixel-height) -3)))) ;; 4K screen (i.e Linux)
(when adjustment
;; 27" screen connected to a MacBook. (icejam-set-font icejam-default-font-family
((>= 1440 pixel-height) (+ icejam-font-height adjustment))))))
(icejam-set-font icejam-default-font-family (+ icejam-font-height 3)))
;; 4K screen on Windows or Linux
((>= 2160 pixel-height)
(icejam-set-font icejam-default-font-family (- icejam-font-height 3)))))))
;; Run the above function once, after elpaca finishes all downloads. ;; Run the above function once, after elpaca finishes all downloads.
(add-hook 'elpaca-after-init-hook 'icejam-set-font-to-screen) (add-hook 'elpaca-after-init-hook 'icejam-set-font-to-screen)

View file

@ -46,8 +46,6 @@
(column-enforce-n 98) (column-enforce-n 98)
(eglot-ensure) (eglot-ensure)
;; If needed, switch the one below to false to disable documentation pop-ups
;; (setq-local lsp-ui-doc-enable t)
(icejam-set-eglot-capfs) (icejam-set-eglot-capfs)
(icejam-delete-elixir-snippets)) (icejam-delete-elixir-snippets))

View file

@ -9,10 +9,7 @@
(declare-function icejam-set-no-eglot-capfs 'icejam-prog-mode) (declare-function icejam-set-no-eglot-capfs 'icejam-prog-mode)
(declare-function rxt--re-builder-switch-pcre-mode "pcre2el")) (declare-function rxt--re-builder-switch-pcre-mode "pcre2el"))
;; Markdown is a dependency of LSP mode. By wrapping it in unless we silence (use-package markdown-mode :ensure t :defer t
;; a warning from the byte compiler.
(unless (elpaca-installed-p 'markdown-mode)
(use-package markdown-mode :ensure t :defer t
:commands (markdown-preview) :commands (markdown-preview)
:config :config
;; Render preview and open it in browser. ;; Render preview and open it in browser.
@ -27,7 +24,8 @@
"--template" "--template"
"github.html5" "github.html5"
"--highlight-style" "--highlight-style"
"pygments")))) "pygments")))
(defun icejam-lang-activate-markdown-mode () (defun icejam-lang-activate-markdown-mode ()
"Reconfigure markdown mode for your own purposes." "Reconfigure markdown mode for your own purposes."

View file

@ -13,7 +13,7 @@
;; Vue JS ;; Vue JS
(add-to-list 'auto-mode-alist '("\\.vue\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.vue\\'" . web-mode))
(setq web-mode-extra-auto-pairs (setopt web-mode-extra-auto-pairs
'(("eex" . (("<%" "%>"))) '(("eex" . (("<%" "%>")))
("leex" . (("<%" "%>"))) ("leex" . (("<%" "%>")))
("erb" . (("<%" "%>") ("erb" . (("<%" "%>")
@ -25,7 +25,6 @@
(setq-local web-mode-script-padding 2) (setq-local web-mode-script-padding 2)
(setq-local web-mode-code-indent-offset 2) (setq-local web-mode-code-indent-offset 2)
(setq-local web-mode-markup-indent-offset 2) (setq-local web-mode-markup-indent-offset 2)
(setq-local lsp-eldoc-enable-hover nil)
(setq-local flycheck-check-syntax-automatically '(save mode-enabled)) (setq-local flycheck-check-syntax-automatically '(save mode-enabled))
(when (string-match-p ".vue" (buffer-file-name)) (when (string-match-p ".vue" (buffer-file-name))
(eglot-ensure))) (eglot-ensure)))