Skip to content

Commit

Permalink
tweak: enhance startup time by correctly deferring some packages
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed May 17, 2024
1 parent a1f1b79 commit d97542e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/me-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ This depends on `+cape-hosts' and `+cape-global-capes'."

(use-package corfu
:straight (:files (:defaults "extensions/*.el"))
:hook (minemacs-after-startup . global-corfu-mode)
:hook (eshell-mode . +corfu-less-intrusive-h)
:hook (minibuffer-setup . +corfu-enable-in-minibuffer-h)
:bind (:map corfu-map
Expand All @@ -86,6 +85,8 @@ This depends on `+cape-hosts' and `+cape-global-capes'."
(corfu-cycle t) ; Allows cycling through candidates
(corfu-min-width 25)
(corfu-auto-delay 0.2)
:init
(+hook-once! prog-mode-hook (global-corfu-mode 1))
:config
(defun +corfu-enable-in-minibuffer-h ()
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
Expand Down
11 changes: 7 additions & 4 deletions modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
(use-package treesit-auto
:straight (:host github :repo "renzmann/treesit-auto")
:when (+emacs-features-p 'tree-sitter)
:hook (minemacs-after-startup . global-treesit-auto-mode)
:hook (minemacs-first-file . +treesit-enable-available-grammars-on-normal-modes)
:hook (minemacs-build-functions . treesit-auto-install-all)
:commands global-treesit-auto-mode
:custom
(treesit-auto-install 'prompt)
:init
(+hook-once! prog-mode-hook
(global-treesit-auto-mode 1)
(+treesit-enable-available-grammars-on-normal-modes))
:config
(setq treesit-auto-langs (append treesit-auto-langs '(xml elisp))
treesit-auto-recipe-list
Expand Down Expand Up @@ -60,7 +63,7 @@
:after evil
:init
;; Require the package on the first `prog-mode' file
(+hook-once! prog-mode-hook (with-eval-after-load 'evil (require 'evil-textobj-tree-sitter)))
(+hook-once! prog-mode-hook (require 'evil-textobj-tree-sitter))
:config
;; Goto start of next function
(define-key evil-normal-state-map (kbd "]f") (+cmdfy! (evil-textobj-tree-sitter-goto-textobj "function.outer")))
Expand Down Expand Up @@ -191,7 +194,7 @@ Fall back to the default `citre--project-root'."
(use-package clink
:straight (:host github :repo "abougouffa/clink.el")
:when (+emacs-features-p 'sqlite3)
:hook (minemacs-first-file . global-clink-mode))
:hook (minemacs-first-c/c++-file . global-clink-mode))

(use-package rtags
:straight t)
Expand Down

0 comments on commit d97542e

Please sign in to comment.