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.

127 lines
3.6 KiB

7 years ago
7 years ago
  1. # Configuration
  2. ## Color Themes
  3. Emacs provides a dozen of
  4. built-in themes you can use out-of-the-box by invoking the `M-x
  5. load-theme` command.
  6. [Zenburn](https://github.com/bbatsov/zenburn-emacs) is the default
  7. color theme in Prelude, but you can change it at your discretion. Why
  8. Zenburn? I (and lots of hackers around the world) find it pretty neat
  9. for some reason. Personally I find the default theme pretty tiresome
  10. for the eyes, that's why I took that "controversial" decision to
  11. replace it. You can, of course, easily go back to the default (or
  12. select another theme entirely).
  13. To disable Zenburn just put in your personal config the following
  14. line:
  15. ```lisp
  16. (disable-theme 'zenburn)
  17. ```
  18. Or you can use another theme altogether by adding something in `personal/preload` like:
  19. ```lisp
  20. (setq prelude-theme 'tango)
  21. ```
  22. !!! Note
  23. To use a non-built-in theme, like [Solarized](https://github.com/bbatsov/solarized-emacs),
  24. you'll have to install it from MELPA first by `M-x package-install RET solarized-theme`. Then add
  25. ``` lisp
  26. (setq prelude-theme 'solarized-dark)
  27. ```
  28. in `personal/preload`.
  29. Finally, if you don't want any theme at all, you can add this to your
  30. `personal/preload`:
  31. ```lisp
  32. (setq prelude-theme nil)
  33. ```
  34. ## Personalizing
  35. All files you create under the `personal/` directory are yours for
  36. personalization. There is no single special personal config file --
  37. any files you create in the `personal/` directory will be loaded in
  38. lexicographical order. The overall loading precedence is:
  39. 1. `personal/preload/*`
  40. 2. `core/`
  41. 3. `personal/prelude-modules.el` (or deprecated `prelude-modules.el`)
  42. 4. `personal/*`
  43. #### Personalization Example
  44. Suppose you want to configure `go-mode` to autoformat on each save. You
  45. can create a file in `personal/`, let's call this one
  46. `config-go-mode.el` and add the following to it.
  47. ``` emacs-lisp
  48. (add-hook 'go-mode-hook
  49. (lambda ()
  50. (add-hook 'before-save-hook 'gofmt-before-save)
  51. (setq tab-width 2)))
  52. ```
  53. #### Tips
  54. **Fork** (instead of cloning) the official Prelude repo and add your
  55. own touch to it. You're advised to **avoid changing stuff outside of
  56. the personal folder** to avoid having to deal with git merge conflicts
  57. in the future.
  58. If you'd like to add some auto installation of packages in your
  59. personal config use the following code:
  60. ```lisp
  61. (prelude-require-packages '(some-package some-other-package))
  62. ```
  63. If you require just a single package you can also use:
  64. ```lisp
  65. (prelude-require-package 'some-package)
  66. ```
  67. ### Preloading personal config
  68. Sometimes you might want to load code before Prelude has started loading. Prelude will automatically preload all
  69. Emacs Lisp files in your `personal/preload` directory. Note that at this point you can't using anything from
  70. Prelude, except a few variables like `prelude-dir`, etc (since nothing is yet loaded).
  71. ### Disabling whitespace-mode
  72. Although `whitespace-mode` is awesome, some people might find it too
  73. intrusive. You can disable it in your
  74. personal config with the following bit of code:
  75. ```lisp
  76. (setq prelude-whitespace nil)
  77. ```
  78. If you like `whitespace-mode`, but prefer it to not automatically
  79. cleanup your file on save, you can disable that behavior by setting
  80. `prelude-clean-whitespace-on-save` to `nil` in your config file with:
  81. ```lisp
  82. (setq prelude-clean-whitespace-on-save nil)
  83. ```
  84. The `prelude-clean-whitespace-on-save` setting can also be set on a
  85. per-file or directory basis by using a file variable or a
  86. `.dir-locals.el` file.
  87. ### Disable flyspell-mode
  88. If you're not fond of spellchecking on the fly:
  89. ```lisp
  90. (setq prelude-flyspell nil)
  91. ```