2019-10-14 17:38:14 +02:00
|
|
|
|
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
|
|
|
|
|
|
2020-05-24 22:17:02 +02:00
|
|
|
|
;; Time-stamp: <2020-05-24T22:16:33+0200>
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
2020-03-08 10:51:04 +01:00
|
|
|
|
;; * Helpful visualizations.
|
|
|
|
|
;; * Colors and theme.
|
|
|
|
|
;; * Icon font.
|
|
|
|
|
;; * Modeline stuff.
|
|
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
2020-03-18 15:00:17 +01:00
|
|
|
|
(require 'basics/package-management)
|
2019-10-14 17:38:14 +02:00
|
|
|
|
(require 'basics/global-variables)
|
|
|
|
|
|
|
|
|
|
(use-package emacs
|
2020-01-27 02:39:22 +01:00
|
|
|
|
;; If 2 files have the same name, append directory name after the filename.
|
2020-03-08 10:51:04 +01:00
|
|
|
|
:custom ((uniquify-after-kill-buffer-p t)
|
|
|
|
|
(uniquify-buffer-name-style 'post-forward)
|
|
|
|
|
(uniquify-strip-common-suffix t))
|
|
|
|
|
:config (progn
|
2020-03-24 22:38:17 +01:00
|
|
|
|
(defun my/set-default-fonts ()
|
|
|
|
|
"Set the default font and the emoji font."
|
|
|
|
|
(when (member "Source Code Pro" (font-family-list)) ; Default.
|
|
|
|
|
(set-frame-font "Source Code Pro-10" t t))
|
|
|
|
|
(when (member "Noto Color Emoji" (font-family-list)) ; Emojis.
|
|
|
|
|
(set-fontset-font t 'unicode "Noto Color Emoji" nil 'prepend)))
|
|
|
|
|
|
|
|
|
|
(tool-bar-mode -1) ; Hide toolbar.
|
2020-04-18 01:16:30 +02:00
|
|
|
|
(menu-bar-mode -1) ; Hide menu bar.
|
2020-05-20 07:59:31 +02:00
|
|
|
|
(when (fboundp #'set-scroll-bar-mode)
|
|
|
|
|
(set-scroll-bar-mode 'right))
|
2020-05-17 18:19:30 +02:00
|
|
|
|
(add-to-list 'default-frame-alist '(scroll-bar-width . 8))
|
2020-03-24 22:38:17 +01:00
|
|
|
|
(my/set-default-fonts)
|
|
|
|
|
(global-hl-line-mode t) ; Highlight current line.
|
|
|
|
|
(show-paren-mode t) ; Visualize matching parens.
|
|
|
|
|
(setq frame-title-format ; Show filename in frame title.
|
2020-03-08 10:51:04 +01:00
|
|
|
|
'(multiple-frames
|
|
|
|
|
"%b" ("" invocation-name "@" system-name
|
|
|
|
|
" – " buffer-file-truename)))))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
;; Icon font (required by doom and others).
|
|
|
|
|
(use-package all-the-icons
|
2020-03-08 10:42:42 +01:00
|
|
|
|
:init (defun my/font-installed-p (font-name)
|
|
|
|
|
"Check if font with FONT-NAME is available."
|
|
|
|
|
(if (find-font (font-spec :name font-name))
|
|
|
|
|
t
|
|
|
|
|
nil))
|
2019-12-13 17:54:59 +01:00
|
|
|
|
;; Install fonts if we have a GUI and the font is not already installed.
|
2020-03-08 10:42:42 +01:00
|
|
|
|
;; See <https://github.com/domtronn/all-the-icons.el/issues/58>.
|
|
|
|
|
:config (when (and (window-system)
|
|
|
|
|
(not (my/font-installed-p "all-the-icons")))
|
2020-03-08 10:51:04 +01:00
|
|
|
|
(all-the-icons-install-fonts t)))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
(unless slow-computer
|
2020-03-27 20:29:38 +01:00
|
|
|
|
(use-package doom-themes
|
2020-05-24 22:17:02 +02:00
|
|
|
|
:demand t
|
2020-03-27 20:29:38 +01:00
|
|
|
|
:after (all-the-icons)
|
2020-04-17 04:29:13 +02:00
|
|
|
|
:custom ((doom-themes-treemacs-theme "doom-colors")
|
|
|
|
|
(doom-themes-treemacs-enable-variable-pitch nil))
|
2020-04-18 01:16:30 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(load-theme 'doom-outrun-electric t)
|
|
|
|
|
(doom-themes-visual-bell-config) ; Flash modeline on error.
|
|
|
|
|
(doom-themes-treemacs-config)
|
2020-05-17 19:33:54 +02:00
|
|
|
|
|
|
|
|
|
(set-face-background 'scroll-bar (face-background 'default))
|
|
|
|
|
(set-face-foreground 'scroll-bar (face-foreground 'shadow)))
|
2020-04-25 18:23:31 +02:00
|
|
|
|
|
|
|
|
|
;; Write a minimal theme to file, to load it in early-init.el.
|
2020-05-03 03:31:25 +02:00
|
|
|
|
(unless (string= (face-background 'default) "unspecified-bg")
|
|
|
|
|
(let ((minimal-theme))
|
|
|
|
|
(setq minimal-theme (concat "(set-face-background 'default \""
|
|
|
|
|
(face-background 'default) "\")\n"
|
|
|
|
|
"(set-face-foreground 'default \""
|
|
|
|
|
(face-foreground 'default) "\")\n"
|
|
|
|
|
"(menu-bar-mode -1)\n"
|
|
|
|
|
"(when (display-graphic-p)\n"
|
|
|
|
|
" (tool-bar-mode -1))\n"))
|
|
|
|
|
(with-temp-file (expand-file-name "early-theme.el"
|
|
|
|
|
user-emacs-directory)
|
2020-05-17 18:19:30 +02:00
|
|
|
|
(insert minimal-theme)))))
|
2020-03-27 20:29:38 +01:00
|
|
|
|
) ; unless slow-computer.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
;; Neat modeline.
|
|
|
|
|
(use-package doom-modeline
|
|
|
|
|
:after (all-the-icons)
|
2020-03-08 10:23:07 +01:00
|
|
|
|
:init (column-number-mode t) ; Show column number.
|
|
|
|
|
:custom ((doom-modeline-minor-modes t) ; Show minor modes.
|
2020-03-08 06:10:30 +01:00
|
|
|
|
(doom-modeline-buffer-file-name-style 'truncate-except-project)
|
2020-03-08 10:23:07 +01:00
|
|
|
|
(mode-line-percent-position nil) ; Don't display percentage.
|
|
|
|
|
(doom-modeline-buffer-state-icon nil)) ; Don't display save icon.
|
2020-03-08 10:51:04 +01:00
|
|
|
|
:hook (after-init . doom-modeline-mode))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
;; Show line numbers on the left side of the buffer.
|
|
|
|
|
(use-package display-line-numbers
|
|
|
|
|
:if (>= emacs-major-version 26)
|
2020-03-08 10:51:04 +01:00
|
|
|
|
:config (progn (defun my/disable-line-numbers ()
|
|
|
|
|
(display-line-numbers-mode -1))
|
|
|
|
|
(global-display-line-numbers-mode)))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
(provide 'basics/appearance)
|
|
|
|
|
;;; appearance.el ends here
|