Skip to content

Instantly share code, notes, and snippets.

@victorolinasc
Created January 12, 2020 17:43
Show Gist options
  • Save victorolinasc/81eabe27e65abc7393fded79588e81f6 to your computer and use it in GitHub Desktop.
Save victorolinasc/81eabe27e65abc7393fded79588e81f6 to your computer and use it in GitHub Desktop.
Emacs package source initialization
; Make availble package functions
(require 'package)
; add a new package source
(customize-set-variable 'package-archives
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")))
; Initializes package list
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; Only evaluate this when compiling this file
(eval-when-compile
; For each package on the list do
(dolist (package '(use-package diminish bind-key))
; Install if not yet installed
(unless (package-installed-p package)
(package-install package))
; Require package making it available on the rest of the configuration
(require package)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment