From 48afb56d36eb89b4084fd230070255d4a95f1b36 Mon Sep 17 00:00:00 2001 From: KJ Date: Fri, 26 Apr 2024 01:24:39 -0400 Subject: [PATCH] Improve emacs startup. --- configs/init-packages.el | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/configs/init-packages.el b/configs/init-packages.el index dfe11bb..43635b6 100644 --- a/configs/init-packages.el +++ b/configs/init-packages.el @@ -45,6 +45,15 @@ :defer t :init (dashboard-setup-startup-hook) + :hook + (dashboard-after-initialize . (lambda () + "Refrescamos el dashboard con la agenda luego de cargar todo" + (setq dashboard-items '( + ;; (recents . 10) + (agenda . 10) + )) + (dashboard-refresh-buffer) + )) :config (setq dashboard-set-file-icons t dashboard-set-heading-icons t @@ -53,10 +62,7 @@ dashboard-agenda-time-string-format "%Y-%m-%d %H:%M") (setq dashboard-startup-banner (expand-file-name "duck.svg" user-emacs-directory)) - (setq dashboard-items '( - (agenda . 10) - ;;(recents . 10) - )) + (setq dashboard-items '()) ) ;; Coloca en emacs la documentacón distribuída por devdocs.io @@ -301,12 +307,13 @@ :defer t :ensure nil :bind ("C-x C-r" . recentf-open-files) + :hook + (elpaca-after-init . recentf-mode) :config (setq recentf-save-file (recentf-expand-file-name (concat temp-dir "/recentf")) recentf-max-saved-items 1000 - recentf-max-menu-items 500) - (recentf-mode 1)) + recentf-max-menu-items 500)) ;; Busqueda rápida con ripgrep (use-package rg @@ -324,9 +331,12 @@ ;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir. (use-package saveplace :ensure nil - :init - (setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))) - (save-place-mode 1) + :defer t + :hook + (elpaca-after-init . (lambda() + (setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))) + (save-place-mode 1) + )) ) ;; Paquete para crear imágens (solo lo uso para sacar capturas SVG de emacs)