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.

87 lines
2.6 KiB

  1. ;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks.
  2. ;;
  3. ;; Copyright © 2011-2020 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: https://github.com/bbatsov/prelude
  7. ;; This file is not part of GNU Emacs.
  8. ;;; Commentary:
  9. ;; We dispense with most of the point and click UI, reduce the startup noise,
  10. ;; configure smooth scolling and a nice theme that's easy on the eyes (zenburn).
  11. ;;; License:
  12. ;; This program is free software; you can redistribute it and/or
  13. ;; modify it under the terms of the GNU General Public License
  14. ;; as published by the Free Software Foundation; either version 3
  15. ;; of the License, or (at your option) any later version.
  16. ;;
  17. ;; This program is distributed in the hope that it will be useful,
  18. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;; GNU General Public License for more details.
  21. ;;
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  24. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. ;; Boston, MA 02110-1301, USA.
  26. ;;; Code:
  27. ;; the toolbar is just a waste of valuable screen estate
  28. ;; in a tty tool-bar-mode does not properly auto-load, and is
  29. ;; already disabled anyway
  30. (when (fboundp 'tool-bar-mode)
  31. (tool-bar-mode -1))
  32. (when prelude-minimalistic-ui
  33. (menu-bar-mode -1))
  34. ;; the blinking cursor is nothing, but an annoyance
  35. (blink-cursor-mode -1)
  36. ;; disable the annoying bell ring
  37. (setq ring-bell-function 'ignore)
  38. ;; disable startup screen
  39. (setq inhibit-startup-screen t)
  40. ;; nice scrolling
  41. (setq scroll-margin 0
  42. scroll-conservatively 100000
  43. scroll-preserve-screen-position 1)
  44. ;; mode line settings
  45. (line-number-mode t)
  46. (column-number-mode t)
  47. (size-indication-mode t)
  48. ;; show line numbers at the beginning of each line
  49. (unless prelude-minimalistic-ui
  50. ;; there's a built-in linum-mode, but we're using
  51. ;; nlinum-mode, as it's supposedly faster
  52. (global-nlinum-mode t))
  53. ;; enable y/n answers
  54. (fset 'yes-or-no-p 'y-or-n-p)
  55. ;; more useful frame title, that show either a file or a
  56. ;; buffer name (if the buffer isn't visiting a file)
  57. (setq frame-title-format
  58. '("" invocation-name " Prelude - " (:eval (if (buffer-file-name)
  59. (abbreviate-file-name (buffer-file-name))
  60. "%b"))))
  61. ;; use zenburn as the default theme
  62. (when prelude-theme
  63. (load-theme prelude-theme t))
  64. ;; show available keybindings after you start typing
  65. (require 'which-key)
  66. (which-key-mode +1)
  67. (provide 'prelude-ui)
  68. ;;; prelude-ui.el ends here