emacs-prelude/core/prelude-ui.el

95 lines
2.9 KiB
EmacsLisp
Raw Normal View History

2011-10-08 23:05:06 +03:00
;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks.
;;
2023-02-24 08:57:29 +02:00
;; Copyright © 2011-2023 Bozhidar Batsov
2011-10-08 23:05:06 +03:00
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
2013-03-07 09:57:33 +02:00
;; URL: https://github.com/bbatsov/prelude
2011-10-08 23:05:06 +03:00
;; This file is not part of GNU Emacs.
;;; Commentary:
;; We dispense with most of the point and click UI, reduce the startup noise,
2024-08-23 01:15:37 +03:00
;; configure smooth scolling and a nice theme that's easy on the eyes (monokai).
2011-10-08 23:05:06 +03:00
;;; License:
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;; the toolbar is just a waste of valuable screen estate
;; in a tty tool-bar-mode does not properly auto-load, and is
;; already disabled anyway
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
2012-06-08 16:50:34 +03:00
2020-09-15 11:11:23 +03:00
(when prelude-minimalistic-ui
(menu-bar-mode -1))
;; the blinking cursor is nothing, but an annoyance
(blink-cursor-mode -1)
2016-02-14 12:08:33 +02:00
;; disable the annoying bell ring
(setq ring-bell-function 'ignore)
;; disable startup screen
(setq inhibit-startup-screen t)
;; nice scrolling
(setq scroll-margin 0
scroll-conservatively 100000
scroll-preserve-screen-position 1)
;; mode line settings
(line-number-mode t)
(column-number-mode t)
(size-indication-mode t)
2011-10-08 23:05:06 +03:00
2020-09-15 11:13:43 +03:00
;; show line numbers at the beginning of each line
(unless prelude-minimalistic-ui
;; there's a built-in linum-mode, but we're using
;; display-line-numbers-mode or nlinum-mode,
;; as it's supposedly faster
(if (fboundp 'global-display-line-numbers-mode)
(global-display-line-numbers-mode)
(global-nlinum-mode t)))
2020-09-15 11:13:43 +03:00
2011-10-08 23:05:06 +03:00
;; enable y/n answers
(fset 'yes-or-no-p 'y-or-n-p)
2012-03-13 17:16:01 +02:00
;; more useful frame title, that show either a file or a
;; buffer name (if the buffer isn't visiting a file)
(setq frame-title-format
'("" invocation-name " Prelude - " (:eval (if (buffer-file-name)
(abbreviate-file-name (buffer-file-name))
"%b"))))
2024-08-23 01:15:37 +03:00
;; use monokai as the default theme
(when prelude-theme
(load-theme prelude-theme t))
2011-10-08 23:05:06 +03:00
2016-03-10 10:51:21 +02:00
;; show available keybindings after you start typing
;; add to hook when running as a daemon as a workaround for a
;; which-key bug
;; https://github.com/justbur/emacs-which-key/issues/306
(if (daemonp)
(add-hook 'server-after-make-frame-hook 'which-key-mode)
(which-key-mode +1))
2016-03-10 10:51:21 +02:00
2011-10-08 23:05:06 +03:00
(provide 'prelude-ui)
;;; prelude-ui.el ends here