Skip to content

Instantly share code, notes, and snippets.

@renaudll
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save renaudll/f9585049c90fd79abb10 to your computer and use it in GitHub Desktop.

Select an option

Save renaudll/f9585049c90fd79abb10 to your computer and use it in GitHub Desktop.
.emacs
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(elpy-enable)
;;
;; Package auto-install
;;
(defvar local-packages '(projectile auto-complete epc jedi))
(defun uninstalled-packages (packages)
(delq nil
(mapcar (lambda (p)
(if (package-installed-p p nil) nil p))
packages)))
(let ((need-to-install
(uninstalled-packages local-packages)))
(when need-to-install
(progn
(package-refresh-contents)
(dolist (p need-to-install)
(package-install p)))))
;;
;; Smex extension
;;
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;; This is your old M-x.
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
;;
;; Projectile setup
;;
(require 'projectile)
(projectile-global-mode)
;;
;; Setup auto-complete
;;
(require 'auto-complete-config)
(ac-config-default)
;; For jedi to function, please run the following commands:
;; pip install jedi elpy argparse flake8 magicimport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment