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.

100 lines
2.9 KiB

  1. ;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks.
  2. ;;
  3. ;; Copyright (c) 2011 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar.batsov@gmail.com>
  6. ;; URL: http://www.emacswiki.org/cgi-bin/wiki/Prelude
  7. ;; Version: 1.0.0
  8. ;; Keywords: convenience
  9. ;; This file is not part of GNU Emacs.
  10. ;;; Commentary:
  11. ;; We dispense with most of the point and click UI, reduce the startup noise,
  12. ;; configure smooth scolling and a nice theme that's easy on the eyes (zenburn).
  13. ;;; License:
  14. ;; This program is free software; you can redistribute it and/or
  15. ;; modify it under the terms of the GNU General Public License
  16. ;; as published by the Free Software Foundation; either version 3
  17. ;; of the License, or (at your option) any later version.
  18. ;;
  19. ;; This program is distributed in the hope that it will be useful,
  20. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;; GNU General Public License for more details.
  23. ;;
  24. ;; You should have received a copy of the GNU General Public License
  25. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  26. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  27. ;; Boston, MA 02110-1301, USA.
  28. ;;; Code:
  29. ;; customization
  30. (defgroup ui nil
  31. "Emacs Prelude UI"
  32. :group 'prelude)
  33. (defcustom prelude-use-minimalistic-ui t
  34. "If set to true Prelude will dispense of most the UI that's mouse related -
  35. menu bar, tool bar, etc"
  36. :type 'boolean
  37. :group 'ui)
  38. (defcustom prelude-use-smooth-scrolling t
  39. "Overrides the default scrolling behavior with a much more common one."
  40. :type 'boolean
  41. :group 'ui)
  42. (defcustom prelude-use-default-prelude-theme t
  43. "If set to true Prelude will load up its default theme (Zenburn),
  44. instead of Emacs's default theme."
  45. :type 'boolean
  46. :group 'ui)
  47. (defcustom prelude-enhance-modeline t
  48. "If set to true Prelude will augment the default modeline settings."
  49. :type 'boolean
  50. :group 'ui)
  51. (when prelude-use-minimalistic-ui
  52. ;; the toolbar is just a waste of valuable screen estate
  53. (tool-bar-mode -1)
  54. ;; the menu bar is mostly useless as well
  55. ;; but removing it under OS X doesn't make much sense
  56. (unless (string= system-type "darwin")
  57. (menu-bar-mode -1))
  58. ;; the blinking cursor is nothing, but an annoyance
  59. (blink-cursor-mode -1)
  60. ;; disable startup screen
  61. (setq inhibit-startup-screen t))
  62. (when prelude-use-smooth-scrolling
  63. ;; nice scrolling
  64. (setq scroll-margin 0
  65. scroll-conservatively 100000
  66. scroll-preserve-screen-position 1))
  67. (when prelude-enhance-modeline
  68. ;; mode line settings
  69. (line-number-mode t)
  70. (column-number-mode t)
  71. (size-indication-mode t))
  72. ;; enable y/n answers
  73. (fset 'yes-or-no-p 'y-or-n-p)
  74. ;; custom Emacs 24 color themes support
  75. (add-to-list 'custom-theme-load-path (concat prelude-dir "themes/"))
  76. (when prelude-use-default-prelude-theme
  77. (load-theme 'zenburn t))
  78. (provide 'prelude-ui)
  79. ;;; prelude-ui.el ends here