2019-10-09 13:13:56 +02:00
|
|
|
;;; wpc-ui.el --- Any related to the UI/UX goes here -*- lexical-binding: t -*-
|
2020-08-31 16:57:34 +02:00
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
2020-08-31 16:57:34 +02:00
|
|
|
;; Version: 0.0.1
|
|
|
|
;; Package-Requires: ((emacs "24"))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Hosts font settings, scrolling, color schemes.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-08-31 13:08:30 +02:00
|
|
|
(require 'constants)
|
2019-10-09 13:13:56 +02:00
|
|
|
(require 'prelude)
|
2020-09-02 15:00:43 +02:00
|
|
|
(require 'al)
|
2020-08-31 12:53:32 +02:00
|
|
|
(require 'fonts)
|
|
|
|
(require 'colorscheme)
|
2019-10-09 13:13:56 +02:00
|
|
|
(require 'device)
|
|
|
|
(require 'laptop-battery)
|
2020-07-06 12:11:08 +02:00
|
|
|
(require 'modeline)
|
2020-09-02 16:01:43 +02:00
|
|
|
(require 'general)
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Configuration
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-08-31 01:49:07 +02:00
|
|
|
;; line height
|
|
|
|
(setq-default line-spacing 0)
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-07-06 21:45:33 +02:00
|
|
|
(when window-system
|
|
|
|
(setq frame-title-format '(buffer-file-name "%f" ("%b"))))
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; Ensure that buffers update when their contents change on disk.
|
|
|
|
(global-auto-revert-mode t)
|
|
|
|
|
|
|
|
;; smooth scrolling settings
|
|
|
|
(setq scroll-step 1
|
|
|
|
scroll-conservatively 10000)
|
|
|
|
|
|
|
|
;; clean up modeline
|
|
|
|
(use-package diminish
|
|
|
|
:config
|
|
|
|
(diminish 'emacs-lisp-mode "elisp")
|
|
|
|
(diminish 'evil-commentary-mode)
|
|
|
|
(diminish 'flycheck-mode)
|
|
|
|
(diminish 'auto-revert-mode)
|
|
|
|
(diminish 'which-key-mode)
|
|
|
|
(diminish 'yas-minor-mode)
|
|
|
|
(diminish 'lispyville-mode)
|
|
|
|
(diminish 'undo-tree-mode)
|
|
|
|
(diminish 'company-mode)
|
|
|
|
(diminish 'projectile-mode)
|
|
|
|
(diminish 'eldoc-mode)
|
|
|
|
;; This is how to diminish `auto-fill-mode'.
|
|
|
|
(diminish 'auto-fill-function)
|
|
|
|
(diminish 'counsel-mode)
|
|
|
|
(diminish 'ivy-mode))
|
|
|
|
|
2020-01-18 23:52:06 +01:00
|
|
|
;; TODO: Further customize `mode-line-format' variable.
|
|
|
|
(delete 'mode-line-modes mode-line-format)
|
|
|
|
(delete '(vc-mode vc-mode) mode-line-format)
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; disable startup screen
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
|
|
|
;; disable toolbar
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
|
|
|
;; premium Emacs themes
|
|
|
|
(use-package doom-themes
|
|
|
|
:config
|
|
|
|
(setq doom-themes-enable-bold t
|
|
|
|
doom-themes-enable-italic t)
|
|
|
|
(doom-themes-visual-bell-config)
|
|
|
|
(doom-themes-org-config))
|
|
|
|
|
|
|
|
;; kbd discovery
|
|
|
|
(use-package which-key
|
|
|
|
:config
|
|
|
|
(setq which-key-idle-delay 0.25)
|
|
|
|
(which-key-mode))
|
|
|
|
|
|
|
|
;; completion framework
|
|
|
|
(use-package ivy
|
|
|
|
:config
|
|
|
|
(counsel-mode t)
|
2020-01-27 12:26:10 +01:00
|
|
|
(ivy-mode t)
|
2020-09-02 16:24:30 +02:00
|
|
|
;; Remove preceding "^" from ivy prompts
|
|
|
|
(setq ivy-initial-inputs-alist nil)
|
2019-10-09 13:13:56 +02:00
|
|
|
;; prefer using `helpful' variants
|
|
|
|
(progn
|
|
|
|
(setq counsel-describe-function-function #'helpful-callable)
|
|
|
|
(setq counsel-describe-variable-function #'helpful-variable))
|
|
|
|
(general-define-key
|
2020-02-10 12:36:09 +01:00
|
|
|
:keymaps '(ivy-minibuffer-map ivy-switch-buffer-map)
|
2019-10-09 13:13:56 +02:00
|
|
|
;; prev
|
|
|
|
"C-k" #'ivy-previous-line
|
|
|
|
"<backtab>" #'ivy-previous-line
|
|
|
|
;; next
|
|
|
|
"C-j" #'ivy-next-line
|
|
|
|
"<tab>" #'ivy-next-line))
|
|
|
|
|
|
|
|
(use-package ivy-prescient
|
|
|
|
:config
|
|
|
|
(ivy-prescient-mode 1)
|
2022-01-28 21:40:11 +01:00
|
|
|
(unless constants-ci?
|
|
|
|
(prescient-persist-mode 1)))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2022-01-21 00:49:52 +01:00
|
|
|
(use-package ivy-pass)
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; all-the-icons
|
|
|
|
(use-package all-the-icons
|
|
|
|
:config
|
2022-01-28 21:40:11 +01:00
|
|
|
(unless (or constants-ci?
|
|
|
|
(f-exists? "~/.local/share/fonts/all-the-icons.ttf"))
|
|
|
|
(all-the-icons-install-fonts t)))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;; icons for Ivy
|
|
|
|
(use-package all-the-icons-ivy
|
|
|
|
:after (ivy all-the-icons)
|
|
|
|
:config
|
|
|
|
(all-the-icons-ivy-setup))
|
|
|
|
|
|
|
|
;; disable menubar
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
|
|
|
|
;; reduce noisiness of auto-revert-mode
|
|
|
|
(setq auto-revert-verbose nil)
|
|
|
|
|
2021-12-24 00:30:31 +01:00
|
|
|
;; highlight lines that are over 80 characters long
|
2019-10-09 13:13:56 +02:00
|
|
|
(use-package whitespace
|
|
|
|
:config
|
2019-12-22 22:34:46 +01:00
|
|
|
;; TODO: This should change depending on the language and project. For
|
|
|
|
;; example, Google Java projects prefer 100 character width instead of 80
|
|
|
|
;; character width.
|
2021-12-24 00:30:31 +01:00
|
|
|
(setq whitespace-line-column 80)
|
2019-10-09 13:13:56 +02:00
|
|
|
(setq whitespace-style '(face lines-tail))
|
|
|
|
(add-hook 'prog-mode-hook #'whitespace-mode))
|
|
|
|
|
|
|
|
;; dirname/filename instead of filename<dirname>
|
|
|
|
(setq uniquify-buffer-name-style 'forward)
|
|
|
|
|
|
|
|
;; highlight matching parens, brackets, etc
|
|
|
|
(show-paren-mode 1)
|
|
|
|
|
|
|
|
;; hide the scroll-bars in the GUI
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
|
2019-12-22 22:34:46 +01:00
|
|
|
;; TODO: Learn how to properly integrate this with dunst or another system-level
|
|
|
|
;; notification program.
|
2019-10-09 13:13:56 +02:00
|
|
|
;; GUI alerts in emacs
|
|
|
|
(use-package alert
|
|
|
|
:commands (alert)
|
|
|
|
:config
|
|
|
|
(setq alert-default-style 'notifier))
|
|
|
|
|
2021-12-17 18:05:18 +01:00
|
|
|
;; TODO: Should `device-laptop?' be a function or a constant that gets set
|
2019-10-09 13:13:56 +02:00
|
|
|
;; during initialization?
|
2021-12-17 18:05:18 +01:00
|
|
|
(when (device-laptop?) (laptop-battery-display))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2022-01-10 23:49:21 +01:00
|
|
|
(colorscheme-whitelist-set 'doom-peacock)
|
2022-01-06 23:09:20 +01:00
|
|
|
|
|
|
|
(when window-system
|
|
|
|
(let ((font "Monospace"))
|
|
|
|
(fonts-whitelist-set font)
|
|
|
|
;; Some themes (e.g. doom-acario-*) change the font for comments. This
|
|
|
|
;; should prevent that.
|
|
|
|
(set-face-attribute font-lock-comment-face nil
|
|
|
|
:family font
|
|
|
|
:slant 'normal)))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-09-01 11:17:43 +02:00
|
|
|
(modeline-setup)
|
2020-02-27 12:42:45 +01:00
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
(provide 'wpc-ui)
|
|
|
|
;;; wpc-ui.el ends here
|