Further housekeeping, bring the initial load down to under 1500 ms
Some checks failed
/ Test config on 20 (push) Failing after 53s
Some checks failed
/ Test config on 20 (push) Failing after 53s
Make the editor load faster by deferring as much as possible until later use. For example, LSP load is now deferred until first use and no longer blocking. Use only elixir-format from elixir-mode, for similar speed reasons. The rest of the package has been taken over by the treesitter version of the mode.
This commit is contained in:
parent
3ffb484fd8
commit
b0361861b4
13 changed files with 297 additions and 328 deletions
423
elpaca.lock
423
elpaca.lock
File diff suppressed because it is too large
Load diff
|
|
@ -100,16 +100,18 @@
|
|||
(use-package exec-path-from-shell
|
||||
;; :if (memq window-system '(x mac ns))
|
||||
:ensure t
|
||||
:defer t
|
||||
:hook ((elpaca-after-init . exec-path-from-shell-initalize))
|
||||
: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))
|
||||
(add-to-list 'exec-path-from-shell-variables var)))
|
||||
|
||||
;; (use-package envrc :ensure t :hook (elpaca-after-init . envrc-global-mode))
|
||||
|
||||
(use-package direnv :ensure t :config (direnv-mode t))
|
||||
(use-package direnv :ensure t :defer t
|
||||
:hook ((elpaca-after-init . direnv-mode)))
|
||||
|
||||
;; Draw underline lower
|
||||
(setopt x-underline-at-descent-line t)
|
||||
|
|
@ -121,13 +123,12 @@
|
|||
indicate-empty-lines nil)
|
||||
|
||||
;;;;;;;;;;;;;;;;; Treemacs
|
||||
(use-package treemacs :ensure t
|
||||
(use-package treemacs :ensure t :defer t
|
||||
:hook ((elpaca-after-init . treemacs-follow-mode)
|
||||
(elpaca-after-init . treemacs-project-follow-mode))
|
||||
:commands (treemacs-follow-mode treemacs-project-follow-mode treemacs)
|
||||
:bind (:map icejam-keys-mode-map
|
||||
([(hyper b)] . treemacs))
|
||||
:config
|
||||
(treemacs-follow-mode t)
|
||||
(treemacs-project-follow-mode t))
|
||||
([(hyper b)] . treemacs)))
|
||||
|
||||
(use-package treemacs-all-the-icons :ensure t :defer t
|
||||
:requires (treemacs)
|
||||
|
|
@ -135,18 +136,14 @@
|
|||
:config (treemacs-load-theme "all-the-icons"))
|
||||
|
||||
;;;;;;;;;;;;;;;;; Record frequency of different commands. Review them later
|
||||
(use-package keyfreq :ensure t
|
||||
:config
|
||||
(declare-function keyfreq-mode "keyfreq")
|
||||
(declare-function keyfreq-autosave-mode "keyfreq")
|
||||
(keyfreq-mode t)
|
||||
(keyfreq-autosave-mode t))
|
||||
(use-package keyfreq :ensure t :defer t
|
||||
:hook ((elpaca-after-init . keyfreq-mode)
|
||||
(elpaca-after-init . keyfreq-autosave-mode)))
|
||||
|
||||
;;;;;;;;;;;;;;;;; Show hints about key combinations
|
||||
(use-package which-key :ensure t
|
||||
(use-package which-key :ensure t :defer t
|
||||
:hook ((elpaca-after-init . which-key-mode))
|
||||
: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
|
||||
|
|
|
|||
|
|
@ -12,11 +12,6 @@
|
|||
(use-package diminish :ensure t)
|
||||
(use-package company :ensure t)
|
||||
|
||||
;; https://emacs-lsp.github.io/lsp-mode/page/performance/#use-plists-for-deserialization
|
||||
;; This supposedly makes it faster.
|
||||
(setenv "LSP_USE_PLISTS" "true")
|
||||
(use-package lsp-mode :ensure t)
|
||||
|
||||
;; Finally, wait for installation of these four packages.
|
||||
(declare-function elpaca-wait "elpaca")
|
||||
(elpaca-wait)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
;;; Code:
|
||||
(require 'icejam-blocking)
|
||||
|
||||
(use-package yasnippet :ensure t
|
||||
(use-package yasnippet :ensure t :defer t
|
||||
:hook ((elpaca-after-init . yas-global-mode))
|
||||
:config
|
||||
(yas-global-mode t)
|
||||
(unbind-key "C-c & C-n" yas-minor-mode-map)
|
||||
(unbind-key "C-c & C-s" yas-minor-mode-map)
|
||||
(unbind-key "C-c & C-v" yas-minor-mode-map))
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
;; Only use RETURN for completion in company
|
||||
(unbind-key "TAB" company-active-map)
|
||||
|
||||
;;; Yasnippet configuration
|
||||
;; Yasnippet configuration
|
||||
(define-key prog-mode-map (kbd "C-c y") 'company-yasnippet)
|
||||
(define-key prog-mode-map (kbd "<f13>") 'icejam-insert-space-and-complete)
|
||||
(define-key prog-mode-map (kbd "TAB") 'company-indent-or-complete-common)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@
|
|||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||
|
||||
;; Actual orderless
|
||||
(use-package vertico :ensure t
|
||||
(use-package vertico :ensure t :defer t
|
||||
:hook ((elpaca-after-init . vertico-mode))
|
||||
:config
|
||||
(setopt vertico-scroll-margin 1) ;; Scroll on N-1
|
||||
(setopt vertico-count 15) ;; Show 5 more candidates
|
||||
|
|
@ -41,22 +42,17 @@
|
|||
|
||||
;; Add working page up /down
|
||||
(keymap-set vertico-map "<next>" 'vertico-scroll-up)
|
||||
(keymap-set vertico-map "<prior>" 'vertico-scroll-down)
|
||||
|
||||
(declare-function vertico-mode "vertico")
|
||||
(vertico-mode t))
|
||||
(keymap-set vertico-map "<prior>" 'vertico-scroll-down))
|
||||
|
||||
(use-package orderless :ensure t
|
||||
:config
|
||||
(setopt completion-styles '(orderless partial-completion basic)) ;; Fallback to basic if orderless does not work.
|
||||
;; Fallback to basic if orderless does not work.
|
||||
(setopt completion-styles '(orderless partial-completion basic))
|
||||
(setopt completion-category-defaults nil)
|
||||
(setopt completion-category-overrides '((file (styles partial-completion)))))
|
||||
|
||||
|
||||
(use-package marginalia :ensure t
|
||||
:config
|
||||
(declare-function marginalia-mode "marginalia")
|
||||
(marginalia-mode t))
|
||||
(use-package marginalia :ensure t :defer t
|
||||
:hook ((elpaca-after-init . marginalia-mode)))
|
||||
|
||||
(use-package consult :ensure t
|
||||
:config
|
||||
|
|
@ -70,7 +66,11 @@
|
|||
("M-g g" . consult-goto-line)
|
||||
("C-c a" . consult-ripgrep)))
|
||||
|
||||
(use-package helpful :ensure t)
|
||||
(use-package helpful :ensure t :defer t
|
||||
:bind (([remap describe-key] . helpful-key)
|
||||
([remap describe-variable] . helpful-variable)
|
||||
([remap describe-function] . helpful-callable)
|
||||
([remap describe-command] . helpful-command)))
|
||||
|
||||
(provide 'icejam-completing-read)
|
||||
;;; icejam-completing-read.el ends here
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
(require 'icejam-keys-mode)
|
||||
(require 'icejam-transient)
|
||||
|
||||
(use-package deft :ensure t
|
||||
(use-package deft :ensure t :defer t
|
||||
:config
|
||||
(setopt deft-directory (substitute-in-file-name "$DEFT_PATH")
|
||||
deft-default-extension "md"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
;; Use flycheck globally to check syntax and compile languages
|
||||
;; Use flycheck checks with flymake.
|
||||
(use-package flymake-flycheck :ensure t :defer t :config
|
||||
(setq-default
|
||||
flycheck-disabled-checkers
|
||||
|
|
@ -10,36 +10,18 @@
|
|||
'(emacs-lisp emacs-lisp-checkdoc
|
||||
emacs-lisp-package sh-shellcheck))))
|
||||
|
||||
;; Use flymake, the built in linter/checker.
|
||||
(use-package flymake :ensure nil
|
||||
:defer t
|
||||
:config
|
||||
(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
|
||||
;; Show 'Fly' in mode line.
|
||||
(setopt flymake-mode-line-lighter "Fly")
|
||||
;; Use the same load-path as normal configuration. This makes the errors that
|
||||
;; appear in elisp files less jarring.
|
||||
(setopt elisp-flymake-byte-compile-load-path load-path)
|
||||
: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
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
;;; Highlight misspelled words
|
||||
;;; Code:
|
||||
|
||||
(use-package ispell :ensure nil
|
||||
(use-package ispell :ensure nil :defer t
|
||||
:config
|
||||
(setopt ispell-program-name "aspell")
|
||||
(setopt ispell-extra-args '("--run-together" "--run-together-limit=5" "--run-together-min=2")))
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
;;; Code:
|
||||
(require 'icejam-blocking)
|
||||
|
||||
;; (use-package lsp-mode :ensure (:depth 5) :requires (company))
|
||||
(with-eval-after-load 'lsp-mode
|
||||
;; https://emacs-lsp.github.io/lsp-mode/page/performance/#use-plists-for-deserialization
|
||||
;; This supposedly makes it faster.
|
||||
(setenv "LSP_USE_PLISTS" "true")
|
||||
(use-package lsp-mode :ensure t :defer t
|
||||
:config
|
||||
(add-to-list 'lsp-disabled-clients '(typescript-ts-mode . vue-semantic-server))
|
||||
(add-to-list 'lsp-disabled-clients '(js-mode . vue-semantic-server))
|
||||
(add-to-list 'lsp-disabled-clients '(css-mode . vue-semantic-server))
|
||||
|
|
@ -60,8 +63,8 @@
|
|||
(unbind-key "s-l s r" lsp-mode-map)
|
||||
(unbind-key "s-l s s" lsp-mode-map))
|
||||
|
||||
(use-package lsp-ui :ensure t :after (lsp-mode))
|
||||
(with-eval-after-load 'lsp-ui
|
||||
(use-package lsp-ui :ensure t :after (lsp-mode) :defer t
|
||||
:config
|
||||
(setopt lsp-ui-doc-enable t
|
||||
lsp-ui-header t
|
||||
lsp-ui-delay 0.5 ;; Wait half a second to display documentation
|
||||
|
|
@ -69,7 +72,7 @@
|
|||
lsp-ui-doc-include-signature t))
|
||||
|
||||
;; Lsp debugger mode
|
||||
(use-package dap-mode :ensure t :after (lsp-mode lsp-ui))
|
||||
(use-package dap-mode :ensure t :after (lsp-mode lsp-ui) :defer t)
|
||||
|
||||
(provide 'icejam-lsp)
|
||||
;;; icejam-lsp.el ends here
|
||||
|
|
|
|||
|
|
@ -12,10 +12,9 @@
|
|||
(global-eldoc-mode t)
|
||||
|
||||
;; Revert tag tables without asking
|
||||
(use-package etags :ensure nil
|
||||
(use-package etags :ensure nil :defer t
|
||||
:config
|
||||
(setopt tags-revert-without-query t) ;; Revert tags without query
|
||||
)
|
||||
(setopt tags-revert-without-query t))
|
||||
|
||||
;;; Show trailing whitespace and remove whitespace on save
|
||||
(use-package whitespace :ensure nil
|
||||
|
|
@ -32,20 +31,19 @@
|
|||
|
||||
;; Use colorful, matching parens
|
||||
;; Rework the code below to enumerate each hook separately:
|
||||
(use-package rainbow-delimiters :ensure t
|
||||
(use-package rainbow-delimiters :ensure t :defer t
|
||||
:hook ((prog-mode . rainbow-delimiters-mode)
|
||||
(text-mode . rainbow-delimiters-mode))
|
||||
:config
|
||||
(electric-pair-mode t)
|
||||
(show-paren-mode t))
|
||||
(text-mode . rainbow-delimiters-mode)
|
||||
(elpaca-after-init . electric-pair-mode)
|
||||
(elpaca-after-init . show-paren-mode)))
|
||||
|
||||
;;; Show hex (#aaa) colors as colors
|
||||
(use-package rainbow-mode :ensure t
|
||||
(use-package rainbow-mode :ensure t :defer t
|
||||
:hook ((prog-mode . rainbow-mode)
|
||||
(text-mode . rainbow-mode)))
|
||||
|
||||
;; Dash integration
|
||||
(use-package dash-at-point :ensure t)
|
||||
(use-package dash-at-point :ensure t :defer t)
|
||||
(with-eval-after-load 'dash-at-point
|
||||
(add-to-list 'dash-at-point-mode-alist '(enh-ruby-mode . "ruby,rubygems,rails"))
|
||||
(add-to-list 'dash-at-point-mode-alist '(elixir-ts-mode . "elixir,hex")))
|
||||
|
|
@ -61,13 +59,11 @@
|
|||
(setq-local tab-width step)
|
||||
(setq-local tab-stop-list (number-sequence step 200 step)))
|
||||
|
||||
(use-package column-enforce-mode :ensure t
|
||||
:config
|
||||
(declare-function global-column-enforce-mode "column-enforce-mode")
|
||||
(global-column-enforce-mode t))
|
||||
(use-package column-enforce-mode :ensure t :defer t
|
||||
:hook (elpaca-after-init . global-column-enforce-mode))
|
||||
|
||||
;; PCRE to Emacs regex translations
|
||||
(use-package pcre2el :ensure t)
|
||||
(use-package pcre2el :ensure t :defer t)
|
||||
|
||||
;; Visual regexp
|
||||
(use-package visual-regexp-steroids :ensure t :after (pcre2el)
|
||||
|
|
|
|||
|
|
@ -11,12 +11,14 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(use-package tree-sitter-langs :ensure t
|
||||
:config
|
||||
(declare-function tree-sitter-langs--bin-dir "tree-sitter-langs")
|
||||
(add-to-list 'treesit-extra-load-path (tree-sitter-langs--bin-dir))
|
||||
(use-package tree-sitter-langs :ensure t :defer t
|
||||
:commands tree-sitter-langs--bin-dir
|
||||
:hook
|
||||
(elpaca-after-init . (lambda () (add-to-list
|
||||
'treesit-extra-load-path
|
||||
(tree-sitter-langs--bin-dir)))))
|
||||
|
||||
(defun icejam-tree-sitter-symlink-grammar-objects ()
|
||||
(defun icejam-tree-sitter-symlink-grammar-objects ()
|
||||
"Create symlinks for treesitter grammars.
|
||||
Tree-sitter-langs-build releases grammars as LANG.so. Treesit needs
|
||||
libtree-sitter-LANG.so"
|
||||
|
|
@ -29,7 +31,7 @@ libtree-sitter-LANG.so"
|
|||
(file-name-nondirectory file))))
|
||||
(if (memq system-type '(ms-dos windows-nt cygwin))
|
||||
(copy-file file target)
|
||||
(make-symbolic-link file target))))))
|
||||
(make-symbolic-link file target)))))
|
||||
|
||||
(provide 'icejam-tree-sitter)
|
||||
;;; icejam-tree-sitter.el ends here
|
||||
|
|
|
|||
|
|
@ -9,17 +9,12 @@
|
|||
(declare-function lsp "lsp-mode" nil)
|
||||
(declare-function column-enforce-n "column-enforce-mode" (number))
|
||||
|
||||
;; Elixir mode is used for formatting through elixir-format function,
|
||||
;; so it needs to be loaded without deferring. One it is, we can
|
||||
;; make it so that treesit takes over.
|
||||
(use-package elixir-mode :ensure t
|
||||
:config
|
||||
(add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-ts-mode)))
|
||||
;; Only load the elixir-format from elixir mode.
|
||||
(use-package elixir-format :defer t
|
||||
:ensure (:type git :host github :repo "elixir-editors/emacs-elixir" :files ("elixir-format.el")))
|
||||
|
||||
(use-package elixir-ts-mode :ensure t
|
||||
:after (elixir-mode lsp-mode lsp-ui)
|
||||
:defer t)
|
||||
(use-package elixir-ts-mode :ensure t :defer t
|
||||
:after (elixir-format lsp-mode lsp-ui))
|
||||
|
||||
(transient-define-prefix icejam-elixir-lang-menu ()
|
||||
"Elixir Buffer Commands."
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
;; a warning from the byte compiler.
|
||||
(declare-function elpaca-installed-p "elpaca")
|
||||
(unless (elpaca-installed-p 'markdown-mode)
|
||||
(use-package markdown-mode :ensure t))
|
||||
(use-package markdown-mode :ensure t :defer t))
|
||||
|
||||
(with-eval-after-load 'markdown-mode
|
||||
(setq-default markdown-command "pandoc"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue