有多個emacs配置,或者說經常把emacs.d文件從一台機器復制到另一台上。每次都把.emacs.d文件都放到~/目錄下有點不方便了。
可以新建~/.emacs.d/init.el文件,輸入一下內容,指定配置文件的目錄即可
(package-initialize)
;;設置proxy
(setq url-proxy-services
'(("no_proxy" . "^\\(localhost\\|10.*\\)")
("http" . "usernaem:passwd@proxy.cnblogs.com")
("https" . "usernaem:passwd@proxy.cnblogs.com"))
;;elpa源 (setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/") ("melpa" . "http://elpa.emacs-china.org/melpa/")))
;;加載配置文件
(defconst user-emacs-directory (file-name-directory (file-chase-links (expand-file-name "~/zb_conf/emacs.d.purcell/" ))) "The giant turtle on which the world rests.") (load-file (expand-file-name "init.el" user-emacs-directory))
把"~/zb_conf/emacs.d.purcell/" 換成你的emacs.d的路徑。
windows下可能需要這種格式,例如放在D盤下,則用“//?/d:/emacs.d/”