赞
踩
M-x package-install [RET] package-name
(add-to-list 'load-path "~/.emacs.d/lisp")
注:其中的my/packages中的my可以被替代为你的名字
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t))
;; cl - Common Lisp Extension
(require 'cl)
;; Add Packages
(defvar my/packages '(
;;packages
;;for example I want to install company, then simply add it to the list
company
) "Default packages")
(setq package-selected-packages my/packages)
(defun my/packages-installed-p ()
(loop for pkg in my/packages
when (not (package-installed-p pkg)) do (return nil)
finally (return t)))
(unless (my/packages-installed-p)
(message "%s" "Refreshing package database...")
(package-refresh-contents)
(dolist (pkg my/packages)
(when (not (package-installed-p pkg))
(package-install pkg))))
;; Find Executable Path on OS X
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
将要安装的包添加到列表中,在下次的启动开始时将会进行下载
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。