2019-10-14 17:38:14 +02:00
|
|
|
|
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
|
|
|
|
|
|
2020-03-08 10:38:29 +01:00
|
|
|
|
;; Time-stamp: <2020-03-08T10:20:47+0100>
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
(require 'basics/global-variables)
|
|
|
|
|
|
|
|
|
|
(use-package emacs
|
|
|
|
|
:ensure nil
|
|
|
|
|
|
2020-01-27 02:39:22 +01:00
|
|
|
|
:custom
|
|
|
|
|
;; If 2 files have the same name, append directory name after the filename.
|
|
|
|
|
(uniquify-after-kill-buffer-p t)
|
|
|
|
|
(uniquify-buffer-name-style 'post-forward)
|
|
|
|
|
(uniquify-strip-common-suffix t)
|
|
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
|
:config
|
|
|
|
|
(tool-bar-mode -1) ; Hide toolbar.
|
|
|
|
|
(if (display-graphic-p)
|
|
|
|
|
(set-scroll-bar-mode 'right)) ; Put scrollbar to the right side.
|
|
|
|
|
(add-to-list 'default-frame-alist ; Set default font.
|
|
|
|
|
'(font . "Source Code Pro-10"))
|
|
|
|
|
(global-hl-line-mode t) ; Highlight current line.
|
|
|
|
|
(show-paren-mode t) ; Visualize matching parens.
|
2019-11-09 18:52:12 +01:00
|
|
|
|
(setq frame-title-format ; Show filename in frame title.
|
|
|
|
|
'(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-02-20 18:50:23 +01:00
|
|
|
|
:pin melpa ; We need > 3.2.0 for all-the-icons-ivy-rich (issue #4).
|
|
|
|
|
|
2019-12-13 17:54:59 +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-10-14 17:38:14 +02:00
|
|
|
|
:config
|
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:38:29 +01:00
|
|
|
|
(when (and (window-system) (not (my/font-installed-p "all-the-icons")))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
(all-the-icons-install-fonts t))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(unless slow-computer
|
2019-12-26 19:23:43 +01:00
|
|
|
|
(use-package doom-themes
|
|
|
|
|
:after (all-the-icons)
|
|
|
|
|
|
|
|
|
|
:config
|
|
|
|
|
(load-theme 'doom-molokai t)
|
|
|
|
|
(doom-themes-visual-bell-config) ; Flash modeline on error.
|
|
|
|
|
|
|
|
|
|
:custom-face
|
|
|
|
|
(font-lock-comment-face ((t (:foreground "#667755"))))
|
|
|
|
|
)
|
|
|
|
|
) ; 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 06:10:30 +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)
|
|
|
|
|
|
|
|
|
|
:config
|
2020-03-08 06:13:04 +01:00
|
|
|
|
(defun my/disable-line-numbers ()
|
2019-11-09 19:29:49 +01:00
|
|
|
|
(display-line-numbers-mode -1))
|
|
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
|
(global-display-line-numbers-mode)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(provide 'basics/appearance)
|
|
|
|
|
;;; appearance.el ends here
|