Enable :ensure t globally for use-package statements.

This commit is contained in:
Derek Taylor
2021-04-16 12:01:52 -05:00
parent 9c262470a4
commit 0b554b27d3
2 changed files with 14 additions and 32 deletions

View File

@@ -72,17 +72,19 @@ This is my personal Emacs config. I patterned my config to mimic Doom Emacs, wh
#+end_src #+end_src
** Installing use-package ** 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 #+begin_src emacs-lisp
(unless (package-installed-p 'use-package) (unless (package-installed-p 'use-package)
(package-install 'use-package)) (package-install 'use-package))
(setq use-package-always-ensure t)
#+end_src #+end_src
* ALL THE ICONS * ALL THE ICONS
This is an icon set that can be used with dashboard, dired, ibuffer and other Emacs programs. This is an icon set that can be used with dashboard, dired, ibuffer and other Emacs programs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package all-the-icons (use-package all-the-icons)
:ensure t)
#+end_src #+end_src
* GENERAL KEYBINDINGS * 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 #+begin_src emacs-lisp
(use-package general (use-package general
:ensure t ;; install general if not installed
:config :config
(general-evil-setup t)) (general-evil-setup t))
@@ -129,7 +130,6 @@ Emacs Dashboard is an extensible startup screen showing you recent files, bookma
** Configuring Dashboard ** Configuring Dashboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package dashboard (use-package dashboard
:ensure t ;; install dashboard if not installed
:init ;; tweak dashboard config before loading it :init ;; tweak dashboard config before loading it
(setq dashboard-set-heading-icons t) (setq dashboard-set-heading-icons t)
(setq dashboard-set-file-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 #+begin_src emacs-lisp
(use-package evil (use-package evil
:ensure t ;; install evil if not installed
:init ;; tweak evil's configuration before loading it :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-integration t) ;; This is optional since it's already set to t by default.
(setq evil-want-keybinding nil) (setq evil-want-keybinding nil)
@@ -168,7 +167,6 @@ This setting ensures that emacsclient always opens on *dashboard* rather than *s
(evil-mode)) (evil-mode))
(use-package evil-collection (use-package evil-collection
:after evil :after evil
:ensure t
:config :config
(evil-collection-init)) (evil-collection-init))
#+end_src #+end_src
@@ -178,7 +176,6 @@ Though 'recentf' is one way to find recent files although I prefer using 'counse
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package recentf (use-package recentf
:ensure t
:config :config
(recentf-mode)) (recentf-mode))
#+end_src #+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 | | (in peep-dired-mode) peep-dired-prev-file | /Move to previous file in peep-dired-mode/ | k |
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package all-the-icons-dired (use-package all-the-icons-dired)
:ensure t) (use-package dired-open)
(use-package dired-open (use-package peep-dired)
:ensure t)
(use-package peep-dired
:ensure t)
(nvmap :prefix "SPC" (nvmap :prefix "SPC"
"d d" '(dired :which-key "Open dired") "d d" '(dired :which-key "Open dired")
"d j" '(dired-jump :which-key "Dired jump to current")) "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 #+begin_src emacs-lisp
(use-package counsel (use-package counsel
:ensure t
:after ivy :after ivy
:config (counsel-mode)) :config (counsel-mode))
(use-package ivy (use-package ivy
:ensure t
:defer 0.1 :defer 0.1
:diminish :diminish
:bind (("C-c C-r" . ivy-resume) :bind (("C-c C-r" . ivy-resume)
@@ -305,7 +297,6 @@ Ivy is a generic completion mechanism for Emacs.
(ivy-use-virtual-buffers t) (ivy-use-virtual-buffers t)
:config (ivy-mode)) :config (ivy-mode))
(use-package ivy-rich (use-package ivy-rich
:ensure t
:after ivy :after ivy
:custom :custom
(ivy-virtual-abbreviate 'full (ivy-virtual-abbreviate 'full
@@ -315,7 +306,6 @@ Ivy is a generic completion mechanism for Emacs.
(ivy-set-display-transformer 'ivy-switch-buffer (ivy-set-display-transformer 'ivy-switch-buffer
'ivy-rich-switch-buffer-transformer)) 'ivy-rich-switch-buffer-transformer))
(use-package swiper (use-package swiper
:ensure t
:after ivy :after ivy
:bind (("C-s" . swiper) :bind (("C-s" . swiper)
("C-r" . swiper))) ("C-r" . swiper)))
@@ -339,7 +329,6 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist'
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ivy-posframe (use-package ivy-posframe
:ensure t
:init :init
(setq ivy-posframe-display-functions-alist (setq ivy-posframe-display-functions-alist
'((swiper . ivy-posframe-display-at-point) '((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. Adding packages for programming langauges, so we can have nice things like syntax highlighting.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package haskell-mode (use-package haskell-mode)
:ensure t)
#+end_src #+end_src
* MAGIT * MAGIT
A git client for Emacs. Often cited as a killer feature for Emacs. A git client for Emacs. Often cited as a killer feature for Emacs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package magit (use-package magit)
:ensure t)
(use-package magit-todos (use-package magit-todos
:ensure t
:config (magit-todos-mode)) :config (magit-todos-mode))
#+end_src #+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. Org-bullets gives us attractive bullets rather asterisks.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-bullets (use-package org-bullets)
:ensure t)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src #+end_src
@@ -456,7 +441,8 @@ Org-tempo is a package that allows for '<s' followed by TAB to expand to a begin
| <v | '#+BEGIN_VERSE' … '#+END_VERSE' | | <v | '#+BEGIN_VERSE' … '#+END_VERSE' |
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-tempo) (use-package org-tempo
:ensure nil)
#+end_src #+end_src
** Source Code Block Syntax Highlighting ** Source Code Block Syntax Highlighting
@@ -474,7 +460,6 @@ Toc-org helps you to have an up-to-date table of contents in org files without e
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package toc-org (use-package toc-org
:ensure t
:commands toc-org-enable :commands toc-org-enable
:init (add-hook 'org-mode-hook 'toc-org-enable)) :init (add-hook 'org-mode-hook 'toc-org-enable))
#+end_src #+end_src
@@ -482,7 +467,6 @@ Toc-org helps you to have an up-to-date table of contents in org files without e
* PROJECTILE * PROJECTILE
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package projectile (use-package projectile
:ensure t
:config :config
(projectile-global-mode 1)) (projectile-global-mode 1))
#+end_src #+end_src
@@ -506,7 +490,6 @@ Eshell is an Emacs 'shell' that is written in Elisp.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eshell-syntax-highlighting (use-package eshell-syntax-highlighting
:after esh-mode :after esh-mode
:ensure t ;; Install if not already installed.
:config :config
(eshell-syntax-highlighting-global-mode +1)) (eshell-syntax-highlighting-global-mode +1))
(setq eshell-aliases-file "~/.config/doom/aliases" (setq eshell-aliases-file "~/.config/doom/aliases"
@@ -522,8 +505,7 @@ Eshell is an Emacs 'shell' that is written in Elisp.
Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer. Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package vterm (use-package vterm)
:ensure t)
(setq shell-file-name "/bin/fish" (setq shell-file-name "/bin/fish"
vterm-max-scrollback 5000) vterm-max-scrollback 5000)
#+end_src #+end_src

View File

@@ -9,7 +9,7 @@
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(package-selected-packages '(package-selected-packages
'(all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel))) '(org-tempo all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.