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
** 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 '<s' followed by TAB to expand to a begin
| <v | '#+BEGIN_VERSE' … '#+END_VERSE' |
#+begin_src emacs-lisp
(use-package org-tempo)
(use-package org-tempo
:ensure nil)
#+end_src
** 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
(use-package toc-org
:ensure t
:commands toc-org-enable
:init (add-hook 'org-mode-hook 'toc-org-enable))
#+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
#+begin_src emacs-lisp
(use-package projectile
:ensure t
:config
(projectile-global-mode 1))
#+end_src
@ -506,7 +490,6 @@ Eshell is an Emacs 'shell' that is written in Elisp.
#+begin_src emacs-lisp
(use-package eshell-syntax-highlighting
:after esh-mode
:ensure t ;; Install if not already installed.
:config
(eshell-syntax-highlighting-global-mode +1))
(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.
#+begin_src emacs-lisp
(use-package vterm
:ensure t)
(use-package vterm)
(setq shell-file-name "/bin/fish"
vterm-max-scrollback 5000)
#+end_src

View File

@ -9,7 +9,7 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(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 was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.