Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

231 lines
7.1 KiB

  1. # Installation
  2. ## Prerequisites
  3. Obviously to use the Emacs Prelude you have to install Emacs
  4. first. We'll assume you can manage this part on your own.
  5. Aim for the newest stable Emacs release, although as a rule of
  6. thumb Prelude aims to support the last 2-3 stable releases.
  7. For spell-checking to work you should install `aspell`, together with its
  8. dictionaries for the languages you wish to check.
  9. You'll also do well to install some of the following:
  10. * `git` (needed by Magit)
  11. * `ag` (`the_silver_searcher`) or `ripgrep` (Projectile has nice integration with them and they are much faster than `grep`)
  12. * your favorite lint tools (for Flycheck)
  13. All those tools are completely optional, though.
  14. !!! Note
  15. Additional external tools might be needed by some of the modules (e.g. tools specific to particular programming languages, etc).
  16. ## Installing Prelude
  17. ### Automated
  18. You can install Emacs Prelude via the command line with either `curl` or
  19. `wget`. Naturally `git` is also required.
  20. The installer script will do the following:
  21. * Clone Prelude's GitHub repo
  22. * Check your Emacs version
  23. * Backup any existing `.emacs` or `.emacs.d` you might have
  24. * Create any additional folders if necessary (e.g. for storing
  25. package-specific data)
  26. If you have a `.emacs` file it will backed up as `.emacs.pre-prelude`
  27. and if you have a `.emacs.d` folder, it will be backed up as
  28. `.emacs.d.pre-prelude.tar`.
  29. #### Via Curl
  30. If you're using `curl` type the following command:
  31. ```shellsession
  32. $ curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
  33. ```
  34. #### Via Wget
  35. If you're using `wget` type:
  36. ```shellsession
  37. $ wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh
  38. ```
  39. ### Manual
  40. Make sure you do not have any `~/.emacs` file or `~/.emacs.d` folder
  41. present.
  42. ```shellsession
  43. $ git clone https://github.com/bbatsov/prelude.git path/to/local/repo
  44. $ ln -s path/to/local/repo ~/.emacs.d
  45. $ cd ~/.emacs.d
  46. ```
  47. !!! Note
  48. If you are using Windows, you should check what Emacs thinks the `~` directory is by running Emacs
  49. and typing `C-x d ~/<RET>`, and then adjust the command appropriately.
  50. ### System-wide (site-wide)
  51. For a multi-user environment, as an admin, the customizations intended
  52. for all users go in the site-start file represented by the variable
  53. `site-run-file`, while single users will use their own init file
  54. represented by the variable `user-init-file`.
  55. If you have placed your Prelude directory in `/opt/prelude` then,
  56. append the following line to the `site-start.el`:
  57. ``` emacs-lisp
  58. (load "/opt/prelude/init.el")
  59. ```
  60. If you are using Emacs as a daemon process, with other users or daemon
  61. processes interacting with the Emacs daemon (e.g. Emacs is your window
  62. manager) then the `site-lisp` directory could be the right place to
  63. place your configuration files.
  64. ## Pinning packages
  65. By default, Prelude will install packages from the MELPA and GNU ELPA
  66. package repositories. Occasionally package integration can break when
  67. upgrading packages, as the packages in the MELPA repository are all
  68. snapshot builds. This can be avoided by pinning packages to stable
  69. versions in other repositories (e.g. MELPA Stable). To do so, copy
  70. `prelude-pinned-packages.el` from the sample directory to Prelude's
  71. root directory and adjust the
  72. [variables](https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html)
  73. inside accordingly.
  74. ## Enabling additional modules
  75. By default most of the modules that ship with Prelude are not
  76. loaded. For more information on the functionality provided by these
  77. modules visit the [docs](modules/index.md).
  78. ```lisp
  79. ;;; Uncomment the modules you'd like to use and restart Prelude afterwards
  80. ;;; General productivity tools
  81. ;; (require 'prelude-ido) ;; Supercharges Emacs completion for C-x C-f and more
  82. (require 'prelude-ivy) ;; A mighty modern alternative to ido
  83. ;; (require 'prelude-selectrum) ;; A powerful, yet simple, alternative to ivy
  84. ;; (require 'prelude-helm) ;; Interface for narrowing and search
  85. ;; (require 'prelude-helm-everywhere) ;; Enable Helm everywhere
  86. (require 'prelude-company)
  87. ;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
  88. ;;; Vim emulation
  89. ;;
  90. ;; Enable this module if you're fond of vim's keybindings.
  91. ;; (require 'prelude-evil)
  92. ;;; Org-mode (a legendary productivity tool that deserves its own category)
  93. ;;
  94. ;; Org-mode helps you keep TODO lists, notes and more.
  95. (require 'prelude-org)
  96. ;;; Programming languages support
  97. ;;
  98. ;; Modules for a few very common programming languages
  99. ;; are enabled by default.
  100. (require 'prelude-c)
  101. ;; (require 'prelude-clojure)
  102. ;; (require 'prelude-coffee)
  103. ;; (require 'prelude-common-lisp)
  104. (require 'prelude-css)
  105. ;; (require 'prelude-dart)
  106. (require 'prelude-emacs-lisp)
  107. ;; (require 'prelude-erlang)
  108. ;; (require 'prelude-elixir)
  109. ;; (require 'prelude-go)
  110. ;; (require 'prelude-haskell)
  111. (require 'prelude-js)
  112. ;; (require 'prelude-latex)
  113. (require 'prelude-lisp) ;; Common setup for Lisp-like languages
  114. (require 'prelude-lsp) ;; Base setup for the Language Server Protocol
  115. ;; (require 'prelude-lua)
  116. ;; (require 'prelude-ocaml)
  117. (require 'prelude-perl)
  118. ;; (require 'prelude-python)
  119. ;; (require 'prelude-racket)
  120. ;; (require 'prelude-ruby)
  121. ;; (require 'prelude-rust)
  122. ;; (require 'prelude-scala)
  123. ;; (require 'prelude-scheme)
  124. (require 'prelude-shell)
  125. ;; (require 'prelude-scss)
  126. ;; (require 'prelude-ts)
  127. (require 'prelude-web) ;; Emacs mode for web templates
  128. (require 'prelude-xml)
  129. (require 'prelude-yaml)
  130. ;;; Misc
  131. (require 'prelude-erc) ;; A popular Emacs IRC client (useful if you're still into Freenode)
  132. ```
  133. You'll need to adjust your `prelude-modules.el` file once the
  134. installation is done.
  135. In case of an automated installation, you'll find this file in the
  136. `personal` directory of your Emacs installation.
  137. If you are doing a manual install then you first need to copy the
  138. `prelude-modules.el` available in the sample directory to the root of
  139. `path/to/prelude/installation` and then adjust that one.
  140. After you've uncommented a module you should either restart Emacs or
  141. evaluate the module `require` expression with <kbd>C-x C-e</kbd>.
  142. ## Updating Prelude
  143. ### Automatic update
  144. Simply run <kbd>M-x prelude-update</kbd> from Emacs itself and restart
  145. Emacs afterwards.
  146. ### Manual update
  147. The update procedure is fairly straightforward and consists of 3
  148. steps:
  149. #### Update all bundled packages
  150. Just run <kbd>M-x package-list-packages RET U x</kbd>.
  151. !!! Note
  152. Technically speaking, this will update all the packages you've installed,
  153. not just those that were bundled with Prelude. That's fine most of the time.
  154. #### Update Prelude's code
  155. ```shellsession
  156. $ cd path/to/prelude/installation
  157. $ git pull
  158. ```
  159. The `path/to/prelude/installation` is usually `~/.emacs.d` (at least
  160. on Unix systems).
  161. #### Restart Prelude
  162. It's generally a good idea to stop Emacs after you do the update. The
  163. next time Prelude starts it will install any new dependencies (if
  164. there are such).
  165. ## Uninstalling Prelude
  166. Provided you've installed Prelude in `.emacs.d`, all you need to do is
  167. delete that folder. If you opted for the manual installation and
  168. making `.emacs.d` a symlink - you remove/update the link. Yeah, it's
  169. as simple as that. No fancy uninstaller required!