From 0b554b27d3d568d8ddebe60d13ec9b8f19dc2bb2 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Fri, 16 Apr 2021 12:01:52 -0500 Subject: [PATCH] Enable :ensure t globally for use-package statements. --- .emacs.d/config.org | 44 +++++++++++++------------------------------- .emacs.d/init.el | 2 +- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/.emacs.d/config.org b/.emacs.d/config.org index 476ffef..a32cfd7 100644 --- a/.emacs.d/config.org +++ b/.emacs.d/config.org @@ -72,17 +72,19 @@ This is my personal Emacs config. I patterned my config to mimic Doom Emacs, wh #+end_src ** Installing use-package +Install use-package and enable ':ensure t' globally. The ':ensure' keyword causes the package(s) within use-package statements to be installed automatically if not already present on your system. To avoid having to add ':ensure t' to every use-package statement in this config, I set 'use-package-always-ensure'. + #+begin_src emacs-lisp (unless (package-installed-p 'use-package) (package-install 'use-package)) +(setq use-package-always-ensure t) #+end_src * ALL THE ICONS This is an icon set that can be used with dashboard, dired, ibuffer and other Emacs programs. #+begin_src emacs-lisp -(use-package all-the-icons - :ensure t) +(use-package all-the-icons) #+end_src * GENERAL KEYBINDINGS @@ -90,7 +92,6 @@ General.el allows us to set keybindings. As a longtime Doom Emacs user, I have #+begin_src emacs-lisp (use-package general - :ensure t ;; install general if not installed :config (general-evil-setup t)) @@ -129,7 +130,6 @@ Emacs Dashboard is an extensible startup screen showing you recent files, bookma ** Configuring Dashboard #+begin_src emacs-lisp (use-package dashboard - :ensure t ;; install dashboard if not installed :init ;; tweak dashboard config before loading it (setq dashboard-set-heading-icons t) (setq dashboard-set-file-icons t) @@ -159,7 +159,6 @@ This setting ensures that emacsclient always opens on *dashboard* rather than *s #+begin_src emacs-lisp (use-package evil - :ensure t ;; install evil if not installed :init ;; tweak evil's configuration before loading it (setq evil-want-integration t) ;; This is optional since it's already set to t by default. (setq evil-want-keybinding nil) @@ -168,7 +167,6 @@ This setting ensures that emacsclient always opens on *dashboard* rather than *s (evil-mode)) (use-package evil-collection :after evil - :ensure t :config (evil-collection-init)) #+end_src @@ -178,7 +176,6 @@ Though 'recentf' is one way to find recent files although I prefer using 'counse #+begin_src emacs-lisp (use-package recentf - :ensure t :config (recentf-mode)) #+end_src @@ -197,12 +194,9 @@ Dired is the file manager within Emacs. Below, I setup keybindings for image pr | (in peep-dired-mode) peep-dired-prev-file | /Move to previous file in peep-dired-mode/ | k | #+begin_src emacs-lisp -(use-package all-the-icons-dired -:ensure t) -(use-package dired-open -:ensure t) -(use-package peep-dired -:ensure t) +(use-package all-the-icons-dired) +(use-package dired-open) +(use-package peep-dired) (nvmap :prefix "SPC" "d d" '(dired :which-key "Open dired") "d j" '(dired-jump :which-key "Dired jump to current")) @@ -291,11 +285,9 @@ Ivy is a generic completion mechanism for Emacs. #+begin_src emacs-lisp (use-package counsel - :ensure t :after ivy :config (counsel-mode)) (use-package ivy - :ensure t :defer 0.1 :diminish :bind (("C-c C-r" . ivy-resume) @@ -305,7 +297,6 @@ Ivy is a generic completion mechanism for Emacs. (ivy-use-virtual-buffers t) :config (ivy-mode)) (use-package ivy-rich - :ensure t :after ivy :custom (ivy-virtual-abbreviate 'full @@ -315,7 +306,6 @@ Ivy is a generic completion mechanism for Emacs. (ivy-set-display-transformer 'ivy-switch-buffer 'ivy-rich-switch-buffer-transformer)) (use-package swiper - :ensure t :after ivy :bind (("C-s" . swiper) ("C-r" . swiper))) @@ -339,7 +329,6 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist' #+begin_src emacs-lisp (use-package ivy-posframe - :ensure t :init (setq ivy-posframe-display-functions-alist '((swiper . ivy-posframe-display-at-point) @@ -365,18 +354,15 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist' Adding packages for programming langauges, so we can have nice things like syntax highlighting. #+begin_src emacs-lisp -(use-package haskell-mode - :ensure t) +(use-package haskell-mode) #+end_src * MAGIT A git client for Emacs. Often cited as a killer feature for Emacs. #+begin_src emacs-lisp -(use-package magit - :ensure t) +(use-package magit) (use-package magit-todos - :ensure t :config (magit-todos-mode)) #+end_src @@ -404,8 +390,7 @@ Org Mode is THE killer feature within Emacs. But it does need some tweaking. Org-bullets gives us attractive bullets rather asterisks. #+begin_src emacs-lisp -(use-package org-bullets - :ensure t) +(use-package org-bullets) (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) #+end_src @@ -456,7 +441,8 @@ Org-tempo is a package that allows for '