1. ;; elpa
  2. (when (>= emacs-major-version 24)
  3. (require 'package)
  4. (setq package-archives '(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
  5. ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
  6. (package-initialize))
  7. ;; 你可以将你需要的插件名字写在 my/packages 中,Emacs 在启动时会自动下载未被安装 的插件
  8. ;; cl - Common Lisp Extension
  9. (require 'cl)
  10. ;; Add Packages
  11. (defvar my/packages '(
  12. ;; --- Auto-completion ---
  13. company
  14. ;; --- Better Editor ---
  15. hungry-delete
  16. swiper
  17. counsel
  18. smartparens
  19. slime
  20. ;; --- Major Mode ---
  21. js2-mode
  22. ;; --- Minor Mode ---
  23. nodejs-repl
  24. exec-path-from-shell
  25. ;; --- Themes ---
  26. monokai-theme
  27. ;; solarized-theme
  28. ) "Default packages")
  29. (setq package-selected-packages my/packages)
  30. (defun my/packages-installed-p ()
  31. (loop for pkg in my/packages
  32. when (not (package-installed-p pkg)) do (return nil)
  33. finally (return t)))
  34. (unless (my/packages-installed-p)
  35. (message "%s" "Refreshing package database...")
  36. (package-refresh-contents)
  37. (dolist (pkg my/packages)
  38. (when (not (package-installed-p pkg))
  39. (package-install pkg))))
  40. ;; 开启全局 Company 补全
  41. (global-company-mode 1)
  42. ;; Emacs 提供的默认 JavaScript Major Mode 并不是非常好用。所以我们可以将默认的模式 替换成 js2-mode 一个比默认模式好用的 Major Mode
  43. ;;(setq auto-mode-alist
  44. ;; (append
  45. ;; '(("\\.js\\'" . js2-mode))
  46. ;; auto-mode-alist))
  47. ;; Set your lisp system and, optionally, some contribs
  48. (setq inferior-lisp-program "d:/dev/sbcl/sbcl.exe")
  49. (require 'slime)
  50. (setq slime-contribs '(slime-fancy))
  51. (provide 'init-elpa)
文档更新时间: 2019-07-25 02:56   作者:admin