102 lines
3.1 KiB
EmacsLisp
102 lines
3.1 KiB
EmacsLisp
;;; init-ui-config.el --- -*- lexical-binding: t -*-
|
|
;;
|
|
;; Filename: init-ui-config.el
|
|
;; Description: Initialize UI Configurations
|
|
;; Author: Mingde (Matthew) Zeng
|
|
;; Copyright (C) 2019 Mingde (Matthew) Zeng
|
|
;; Created: Thu Mar 14 16:12:56 2019 (-0400)
|
|
;; Version: 3.0
|
|
;; URL: https://github.com/MatthewZMD/.emacs.d
|
|
;; Keywords: M-EMACS .emacs.d ui
|
|
;; Compatibility: emacs-version >= 26.1
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;;; Commentary:
|
|
;;
|
|
;; This initializes prettify-symbols-mode and other UI configurations
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;; 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. If not, see <https://www.gnu.org/licenses/>.
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;;; Code:
|
|
|
|
(eval-when-compile
|
|
(require 'init-const)
|
|
(require 'battery))
|
|
|
|
;; Highlight
|
|
(global-hl-line-mode 1)
|
|
;; -Highlight
|
|
|
|
;; ;; PreSym
|
|
;; (global-prettify-symbols-mode 1)
|
|
;; (defun add-pretty-lambda ()
|
|
;; "Make some word or string show as pretty Unicode symbols. See https://unicodelookup.com for more."
|
|
;; (setq prettify-symbols-alist
|
|
;; '(("lambda" . 955)
|
|
;; ("delta" . 120517)
|
|
;; ("epsilon" . 120518)
|
|
;; ("->" . 8594)
|
|
;; ("<=" . 8804)
|
|
;; (">=" . 8805))))
|
|
;; (add-hook 'prog-mode-hook 'add-pretty-lambda)
|
|
;; (add-hook 'org-mode-hook 'add-pretty-lambda)
|
|
;; ;; -PreSym
|
|
|
|
;; TitleBar
|
|
(setq-default frame-title-format '("M-EMACS - " user-login-name "@" system-name " - %b"))
|
|
;; -TitleBar
|
|
|
|
;; YorN
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
(setq use-dialog-box nil)
|
|
;; -YorN
|
|
|
|
;; StartupScreen
|
|
(setq inhibit-startup-screen t)
|
|
(setq initial-major-mode 'text-mode)
|
|
;; https://www.youtube.com/watch?v=NfjsLmya1PI
|
|
(setq initial-scratch-message "Present Day, Present Time...\n")
|
|
;; -StartupScreen
|
|
|
|
;; DisLineNum
|
|
;; Hook line numbers to only when files are opened, also use linum-mode for emacs-version< 26
|
|
(if (version< emacs-version "26")
|
|
(global-linum-mode)
|
|
(add-hook 'text-mode-hook #'display-line-numbers-mode)
|
|
(add-hook 'prog-mode-hook #'display-line-numbers-mode))
|
|
;; Display column numbers in modeline
|
|
(column-number-mode 1)
|
|
;; -DisLineNum
|
|
|
|
;; DisTimeBat
|
|
(display-time-mode 1)
|
|
(when (and battery-status-function
|
|
(not (string-match-p "N/A" (battery-format "%B" (funcall battery-status-function)))))
|
|
(display-battery-mode 1))
|
|
;; -DisTimeBat
|
|
|
|
;; PixelScrollPrecMode
|
|
(when (version<= "29.1" emacs-version)
|
|
(pixel-scroll-precision-mode 1))
|
|
;; -PixelScrollPrecMode
|
|
|
|
(provide 'init-ui-config)
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;; init-ui-config.el ends here
|