Last active
May 7, 2020 09:38
-
-
Save vicente-gonzalez-ruiz/bfd9dfcaf138d51d8b7c05919eb2b0f7 to your computer and use it in GitHub Desktop.
Emacs + MELPA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://realpython.com/emacs-the-best-python-editor/ | |
# https://melpa.org/#/getting-started | |
cat > $HOME/.emacs << EOF | |
;; =================================== | |
;; MELPA Package Support | |
;; =================================== | |
;; Enables basic packaging support | |
(require 'package) | |
;; Adds the Melpa archive to the list of available repositories | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) | |
;; Initializes the package infrastructure | |
(package-initialize) | |
;; If there are no archived package contents, refresh them | |
(when (not package-archive-contents) | |
(package-refresh-contents)) | |
;; Installs packages | |
;; | |
;; myPackages contains a list of package names | |
(defvar myPackages | |
'(better-defaults ;; Set up some better Emacs defaults | |
material-theme ;; Theme | |
) | |
) | |
;; Scans the list in myPackages | |
;; If the package listed is not already installed, install it | |
(mapc #'(lambda (package) | |
(unless (package-installed-p package) | |
(package-install package))) | |
myPackages) | |
;; =================================== | |
;; Basic Customization | |
;; =================================== | |
(setq inhibit-startup-message t) ;; Hide the startup message | |
(load-theme 'material t) ;; Load material theme | |
(global-linum-mode t) ;; Enable line numbers globally | |
;; User-Defined init.el ends here | |
EOF | |
# Run in emacs: | |
M-x package-refresh-contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment