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.

125 lines
3.5 KiB

  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** To use a non-built-in theme, like [Solarized](https://github.com/bbatsov/zenburn-emacs),
  23. you'll have to install it from MELPA first by `M-x package-install RET solarized-theme`. Then add
  24. ``` lisp
  25. (setq prelude-theme 'solarized-dark)
  26. ```
  27. in `personal/preload`.
  28. Finally, if you don't want any theme at all, you can add this to your
  29. `personal/preload`:
  30. ```lisp
  31. (setq prelude-theme nil)
  32. ```
  33. ## Personalizing
  34. All files you create under the `personal/` directory are yours for
  35. personalization. There is no single special personal config file --
  36. any files you create in the `personal/` directory will be loaded in
  37. lexicographical order. The overall loading precedence is:
  38. 1. `personal/preload/*`
  39. 2. `core/`
  40. 3. `prelude-modules.el`
  41. 4. `personal/*`
  42. #### Personalization Example
  43. Suppose you want to configure `go-mode` to autoformat on each save. You
  44. can create a file in `personal/`, let's call this one
  45. `config-go-mode.el` and add the following to it.
  46. ``` emacs-lisp
  47. (add-hook 'go-mode-hook
  48. (lambda ()
  49. (add-hook 'before-save-hook 'gofmt-before-save)
  50. (setq tab-width 2)))
  51. ```
  52. #### Tips
  53. **Fork** (instead of cloning) the official Prelude repo and add your
  54. own touch to it. You're advised to **avoid changing stuff outside of
  55. the personal folder** to avoid having to deal with git merge conflicts
  56. in the future.
  57. If you'd like to add some auto installation of packages in your
  58. personal config use the following code:
  59. ```lisp
  60. (prelude-require-packages '(some-package some-other-package))
  61. ```
  62. If you require just a single package you can also use:
  63. ```lisp
  64. (prelude-require-package 'some-package)
  65. ```
  66. ### Preloading personal config
  67. Sometimes you might want to load code before Prelude has started loading. Prelude will automatically preload all
  68. Emacs Lisp files in your `personal/preload` directory. Note that at this point you can't using anything from
  69. Prelude, except a few variables like `prelude-dir`, etc (since nothing is yet loaded).
  70. ### Disabling whitespace-mode
  71. Although `whitespace-mode` is awesome, some people might find it too
  72. intrusive. You can disable it in your
  73. personal config with the following bit of code:
  74. ```lisp
  75. (setq prelude-whitespace nil)
  76. ```
  77. If you like `whitespace-mode`, but prefer it to not automatically
  78. cleanup your file on save, you can disable that behavior by setting
  79. `prelude-clean-whitespace-on-save` to `nil` in your config file with:
  80. ```lisp
  81. (setq prelude-clean-whitespace-on-save nil)
  82. ```
  83. The `prelude-clean-whitespace-on-save` setting can also be set on a
  84. per-file or directory basis by using a file variable or a
  85. `.dir-locals.el` file.
  86. ### Disable flyspell-mode
  87. If you're not fond of spellchecking on the fly:
  88. ```lisp
  89. (setq prelude-flyspell nil)
  90. ```