Skip to content

Instantly share code, notes, and snippets.

@leoandeol
Last active October 20, 2020 23:15
;; ===================================
;; 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)
;; Refresh packages
(package-refresh-contents)
;; Installs packages
;; myPackages contains a list of package names
;; Set up some better Emacs defaults
(defvar myPackages
'(better-defaults
elpy ;; emacs lisp python
ein ;; emacs ipython notebook
flycheck ;; on the fly syntax check
blacken ;; black formatting on save
magit ;;git integration
zenburn-theme ;; theme soft for the eye
)
)
;; 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
(setq elpy-rpc-python-command "python3")
(load-theme 'zenburn t)
(global-linum-mode t) ;; Enable line numbers globally
;; ====================================
;; Development Setup
;; ====================================
;; Enable elpy
(elpy-enable)
;; Use IPython for REPL
(setq elpy-shell-echo-output nil
python-shell-interpreter "jupyter"
python-shell-interpreter-args "console --simple-prompt"
python-shell-prompt-detect-failure-warning nil)
(add-to-list 'python-shell-completion-native-disabled-interpreters
"jupyter")
;; Enable Flycheck
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode))
;; Enable blacken
(add-hook 'elpy-mode-hook 'blacken-mode)
;; User-Defined init.el ends here
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ein:output-area-inlined-images t)
'(elpy-rpc-python-command "python3")
'(mailcap-user-mime-data nil)
'(package-selected-packages (quote (doom-themes ein blacken better-defaults elpy))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment